Shuffle & next track - what's the story?

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Shuffle & next track - what's the story?

Re: Shuffle & next track - what's the story?

by jkforde » Thu Apr 16, 2009 3:26 pm

ok, got the 1236 version... now the PlayNext! option does appears in the NowPlaying context menu so that's fine but the shuffle doesn't turn back on after choosing a track... so will post this remaining issue to the thread you suggested

update: OK, now working with MM 3.1.0_1236! ... thanks very much Ray for this! together with DreadM's NoirBlue skin (esp. the MiniPlayer skin) my MM is perfect... thanks nohitter for staying with me!

Re: Shuffle & next track - what's the story?

by nohitter151 » Thu Apr 16, 2009 2:53 pm

jkforde wrote:followup: i installed 3.1.0_1232 beta and still have the same issues as I outlined above...
1. Might be best to post that info at the script's official thread: http://www.mediamonkey.com/forum/viewto ... =2&t=38616
2. Why did you install 1232? (1236 is the latest available build)

Re: Shuffle & next track - what's the story?

by jkforde » Thu Apr 16, 2009 2:46 pm

followup: i installed 3.1.0_1232 beta and still have the same issues as I outlined above...

Re: Shuffle & next track - what's the story?

by jkforde » Wed Apr 15, 2009 2:53 pm

@nohitter, thanks, missed that little detail. will try with 3.1beta :roll:

Re: Shuffle & next track - what's the story?

by nohitter151 » Wed Apr 15, 2009 8:48 am

jkforde wrote:thanks Ray for the script. I've tried it using MM 3.0.7.1191: shuffle on, continuous on

in the Now Playing track list window it does not appear in the track context menu on right-click

in the Library window it does appear in the track context menu, does skip to the next track but does not turn shuffle back on after running (the selected next track does play)
From Ray's first post in the script thread:
Note that V3.1 (currently in beta) is required as it uses OnShuffleClicked and OnPlayBackEnd events which were introduced in 3.1.

Re: Shuffle & next track - what's the story?

by jkforde » Wed Apr 15, 2009 6:47 am

thanks Ray for the script. I've tried it using MM 3.0.7.1191: shuffle on, continuous on

in the Now Playing track list window it does not appear in the track context menu on right-click

in the Library window it does appear in the track context menu, does skip to the next track but does not turn shuffle back on after running (the selected next track does play)

Re: Shuffle & next track - what's the story?

by raybeau528 » Mon Apr 06, 2009 5:43 pm

A supported installation package is available here: http://www.mediamonkey.com/forum/viewto ... =2&t=38616

Re: Shuffle & next track - what's the story?

by raybeau528 » Sun Apr 05, 2009 7:02 pm

@jkforde - I think this little script might do what you're looking for. Extract and copy to scripts\auto\playnext.vbs.
Let me know if it works for you and if so I'll make an install package for it.

To use, right click on a track in the track list window and select Play Next! It will place the selected track after the current playing track in now playing. If shuffle is on it will temporarily turn it off. When the next track (the one you clicked on to play next) starts playing it will turn shuffle back on.

Edit: Addressed the second part of your request to set the Next track in the now playing window (assuming I understood correctly). When you select a track in the Now Playing window and right-click on Play Next!, that track will be played next regardless if Shuffle is on or off. If it's on, it will turn it off temporarily and turn it back on when the next track starts playing.

Edit: Update addresses a couple issues with shuffle state changes.


Ray

Code: Select all

    '
    ' MediaMonkey Script
    '
    ' NAME:  PlayNext
    '
    '
    ' [PlayNext]
    ' FileName=PlayNext.vbs
    ' ProcName=PlayNext
    ' Order=210
    ' DisplayName=Play Next!
    ' Description=Play Next 
    ' Language=VBScript
    ' ScriptType=0
    '
    '

Option Explicit

Sub OnStartup   'Create PlayNext Menu Item

    Dim itm1

    Set itm1 = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList,0,0)
    itm1.Caption = "Play Next!"
    itm1.UseScript = Script.ScriptPath
    itm1.IconIndex = 18
    itm1.Visible = True
	Script.RegisterEvent itm1, "OnClick","Event_TrackListPlayNext"
  
    Set itm1 = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP,0,0)
    itm1.Caption = "Play Next!"
    itm1.UseScript = Script.ScriptPath
    itm1.IconIndex = 18
    itm1.Visible = True
	Script.RegisterEvent itm1, "OnClick","Event_NowPlayingPlayNext"
	
	SDB.IniFile.BoolValue("PlayNext","ShuffleState") = SDB.Player.isShuffle
	'Script.RegisterEvent SDB, "OnShuffleClicked", "Event_ShuffleClicked"
	
End Sub 'OnStartup

Sub Event_TrackListPlayNext( arg )

	Dim i
	Script.UnRegisterEvents SDB
	Script.RegisterEvent SDB, "OnShuffleClicked", "Event_ShuffleClicked"
	
	If SDB.Player.isShuffle Then
		SDB.IniFile.BoolValue("PlayNext","ShuffleState") = True
		SDB.IniFile.BoolValue("PlayNext","ShuffleClicked") = True
		SDB.Player.isShuffle = False
	End If
	
	Dim otrack : Set oTrack = SDB.CurrentSongList.Item(0)
	Dim oPlayerTracks : Set oPlayerTracks = SDB.Player.CurrentSongList
	Dim oRemainderTracks : Set oRemainderTracks = SDB.NewSongList
	
	SDB.IniFile.IntValue("PlayNext","NextTrack") = SDB.Player.CurrentSongIndex +1
	For i = SDB.Player.CurrentSongIndex +1 to oPlayerTracks.Count-1
		oRemainderTracks.Add ( oPlayerTracks.Item(i) )
		SDB.Player.PlayListDelete(SDB.Player.CurrentSongIndex +1)
	Next
	
	SDB.Player.PlayListAddTrack( oTrack )
	SDB.Player.PlayListAddTracks( oRemainderTracks )

	Script.RegisterEvent SDB, "OnPlayBackEnd","Event_OnPlayBackEnd"

End Sub

Sub Event_NowPlayingPlayNext( arg )

	Dim i
	Script.UnRegisterEvents SDB
	Script.RegisterEvent SDB, "OnShuffleClicked", "Event_ShuffleClicked"
	
	If SDB.Player.isShuffle Then
		SDB.IniFile.BoolValue("PlayNext","ShuffleState") = True
		SDB.IniFile.BoolValue("PlayNext","ShuffleClicked") = True
		SDB.Player.isShuffle = False
	End If
	
	Dim otrack : Set oTrack = SDB.CurrentSongList.Item(0)
	Dim oPlayerTracks : Set oPlayerTracks = SDB.Player.CurrentSongList

	For i = 0 to oPlayerTracks.Count -1
		If oPlayerTracks.Item(i).ID = oTrack.ID Then
			Exit For
		End IF
	Next
	SDB.IniFile.IntValue("PlayNext","NextTrack") = i
	Script.RegisterEvent SDB, "OnPlayBackEnd","Event_OnPlayBackEnd"

End Sub

Sub Event_OnPlayBackEnd()

	Script.UnRegisterEvents SDB
	Script.RegisterEvent SDB, "OnShuffleClicked", "Event_ShuffleClicked"
	
	SDB.Player.STop
	Script.RegisterEvent SDB, "OnPlay","Event_Play"
	SDB.Player.Play

End Sub

Sub Event_Play()

	Script.UnRegisterEvents SDB
	Script.RegisterEvent SDB, "OnShuffleClicked", "Event_ShuffleClicked"
	
	SDB.Player.CurrentSongIndex = SDB.IniFile.IntValue("PlayNext","NextTrack")
	SDB.IniFile.BoolValue("PlayNext","ShuffleClicked") = True
	SDB.Player.isShuffle = SDB.IniFile.BoolValue("PlayNext","ShuffleState")
	
End Sub

Sub Event_ShuffleClicked()

	If Not SDB.IniFile.BoolValue("PlayNext","ShuffleClicked") Then
		SDB.IniFile.BoolValue("PlayNext","ShuffleState") = SDB.Player.isShuffle ' User clicked
	Else
		SDB.IniFile.BoolValue("PlayNext","ShuffleClicked") = False ' Expected
	End If
	
End Sub

Re: Shuffle & next track - what's the story?

by nohitter151 » Sat Apr 04, 2009 7:29 pm

I guess you already know the story that its not possible and that's why you posted to the wishlist.

Shuffle & next track - what's the story?

by jkforde » Sat Apr 04, 2009 6:02 pm

hi, any way to get MM to play a track via 'play next' even when shuffle is on. i know about the randomise list workaround etc - just want to choose a track to play next but still maintain a shuffle for the rest of the tracks...and any way to get 'play next' in the now playing list content menu??

Top