Last.fm and external players (1 Viewer)

Symphy

Retired Team Member
  • Premium Supporter
  • August 25, 2007
    501
    151
    Groningen
    Home Country
    Netherlands Netherlands
    Started on: 2007-11-12
    last update: 2007-11-12

    Summary:
    Code change to allow the use of last.fm radio with an external player like PureAudio.

    Area:
    Last.fm radio

    Description:
    A small change in code will allow the last.fm radio to be used in conjunction with any external player supporting webstreams. Currently the last.fm radio hooks directly into the BASS player:
    Code:
    BassMusicPlayer.Player.LastFMSync += new BassAudioEngine.LastFMSyncReceived(OnLastFMSyncReceived);
    Now when moving this:
    Code:
    public delegate void LastFMSyncReceived(object sender, DateTime syncTime);
    
    public event LastFMSyncReceived LastFMSync;
    from the BassAudioEngine class to the IPlayer class, this call can be changed into:
    Code:
    g_Player.Player.LastFMSync += new IPlayer.LastFMSyncReceived(OnLastFMSyncReceived);

    This will do the trick. The external player is then responsible for raising LastFMSync. No further changes are needed for the BASS player as far as i can see.

    Regards,
    Symphy
     

    Symphy

    Retired Team Member
  • Premium Supporter
  • August 25, 2007
    501
    151
    Groningen
    Home Country
    Netherlands Netherlands
    I did a quick test. The audioscrobbler plugin seems to work fine with PureAudio enabled. Also PureAudio is launched when starting last.fm radio. However, because the internal BASS player is not used in that case, the LastFMSync event never gets fired. I must admit i don't know yet how this event fits in the overal picture, but i assume it's required for proper operation. My proposal will allow me to implement this event in PureAudio similar to the internal BASS player.

    Regards,
    Symphy
     

    rtv

    Retired Team Member
  • Premium Supporter
  • April 7, 2005
    3,622
    301
    Osnabruck
    Home Country
    Germany Germany
    My proposal will allow me to implement this event in PureAudio similar to the internal BASS player.

    Just parse the stream until reaching a "SYNC", subtract the current buffer length and fire the event in time.

    This is only needed for continous streams. The most recent preference of last.fm playback are XSPF playlists however. You'll enter that playmode after skipping once. I'd be rather interested in your results of skipping. With BASS sometimes the stream doesn't start correctly so the playlist player skips another track..
     

    Symphy

    Retired Team Member
  • Premium Supporter
  • August 25, 2007
    501
    151
    Groningen
    Home Country
    Netherlands Netherlands
    Ok thanx for the info. Will look into it the coming weeks. Since i also use the BASS library, i'll most likely encounter the same skipping problems.

    Regards,
    Symphy
     

    Users who are viewing this thread

    Top Bottom