Ver 1.8 (2012-08-07) [MM4 Only]
- Changed Information box to a version which let you copy the information
- Added new fields
- - MediaMonkey version
- - ApplicationPath
- - Database location
- - ScriptsIni location
- - Script location
- - AddonInstallRoot
- - Current Collection
- - Collection SQL
- - RelatedObjectID (New useful Node property)
Enjoy!
/Bex
-------------------------------------------------------------------------------------
Script is updated
Ver 1.7 (2008-06-06) [MM3 only]
- Added AlbumArt info (Both from DB and AlbumArt object)
- Added CurrentTime
- Fixed Month/Day on Date and OriginalDate
Enjoy!
/Bex
-------------------------------------------------------------------------------------
Bugfix Update
Ver 1.6 (2008-05-21) [MM3 only]
- Fixed LastPlayHistoryDate and FirstPlayHistoryDate showed the same date
- Fixed so Show/Hide menus are remembered between sessions
Enjoy!
/Bex
-------------------------------------------------------------------------------------
Script is updated
Ver 1.6 (2008-05-21) [MM3 only]
- Added LastPlayHistoryDate
- Added FirstPlayHistoryDate
Enjoy!
/Bex
-------------------------------------------------------------------------------------
Script is updated
Ver 1.5 (2008-05-21) [MM3 only]
- Added PlayCount
- Added PlayHistory Records
- Replaced Path With Folder
Enjoy!
/Bex
-------------------------------------------------------------------------------------
Script is updated
Ver 1.4 (2008-05-15) [MM3 only]
- Added ParentFolderID
- Added FolderID
- Added SubFolderID(s)
Enjoy!
/Bex
-------------------------------------------------------------------------------------
Script is updated
Ver 1.3 (2008-04-30) [MM3 only]
- Added SignType
- Added SignPart1-4
Enjoy!
/Bex
-------------------------------------------------------------------------------------
Script is updated
Ver 1.2 (2008-04-20) [MM3 only]
- Added Length and Size
- Minor Fixes
Enjoy!
/Bex
-------------------------------------------------------------------------------------
Script is updated
Ver 1.1 (2008-02-05) [MM3 only]
- Added Composer, Conductor, Lyricist
- Fixed GenreID was displaying SongID
Enjoy!
/Bex
---------------------------------------------------------------------------------
Hi fellow scripters,
Here is yet another script developed for us scripters!
This time you'll get a script which easily displays valuable information of nodes and songs from a menu entry in all pop menus. It's a great help when debugging or developing scripts.
The menu entries can be toggled on/off through the scripts menu. So you don't have any disturbing menus when you just using MM.
If you miss something let me know and I'll add it.
Check it out and let me know what you think!
Enjoy!
/Bex
---------------------------------------------------------------------------------
For information only. Installer can be downloaded in the end of the post.
Code: Select all
'' MediaMonkey Script
'
' NAME: DebugHelper
' VERSION: 1.8
' LAST UPDATED: 2012-08-07
' AUTHOR: Bex
' DATE : 2008-02-05
Sub OnStartup
If not SDB.IniFile.ValueExists("DebugHelper","MnuCaption") Then SDB.IniFile.StringValue("DebugHelper","MnuCaption")="Show Debug Helper Menu"
Dim Mnu : Set Mnu = SDB.UI.AddMenuItem( SDB.UI.Menu_Scripts, 0, 0)
Mnu.Caption = SDB.IniFile.StringValue("DebugHelper","MnuCaption")
Mnu.OnClickFunc = "ToggleOnOff"
Mnu.IconIndex = 27
Mnu.UseScript=Script.ScriptPath
' Add a menu entry to the Pop track menu in Now Playing Main Window
Set Mnu = SDB.UI.AddMenuItem( SDB.UI.Menu_Pop_NP_MainWindow, 1, 1)
Mnu.Caption = "Debug Helper Song"
Mnu.OnClickFunc = "DisplaySongInfo"
Mnu.IconIndex = 27
Mnu.UseScript=Script.ScriptPath
Set SDB.Objects("Mnu1") = Mnu
Mnu.Visible = SDB.IniFile.BoolValue("DebugHelper","MnuVisible")
' Add a menu entry to the Pop track menu in main window
Set Mnu = SDB.UI.AddMenuItem( SDB.UI.Menu_Pop_TrackList, 1, 1)
Mnu.Caption = "Debug Helper Song"
Mnu.OnClickFunc = "DisplaySongInfo"
Mnu.IconIndex = 27
Mnu.UseScript=Script.ScriptPath
Set SDB.Objects("Mnu2") = Mnu
Mnu.Visible = SDB.IniFile.BoolValue("DebugHelper","MnuVisible")
' Add a menu entry to the Pop track menu in Now Playing
Set Mnu = SDB.UI.AddMenuItem( SDB.UI.Menu_Pop_NP, 1, 1)
Mnu.Caption = "Debug Helper Song"
Mnu.OnClickFunc = "DisplaySongInfo"
Mnu.IconIndex = 27
Mnu.UseScript=Script.ScriptPath
Set SDB.Objects("Mnu3") = Mnu
Mnu.Visible = SDB.IniFile.BoolValue("DebugHelper","MnuVisible")
' Add a menu entry to the Pop Node menu
Set Mnu = SDB.UI.AddMenuItem( SDB.UI.Menu_Pop_Tree , 1, 1)
Mnu.Caption = "Debug Helper Node"
Mnu.OnClickFunc = "DisplayNodeInfo"
Mnu.IconIndex = 27
Mnu.UseScript=Script.ScriptPath
Set SDB.Objects("Mnu4") = Mnu
Mnu.Visible = SDB.IniFile.BoolValue("DebugHelper","MnuVisible")
End Sub
Sub ToggleOnOff(Mnu)
If Mnu.Caption = "Show Debug Helper Menu" Then
Mnu.Caption = "Hide Debug Helper Menu"
SDB.Objects("Mnu1").Visible = True
SDB.Objects("Mnu2").Visible = True
SDB.Objects("Mnu3").Visible = True
SDB.Objects("Mnu4").Visible = True
SDB.IniFile.BoolValue("DebugHelper","MnuVisible")=1
SDB.IniFile.StringValue("DebugHelper","MnuCaption")="Hide Debug Helper Menu"
Else
Mnu.Caption = "Show Debug Helper Menu"
SDB.Objects("Mnu1").Visible = False
SDB.Objects("Mnu2").Visible = False
SDB.Objects("Mnu3").Visible = False
SDB.Objects("Mnu4").Visible = False
SDB.IniFile.BoolValue("DebugHelper","MnuVisible")=0
SDB.IniFile.StringValue("DebugHelper","MnuCaption")="Show Debug Helper Menu"
End If
End Sub
Sub DisplaySongInfo(o)
Dim list,DB,info
Set list = SDB.SelectedSongList
Set DB = SDB.Database
info = info & "MediaMonkey:" & VbTab & VbTab & SDB.VersionString &"."& SDB.VersionBuild & vbcrlf
info = info & "ApplicationPath:" & VbTab & SDB.ApplicationPath & vbcrlf
info = info & "Database location:" & VbTab & SDB.Database.Path & vbcrlf
info = info & "ScriptsIni location:" & VbTab & SDB.ScriptsIniFile & vbcrlf
info = info & "Script location:" & VbTab & SDB.ScriptsPath & vbcrlf
info = info & "AddonInstallRoot:" & VbTab & SDB.CurrentAddonInstallRoot & vbcrlf
info = info & "Current Collection:" & VbTab & DB.OpenSql("SELECT ID||' '||Name FROM (SELECT ID, Name FROM Filters UNION SELECT -1, 'Entire Library') WHERE ID="& SDB.Database.ActiveFilterID).StringByIndex(0) & vbcrlf
info = info & "Collection SQL:" & VbTab & VbTab & SDB.Database.GetFilterQuery(SDB.Database.ActiveFilterID) & vbcrlf
info = info & "Is Not In DB:" & VbTab & VbTab & list.item(0).IsntInDB & vbcrlf
info = info & "Songs.ID:" & VbTab & VbTab & list.item(0).ID & vbcrlf
info = info & "Title:" & VbTab & VbTab & VbTab & list.item(0).Title & vbcrlf
info = info & "ArtistID(s):" & VbTab & VbTab & DB.OpenSql("SELECT group_concat(IDArtist,'; ') FROM ArtistsSongs WHERE PersonType=1 AND IDSong="&list.item(0).ID&" GROUP BY IDSong").StringByIndex(0) & VbNewline
info = info & "Artist(s):" & VbTab & VbTab & list.item(0).ArtistName & VbNewline
info = info & "AlbumID:" & VbTab & VbTab & list.item(0).Album.ID & VbNewline
info = info & "Album:" & VbTab & VbTab & VbTab & list.item(0).AlbumName & VbNewline
info = info & "AlbumArtistID(s):" & VbTab & DB.OpenSql("SELECT group_concat(IDArtist,'; ') FROM ArtistsAlbums WHERE IDAlbum="&list.item(0).Album.ID&" GROUP BY IDAlbum").StringByIndex(0) & VbNewline
info = info & "AlbumArtist(s):" & VbTab & VbTab & list.item(0).AlbumArtistName & VbNewline
info = info & "GenreID(s):" & VbTab & VbTab & DB.OpenSql("SELECT group_concat(IDGenre,'; ') FROM GenresSongs WHERE IDSong="&list.item(0).ID&" GROUP BY IDSong").StringByIndex(0) & VbNewline
info = info & "Genre(s):" & VbTab & VbTab & list.item(0).Genre & VbNewline
info = info & "ComposerID(s):" & VbTab & VbTab & DB.OpenSql("SELECT group_concat(IDArtist,'; ') FROM ArtistsSongs WHERE PersonType=3 AND IDSong="&list.item(0).ID&" GROUP BY IDSong").StringByIndex(0) & VbNewline
info = info & "Composer(s):" & VbTab & VbTab & list.item(0).Author & VbNewline
info = info & "ConductorID(s):" & VbTab & VbTab & DB.OpenSql("SELECT group_concat(IDArtist,'; ') FROM ArtistsSongs WHERE PersonType=4 AND IDSong="&list.item(0).ID&" GROUP BY IDSong").StringByIndex(0) & VbNewline
info = info & "Conductor(s):" & VbTab & VbTab & list.item(0).Conductor & VbNewline
info = info & "LyricistID(s):" & VbTab & VbTab & DB.OpenSql("SELECT group_concat(IDArtist,'; ') FROM ArtistsSongs WHERE PersonType=5 AND IDSong="&list.item(0).ID&" GROUP BY IDSong").StringByIndex(0) & VbNewline
info = info & "Lyricist(s):" & VbTab & VbTab & list.item(0).Lyricist & VbNewline
info = info & "Rating:" & VbTab & VbTab & VbTab & list.item(0).Rating & VbNewline
info = info & "Date:" & VbTab & VbTab & VbTab & list.item(0).Year &"-"& list.item(0).Month &"-"& list.item(0).Day & VbNewline
info = info & "DateInDB:" & VbTab & VbTab & DB.OpenSql("SELECT Year FROM Songs WHERE ID="&list.item(0).ID).StringByIndex(0) & VbNewline
info = info & "OriginalDate:" & VbTab & VbTab & list.item(0).OriginalYear &"-"& list.item(0).OriginalMonth &"-"& list.item(0).OriginalDay & VbNewline
info = info & "OriginalDateInDB:" & VbTab & DB.OpenSql("SELECT OrigYear FROM Songs WHERE ID="&list.item(0).ID).StringByIndex(0) & VbNewline
info = info & "VBR:" & VbTab & VbTab & VbTab & list.item(0).VBR & VbNewline
info = info & "SampleRate:" & VbTab & VbTab & list.item(0).SampleRate & VbNewline
info = info & "Bitrate:" & VbTab & VbTab & list.item(0).Bitrate & VbNewline
info = info & "Length:" & VbTab & VbTab & VbTab & list.item(0).SongLengthString & VbNewline
info = info & "Length:" & VbTab & VbTab & VbTab & list.item(0).SongLength & " (ms)" & VbNewline
info = info & "Size:" & VbTab & VbTab & VbTab & list.item(0).FileLength & VbNewline
info = info & "Folder:" & VbTab & VbTab & VbTab & Left(list.item(0).Path,InStrRev(list.item(0).Path,"\")) & VbNewline
info = info & "FileName:" & VbTab & VbTab & Mid(list.item(0).Path,InStrRev(list.item(0).Path,"\")+1,InStrRev(list.item(0).Path,".")-InStrRev(list.item(0).Path,"\")-1) & VbNewline
info = info & "Type:" & VbTab & VbTab & VbTab & Mid(list.item(0).Path,InStrRev(list.item(0).Path,".")+1) & VbNewline
info = info & "ParentFolderID:" & VbTab & VbTab & DB.OpenSql("SELECT IDParentFolder FROM Folders WHERE ID IN (SELECT IDFolder FROM Songs WHERE ID="&list.item(0).ID &")").StringByIndex(0) & VbNewline
info = info & "FolderID:" & VbTab & VbTab & DB.OpenSql("SELECT IDFolder FROM Songs WHERE ID="&list.item(0).ID).StringByIndex(0) & VbNewline
info = info & "SubFolderID(s):" & VbTab & VbTab & DB.OpenSql("SELECT group_concat(ID,'; ') FROM Folders WHERE IDParentFolder IN (SELECT IDFolder FROM Songs WHERE ID="&list.item(0).ID &")").StringByIndex(0) & VbNewline
info = info & "IDMedia:" & VbTab & VbTab & list.item(0).Media.ID & VbNewline
info = info & "DriveLetterNr:" & VbTab & VbTab & list.item(0).Media.DriveLetter & VbNewline
info = info & "DriveLetter:" & VbTab & VbTab & Chr(list.item(0).Media.DriveLetter+65) & VbNewline
info = info & "IDMedia:" & VbTab & VbTab & list.item(0).Media.ID & VbNewline
info = info & "DriveType:" & VbTab & VbTab & GetDriveType(list.item(0).Media.DriveType) & VbNewline
info = info & "SerialNumber:" & VbTab & VbTab & list.item(0).Media.SerialNumber & VbNewline
info = info & "SerialNumberHEX:" & VbTab & Hex(list.item(0).Media.SerialNumber) & VbNewline
info = info & "DateAdded:" & VbTab & VbTab & list.item(0).DateAdded & VbNewline
info = info & "FileModified:" & VbTab & VbTab & list.item(0).FileModified & VbNewline
info = info & "Leveling:" & VbTab & VbTab & list.item(0).Leveling & VbNewline
info = info & "LevelingAlbum:" & VbTab & VbTab & list.item(0).LevelingAlbum & VbNewline
info = info & "SignType:" & VbTab & VbTab & DB.OpenSql("SELECT SignType FROM Songs WHERE ID="&list.item(0).ID).StringByIndex(0) & VbNewline
info = info & "SignPart1-4:" & VbTab & VbTab & DB.OpenSql("SELECT SignPart1||', '||SignPart2||', '||SignPart3||', '||SignPart4 FROM Songs WHERE ID="&list.item(0).ID).StringByIndex(0) & VbNewline
info = info & "PlayCount:" & VbTab & VbTab & list.item(0).PlayCounter & VbNewline
info = info & "PlayHistory Records:" & VbTab & DB.OpenSql("SELECT COUNT(*) FROM Played WHERE IDSong="&list.item(0).ID).StringByIndex(0) & VbNewline
If Cdbl(list.item(0).LastPlayed)=0 Then LastPlayed="-" Else LastPlayed=list.item(0).LastPlayed
info = info & "LastPlayed:" & VbTab & VbTab & LastPlayed & VbNewline
Set phdates=DB.OpenSql("SELECT IFNULL(DATETIME(MIN(PlayDate+2415018.5)),'0'), IFNULL(DATETIME(MAX(PlayDate+2415018.5)),'0') FROM Played WHERE IDSong="&list.item(0).ID)
If phdates.StringByIndex(0) = "0" Then Mindate = "-" Else Mindate=FormatDateTime(phdates.StringByIndex(0))
If phdates.StringByIndex(1) = "0" Then Maxdate = "-" Else Maxdate=FormatDateTime(phdates.StringByIndex(1))
info = info & "LastPlayHistoryDate:" & VbTab & Maxdate & VbNewline
info = info & "FirstPlayHistoryDate:" & VbTab & Mindate & VbNewline
info = info & "Time Now:" & VbTab & VbTab & Now() & VbNewline
Set iter=DB.OpenSql("SELECT 'In DB:"& VbTab & VbTab &"Image '||(CoverOrder+1)|| CASE WHEN CoverStorage=0 THEN ': (In Tag)' ELSE ': (Linked)' END, CoverType, CoverPath FROM Covers WHERE IDSong="&list.item(0).ID)
Do While Not iter.EOF
info = info & Iter.StringByIndex(0) &" "& GetCoverTypeName(Iter.StringByIndex(1))&", "& Iter.StringByIndex(2) & VbNewline
iter.Next
Loop
Set iter = Nothing
Set pics = list.item(0).AlbumArt
For i=0 To pics.Count-1
info = info & "ArtObj:"& VbTab & VbTab &"Image " & i+1 & GetStorage(pics.item(i).ItemStorage) &" "& GetCoverTypeName(pics.item(i).ItemType) &", "& pics.item(i).RelativePicturePath & VbNewline
Next
'SDB.MessageBox Info, mtInformation, Array(mbOK)
Call MsgboxWB(info,"TrackWB")
End Sub
Function Style()
styleOn = Not styleOn
If styleOn Then
Style = ""
Else
Style = " class=""Dark"""
End If
End Function
Function MsgboxWB(text,SavePositionName)
Dim Form,WB,Btn,HTML
Set Form = SDB.UI.NewForm
Form.Common.SetRect 0, 0, 300, 300
Form.Common.MinWidth = 300
Form.Common.MinHeight = 300
Form.FormPosition = 4
Form.BorderStyle = 2
Form.Caption = "HTML Message Box"
Form.SavePositionName = SavePositionName
Set WB = SDB.UI.NewActiveX(Form, "Shell.Explorer")
WB.Common.SetRect 0, 0, Form.Common.Width-20, Form.Common.Height-75
WB.Common.Anchors = 1+2+4+8
HTML="<!DOCTYPE html>" & vbcrlf
HTML=HTML & "<html>" & vbcrlf
HTML=HTML & "<body>" & vbcrlf
HTML=HTML & "<pre>" & text & "</pre>"
HTML=HTML & "<body>" & vbcrlf
HTML=HTML & "<html>" & vbcrlf
WB.SetHTMLDocument(HTML)
Form.ShowModal
End Function
Function GetStorage(nr)
If nr=0 Then GetStorage = ": (In Tag)"
If nr=1 Then GetStorage = ": (Linked)"
End Function
Sub DisplayNodeInfo(o)
Dim Node : Set Node=SDB.MainTree.CurrentNode
info = info & "Caption: " & VbTab & VbTab & Node.Caption & VbNewline
info = info & "CustomData: " & VbTab & VbTab & Node.CustomData & VbNewline
info = info & "CustomDataId: " & VbTab & VbTab & Node.CustomDataId & VbNewline
info = info & "CustomNodeId: " & VbTab & VbTab & Node.CustomNodeId & VbNewline
info = info & "RelatedObjectID: " & VbTab & Node.RelatedObjectID & VbNewline
If Node.CustomObject Is Nothing Then
info = info & "CustomObject:"& VbTab & VbTab & "Is Nothing" & VbNewline
Else
info = info & "CustomObject:"& VbTab & VbTab & "Exists" & VbNewline
End If
info = info & "IconIndex: " & VbTab & VbTab & Node.IconIndex & VbNewline
info = info & "NodeType: " & VbTab & VbTab & Node.NodeType & VbNewline
info = info & "Path: " & VbTab & VbTab & VbTab & Node.Path & VbNewline
info = info & "SortCriteria: " & VbTab & VbTab & Node.SortCriteria & VbNewline
info = info & "SortGroup: " & VbTab & VbTab & Node.SortGroup & VbNewline
'SDB.MessageBox Info, mtInformation, Array(mbOK)
Call MsgboxWB(info,"NodeWB")
End Sub
Function GetDriveType(T)
Select Case T
Case 2
GetDriveType = "2 - Removable"
Case 3
GetDriveType = "3 - Fixed"
Case 4
GetDriveType = "4 - Remote"
Case 5
GetDriveType = "5 - CDROM"
Case 12345
GetDriveType = "12345 - Network"
Case Else
GetDriveType = T & " - Unknown"
End Select
End Function
Function GetCoverTypeName(CoverType)
Dim CoverTypeDict
Set CoverTypeDict = CreateObject("Scripting.Dictionary")
With CoverTypeDict
.Add 0, SDB.Localize("Not specified")
.Add 1, SDB.Localize("PNG file icon")
.Add 2, SDB.Localize("File icon")
.Add 3, SDB.Localize("Cover (front)")
.Add 4, SDB.Localize("Cover (back)")
.Add 5, SDB.Localize("Leaflet Page")
.Add 6, SDB.Localize("Media Label")
.Add 7, SDB.Localize("Lead Artist")
.Add 8, SDB.Localize("Artist")
.Add 9, SDB.Localize("Conductor")
.Add 10, SDB.Localize("Band")
.Add 11, SDB.Localize("Composer")
.Add 12, SDB.Localize("Lyricist")
.Add 13, SDB.Localize("Recording Location")
.Add 14, SDB.Localize("During Recording")
.Add 15, SDB.Localize("During Performance")
.Add 16, SDB.Localize("Video Screen Capture")
.Add 17, SDB.Localize("A bright coloured fish")
.Add 18, SDB.Localize("Illustration")
.Add 21, SDB.Localize("Band Logotype")
.Add 20, SDB.Localize("Publisher Logotype")
End with
GetCoverTypeName = CoverTypeDict.Item(Int(CoverType))
Set CoverTypeDict = Nothing
End Function
Download:
Latest version:
MM4 (Installer)
DebugHelper 1.8
MM3 (Installer)
DebugHelper 1.7
Installation Instructions:
Avoid "Product installation error"
- Vista/Win 7 Users:
- - To be able to install scripts you must Run MM as an administrator.
- - It means that you must right click the MM icon and select "Run as administrator" even if you are logged in as an administrator.
- All Users:
- - Check in your task manager that you only have one instance of MediaMonkey.exe running.
1. Download the mmip file and double click on it.
2. Goto Tools->Scripts->Show Debug Helper Menu
3. Right click on a track or node and select "Debug Helper Song/Node"