Page 4 of 14

Re: mmStations V2.3

Posted: Fri Nov 14, 2008 2:26 pm
by raybeau528
The section looks fine, thanks. I found the problem and will update the install package shortly.

Ray

Re: mmStations V2.3

Posted: Fri Nov 14, 2008 2:36 pm
by raybeau528
Nyn, found the problem - new version is available in post 1.

Ray

Re: mmStations V2.3

Posted: Fri Nov 14, 2008 2:42 pm
by nynaevelan
Betcha didn't think you would spend so much time developing this. :wink: BTW, the CopytoPlaylists is VERY handy when I am evaluating new tracks, makes it much easier to assign them to the appropriate playlist later. Thanks for both.... :D :D

Nyn

Re: mmStations V2.3

Posted: Fri Nov 14, 2008 3:05 pm
by nynaevelan
raybeau528 wrote:Nyn, found the problem - new version is available in post 1.

Ray
Thanks, that fixed it. :D

Nyn

Re: mmStations V2.3

Posted: Sat Nov 15, 2008 8:35 pm
by raybeau528
Nyn, glad you liked that little copytoplaylist feature. The few scripts I've written I've done so because they support how I like to use MM. Suggestions such as yours help make it better. And speaking of suggestions, I'm thinking of adding a couple small buttons to the mmstation panel and was looking for inputs - perhaps randomize the selected playlist or something else related to the theme of mmStations. Space is limited in the horizontal layout but I could probably squeeze two buttons in the space of a station button - these would be in addition to the ten station buttons. Any thoughts?

Ray

Re: mmStations V2.3

Posted: Sat Nov 15, 2008 10:44 pm
by nynaevelan
Ok:

I've had some time to think about it and I like the randomize option. Also, maybe an option that would take you to the last selected playlist but not sure how you would get that to work if you haven't selected a playlist within that session. I really cannot think of anything else in the theme of mmStations that would help. Of course as soon as I stop thinking about it, I'll probably have more ideas. :-?

Nyn

Re: mmStations V2.3

Posted: Mon Nov 17, 2008 2:27 am
by fuzzynavel
Your 2.3 fix did it for me - everything is working very smoothly. Thanks so much!

Re: mmStations V1.0

Posted: Sat Dec 20, 2008 9:08 pm
by nynaevelan
raybeau528 wrote:Nyn,

Here's a quick a dirty script to copy the Now Playing.

Code: Select all

'
' MediaMonkey Script
'
' NAME:  SaveNowPlaying
'
'
' [SaveNowPlaying]
' FileName=SaveNowPlaying.vbs
' ProcName=SaveNowPlaying
' Order=210
' DisplayName=Save NowPlaying
' Description=Save NowPlaying List to a PlayList
' Language=VBScript
' ScriptType=0
'
'

Option Explicit

Sub OnStartup	'Create Save NowPlaying Menu Item

  Dim itm1

  Set itm1 = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP,0,0)
  itm1.Caption = "Save NowPlaying"
  itm1.OnClickFunc = "SaveNowPlaying"
  itm1.UseScript = Script.ScriptPath
  itm1.IconIndex = 18
  itm1.Visible = True

End Sub 'OnStartup


Sub SaveNowPlaying(arg)

	Dim tree 				: Set tree = SDB.MainTree
	Dim SelectedPlayList	: Set SelectedPlayList = sdb.playlistbytitle( SDB.MainTree.CurrentNode.caption )	
	Dim SelectedSongList 	: Set SelectedSongList = SDB.CurrentSongList
	Dim NewSongList			: Set NewSongList = SDB.NewSongList


	Dim TopPlayList	: Set TopPlaylist = SDB.PlaylistByTitle("")
	Dim NewPlayList
	Set NewPlayList = TopPlayList.CreateChildPlaylist("Copy of NowPlaying "&dtnum)
	If not (NewPlayList is Nothing) Then
		NewPlayList.Clear
	End If
			
	NewPlayList.AddTracks(SDB.Player.CurrentSongList)

End Sub

' Returns a 14 char string which changes every second - should be unique for this application
function dtNum()
	
	dim y,m,d,h,n,s
	
	y = Cstr(DatePart("YYYY",Date))
	m = zfill(Cstr(DatePart("m",Date)),2)
	d = zfill(Cstr(DatePart("d",Date)),2)
	h = zfill(Cstr(DatePart("h",now)),2)
	n = zfill(Cstr(DatePart("n",now)),2)
	s = zfill(Cstr(DatePart("s",Now)),2)
	
	dtNum = y & m & d & h & n & s
	
end function


' Left fills with zeros
function zfill(s,n)

	dim i,t
	t=s
	while len(t) < n
		t = "0" & t
	wend
	zfill = t

end function
Ray:

Is it possible to add some kind of timer to this or better yet a way for it to save the NP list either or startup or shutdown??

Nyn

Re: mmStations V2.3

Posted: Sun Dec 21, 2008 11:33 am
by rogerr
Nice script. Any chance you can enhance to be able to add MegaDJ playlists?

Re: mmStations V2.3

Posted: Sun Dec 21, 2008 11:41 am
by raybeau528
Nyn,

By timer, do you mean automatically save the nowplaying list every x minutes/seconds ? I can look at saving at startup or shutdown as well.

Rogerr,
Let me look into it. I believe a MegaDJ playlist is quite different than the MM playlists but almost anything's possible.


Ray

Re: mmStations V2.3

Posted: Sun Dec 21, 2008 11:52 am
by nynaevelan
raybeau528 wrote:Nyn,

By timer, do you mean automatically save the nowplaying list every x minutes/seconds ? I can look at saving at startup or shutdown as well.


Ray
I would be content with a startup or shutdown autosave but if you could get it to save every hour or so that would be fantastic.

Nyn

Re: mmStations V2.3

Posted: Sun Dec 21, 2008 12:15 pm
by raybeau528
Nyn,

Your preference then would be to have it save the current playing song to the favorites playlist every hour? That should be doable.

Ray

Re: mmStations V2.3

Posted: Sun Dec 21, 2008 12:18 pm
by nynaevelan
Ray:

No, not that one, the script you created to save the now playling list to a particular saved list. I'm ok with the favorites being a manual process.

Nyn

Re: mmStations V2.3

Posted: Sun Dec 21, 2008 12:37 pm
by raybeau528
Ah! That makes much more sense!

Ray

Re: mmStations V2.3

Posted: Sun Dec 21, 2008 4:16 pm
by raybeau528
Nyn,

This will trigger a copy every 1 hour. If you want to change the frequency, change the 1000*60*60 in this line:

Code: Select all

  Dim Tmr : Set Tmr = SDB.CreateTimer( 1000*60*60 )   ' 1 hour Timer Enabled
Where 1000 is for 1 second.


Code: Select all

'
' MediaMonkey Script
'
' NAME:  SaveNowPlaying
'
'
' [SaveNowPlaying]
' FileName=SaveNowPlaying.vbs
' ProcName=SaveNowPlaying
' Order=210
' DisplayName=Save NowPlaying
' Description=Save NowPlaying List to a PlayList
' Language=VBScript
' ScriptType=0
'
'

Option Explicit

Sub OnStartup	'Create Save NowPlaying Menu Item

  Dim itm1

  Set itm1 = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP,0,0)
  itm1.Caption = "Save NowPlaying"
  itm1.OnClickFunc = "SaveNowPlaying"
  itm1.UseScript = Script.ScriptPath
  itm1.IconIndex = 18
  itm1.Visible = True
  
  Dim Tmr : Set Tmr = SDB.CreateTimer( 1000*60*60 )   ' 1 hour Timer Enabled
  Tmr.Enabled=true
  Script.RegisterEvent Tmr, "OnTimer", "SaveNowPlaying"

End Sub 'OnStartup


Sub SaveNowPlaying(arg)

	Dim TopPlayList	: Set TopPlaylist = SDB.PlaylistByTitle("")
	Dim NewPlayList
	Set NewPlayList = TopPlayList.CreateChildPlaylist("Copy of NowPlaying "&dtnum)
	If not (NewPlayList is Nothing) Then
		NewPlayList.Clear
	End If
		
	NewPlayList.AddTracks(SDB.Player.CurrentSongList)

End Sub

' Returns a 14 char string which changes every second - should be unique for this application
function dtNum()
	
	dim y,m,d,h,n,s
	
	y = Cstr(DatePart("YYYY",Date))
	m = zfill(Cstr(DatePart("m",Date)),2)
	d = zfill(Cstr(DatePart("d",Date)),2)
	h = zfill(Cstr(DatePart("h",now)),2)
	n = zfill(Cstr(DatePart("n",now)),2)
	s = zfill(Cstr(DatePart("s",Now)),2)
	
	dtNum = y & m & d & h & n & s
	
end function


' Left fills with zeros
function zfill(s,n)

	dim i,t
	t=s
	while len(t) < n
		t = "0" & t
	wend
	zfill = t

end function