Party Shuffle (digital jukebox) on MP! (Updated 30/10/2004) (1 Viewer)

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
Hey guys

I noticed some demand for a digital jukebox mode, and while this isn't that exactly, its one step closer. It is my first time fiddling with MP - I decided to do so while frodo is away so the sources don't change much while I'm programming...

Anyway, I delved into the MP source code and added some code here and there to the GUIMusic and MusicDatabase projects. The new party shuffle functionality (as seen in iTunes) is implemented in the playlists screen. Basically what it is is that it will randomly pick 12 songs to play, and when one finishes, it will remove it and pick another, maintaining at least 12 songs in the playlist. In other words, MP plays random songs and shows you the next 11 songs it intends to play. You can delete these and MP will pick new ones. You can also, as before, continue adding songs to the playlist and MP will play them. After the added songs are played, it returns to randomly picking songs.

To activate party shuffle, simply press the Party Shuffle button at the bottom of the playlist screen. To turn it off, simply press it again.

Once you press it, it will load up 12 random songs and play them. To get rid of a song, select it and press Y (or whatever your delete playlist item key is). To select the next song to play in the list, simply select the song and click on it. All the songs in between the song currently playing and the selected song will be removed from the playlist and random songs will be added if required to fill up the list. You cannot delete the currently playing song. Press Next if you want to stop playing the current song. The Clear button clears the playlist and fill it with 12 random songs. If a song is playing, it will not remove that song. Stop the song first before clearing the playlist if you wish to do so. The previous button is permanently disabled as once a song is played, it is removed from the playlist in party shuffle mode.

To install party shuffle, because it is a patch and not a plugin, you will need to overwrite a few MP files. I have developed this using the latest source code (0.0.0.12). To install, download the file and extract the files to the following locations:

MusicDatabase.dll to your MediaPortal folder
GUIMusic.dll to MediaPortal\plugins\windows
mymusicplaylist.xml to MediaPortal\skin\mce
strings.xml to MediaPortal\language\English

In all cases, it should be overwriting a file. If it does not, then you are not putting it in the right folder.

This patch only works with the mce skin and with the English language (until someone adds it into the other skins and languages).

It is basically finished from my point of view, and all bugs that I have found have been resolved.

The source code is included in the download as well. You do not need to touch it unless you want to view the source code (it is the two .cs files) (be easy on me when you see it though, I'm not a C# programmer, more a VB.NET person ;-) ).

Download it at: Link removed - party shuffle in MP 0.0.0.13

Anyway, I think this is all I have to say, hope you guys can get it working! Post any suggestions/feedback/bugs and anything else here...

Sam
EDIT: updated it with new version 28/10/2004
EDIT: updated it with new version 29/10/2004. See post below.
EDIT: updated it with new version 30/10/2004. See post below.
EDIT: removed link to patch - party shuffle in MP 0.0.0.13
 

MrMario64

Retired Team Member
  • Premium Supporter
  • April 22, 2004
    822
    1
    50
    Home Country
    Netherlands Netherlands
    It sounds promising!

    Frodo will surely have a look when he is back in 2.5 weeks from his vacation.
     

    sla

    Portal Member
    August 25, 2004
    19
    0
    Melbourne, Australia
    Good idea and great work, Samuel.

    Some minor issues:
    Whenever I turned on party mode (tried a few times), it mostly didn't give me 12 songs - usually 6-7 to start with.

    Then as I press F8 to go to the next song, it may or may not gradually fill all 12 slots. When all 12 slots are filled, all 12 may or may not stay filled when pressing F8. Same thing happens when I skip to a song further down the list. Haven't worked out when or why it would or wouldn't replace songs.

    Also, sometimes I get 2 of the same song adjacent to each other.
     

    sigdor

    Portal Member
    September 15, 2004
    6
    0
    nice work !

    i think you forgot to delete one line in your database.cs source code:

    //added by Sam
    public bool GetRandomSong(ref Song song)
    {
    ..
    ..
    maxIDSong = Int32.Parse(Get(results,0,"idSong"));
    maxIDSong = 1001; <--- you overwrite the correct "max idsong" value
     

    grouzy

    MP Donator
  • Premium Supporter
  • September 4, 2004
    30
    1
    London, UK
    Home Country
    France France
    That looks great !

    On strange thing on my side : when I press "party shuffle" the first time, it queues 4 times the same songs (so I have 3 songs in the begining playlist). It then queues normally new songs when 1 is finished
     
    A

    Anonymous

    Guest
    Thanks a lot Samuel, my friend :D

    Here is my bug report.

    When I select "party shuffle" ... it WORKS (with winamp plugin too) PERFECT and THANKS THANKS THANKS

    But... :wink: I cannot see the playlist, I don't see where I can watch the 12 songs selected/shuffled ??? maybe I look at the wrong place ?

    The "party shuffle" suffle songs only from the current directory, not the sub-directory's into this one. am I wrong ?

    Returning from the playlist mode(with right click) play next song. No problem using ESC key

    note: I actualy use NO playlist at all.
     

    samuel337

    Portal Pro
    August 25, 2004
    772
    0
    Melbourne, Australia
    Hey guys

    Thanks for testing it.

    Also, sometimes I get 2 of the same song adjacent to each other.

    Yeh I know, it doesn't do duplication checks yet. I will add this in later.

    nice work !

    i think you forgot to delete one line in your database.cs source code:

    //added by Sam
    public bool GetRandomSong(ref Song song)
    {
    ..
    ..
    maxIDSong = Int32.Parse(Get(results,0,"idSong"));
    maxIDSong = 1001; <--- you overwrite the correct "max idsong" value

    Thanks sigdor, this mistake is probably why all of you are having problems with the queuing of songs. I'll remove this and recompile it later today. Also it is suppose to loop when the database record is non-existent...

    But... Wink I cannot see the playlist, I don't see where I can watch the 12 songs selected/shuffled ??? maybe I look at the wrong place ?

    If you click on the playlist button on the music screen, you should see this.

    The "party shuffle" suffle songs only from the current directory, not the sub-directory's into this one. am I wrong ?

    Nope, it shuffles all of the songs. You cannot currently set whether to shuffle from a particular folder, artist, album, genre, etc.

    Returning from the playlist mode(with right click) play next song. No problem using ESC key

    hmm.... never tried a right-click before...will have a look later.

    note: I actualy use NO playlist at all.
    I don't really understand what you mean here, but I think this is your problem. You are overriding the party shuffle by selecting partcular songs and playing it. Try adding the songs to the playlist.

    A short notice on the changes/bugfixes would be nice!

    Ok, I'll do it for the next version. Basically the changes from the first version to the 28/10/2004 version is that I added in support for the clear button, and I resolved a song selection/playlist display bug.

    Sam
     

    samuel337

    Portal Pro
    August 25, 2004
    772
    0
    Melbourne, Australia
    Ok guys, here's a new version of the Party Shuffle patch. Simply download it from the same link (see previous post) and install it in the same way, overwriting the previous files.

    Changes in this new version:
    - fixed silly mistake pointed out by sigdor. Also recoded/checked some bits - it should now always have at least 12 songs in the playlist.

    - it now does duplication checks before adding the song. However, as when each song is played, it is deleted from the playlist, the program can only check for duplication of the songs that are in the list. That is, no duplicate songs will appear in the list, but songs that have been played before may appear.

    - now handles machines that have less than 12 songs in the music database. Instead of randomly picking songs for these situations, the party shuffle feature will ensure that all of the songs are in the playlist and that there are no duplications. As a result, it is possible to have less than 12 songs in the list in this situation.

    I think this is all the changes I made...everything should be working fine now. Please continue to report any bugs if you find any.

    sebcbien:
    I tried the right-clicking thing (never noticed this before) and it seems to be working properly, except that apart from exiting the playlist screen, it also sends a click event to the returned screen as well. For example, if I right-click in the playlist screen, it will exit the playlist screen and return to the screen before, but it will also send a click event where the cursor is to this screen, making MP play whichever song is clicked on. This seems like a MP problem, maybe frodo can shed some light on this when he comes back...

    One more thing, I think I've found a bug in the configuration app. When you delete a 'music share' and then rebuild the music database, the songs that were in the deleted music share remain in the music database, even though the music share was deleted. Can someone confirm/explain this? Is this a bug?

    Sam
     

    Users who are viewing this thread

    Top Bottom