Cross plugin playlists (1 Viewer)

egonspengleruk

Retired Team Member
  • Premium Supporter
  • June 30, 2005
    250
    0
    Hi all,

    Is it possible to access a Video/Music playlist from within another Plugin? If so what bit of code do I need to use?
    Sorry for the waffley question...but not sure how else to put it. Stage 2 of the MyBurner plugin is to add in a Burn To CD/DVD item into the context menu of MyMusic and MyVideos. But to do that I need to somehow create a global playlist that can be accessed from each of the plugins.....any ideas on where in the code I should be looking at to start this?

    Egon
     

    patrick

    Portal Pro
    April 20, 2005
    608
    45
    Southeast
    Home Country
    United States of America United States of America
    egonspengleruk said:
    Is it possible to access a Video/Music playlist from within another Plugin? If so what bit of code do I need to use?

    Hi Egon,

    It has been a while since I looked at this but I think it is along the lines of:

    MediaPortal.Playlists.PlayList mpPlaylist = PlayListPlayer.GetPlaylist(PlayListPlayer.PlayListType.PLAYLIST_MUSIC);

    The playlist types are:
    PLAYLIST_NONE,
    PLAYLIST_MUSIC,
    PLAYLIST_MUSIC_TEMP,
    PLAYLIST_VIDEO,
    PLAYLIST_VIDEO_TEMP


    HTH,
    patrick
     

    egonspengleruk

    Retired Team Member
  • Premium Supporter
  • June 30, 2005
    250
    0
    patrick said:
    egonspengleruk said:
    Is it possible to access a Video/Music playlist from within another Plugin? If so what bit of code do I need to use?

    Hi Egon,

    It has been a while since I looked at this but I think it is along the lines of:

    MediaPortal.Playlists.PlayList mpPlaylist = PlayListPlayer.GetPlaylist(PlayListPlayer.PlayListType.PLAYLIST_MUSIC);

    The playlist types are:
    PLAYLIST_NONE,
    PLAYLIST_MUSIC,
    PLAYLIST_MUSIC_TEMP,
    PLAYLIST_VIDEO,
    PLAYLIST_VIDEO_TEMP


    HTH,
    patrick

    Hey Patrick,

    Above doesnt compile....but the below does.

    PlayListPlayer player = new PlayListPlayer();
    PlayList playlist = player.GetPlaylist(PlayListType.PLAYLIST_MUSIC);
    But it doesnt get me the current MyMusic playlist :(
    Makes sense as i have just created a new object and havent put anything in it yet.

    Started looking for PLAYLIST_MUSIC in the code and found the following

    void OnPlayCD(string strDriveLetter, bool AskForAlbum)
    {
    // start playing current CD
    PlayList list = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_MUSIC_TEMP);

    Makes sense...but playlistPlayer is defined as
    protected PlayListPlayer playlistPlayer;

    So I dont have any way of getting at it outside the MyMusic plugin?

    Egon

    Egon
     

    samuel337

    Portal Pro
    August 25, 2004
    772
    0
    Melbourne, Australia
    Try this:

    Code:
    MediaPortal.Playlists.PlayListPlayer.SingletonPlayer.GetPlaylist(playlistType)

    where playlistType is the one of the possible playlist values in the PlaylistType enum.

    BTW, this has just given me an idea:
    If you are going to have functionality that allows people to add items to burn from other modules, you should get the devs to create a new playlistType called maybe PLAYLIST_BURN. This way, other plugin devs can add its to this playlist and then you can read it in your plugin and burn it.

    Sam
     

    egonspengleruk

    Retired Team Member
  • Premium Supporter
  • June 30, 2005
    250
    0
    samuel337 said:
    Try this:

    Code:
    MediaPortal.Playlists.PlayListPlayer.SingletonPlayer.GetPlaylist(playlistType)

    where playlistType is the one of the possible playlist values in the PlaylistType enum.

    BTW, this has just given me an idea:
    If you are going to have functionality that allows people to add items to burn from other modules, you should get the devs to create a new playlistType called maybe PLAYLIST_BURN. This way, other plugin devs can add its to this playlist and then you can read it in your plugin and burn it.

    Sam

    Hey Sam,

    Already thought of that. I currently have a PLAYLIST_BURN_AUDIO and PLAYLIST_BURN_VIDEO. Need seperate ones in order to know if im burning a music CD or a video DVD.

    Will give that code a try.

    Egon
     

    Bram

    Portal Pro
    December 12, 2005
    851
    3
    's-Hertogenbosch
    Home Country
    Netherlands Netherlands
    Fantastic you're continuing devlopment of the plugin.
    Will there a possebility to normalize before burning in the future?
     

    egonspengleruk

    Retired Team Member
  • Premium Supporter
  • June 30, 2005
    250
    0
    Bram said:
    Fantastic you're continuing devlopment of the plugin.
    Will there a possebility to normalize before burning in the future?

    Hey Bram,

    Yeah I saw your post on the MyBurner topic.....it would probably be doable.....but I just dont know how to do it yet. Its on the list of things to do but near the bottom as its going to take a while to find out how things like that work...

    Egon
     

    Users who are viewing this thread

    Top Bottom