by DiddeLeeDoo » Fri Aug 04, 2006 7:21 am
A very simple Bookmark script.
Adds a 'Bookmark' item in the Play menu
The bookmarked song will be placed in a playlist called Bookmarks.
When a bookmark is used, it will be forgotten, and needs to be set again if you want to set it again for the same song.
To find bookmarked songs, simply go to the playlist Bookmarks, start playing the song, and go to the menu Player and hit the ticked 'Bookmark'
Might put the bookmarked songs into a sub menu instead of playlist later, as this script will not work so well if you already have a playlist called Bookmarks.
Changelog:
1.12 - 1.20 : A bit more tidy
1.20 - 2.00 : Bookmarked songs get collected in a Playlist called Bookmarks
Code: Select all
'-------------------------------------------------------------------
' \Program Files\MediaMonkey\Scripts\Auto\PlayMenu_Bookmarks.vbs
'
' Version 2.00
' 20 October 2006
' By DiddeLeeDoo
'-------------------------------------------------------------------
Private Const B="Bookmarks"
Sub OnStartup
Set BMK=SDB.UI.AddMenuItem(SDB.UI.Menu_Play,4,2)
BMK.Caption=SDB.Localize("Bookmark")
BMK.UseScript=Script.ScriptPath
BMK.OnClickFunc="MenuSwitch"
SDB.Objects(B)=BMK
Script.RegisterEvent SDB, "OnPlay", "IsBookMarked"
End Sub
Sub IsBookMarked
SID=SDB.Player.CurrentSong.ID
FID=SDB.Tools.IniFileByPath(SDB.ApplicationPath &B&".dat").BoolValue(B,SID)
SDB.Objects(B).Checked=FID
End Sub
Sub MenuSwitch(BMK)
Set FID=SDB.Tools.IniFileByPath(SDB.ApplicationPath &B&".dat")
SID=SDB.Player.CurrentSong.ID
If SDB.Objects(B).Checked Then
If Not SDB.Player.isPlaying Then SDB.Player.Play
TIM=FID.IntValue(B,SID)
SDB.Player.Playbacktime=TIM
FID.DeleteKey B,SID
SDB.Objects(B).Checked=False
Else
FID.IntValue(B,SID)=SDB.Player.Playbacktime
SDB.Objects(B).Checked=True
End If
Set PLS=SDB.PlaylistByTitle("").CreateChildPlaylist(B)
PLS.Clear
Set KYS=FID.Keys(B)
For i=0 To KYS.Count-1
SID=KYS.Item(i)
SID=Left(SID,InStr(SID,"=")-1)
PLS.AddTrackByID(SID)
Next
Set FID=Nothing
Set PLS=Nothing
Set KYS=Nothing
End Sub
A very simple Bookmark script.
Adds a 'Bookmark' item in the Play menu
The bookmarked song will be placed in a playlist called Bookmarks.
When a bookmark is used, it will be forgotten, and needs to be set again if you want to set it again for the same song.
To find bookmarked songs, simply go to the playlist Bookmarks, start playing the song, and go to the menu Player and hit the ticked 'Bookmark'
Might put the bookmarked songs into a sub menu instead of playlist later, as this script will not work so well if you already have a playlist called Bookmarks.
Changelog:
1.12 - 1.20 : A bit more tidy
1.20 - 2.00 : Bookmarked songs get collected in a Playlist called Bookmarks
[code]'-------------------------------------------------------------------
' \Program Files\MediaMonkey\Scripts\Auto\PlayMenu_Bookmarks.vbs
'
' Version 2.00
' 20 October 2006
' By DiddeLeeDoo
'-------------------------------------------------------------------
Private Const B="Bookmarks"
Sub OnStartup
Set BMK=SDB.UI.AddMenuItem(SDB.UI.Menu_Play,4,2)
BMK.Caption=SDB.Localize("Bookmark")
BMK.UseScript=Script.ScriptPath
BMK.OnClickFunc="MenuSwitch"
SDB.Objects(B)=BMK
Script.RegisterEvent SDB, "OnPlay", "IsBookMarked"
End Sub
Sub IsBookMarked
SID=SDB.Player.CurrentSong.ID
FID=SDB.Tools.IniFileByPath(SDB.ApplicationPath &B&".dat").BoolValue(B,SID)
SDB.Objects(B).Checked=FID
End Sub
Sub MenuSwitch(BMK)
Set FID=SDB.Tools.IniFileByPath(SDB.ApplicationPath &B&".dat")
SID=SDB.Player.CurrentSong.ID
If SDB.Objects(B).Checked Then
If Not SDB.Player.isPlaying Then SDB.Player.Play
TIM=FID.IntValue(B,SID)
SDB.Player.Playbacktime=TIM
FID.DeleteKey B,SID
SDB.Objects(B).Checked=False
Else
FID.IntValue(B,SID)=SDB.Player.Playbacktime
SDB.Objects(B).Checked=True
End If
Set PLS=SDB.PlaylistByTitle("").CreateChildPlaylist(B)
PLS.Clear
Set KYS=FID.Keys(B)
For i=0 To KYS.Count-1
SID=KYS.Item(i)
SID=Left(SID,InStr(SID,"=")-1)
PLS.AddTrackByID(SID)
Next
Set FID=Nothing
Set PLS=Nothing
Set KYS=Nothing
End Sub
[/code]