NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Other Clients Old Stuff (legacy) MVP & NMT MVPMCX2 and other NMT stuff v
« Previous 1 … 27 28 29 30 31 … 37 Next »
ML2 Issues on PCH

 
  • 0 Vote(s) - 0 Average
ML2 Issues on PCH
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#11
2008-03-29, 06:38 PM
Unfortunately the server has no idea what requested the playback, the Music Library or an plugin, so its hard to tailor the behaviour depending on the source. I'm sure having the skip back/forward working and the short-between-song-gap is also pretty important, so if we can get the current playlist approach to work, I think it'd be the preference of most people.

Other than the built in Music Library, ML2 is definitely the most commonly used music plugin though, so I'll wait until psycik wakes up and gives a general description of how it works, then I'll see if I can come up with some approach that works well with the way it works.

EDIT: speak of the devil...
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#12
2008-03-29, 06:44 PM
psycik Wrote:Ok, so what are you after?
  • How do I add tracks to a playlist in general (Queue)
  • specifically for jukebox mode (the timed random call)
  • Or the Random button
  • and the last way would be at the end of a random playlist..

    I'll go find out if I do anything funny in adding tracks to play lists for each of these conditions, or whether I just dump the tracks in one hit. I think mostly I just loop though all the tracks called PluginHelper.AddAudioFileToQueue.....but I do remember there's one where i add a first track, and then add the others later..something about the MVP made me do that.

    I'll be back......need coffee first!!!
The reason all this has come up is because when the first song is about to start playing on a PCH, I ask the plugin helper for the list of songs in the playback queue, and generate a pls playlist file containing all those songs, then ask the PCH to play the pls.

The important thing in this comment is that this is done when the first song playback is about to be requested. Any later AddAudioFileToQueue() calls are effectively ignored because the PCH has already grabbed the PLS file containing the list of files.

This works ok for the built in Music Library because it generates the list of files to play before actually telling them to play.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,193
Threads: 958
Joined: May 2006
#13
2008-03-29, 07:05 PM
Here is an example with the new forced stop of the playlist but the original PLS (which is created) never plays.

Code:
2008-03-29 12:37:03.653    VERBOSE    [6]    MusicLibrary2: Query returned 11
2008-03-29 12:37:03.653    VERBOSE    [6]    MusicLibrary2: Generating a random playlist of 60 length
2008-03-29 12:37:03.654    VERBOSE    [6]    MusicLibrary2: setting temporary playlist
2008-03-29 12:37:03.663    VERBOSE    [6]    MusicLibrary2:  Adding tracks to pluginHelper
2008-03-29 12:37:03.664    VERBOSE    [6]    Adding C:\mp3\A1\crazy.flac to play queue
2008-03-29 12:37:03.668    VERBOSE    [6]    Sending audio playback request: C:\mp3\A1\CRAZY~1.FLA
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\02 Named flac.flac to play queue
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\04 - Wish You Were Here.fla to play queue
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\02 Crazy.fla to play queue
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\martin.mp3 to play queue
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\New Stories (Highway Blues).wma to play queue
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\02 Crazy.MP3 to play queue
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\00 flac.mp3 to play queue
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\41_30secOgg-q0.ogg to play queue
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\01 Some Loud Thunder.mp3 to play queue
2008-03-29 12:37:03.670    VERBOSE    [6]    Adding C:\mp3\A1\output.mp3 to play queue
2008-03-29 12:37:03.671    VERBOSE    [6]    MusicLibrary2:  tracks added to playlist they should start playing.11
2008-03-29 12:37:03.671    VERBOSE    [6]    MusicLibrary2: called GetAudioPlaylist again: 11
2008-03-29 12:37:03.671    VERBOSE    [6]    OnKeyDown() complete
2008-03-29 12:37:03.671    VERBOSE    [6]    MVP sending frame
2008-03-29 12:37:03.728    VERBOSE    [6]    sendIncrementalFrame3
2008-03-29 12:37:03.755    VERBOSE    [7]    MVP playback requested: C:\mp3\A1\CRAZY~1.FLA (shortname)
2008-03-29 12:37:03.755    VERBOSE    [7]    MVP playback requested: C:\mp3\A1\crazy.flac (longname)
...
2008-03-29 12:40:19.399    VERBOSE    [7]    Song ended. Checking if there are more songs to play.
2008-03-29 12:40:19.399    VERBOSE    [7]    Playlist size: 0    current index: 0
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#14
2008-03-29, 07:11 PM
It only creates the .pls file if more than one song is in the play queue. The patch I supplied earlier in this thread probably stops this working because it empties the play queue when stop is received. Prior to this patch it would have proceeded to request the next song starts playing, and the queue would now have had lots of songs queued, so would have generated and played a PLS file (including that very first file).
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 53,193
Threads: 958
Joined: May 2006
#15
2008-03-29, 07:15 PM
Exactly. And because of the index issue it kept asking for the original PLS file 11 times.

Martin.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#16
2008-03-29, 07:25 PM
Might have to do this in a series of posts.

Hitting the random button.
I go get the tracks to play.
Then get any existing tracks currently queued for playing (GetAudioPlayList())
Then if existing tracks empty, I just add then in all in one hit (AddAudioFileToQueue)


hmm, for an existing run of tracks, and you call random again, I don't ever actually call AddAudioFileToQueue again. But i get back an IList from GetAudioPlaylist, then actually update it?!? And it magically works.

I think that's probably the (bad) bit of code you were looking for.

So you're probably saying that my first random is probably ok, but my second one will never work and I'll have to recognise that the audio queue is empty and AddAudioFileToQueue again to restart it with a new set of tracks.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#17
2008-03-29, 07:29 PM
If you want, here is that section that you just had the logging for (starting from the 4th line in your log post):
Code:
PLogger.Verbose(ConfigConstants.PluginIntName + ":  Adding tracks to pluginHelper");
foreach (string mp3file in tracks)
{
    if (i > trackCount)
    {
        PLogger.Verbose2(ConfigConstants.PluginIntName + ": Adding track: " + mp3file);
        PluginHelperFactory.getPluginHelper().AddAudioFileToQueue(mp3file);
    }
    i++;
}
PLogger.Verbose(ConfigConstants.PluginIntName + ":  tracks added to playlist they should start playing." + tracks.Count);
                    
tracks = (ArrayList)PluginHelperFactory.getPluginHelper().GetAudioPlayList(out currentIndex, out trackDuration, out playbackPosition);
if (tracks != null)
    PLogger.Verbose(ConfigConstants.PluginIntName + ": called GetAudioPlaylist again: " + tracks.Count);

Nothing special in there...
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#18
2008-03-29, 07:42 PM
I think based on the info above, the attached patch is probably the best I can do for now. On ML2's first request to AddAudioFileToQueue(), behind the scenes it'll start the first song playing immediately, and send a single audio file play request to the PCH. Each subsequent request to AddAudioFileToQueue() will get added to the play queue. When the first song completes, a PLS file will be generated for all the other songs in the queue, and sent to the PCH as a complete PLS. At the completion of the PLS all audio playback will stop.

The user wont be able to skip to the next track etc until that first song has completed (since the PLS is only loaded at the start of the second song).
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#19
2008-03-29, 07:43 PM
psycik, just so you know whats different from Music Library: I create a Queue object, add all the files to it, then call PlayFiles(). This had the convenience of knowing all the songs by the time the first song actually started playing.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#20
2008-03-29, 07:47 PM
Ok, I could do that. Is there a queue object?? I never seen one - but I suppose once this was working I had no reason to look further.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (8): « Previous 1 2 3 4 5 … 8 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  Issues with FF and Seeking on HD .ts files specifically jt25741 10 4,279 2011-03-27, 08:28 PM
Last Post: Jaggy
  Some issues with Install jt25741 26 7,451 2011-03-27, 04:20 AM
Last Post: mvallevand
  ts timeline issues and direct playback through NMT zaldwaik 11 4,680 2010-06-29, 01:03 AM
Last Post: lairpost
  Popcorn Hour remote issues imagn 5 3,427 2009-10-31, 05:34 PM
Last Post: imagn
  new mvpmc2 HDMI issues imagn 5 2,470 2009-05-27, 01:02 AM
Last Post: mvallevand
  Fast Forward Issues srhutch 4 2,090 2009-02-18, 12:03 AM
Last Post: sub
  How do you deal with time sync issues? philly_phenom 19 7,337 2008-07-29, 10:51 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode