If the player is not playing, it will clear, queue and start playing the selected tracks.
http://teknojnky.googlepages.com/ClearAndQueue.mmip
Should work on mm2 and mm3 but have not tested on mm2.
Code: Select all
Option Explicit
'==========================================================================
'
' MediaMonkey Script
'
' SCRIPTNAME: Clear and Queue
' DEVELOPMENT STARTED: 2008.06.21
Dim Version : Version = "2008.06.22.1100"
' DESCRIPTION: Adds a context menu to clear the now playing and queue the selected
' tracks without interupting the currently playing track'
' FORUM THREAD: http://www.mediamonkey.com/forum/viewtopic.php?f=2&t=30535
'
' INSTALL:
' - download install package @ http://teknojnky.googlepages.com/ClearAndQueue.mmip
' Recent Updates:
' 2008.06.21 Initial version'
Sub OnStartup
Do While Not SDB.IsRunning
SDB.Tools.Sleep 100
SDB.ProcessMessages
Loop
Dim mnu
Set mnu = SDB.UI.AddMenuItem (SDB.UI.Menu_Pop_TrackList,2,0)
mnu.Caption = "Clear and Queue Next"
Script.RegisterEvent mnu, "OnClick", "ClearAndQueue"
mnu.IconIndex = 54
mnu.Hint = "Clears the Now Playing Window and queues selected files"
' mnu.Shortcut = "" 'assign your own shortcut'
Set mnu = SDB.UI.AddMenuItem (SDB.UI.Menu_Pop_NP,1,0)
mnu.Caption = "Clear and Queue Next"
Script.RegisterEvent mnu, "OnClick", "ClearAndQueue"
mnu.IconIndex = 54
mnu.Hint = "Clears the Now Playing Window and queues selected files"
Set mnu = SDB.UI.AddMenuItem (SDB.UI.Menu_Pop_Tree,2,0)
mnu.Caption = "Clear and Queue Next"
Script.RegisterEvent mnu, "OnClick", "ClearAndQueue"
mnu.IconIndex = 54
mnu.Hint = "Clears the Now Playing Window and queues selected files"
End Sub
Sub ClearAndQueue(obj)
Dim Selected
Set Selected = SDB.CurrentSongList
If Selected.Count > 0 Then
SDB.Player.PlaylistClear
' SDB.Player.PlaylistAddTrack(SDB.Player.CurrentSong)
SDB.Player.PlaylistAddTracks(Selected)
If SDB.Player.isPlaying = False Then SDB.Player.Play
End If
End Sub