Auto\MusicNonStop.vbs - Autocue song after end of Now Playin

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

onkel_enno
Posts: 2146
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno » Sun Jun 26, 2005 9:37 am

You never get anough, do you? :lol:

It should be possible and I will try to implement it tomorrow, OK?

BTW How many beers do you had? :wink:

Edit:
Here it is:

Code: Select all

...
When selecting "All Tracks", all Tracks are added from the Playlist sorted like in the Playlist. When selecting 1...5 Tracks, these Tracks are selected randomly from the Playlist.
Last edited by onkel_enno on Thu Jun 30, 2005 3:21 am, edited 1 time in total.
SansaMonkey - for SanDisk Sansa and Rockbox Users

Please no PMs for Questions which should be asked in the Forum. Thx

judas
Posts: 572
Joined: Thu Jun 02, 2005 11:26 pm
Location: Bogotá, Colombia

Post by judas » Mon Jun 27, 2005 10:17 am

Youre turning me into an alcoholic mate...thats beautiful!!!

i actually did drink a few beers...im from COlombia and the soccer final was held yesterday lol :D (yes..my team won)

mmm......and no, i cant get enough...can you please now add an option so it calls my mobile automatically every time a song is played twice in less than 5 minutes?? oh...and can you make it scratch my back as well? LOL

its working perfectly, thanks a lot. i hope you find it useful as well...im loving it!!!!

juan

[/quote]

onkel_enno
Posts: 2146
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno » Mon Jun 27, 2005 11:55 pm

judas wrote: i actually did drink a few beers...im from COlombia and the soccer final was held yesterday lol :D (yes..my team won)
:evil: :lol:
judas wrote: mmm......and no, i cant get enough...can you please now add an option so it calls my mobile automatically every time a song is played twice in less than 5 minutes?? oh...and can you make it scratch my back as well? LOL

That goes quite too far :roll:

Nice if you 're happy with it. If you have any further suggestions, let me know.

CU


EDIT
There was an error with Auo-Playlists with changing Number of Tracks.
This version should work better:

Code: Select all

'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'Save this File (MusicNonStop.vbs) in MediaMonkey\Scripts\Auto
'and add the following Lines to MediaMonkey\Scripts\Scripts.ini
'(without apostrophes):
'
'[MusicNonStop]
'FileName=Auto\MusicNonStop.vbs
'ProcName=MusicNonStop
'Order=10
'DisplayName=MusicNonStop
'Description=MusicNonStop
'Language=VBScript
'ScriptType=2
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Option Explicit

const inclPersistent = False 'show Playlists like "Last 50 played", ... or not
const MaxTracksAdd = 3 'how many selectable Tracks are shown in Menu

const ObjName = "MusicNonStopPlaylist" 'Name of the Objects stored within MediaMonkey

'Create MenuItem

Sub OnStartUp
	Dim MenuItem
	Dim MenuItemSub
	Dim strTemp
	Dim boolTemp
	Dim intTemp
	Dim a
	
	'MenuEntries Playlists
	
	SDB.UI.AddMenuItemSep SDB.UI.Menu_Play, -1, -1
	Set MenuItemSub = SDB.UI.AddMenuItemSub(SDB.UI.Menu_Play, -1, -1)
	MenuItemSub.Caption = "Music Non Stop"
	MenuItemSub.UseScript = Script.ScriptPath
	MenuItemSub.OnClickFunc = "ShowPlaylists"
	SDB.Objects(objName) = MenuItemSub
	
	'MenuEntry >Yes<
	
	Set MenuItem = SDB.UI.AddMenuItem(MenuItemSub, -1, -1)
		MenuItem.Caption = SDB.Localize("Yes")
		MenuItem.Hint = "On last Track of Now Playing, Tracks from selected Playlist will be added"
		MenuItem.Enabled = True
		MenuItem.UseScript = Script.ScriptPath
		MenuItem.OnClickFunc = "SwitchOnOff"
		
		strTemp = SDB.IniFile.StringValue("Player", "NonStop")
		if strTemp = "" then boolTemp = False else boolTemp = CBool(strTemp)
		MenuItem.Checked = boolTemp	
	Set MenuItem = Nothing
	
	SDB.UI.AddMenuItemSep MenuItemSub, -1, -1
	
	strTemp = SDB.IniFile.StringValue("Player", "NonStopNo")
	if strTemp = "" then intTemp = 0 else intTemp = CInt(strTemp)
	
	'Menu entries >No of Tracks<
	
	for a = 0 to MaxTracksAdd
		Set MenuItem = SDB.UI.AddMenuItem(MenuItemSub, -1, -1)
			if a = 0 then MenuItem.Caption = SDB.Localize("All") else MenuItem.Caption = a
			if a <> 1 then MenuItem.Caption = MenuItem.Caption & " " & SDB.Localize("Tracks") else MenuItem.Caption = MenuItem.Caption & " " & SDB.Localize("Track")
			'MenuItem.Hint = MenuItem.Caption & " of the Playlist will be added"
			MenuItem.Enabled = True
			MenuItem.UseScript = Script.ScriptPath
			MenuItem.OnClickFunc = "SetNumber"
			MenuItem.Checked = (intTemp = a)
			SDB.Objects(objName & "No" & a) = MenuItem
		Set MenuItem = Nothing
	next
	
	SDB.UI.AddMenuItemSep MenuItemSub, -1, -1
	
	Set MenuItemSub = Nothing
end Sub

'Switch MusicNonStop On/Off

Sub SwitchOnOff(MenuItem)
	MenuItem.Checked = not MenuItem.Checked 'Change
	SDB.IniFile.StringValue("Player", "NonStop") = MenuItem.Checked 'Save
End Sub

'Add Tracks to NowPlaying, if last Track starts playing

Sub MusicNonStop
	Dim strTemp
	Dim boolTemp
	Dim PlaylistName
	Dim PlaylistTracks
	Dim a
	Dim NoTracks
	Dim rndItem
	
	if SDB.Player.CurrentSongIndex = SDB.Player.PlaylistCount-1 then
		strTemp = SDB.IniFile.StringValue("Player", "NonStop")
		if strTemp = "" then boolTemp = False else boolTemp = CBool(strTemp)
		if boolTemp then
			PlaylistName = SDB.IniFile.StringValue("Player", "NonStopPlaylist")
			Set PlaylistTracks = SDB.PlaylistByTitle(PlaylistName).Tracks
			
			strTemp = SDB.IniFile.StringValue("Player", "NonStopNo")
			if strTemp = "" then NoTracks = 0 else NoTracks = CInt(strTemp)
			
			if strTemp = 0 then
				'Last Track -> add all Tracks from Playlist "My Playlist"
				SDB.Player.PlaylistAddTracks(PlaylistTracks)
			elseif PlaylistTracks.Count > 0 then
				'Add # of randomly selected Tracks from Playlist to Now Playing
				Randomize Timer
				for a = 1 to NoTracks
					rndItem = Int((PlaylistTracks.Count-1) * Rnd)
					SDB.Player.PlaylistAddTrack(PlaylistTracks.Item(rndItem))
				next
			end if
			Set PlaylistTracks = Nothing
		end if
	end if
End Sub

'Save No of Tracks in INI-File and mark the Entry as checked

Sub SetNumber(MenuItem)
Dim strTemp
Dim intTemp
Dim a
	
	strTemp = MenuItem.Caption
	strTemp = Trim(Left(strTemp, Instr(strTemp, " ")))
	if strTemp = SDB.Localize("All") then intTemp = 0 else intTemp = CInt(strTemp)
	
	'Save to Ini
	SDB.IniFile.StringValue("Player", "NonStopNo") = intTemp
	
	for a = 0 to MaxTracksAdd
		SDB.Objects(objName & "No" & a).Checked = (a = intTemp)
	next
end Sub

'Create SubMenus for Playlist-Selection

Sub ShowPlaylists(MenuItem)
	Dim DataSet
	Dim PLCount
	Dim Counter
	Dim PLMenu
	Dim SelectedPL
	Dim SQL
	
	SelectedPL = SDB.IniFile.StringValue("Player", "NonStopPlaylist")
	
	Set DataSet = SDB.Database.OpenSQL("Select Max(IDPlaylist) from Playlists")
	PLCount = DataSet.ValueByIndex(0)
	Set DataSet = Nothing
	
	for Counter = 1 to PLCount + 10 'tolerance (for created Playlists which where immediately deleted)
		Set PLMenu = SDB.Objects(objName & Counter)
		SQL = "Select PlaylistName from Playlists WHERE IDPlaylist = " & Counter
		if not inclPersistent then SQL = SQL & " AND Persistent IS NULL"
		Set DataSet = SDB.Database.OpenSQL(SQL)
		if DataSet.EOF and (not (PLMenu is Nothing)) then 
			PLMenu.Enabled = False
			PLMenu.Checked = False
		elseif not Dataset.EOF then
			if PLMenu is Nothing then
				Set PLMenu = SDB.UI.AddMenuItem(SDB.Objects(objName), -1, -1)
				PLMenu.Hint = Counter
				PLMenu.UseScript = Script.ScriptPath
				PLMenu.OnClickFunc = "SelectPlaylist"
				SDB.Objects(objName & Counter) = PLMenu
			end if
			PLMenu.Caption = DataSet.StringByIndex(0)
			PLMenu.Enabled = True
			PLMenu.Checked = (SelectedPL = PLMenu.Caption)
		end if
		Set DataSet = Nothing
		Set PLMenu = Nothing
	next
end Sub

'Save Playlist-Selection

Sub SelectPlaylist(MenuItem)
	SDB.IniFile.StringValue("Player", "NonStopPlaylist") = MenuItem.Caption
End Sub
@Judas
Would you please edit your first post and rename the Topic to "Auto\MusicNonStop.vbs"!? Thanks
SansaMonkey - for SanDisk Sansa and Rockbox Users

Please no PMs for Questions which should be asked in the Forum. Thx

judas
Posts: 572
Joined: Thu Jun 02, 2005 11:26 pm
Location: Bogotá, Colombia

Post by judas » Fri Jul 08, 2005 12:07 pm

OH...i hadnt seen your post...edited the topic.

i didnt notice the problem...anyway, guess this will be better :-)

juan

Guest

Post by Guest » Sun Jul 10, 2005 4:25 pm

i dont get this subject what are you trying to do?

it seems to me that you can just turn on the repeat button and it will keep playing the now playing playlist.?

but then i have a huge playlist so it is little wonder i never get to the end of it.

but my sister plays a short list and plays over and over and over and over all the time she plays online and we just have the repeat button on?

8) :o

onkel_enno
Posts: 2146
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno » Mon Jul 11, 2005 1:02 am

If you don't understand it, or don't need it, don't use it :wink:
SansaMonkey - for SanDisk Sansa and Rockbox Users

Please no PMs for Questions which should be asked in the Forum. Thx

Guest

Post by Guest » Mon Jul 11, 2005 5:29 pm

smart a.. aswers are not needed what is needed is a correct answer as to what it is to do and how to use it.

you people that can program forget that us that can not also would like to do your stuff if we could get step by step instructuions that tell us what to do in order to use your stuff. and what your stuff is to do?

:)

judas
Posts: 572
Joined: Thu Jun 02, 2005 11:26 pm
Location: Bogotá, Colombia

Re: Auto\MusicNonStop.vbs - Autocue song after end of Now Pl

Post by judas » Mon Jul 11, 2005 9:27 pm

judas wrote: what im looking for is for a script that automatically autocues a song from a seleceted location when the end of the Now Playing list is reached...so to have music on all the time.

the automatic track would be a random track from either a specific playlist and it should be easy to turn on/off (as with a tick on AUtocue on/off).
thats from the first post...perhaps reading before asking is a good idea...

Guest

Post by Guest » Mon Jul 11, 2005 10:06 pm

what i had trouble with was understanding the subject by the name of the title.?

what your repost of the first message tells me is that you are looking to auto run another playlist after the first playlist?

sounds like a good idea.

8)

judas
Posts: 572
Joined: Thu Jun 02, 2005 11:26 pm
Location: Bogotá, Colombia

Post by judas » Tue Jul 12, 2005 12:35 am

well....yeah...as the script is now you can choose to play one, two,three etc songs from a playlist you select or even the entire playlist...is nice because most times Now Playing doesnt have that many songs.

it had been requested before by someone...cant find the thead now though...hope you find it useful, ust give it a try, it works like a charm. :lol:

onkel_enno
Posts: 2146
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno » Tue Jul 12, 2005 12:54 am

Yes, it is a good idea and since judas asked for it, I use it the whole day.
Now I have music on all the day.
The advantage facing (?) repeating a playlist again and again is that at me there is always only 1 Track added to Now Playing and if I suddenly want to hear a Track, I could select this Track, select Play last and in a few Moments the Track will start, without having to reorder Now Playing.
SansaMonkey - for SanDisk Sansa and Rockbox Users

Please no PMs for Questions which should be asked in the Forum. Thx

judas
Posts: 572
Joined: Thu Jun 02, 2005 11:26 pm
Location: Bogotá, Colombia

Post by judas » Tue Jul 12, 2005 1:01 am

:D :) :lol: :P :D :) :lol: :P :D :) :lol: :P :D :) :lol: :P :D :) :lol: :P

i love it to...much better than the autocue I used in winamp...i have it set to add one song as well...sometimes i like adding 3, that way i have the option to delete one of those if i dont want to listen to it next :-)

so thanks again there mate!!

onkel_enno
Posts: 2146
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno » Tue Jul 12, 2005 2:35 am

judas wrote:i have it set to add one song as well...sometimes i like adding 3, that way i have the option to delete one of those if i dont want to listen to it next :-)
BTW you can change the Number in this Line

Code: Select all

const MaxTracksAdd = 3
to what you want, if you want to add more than 3 Tracks
SansaMonkey - for SanDisk Sansa and Rockbox Users

Please no PMs for Questions which should be asked in the Forum. Thx

judas
Posts: 572
Joined: Thu Jun 02, 2005 11:26 pm
Location: Bogotá, Colombia

Post by judas » Tue Jul 12, 2005 2:40 am

yeah i saw that before... :-). thanks still...

psyXonova
Posts: 785
Joined: Fri May 20, 2005 3:57 am
Location: Nicosia, Cyprus
Contact:

Post by psyXonova » Tue Jul 12, 2005 6:20 am

This is how i use it:
I have FileMonitor on
I constantly download and add new files in my collection..
i have created an auto-playlist that contains the tracks added to MM up until 7 days ago and have not yet been played.
I use this script to add 2 randoms songs everytime from this playlist...
That way i can hear my new songs, something that i had to do manually!!

This is cool, every song i have now has the possibilities to be played!!!
Cool, cool, cool
The last 2 days i've heard songs i didn't even knew they exist in my library LOL

Post Reply