g_player help (1 Viewer)

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Looking to use the MP internal player in a plugin but struggling to find any documentation about it...

    Having been through a fair bit of code it looks like g_player is the object to use but could do with some advice on using it.

    All the calls I have seen to g_player tend to be wrapped in a whole lot of other code so it is confusing what is needed and what is not.

    Anyone point in the direction of some documenation or a simple plugin which makes it obvious how to use it?

    Failing that can someone at least confirm that basical controls (play, stop, pause, ffwd etc) are handled by g_player itself to there is no need to cater for most of that in the plugin?
     

    gemx

    Retired Team Member
  • Premium Supporter
  • October 31, 2006
    1,972
    539
    Home Country
    Germany Germany
    At first there is an IPlayer interface which all players wether internal or external must implement.
    g_player is a singleton (only one instance throughout the whole app) which utilizes the needed "real" player and uses it's functions via the IPlayer interface.
    g_player itself also implements the IPlayer interface.

    So - yes - all you need to do is using the g_player class and you can control any media with it.
    g_player is responsible to route a certain IPlayer interface call to the correct underlying player.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    so
    Code:
    g_player.PlayAudioStream("c:\my.mp3");
    inside a plugin would be sufficient to play the mp3 file in whatever audio player the user has setup be it directshow, BASS or something like the ASIO plugin?

    ie. g_player does not need defining in a plugin??

    (reading the code is the method above deprecated and I should call the method with the 2nd bool argument ?)
     

    gemx

    Retired Team Member
  • Premium Supporter
  • October 31, 2006
    1,972
    539
    Home Country
    Germany Germany
    Yep, that's right. From inside a plugin you don't need instantiate a certain player class.
    Just call g_player.PlayAudioStream(...) or g_player.PlayVideo....

    g_player should handle the media and hand it over to the "real" player itself.

    Not quite sure about the "deprecated" msg though. Haven't touch code where this was needed for a while
     

    Users who are viewing this thread

    Top Bottom