Premise Shuffle Playlists?

Motorola Premise

samgreco

Active Member
I seem to remember that there was a module to add shuffle capability to Premise playlists. I found PlaylistPlus, but that offers Random (which is not very random, I keep hearing a lot of the same songs over and over) but not shuffle.

Unfortunately, search on the old forum does not seem to be working.
 
... a module to add shuffle capability to Premise playlists..
I think I have a copy of it handy ...

The attached zip contains the "modShuffleChildren.xdo" module. It contains a sinlge function called "shuffleChildren". You can import it or simply copy/paste the following code into the Globals section of an existing module.
Code:
'shuffles children in a container
'Example:
'shuffleChildren(media.Playlists.MyPlaylist)

function shuffleChildren(objContainer)
	'get collection of child objects, no recursion
	set colChildren = objContainer.getChildren(2)

	'set number of children
	iCount = colChildren.Count

	for i = 0 to iCount - 1
		'create random insertion index based on number of children
		iIndex = round(rnd*iCount)

		on error resume next
		'move current object ahead of insertion object
		objContainer.MoveEx 1, colChildren.Item(i), colChildren.Item(iIndex)
		on error goto 0
	next

	'cleanup
	set colChildren = nothing
end function
 
Apparently, I am not getting my head around this either.

Where would I use/invoke this script to get it to shuffle a list?
 
Here's the original post concerning the shuffleChildren function. There are no examples of where you'd use the function.

Would it make sense to have a "Shuffle" command in Premise Browser's view of a MediaZone? Perhaps it would be displayed in the "Current Options" list above the "Play" command? I think it should apply exclusively to PlayLists.
 
Excellent. I just created individual scripts for the playlists I have and shuffled them. Seemed to work well. So I'll just have to reshuffle occasionally.

Thanks as always.
 
Import the attached XDO and it will add a "Shuffle" command to a PlayList's "Current Options" menu (see the first image). This module assumes the "shuffleChildren" function is already installed in Default > GlobalScripts or in some other Module.

The second image shows that the XDO adds a new ScriptMenuItem, called "Shuffle", to Modules > Plugins > Selectors > Media > PlayList. The script is fairly simple: it retrieves the currently displayed PlayList, shuffles it, and then refreshes the user-interface.
 

Attachments

  • ShuffleCommand.jpg
    ShuffleCommand.jpg
    23.9 KB · Views: 16
  • ShufflePlayList.png
    ShufflePlayList.png
    37.3 KB · Views: 14
  • ShufflePlayList.zip
    ShufflePlayList.zip
    1.2 KB · Views: 12
Back
Top