No announcement yet.

Working with Windows Media Player and StreetDeck to manage MP3s

  • Filter
  • Time
  • Show
Clear All
new posts

  • Working with Windows Media Player and StreetDeck to manage MP3s

    StreetDeck has an abstraction layer over the WMP. GetWMP() is a function off the MediaController that really is just a quick hack that gives you direct access to the media player backend because we havenít built all the same functionality into the StreetDeck SDK yet. StreetDeck should respond to some WMP events like play, but only if it is the currently selected media manager.

    To play anything in StreetDeck, you have to convert the playlist to its format.

    WMPLib.IWMPPlayer wmp = (WMPLib.IWMPPlayer)app.MediaController.GetWMP();
    WMPLib.IWMPPlaylist Album = wmp.mediaCollection.getAll();

    if (Album != null)
    StreetDeck.AudioPlaylist SDPlaylist = app.MediaController.MusicManager.NewPlaylist("Test ", null);
    StreetDeck.MusicManager mm = app.MediaController.MusicManager;

    //We need to convert the WMP playlist to a streetdeck playlist before being able to set it
    for (int i=0;i<Album.count;i++)
    WMPLib.IWMPMedia wmpMedia = Album.get_Item(i);
    StreetDeck.AudioMedia SDMedia = mm.NewMedia(wmpMedia.sourceURL);

    //StreetDeck will automatically append any set playlists, so we should clear the current list first

    //Set the new playlist, this actually appends the playlist to the current playlist though
    mm.CurrentPlaylist = SDPlaylist;

    //This will load the first the first item in the playlsit and the music manager
    mm.CurrentMedia = mm.CurrentPlaylist.Item(0);

    //Show the music module

    //Start the media playing
    app.SendFunction(StreetDeck.enumSDFunctions.eFunct ionPlayModuleMedia);