How to get info for currently playing file. (1 Viewer)

crawshaws

Portal Member
October 1, 2010
11
0
Home Country
United Kingdom United Kingdom
Hi all,

I am trying to write a plugin, and part of this plugin needs to be able to access the details of the currently playing file.

the only plugin i can think of off the top of my head which does this is the mini display plugin, so i looked at the code and found something called "SystemStatus".

I then realised this was a struct which was part of that assembly. and i couldnt find where i got its data from in mediaportal.

So, my question is, how do i get the currently playing file, time elapsed and duration etc from media portal to work in my plugin.

thanks.
 

ltfearme

Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    You can listen to player events:
    g_Player.PlayBackChanged += new g_Player.ChangedHandler(g_Player_PlayBackChanged);
    g_Player.PlayBackEnded += new g_Player.EndedHandler(g_Player_PlayBackEnded);
    g_Player.PlayBackStarted += new g_Player.StartedHandler(g_Player_PlayBackStarted);
    g_Player.PlayBackStopped += new g_Player.StoppedHandler(g_Player_PlayBackStopped);

    The filename is a parameter to the events, you can use the g_Player class to get other stuff like Duration, Current Position etc.
     

    Users who are viewing this thread

    Top Bottom