MediaMonkey 5 Scripting Tips & Tricks

From MediaMonkey Wiki
Jump to: navigation, search

Debugging tips


MediaMonkey 5 uses for debugging chrome and his built-in DevTools. Developer can open debugger in chrome in two ways:
- using hotkey Alt+Shift+Ctrl
- using popup 'Show DevTools' entry

How to debug init method of dialog?

Init method is a entry point for all dialogs and is called as first method when dialog opening. There are several ways how to debug this method, but we have prepared (since build 2066) methods to make things easier.
Add these two lines AFTER init method:

requirejs('helpers/debugTools');
registerDebuggerEntryPoint.call(this /* method class */, 'init' /* method name to inject */);


When you open dialog, DevTools will automatically open and application waits on message dialog to continue (so developer have time to set breakpoints etc.).


Get/Set Application Settings

var sett = JSON.parse(app.settings.getJSON(""));
...
app.settings.setJSON("", JSON.stringify(sett));

Following variables are exported to sett:

System
JustInstalled,FirstTimeRun,NeedsFileAssocOnNextRun,IniVersion,LockCoverWindowAspectRatio,CurrentAspectRatio,LastVideoMode,PreviousVideoMode,SubtitlesSize,SubtitlesEnabled,WinampPath, TempDir,DLNA_Player_UUID,DLNA_Player_Name,PlayerType,UseExternalVideoPlayer,IgnoreDriveLetters,CheckForNewVersion,ShowSplashScreen,ShowPartyDlgAgain,AskUserMassEdit,StartJustOneInstance, BackupScheduleEnabled,BackupScheduleType,LastDatabaseBackup,Skinned,DefaultViewVisibleInMainTree,ExpandAlbumsByDefault,NoOfTracksToShow,DontUseCoversCache,Show3DMirror,ShowDetailsInAAWindow, ShowCoverInAAWindow,ShowDetailsInOrder0,ShowDetailsInOrder1,ShowDetailsInOrder2,ShowDetailsInOrder3,ShowDetailsInOrder4,ShowDetailsInOrder5,ShowDetailsInOrder6,ShowDetailsInOrder7, ShowDetailsInOrder8,ShowDetailsTextHeight,PlayMode,PartyPlayMode,LastUsedThumbType,ShowMainMenu,AlwaysShowTabs,Telemetry,ShowEULA

Options
PlaybackControl,UseMD5Signature,AskAnalyzeRedundancy,UseDBforComputerNode,RemoveUnderscoresWhenScanning,AutomaticallyUpdateMovedFiles,ItemAction,ItemActionStopped,DefaultPlayNowAction, ShowWarningPlayNotAccessible,LongTitleScroll,ScanExts,AssocExts,MediaWizard_CheckedActions,RescanDBInfo,RescanModifFilesOnly,SearchMissingLyrics,SaveMissingLyrics,SearchMissingArtwork, SaveMissingArtwork,UsePathToGuessMetadata,UseFileToGuessMetadata,PreferTagsForMetadata,doIgnoreShorterKB,doIgnoreShorterSec,IgnoreShorterKB,IgnoreShorterSec,ReRegisterFileTypes, ActionForFiles,AutoPlayAct_CDPlay,AutoPlayAct_DVDPlay,AutoPlayAct_CDRip,AutoPlayAct_CDBurn,ContextMnuAct_Play,ContextMnuAct_PlayNext,ContextMnuAct_PlayLast,LastScannedFolders,AmazonCountry, NormalizeVolume,NormalizePreventClipping,AutoAnalyzeVolume,AutoAnalyzeVolumeType,AutoGenThumbs,NormalizeNewOnly,NormalizeTargetPlayerLevel,NormalizeTargetFileLevel,NormalizeTargetBurnLevel, NormalizeTargetRipLevel,NormalizeAlbums,NormalizationSource,NormalizationSourceRip,StoreID3TagVersion,StoreID3AfterEdit,StoreID3v2Encoding,StoreID3v2Version,TrackNumbersFromPlaylists, UseTrackNumbersFromPlaylists,DefaultThreadPriority,_UseProcessorCores_AutoConvert,_UseProcessorCores_Convert,_UseProcessorCores_Ripping,_UseProcessorCores_Leveling,ShowPlsWhenMinimized, SimpleVisType,VisPluginFileName,VisModuleIndex,StoreM3UinUTF8,ModifyTimeOnTag,CreateAddedPlst,CoverViewType,ScanCoversTag,ScanCoversFiles,ApplyCoversToAlbum,MoveNonMediaFiles,RemoveEmptyFolders, OrgAddTracksToLib,OrgTracksMove,EjectCD,VerifyRippedTracks,ConvertByReplace,CheckPlaylistDups,SearchWholeWordsOnly,SearchMode,IgnoreTHEs,IgnoreTHEStrings,IgnorePrefixFields,ShowTrackShortcut, OpenDialogsInWindow,ActiveTrackShortcutType,TimeServerHost,TimeServerPort

Player
OutputPlugin,Volume,PlayerUnmutedVolume,Panning,PlayerMute,Random,Repeat,Crossfade,PlaylistVisible,EqualizerVisible,VisualizationVisible,ShowAlbumCovers,ShowRemainingTime,NowPlayingPosition, PlayerPosition,ShowNowPlayingInMiniMode,AutoDJSwitchedOn,WasContinuousChecked,WasShuffledChecked,MainVisDisabled

Appearance
ShowNumberedColInSongView,ShowTracksInLibraryNode,ShowTrayIcon,MinimizeToTray,CloseToTray,MouseGestures,ShowToolTips,ShowTrackToolTip,ShowTrackToolTipAll,PlayerSkinNameNS3,ShowNewTrackInfo, PlayerSticky,PlayerVisible,NowPlayingDockable,ShowTreeTitle,ShowPlstTitle,ShowCoversTitle,ShowBrowserTitle,Language,ShowNowPlayingControls,ShowNowPlayingControlsMini,ShowPlayControls, ShowPlayControlsMini,NowPlayingOnTop,MultiStringSeparator

Backgrounds
ShowToolbarBackground,ShowTreeBackground,ShowSongsBackground,ShowPlaylistBackground,UseOneFullBackground,UseSkinBackground,ToolbarBackground,TreeBackground,SongsBackground,PlaylistBackground, TreeBackgroundScroll,SongsBackgroundScroll,PlaylistBackgroundScroll

Masks
CacheMask,CacheAlbumMask,PreviewMask,DownloadLocation

PartyMode
DisableAudioControls,DisableRepositioning,HideMenu,FullScreen,PreventSwitching,EnableVolumePlayPause,PasswEnabled,TotalLock,PartyNPVisibled,NonPartyNPVisibled,PartyPasswEditText, PartyPlayNowAction,PartyItemAction,PartyItemActionStopped

Podcasts
PodcastLastTimeUpdate,MaxDownloadsAtOnce,Glb_CheckPodcast,Glb_DownloadLocation,Glb_RetainNumber,Glb_DelRatingValue,Glb_EpisodeAge,Glb_DownloadType,Glb_DelEpisodes,Glb_DelOnlyListened, Glb_DelRating,Glb_RetainEpisodes,Glb_OverwriteTags,Glb_ShowRemovedEpisodes,Glb_KeepUpdatingMetadata

InfoPopUp
ShowTime,Opacity,Horizontal,Vertical

Tree
ShowMusicTree,ShowM3Us,ShowComputerAll,ComputerAllTop,ShowLocationAll,LocationAllTop

AlbumBrowser
Visible,ShowLive,ShowBestOf,ShowSingles,ShowReReleases,AutoUpdate,CheckArtist,CheckAlbum,CheckActors,CheckInvolvedPeople,Publisher,Director,Producer,Title,Writer,ParentalRating,CheckYear, CheckLabel,CheckCover,CheckLyrics,CheckTracks,CheckTrackNumber,CheckComment,UseJavaScript,RunningScriptName

AutoTag
UpdateEmptyOnly,RemoveUnderscores

PreviewSettings
PreviewStartTime,PreviewLength

FreedbSettings
ServerName,UseHTTP,UserName,UserDomain,AutoQuery,SecondaryServer,SecondaryUseHTTP,LastMMServerCheck,FirstServerProblem

Proxy
UseProxy,Server,Port,Username,Password

MediaSharing
AllowControlViaUPnP,LimitConvertedContent,LimitConvertedContentSize,UPNP_CacheDir,UPNP_RendererUUID,RendererName

streaming
LimitStreamCacheContent,LimitStreamCacheContentSize,StreamCacheDir

AutoScan
autoRemoveDeadLinks,autoRemoveAttributes

CustomFields
Fld1Name,Fld2Name,Fld3Name,Fld4Name,Fld5Name

Burn
TestOrBurn,BurnType,BurnDrive,BurnMethod,Finalization,FileSystem,LastSpeedItemIndex,WriteCDText,EjectMedia,VerifyData,SoundAlert,CacheNetFiles,OnTheFly,BurnM3Us,AlbArtBurn,AlbArtToTags, NormalizeVolume,LevelSource,EnableAutoConversion,AutoConversions

M3UBurnSettings
M3UForArists,M3UForAlbums,M3UForPlaylists,M3UForLocations,Organize,DestDirectory

Sleep
ShutdownAfter,FadeVolume,FadeAfter,VolumePercent,ShutdownPC

Equalizer
Bands,LeftPreamp,RightPreamp,Left1,Right1,Left2,Right2,Left3,Right3,Left4,Right4,Left5,Right5,Left6,Right6,Left7,Right7,Left8,Right8,Left9,Right9,Left10,Right10,Enabled

Confirmations
ConfirmRemovePlaying,ConfirmMore64PathChars,ConfirmImportRatings,ConfirmScanResults,ConfirmDeviceNotEnoughSpace,ConfirmMoveDBFolder,ConfirmCopyDBFolder,ConfirmDeletePlaylist, ConfirmDeletePlaying,ConfirmDeleteValue,ConfirmDeletePlaylistValue,ConfirmDeleteFolderValue,ConfirmMoveDBFolderValue,ConfirmCopyDBFolderValue,ConfirmDeletePlayingValue

Auto-organize
ExcludeFolders,DoInBackground,DeleteEmptiedFolders