Enqueue Albums 1.3 - Updated 01/05/2010

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Enqueue Albums 1.3 - Updated 01/05/2010

Postby trixmoto on Tue Jun 05, 2007 3:32 pm

This script was requested here. It loops through the selected tracks, adding all the tracks in the album of each one to the end of the Now Playing list. An option appears in the context menu (tracklist and now playing) to trigger this script.

Code: Select all
'
' MediaMonkey Script
'
' NAME: EnqueueAlbums 1.3
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 01/05/2010
'
' Thanks to Steegy for the SkinnedInputBox
'
' INSTALL: Copy to Scripts\Auto directory
'
' FIXES: Fixed tracks not being added in correct order
'

Option Explicit

Dim Playlists : Playlists = False
Dim PlayNext : PlayNext = False

Sub onStartUp
  Dim itm : Set itm = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP,1,1)
  itm.Caption = "Enqueue Albums"
  itm.OnClickFunc = "ItmClick"
  itm.UseScript = Script.ScriptPath
  itm.IconIndex = 56
  Set SDB.Objects("EnqueueAlbumsMenu1") = itm
  Set itm = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList,1,1)
  itm.Caption = "Enqueue Albums"
  itm.OnClickFunc = "ItmClick"
  itm.UseScript = Script.ScriptPath
  itm.IconIndex = 56 
  Set SDB.Objects("EnqueueAlbumsMenu2") = itm
End Sub

Sub ItmClick(itm)
  Dim list : Set list = SDB.SelectedSongList.Albums
  If list.Count > 0 Then
    Dim p : Set p = Nothing
    If Playlists Then
      Dim n : n = SkinnedInputBox("Please enter unique playlist name:","EnqueueAlbums","","EnqueueAlbumsPosition")
      If Not (n = "") Then
        Set p = SDB.PlaylistByTitle("").CreateChildPlaylist(n)
      End If
    End If
    Dim i : i = 0   
    Dim k : k = SDB.Player.CurrentSongIndex
    For i = 0 To list.Count-1
      Dim j : j = 0
      Dim sql : sql = "AND Songs.IDAlbum="&list.Item(i).ID&" ORDER BY DiscNumber COLLATE NUMERICSTRING,TrackNumber COLLATE NUMERICSTRING"       
      Dim itr : Set itr = SDB.Database.QuerySongs(sql)
      While Not itr.EOF
        j = j+1
        Dim t : Set t = itr.Item
        Call SDB.Player.PlaylistAddTrack(t)
        If PlayNext Then
          Call SDB.Player.PlaylistMoveTrack(SDB.Player.PlaylistCount-1,k+((i+1)*j))
        End If
        If Not (p Is Nothing) Then
          Call p.AddTrack(t)               
        End If           
        itr.Next
      WEnd           
    Next   
  End If
End Sub

Function SkinnedInputBox(Text, Caption, Input, PositionName)
   Dim Form, Label, Edt, btnOk, btnCancel, modalResult

   ' Create the window to be shown
   Set Form = SDB.UI.NewForm
   Form.Common.SetRect 100, 100, 360, 130
   Form.BorderStyle  = 2   ' Resizable
   Form.FormPosition = 4   ' Screen Center
   Form.SavePositionName = PositionName
   Form.Caption = Caption
     
   ' Create a button that closes the window
   Set Label = SDB.UI.NewLabel(Form)
   Label.Caption = Text
   Label.Common.Left = 5
   Label.Common.Top = 10
     
   Set Edt = SDB.UI.NewEdit(Form)
   Edt.Common.Left = Label.Common.Left
   Edt.Common.Top = Label.Common.Top + Label.Common.Height + 5
   Edt.Common.Width = Form.Common.Width - 20
   Edt.Common.ControlName = "Edit1"
   Edt.Common.Anchors = 1+2+4 'Left+Top+Right
   Edt.Text = Input
       
   ' Create a button that closes the window
   Set BtnOk = SDB.UI.NewButton(Form)
   BtnOk.Caption = "&OK"
   BtnOk.Common.Top = Edt.Common.Top + Edt.Common.Height + 10
   BtnOk.Common.Hint = "OK"
   BtnOk.Common.Anchors = 4   ' Right
   BtnOk.UseScript = Script.ScriptPath
   BtnOk.Default = True
   BtnOk.ModalResult = 1
   
   Set BtnCancel = SDB.UI.NewButton(Form)
   BtnCancel.Caption = "&Cancel"
   BtnCancel.Common.Left = Form.Common.Width - BtnCancel.Common.Width - 15
   BtnOK.Common.Left = BtnCancel.Common.Left - BtnOK.Common.Width - 10
   BtnCancel.Common.Top = BtnOK.Common.Top
   BtnCancel.Common.Hint = "Cancel"
   BtnCancel.Common.Anchors = 4   ' Right
   BtnCancel.UseScript = Script.ScriptPath
   BtnCancel.Cancel = True
   BtnCancel.ModalResult = 2
       
   If Form.showModal = 1 Then
     SkinnedInputBox = Edt.Text
   Else
     SkinnedInputBox = ""
   End If 
End Function
Last edited by trixmoto on Fri Jun 08, 2007 2:11 pm, edited 2 times in total.
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby MarineBrat on Tue Jun 05, 2007 4:26 pm

Seems to work nicely here on MM3A4.
MarineBrat
 
Posts: 466
Joined: Tue Jun 14, 2005 5:12 am
Location: Loony left coast, USA.

Postby powerpill-pacman on Wed Jun 06, 2007 6:21 am

Works like a charm, now MM seems pretty much complete to me. Thanks very much for just another great script.
powerpill-pacman
 
Posts: 147
Joined: Mon Feb 21, 2005 6:07 pm
Location: berlin, germany

Postby powerpill-pacman on Fri Jun 08, 2007 12:03 pm

Just one litlle wish to add: Would it be possible to create a new playlist from the enqueued albums autmatically?
powerpill-pacman
 
Posts: 147
Joined: Mon Feb 21, 2005 6:07 pm
Location: berlin, germany

Postby trixmoto on Fri Jun 08, 2007 1:11 pm

I was about to say no, but I think I might just have worked out how to do it...
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby powerpill-pacman on Fri Jun 08, 2007 1:55 pm

Sounds good! :P
powerpill-pacman
 
Posts: 147
Joined: Mon Feb 21, 2005 6:07 pm
Location: berlin, germany

Postby trixmoto on Fri Jun 08, 2007 2:12 pm

New version (1.1) is now available from my website (and code updated above). I have added the option to create playlists of the enqueued tracks.
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby powerpill-pacman on Fri Jun 08, 2007 2:32 pm

You're unbelievably fast. Thanks very much. But where can i find the playlist option?
powerpill-pacman
 
Posts: 147
Joined: Mon Feb 21, 2005 6:07 pm
Location: berlin, germany

Postby trixmoto on Fri Jun 08, 2007 10:19 pm

You have to edit the script file (look for the star (*)) by setting the "Playlists" variable to "True".
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Postby powerpill-pacman on Sat Jun 09, 2007 5:41 pm

Thanks for the hint. I should've read the script (shame on me).
powerpill-pacman
 
Posts: 147
Joined: Mon Feb 21, 2005 6:07 pm
Location: berlin, germany

Re: Enqueue Albums 1.1 [MM2+3]

Postby Juraitwaluzka on Mon Jun 29, 2009 6:04 am

Very useful script. I was wondering how hard it would be to make it enqueue in such a way that the album plays next instead of at the end of the playlist.

An example... I have some auto playlists that generate say 2 hours of different songs. While listening I decide I want to hear the rest of the album of whatever song is playing. Now I do an 'Enqueue Albums' then manually move the tracks into place. However, it would be nice if the tracks would be inserted so that I automatically hear them next, then when the album runs out the rest of the playlist goes ahead.
Juraitwaluzka
 
Posts: 5
Joined: Fri Jul 13, 2007 1:56 am

Re: Enqueue Albums 1.1 [MM2+3]

Postby trixmoto on Mon Jun 29, 2009 8:42 am

It should be possible to do this, yes. I'll add it to my list.
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Re: Enqueue Albums 1.2 - Updated 10/01/2010

Postby trixmoto on Sun Jan 10, 2010 6:57 pm

New version (1.2) is now available to download from my website. Changes include...

- Removed old MM2 code to improve performance
- Added option to play next instead of play last
- Added update server to installation package
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Re: Enqueue Albums 1.2 - Updated 10/01/2010

Postby florin on Thu Jan 14, 2010 6:11 pm

Can you add an Enqueue Track option? It's the one option I would really like in MM.
florin
 
Posts: 23
Joined: Sat Sep 27, 2008 10:38 pm
Location: Romania

Re: Enqueue Albums 1.2 - Updated 10/01/2010

Postby trixmoto on Thu Jan 14, 2010 6:38 pm

There are buttons on the toolbar for that, "Play Next" and "Play Last".
Loving the Monkey? - Get Gold
Check out my scripts at http://trixmoto.net including my top ten
Getting "Product Installation Error" when installing scripts? - Try this
Subscribe to my RSS feed for all the latest news
trixmoto
 
Posts: 8509
Joined: Fri Aug 26, 2005 8:28 am
Location: England

Next

Return to Need Help with Addons?

Who is online

Users browsing this forum: Ask Jeeves [Bot], MSN [Bot], Yahoo [Bot] and 5 guests