Next Artist or Album
Moderator: Gurus
Next Artist or Album
Hi,
I can't find the function to switch to the next (or previous) artist (or Album) !
I'd like to have a short-cut for this function, so I could use this function with my remote control !
Hope someone can help me !
Nick
I can't find the function to switch to the next (or previous) artist (or Album) !
I'd like to have a short-cut for this function, so I could use this function with my remote control !
Hope someone can help me !
Nick
You mean you just want to go to the next/previous node in the library tree?
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
If you want to go next/previous only on the current node level (only sibling nodes), then use these methods:
If you want to go to the next/previous node regardless of it's hierarchy, then use these methods:
I don't have time to help you linking these methods to your remote, but I'm sure there are others here that can help you more.
(Peke seems to know a lot about remotes).
Cheers
Steegy
Code: Select all
Sub GoToNextSiblingNode
On Error Resume Next
SDB.MainTree.CurrentNode = SDB.MainTree.NextSiblingNode(SDB.MainTree.CurrentNode)
End Sub
Sub GoToPreviousSiblingNode
On Error Resume Next
SDB.MainTree.CurrentNode = SDB.MainTree.PreviousSiblingNode(SDB.MainTree.CurrentNode)
End Sub
Code: Select all
Sub GoToNextNode
On Error Resume Next
SDB.MainTree.CurrentNode = SDB.MainTree.NextNode(SDB.MainTree.CurrentNode)
End Sub
Sub GoToPreviousNode
On Error Resume Next
SDB.MainTree.CurrentNode = SDB.MainTree.PreviousNode(SDB.MainTree.CurrentNode)
End Sub
(Peke seems to know a lot about remotes).
Cheers
Steegy
Last edited by Steegy on Tue Jan 02, 2007 3:51 pm, edited 2 times in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
-
- Posts: 14163
- Joined: Sat Oct 25, 2003 7:57 am
- Location: (Texas)
- Contact:
you need a script to move the songs by artists instead of track names.
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
So you want that a push on the button of your remote: starts playing the next album/artist (the next in alphabet).
Do you want to switch the tracks view to that (newly chosen) artist/album, or do you want it to stay as it was?
I don't have time to make this right now. (If nobody has done this in a month or so, please remind us/me, maybe I'll have time then)
@Other scripters:
How it would work:
- Get current playing Artist/Album name.
- Query database for the songs (alphabetically ordered) that have an Artist/Album name that is next (limit results to 1).
- Send all songs from that Artist/Album to the player as nowplaying list and start playing.
- Optionally: Browse to the correct Artist/Album node (using my BrowseToNode script).
If the correct Artist/Album tracks view has to be shown, there's a second way to do this:
- Get current playing Artist/Album name.
- Browse to the correct Artist/Album node (using my BrowseToNode script).
- Send all songs in the track view to the player as nowplaying list and start playing.
(so definately easier, but requires to open the Artist/Album node)
At least, these are the 2 things I would use. The choice depends on the fact if the Artist/Album node has to be opened. With the first method, this can be made optional.
Cheers
Steegy
Do you want to switch the tracks view to that (newly chosen) artist/album, or do you want it to stay as it was?
I don't have time to make this right now. (If nobody has done this in a month or so, please remind us/me, maybe I'll have time then)
@Other scripters:
How it would work:
- Get current playing Artist/Album name.
- Query database for the songs (alphabetically ordered) that have an Artist/Album name that is next (limit results to 1).
- Send all songs from that Artist/Album to the player as nowplaying list and start playing.
- Optionally: Browse to the correct Artist/Album node (using my BrowseToNode script).
If the correct Artist/Album tracks view has to be shown, there's a second way to do this:
- Get current playing Artist/Album name.
- Browse to the correct Artist/Album node (using my BrowseToNode script).
- Send all songs in the track view to the player as nowplaying list and start playing.
(so definately easier, but requires to open the Artist/Album node)
At least, these are the 2 things I would use. The choice depends on the fact if the Artist/Album node has to be opened. With the first method, this can be made optional.
Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
That's it !Steegy wrote:So you want that a push on the button of your remote: starts playing the next album/artist (the next in alphabet).
I want it to stay as it it, so that I can "skip to next track" AND "skip to next Album/Artist" !!Steegy wrote: Do you want to switch the tracks view to that (newly chosen) artist/album, or do you want it to stay as it was?
So, together with mediamonkey would make my computer a great audiostation, used with a remote control !!!
Sorry, I don't know much about programming or things like this, so I'm not able to help anyway...
thx, Nick
I'll have a look at it this evening.
Cheers
Steegy
Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Here's the script you can use:
These methods "PlayNextAlbum", "PlayPreviousAlbum", "PlayNextAlbumArtist", "PlayPreviousAlbumArtist", "PlayNextAlbumSameArtist", "PlayPreviousAlbumSameArtist" can be called by the program (e.g. "Girder") that you use for your remote control.
The methods can be externaly called with command line parameters, e.g.:
C:\Program Files\MediaMonkey\Scripts\Previous&Next Album(Artist).vbs /PlayNextAlbum
In Girder, you'll probably need to set the application to execute to:
C:\Windows\System32\Wscript.exe
The command line parameters (next thing to specify in Girder) have to be set to something like:
C:\Program Files\MediaMonkey\Scripts\Previous&Next Album(Artist).vbs /PlayNextAlbum
How to add (for Girder 3.2.9b):
- Menu Edit > Add new Command
- Tabpage "O.S." > dropdown list > "Execute" (or something similar).
- Fill in the text areas as said above (one box for the wscript program location, one line for the command line parameters), and preferable set startup visibility to "hidden" (or "invisible").
- Click the apply button and then right-click the command icon in the left pane, and choose "test command".
For a more complete walkthrough with screenshots, please look at page 2.
Cheers
Steegy
Code: Select all
'==========================================================================
'
' MediaMonkey Script
'
' NAME: Previous&Next Album(Artist) v0.5.2
' DESCRIPTION:
' Exposes methods "PlayNextAlbum", "PlayPreviousAlbum", "PlayNextAlbumArtist",
' "PlayPreviousAlbumArtist", "PlayNextAlbumSameArtist", "PlayPreviousAlbumSameArtist"
' These methods can e.g. be called from use with a remote control.
'
' AUTHOR: Steegy aka RC (Ruben Castelein)
' DATE : 06/06/2006
' UPDATE: 14/06/2006
'
'==========================================================================
Const AlwaysClearPlaylistAndStop = False ' Setting this to true will always clear the now playing list and stop playback, even if no matching album has been found
Const ShowNode = True ' Setting this to True will let the chosen album's node automaticly be selected
Dim SDB : Set SDB = CreateObject("SongsDB.SDBApplication")
'*****************************************************
'**** COMMAND LINE PARAMETERS ****
'*****************************************************
If Not IsEmpty(WScript) Then
If WScript.Arguments.Named.Exists("PlayNextAlbum") Then
Call PlayNextAlbum
ElseIf WScript.Arguments.Named.Exists("PlayPreviousAlbum") Then
Call PlayPreviousAlbum
ElseIf WScript.Arguments.Named.Exists("PlayNextAlbumArtist") Then
Call PlayNextAlbumArtist
ElseIf WScript.Arguments.Named.Exists("PlayPreviousAlbumArtist") Then
Call PlayPreviousAlbumArtist
ElseIf WScript.Arguments.Named.Exists("PlayNextAlbumSameArtist") Then
Call PlayNextAlbumSameArtist
ElseIf WScript.Arguments.Named.Exists("PlayPreviousAlbumSameArtist") Then
Call PlayPreviousAlbumSameArtist
End If
End If
'*****************************************************
'**** MAIN METHODS ****
'*****************************************************
Sub PlayNextAlbum
If SDB.Player.CurrentSong Is Nothing Then Exit Sub
Dim CurrentAlbumName : CurrentAlbumName = SDB.Player.CurrentSong.AlbumName
Dim CurrentAlbumArtistName : CurrentAlbumArtistName = SDB.Player.CurrentSong.AlbumArtistName
' Fill the now playing list with an album with the same name, but the next album artist in alphabet
Call PlayFromQuery("" _
& "AND Songs.IDAlbum IN (" _
& "SELECT TOP 1 Albums.ID " _
& "FROM (Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID) " _
& "WHERE (Albums.Album='" & DoubleUpSingleQuotes(CurrentAlbumName) & "' " _
& "AND StrComp(Artists.Artist, '" & DoubleUpSingleQuotes(CurrentAlbumArtistName) & "')=1) " _
& "ORDER BY Artists.Artist" _
& ") ORDER BY Songs.SongOrder", True)
' If the now playing list has been filled (so there is such an album as searched for above) then exit the subroutine
If SDB.Player.PlaylistCount <> 0 Then Exit Sub
' If no such album was found, then get the next album with the next name in the alphabet
Call PlayFromQuery("" _
& "AND Songs.IDAlbum IN (" _
& "SELECT TOP 1 Albums.ID " _
& "FROM (Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID) " _
& "WHERE StrComp(Albums.Album, '" & DoubleUpSingleQuotes(CurrentAlbumName) & "')=1 " _
& "ORDER BY Albums.Album, Artists.Artist" _
& ") ORDER BY Songs.SongOrder", False)
End Sub
Sub PlayPreviousAlbum
If SDB.Player.CurrentSong Is Nothing Then Exit Sub
Dim CurrentAlbumName : CurrentAlbumName = SDB.Player.CurrentSong.AlbumName
Dim CurrentAlbumArtistName : CurrentAlbumArtistName = SDB.Player.CurrentSong.AlbumArtistName
' Fill the now playing list with an album with the same name, but the previous album artist in alphabet
Call PlayFromQuery("" _
& "AND Songs.IDAlbum IN (" _
& "SELECT TOP 1 Albums.ID " _
& "FROM (Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID) " _
& "WHERE (Albums.Album='" & DoubleUpSingleQuotes(CurrentAlbumName) & "' " _
& "AND StrComp(Artists.Artist, '" & DoubleUpSingleQuotes(CurrentAlbumArtistName) & "')=-1) " _
& "ORDER BY Artists.Artist DESC" _
& ") ORDER BY Songs.SongOrder", True)
' If the now playing list has been filled (so there is such an album as searched for above) then exit the subroutine
If SDB.Player.PlaylistCount <> 0 Then Exit Sub
' If no such album was found, then get the previous album with the next name in the alphabet
Call PlayFromQuery("" _
& "AND Songs.IDAlbum IN (" _
& "SELECT TOP 1 Albums.ID " _
& "FROM (Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID) " _
& "WHERE StrComp(Albums.Album, '" & DoubleUpSingleQuotes(CurrentAlbumName) & "')=-1 " _
& "ORDER BY Albums.Album DESC, Artists.Artist DESC" _
& ") ORDER BY Songs.SongOrder", False)
End Sub
Sub PlayNextAlbumArtist
If SDB.Player.CurrentSong Is Nothing Then Exit Sub
Dim CurrentAlbumName : CurrentAlbumName = SDB.Player.CurrentSong.AlbumName
Dim CurrentAlbumArtistName : CurrentAlbumArtistName = SDB.Player.CurrentSong.AlbumArtistName
' Fill the now playing list with the first album of the next album artist in alphabet
Call PlayFromQuery("" _
& "AND Songs.IDAlbum IN (" _
& "SELECT TOP 1 Albums.ID " _
& "FROM (Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID) " _
& "WHERE StrComp(Artists.Artist, '" & DoubleUpSingleQuotes(CurrentAlbumArtistName) & "')=1 " _
& "ORDER BY Artists.Artist, Albums.Album" _
& ") ORDER BY Songs.SongOrder", False)
End Sub
Sub PlayPreviousAlbumArtist
If SDB.Player.CurrentSong Is Nothing Then Exit Sub
Dim CurrentAlbumName : CurrentAlbumName = SDB.Player.CurrentSong.AlbumName
Dim CurrentAlbumArtistName : CurrentAlbumArtistName = SDB.Player.CurrentSong.AlbumArtistName
' Fill the now playing list with the first album of the previous album artist in alphabet
Call PlayFromQuery("" _
& "AND Songs.IDAlbum IN (" _
& "SELECT TOP 1 Albums.ID " _
& "FROM (Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID) " _
& "WHERE StrComp(Artists.Artist, '" & DoubleUpSingleQuotes(CurrentAlbumArtistName) & "')=-1 " _
& "ORDER BY Artists.Artist DESC, Albums.Album" _
& ") ORDER BY Songs.SongOrder", False)
End Sub
Sub PlayNextAlbumSameArtist
If SDB.Player.CurrentSong Is Nothing Then Exit Sub
Dim CurrentAlbumName : CurrentAlbumName = SDB.Player.CurrentSong.AlbumName
Dim CurrentAlbumArtistName : CurrentAlbumArtistName = SDB.Player.CurrentSong.AlbumArtistName
Call PlayFromQuery("" _
& "AND Songs.IDAlbum IN (" _
& "SELECT TOP 1 Albums.ID " _
& "FROM (Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID) " _
& "WHERE StrComp(Artists.Artist, '" & DoubleUpSingleQuotes(CurrentAlbumArtistName) & "')=0 " _
& "AND StrComp(Albums.Album, '" & DoubleUpSingleQuotes(CurrentAlbumName) & "')=1 " _
& "ORDER BY Albums.Album" _
& ") ORDER BY Songs.SongOrder", False)
End Sub
Sub PlayPreviousAlbumSameArtist
If SDB.Player.CurrentSong Is Nothing Then Exit Sub
Dim CurrentAlbumName : CurrentAlbumName = SDB.Player.CurrentSong.AlbumName
Dim CurrentAlbumArtistName : CurrentAlbumArtistName = SDB.Player.CurrentSong.AlbumArtistName
Call PlayFromQuery("" _
& "AND Songs.IDAlbum IN (" _
& "SELECT TOP 1 Albums.ID " _
& "FROM (Albums INNER JOIN Artists ON Albums.IDArtist = Artists.ID) " _
& "WHERE StrComp(Artists.Artist, '" & DoubleUpSingleQuotes(CurrentAlbumArtistName) & "')=0 " _
& "AND StrComp(Albums.Album, '" & DoubleUpSingleQuotes(CurrentAlbumName) & "')=-1 " _
& "ORDER BY Albums.Album DESC" _
& ") ORDER BY Songs.SongOrder", False)
End Sub
'*****************************************************
'**** WORKER METHOD ****
'*****************************************************
Sub PlayFromQuery(Query, QueryFollows)
If AlwaysClearPlaylistAndStop Or QueryFollows Then Call SDB.Player.PlaylistClear
Dim FirstItem : Set FirstItem = Nothing
Dim SongIter : Set SongIter = SDB.Database.QuerySongs(Query)
If Not SongIter.EOF Then
Call SDB.Player.PlaylistClear
Set FirstItem = SongIter.Item
End If
Do While Not SongIter.EOF
Call SDB.Player.PlaylistAddTrack(SongIter.Item)
Call SongIter.Next
Loop
If Not FirstItem Is Nothing Then
Call SDB.Player.Next
If Not SDB.Player.isPlaying Then
Call SDB.Player.Play
End If
If ShowNode Then
If Not SDB.Objects("PreviousNodeFromRemote") Is Nothing Then SDB.MainTree.ParentNode(SDB.Objects("PreviousNodeFromRemote")).Expanded = False
Dim NodeRef : Set NodeRef = GetNode(SDB.MainTree.FirstChildNode(SDB.MainTree.Node_Artist), Array(FirstItem.AlbumArtistName, FirstItem.AlbumName))
If Not NodeRef Is Nothing Then SDB.MainTree.CurrentNode = NodeRef
Set SDB.Objects("PreviousNodeFromRemote") = NodeRef
End If
Else
If AlwaysClearPlaylistAndStop And Not QueryFollows Then Call SDB.Player.Stop
End If
End Sub
Function GetNode(StartNode, PathToNode)
Set GetNode = Nothing
On Error Resume Next
Dim Node2B : Set Node2B = StartNode
Dim i
For i = 0 To UBound(PathToNode)
If i > 0 Then
Node2B.Expanded = True
Set Node2B = SDB.MainTree.FirstChildNode(Node2B)
End If
If Node2B.Caption <> PathToNode(i) Then
Do
Set Node2B = SDB.MainTree.NextSiblingNode(Node2B)
If Err <> 0 Then Exit Function
Loop While Node2B.Caption <> PathToNode(i)
End If
Next
Set GetNode = Node2B
End Function
'*****************************************************
'**** UTILITY METHOD ****
'*****************************************************
Function DoubleUpSingleQuotes(strInput)
DoubleUpSingleQuotes = Replace(strInput, "'", "''")
End Function
The methods can be externaly called with command line parameters, e.g.:
C:\Program Files\MediaMonkey\Scripts\Previous&Next Album(Artist).vbs /PlayNextAlbum
In Girder, you'll probably need to set the application to execute to:
C:\Windows\System32\Wscript.exe
The command line parameters (next thing to specify in Girder) have to be set to something like:
C:\Program Files\MediaMonkey\Scripts\Previous&Next Album(Artist).vbs /PlayNextAlbum
How to add (for Girder 3.2.9b):
- Menu Edit > Add new Command
- Tabpage "O.S." > dropdown list > "Execute" (or something similar).
- Fill in the text areas as said above (one box for the wscript program location, one line for the command line parameters), and preferable set startup visibility to "hidden" (or "invisible").
- Click the apply button and then right-click the command icon in the left pane, and choose "test command".
For a more complete walkthrough with screenshots, please look at page 2.
Cheers
Steegy
Last edited by Steegy on Thu Jun 15, 2006 2:31 pm, edited 5 times in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
NickDiamond
what version of girder do you use and what Remote Control?
what version of girder do you use and what Remote Control?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to attach PICTURE/SCREENSHOTS to forum posts
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to attach PICTURE/SCREENSHOTS to forum posts
@NickDiamond
THX, I'm using ATI Remote Wonder I and Girder 3.3.2.
Warning From Moderator 2 Peke: Stay On Topic
THX, I'm using ATI Remote Wonder I and Girder 3.3.2.
Warning From Moderator 2 Peke: Stay On Topic
Last edited by Peke on Thu Jun 08, 2006 4:00 am, edited 1 time in total.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to attach PICTURE/SCREENSHOTS to forum posts
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to attach PICTURE/SCREENSHOTS to forum posts