understand the way a plugin could be written (1 Viewer)

Mike Lowrey

Portal Pro
February 4, 2009
638
124
Berlin
Germany Germany
I've read the wiki and also reviewed the incubator projects in order to understand the way a plugin(for example an audiobook plugin) could be written. But to be honest, the amount of descriptive plugin.xml files and a somehow confusing low amount of code (with understandable functions) make me feel lost!
Can someone just add a basic example of how to expose a simple string, list and an image in an MP2 extension?
 

Albert

MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    41
    Freiburg im Breisgau, Germany
    Germany Germany
    AW: Re: MP2 development - almost alpha state

    I've read the wiki and also reviewed the incubator projects in order to understand the way a plugin(for example an audiobook plugin) could be written. But to be honest, the amount of descriptive plugin.xml files and a somehow confusing low amount of code (with understandable functions) make me feel lost!
    Can someone just add a basic example of how to expose a simple string, list and an image in an MP2 extension?
    What exactly do you want to do?
    "Expose a string, list and an image"... What do you mean by "expose"? MP2 supports several extension points where code and resources can be added to the system. For example, you can plug in database implementations, media players, UI plugins, pure code plugins, skin extensions, language extensions, ....
     

    Mike Lowrey

    Portal Pro
    February 4, 2009
    638
    124
    Berlin
    Germany Germany
    Re: MP2 development - almost alpha state

    What exactly do you want to do?
    I'm interested in writing a simple plugin which can be accessed from the homescreen.

    Let's assume i want to write an audiobook plugin:

    If i understand everything correct i now need two plugins for MP2 one that extracts metadata from audiobook(for example mp4a files) and adds them into the database.

    And then i also have to write another plugins which access these data and displays them in the Client.

    For now the last thing is the most interesting one... It would be great to just have a simple sample project on how to achieve this...

    //edit
    Sorry, you can forget the last question... haven't found any reference to the hello world plugin till i 've read the thread about vb.net!

    The question regarding the metadata extractor still remains.

    //edit 2:
    How can i incorporate the same navigation structure like in the basic plugins...
    The SlimTVClients uses Include instead of Screen and(seems to do this by using the master_menu as source) but when using the "Screen" like done in the hello world plugin there is no working Source property(or at least it's not working like in the SlimTVClient)
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,391
    6,966
    Germany Germany
    Country flag
    AW: Re: MP2 development - almost alpha state

    //edit 2:
    How can i incorporate the same navigation structure like in the basic plugins...
    The SlimTVClients uses Include instead of Screen and(seems to do this by using the master_menu as source) but when using the "Screen" like done in the hello world plugin there is no working Source property(or at least it's not working like in the SlimTVClient)
    The navigation uses so called "WorkflowStates". Such a state basically contains an ID, the name of a Screen (xaml) and a Model (cs). They can be defined inside the skin: i.e. look into SlimTvClient\Skin\default\workflow\SlimTvClient-states.xml.

    The next step is to define the different navigation "step" between the different WorkFlowStates. i.e.:confused:limTvClient\Skin\default\workflow\SlimTvClient-actions.xml:
    Code:
      <MenuActions>
        <PushNavigationTransition Id="B4A9199F-6DD4-4bda-A077-DE9C081F7703"
            Name="Home->SlimTvClient"
            DisplayCategory="A-SlimTvClient"
            SortOrder="a"
            SourceState="7F702D9C-F2DD-42da-9ED8-0BA92F07787F"
            TargetState="C7646667-5E63-48c7-A490-A58AC9518CFA"
            DisplayTitle="SlimTvClient"/>
    ...
    This way you can easily add an Action to the main menu, if you define the SourceState guid to the home screen, and the TargetState to your own defined WorkFlowState.
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,391
    6,966
    Germany Germany
    Country flag
    AW: understand the way a plugin could be written

    Yes, correctly.

    The main advantage is, that the Actions and States can be defined by the Skin. So if you want "to have an extra button here", and "hide one button there" it's up to the skin to do so.

    You could also experiment with some existing Actions file (i.e. of weather main screen) and add another PushNavigationTransition to point to some State of any available plugin. That way an plugin can add buttons to any other plugin.

    edit:
    you can set the "SourceState" also to "*" (or sth. like this), which causes the button to be present in every screen/menu
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    41
    Freiburg im Breisgau, Germany
    Germany Germany
    AW: Re: understand the way a plugin could be written

    So only if i add a WorkFlowState the menu shows up?
    No. Correct is this:

    A menu entry shows up if a MENU ACTION is defined. The Workflow/MenuActions element in the workflow definition files contain menu actions which show up in the menu.
    One kind of actions are TRANSITIONS which make the state engine (=workflow manager) move from one workflow state to another. That's what morpheus means.
    But there are many more examples for menu actions, for example actions which call a method in a model or actions which are completely backed by a so called "workflow contributor" (interface IWorkflowContributor).
     

    Mike Lowrey

    Portal Pro
    February 4, 2009
    638
    124
    Berlin
    Germany Germany
    Thanks for your help, i will see how far i can get with these information.

    Just as a side note, may be it's just me but the whole concept seems to be really complex...
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    J Understanding what EPG shows about schedules General 8
    A MP2.2.2, understanding movies/videos/tv and WTV recordings. General 16
    joecrow 1.25.0 Radio Time plugin fails after Resume from Sleep with MP 1.25 Bugreports 3
    P MP2: US user, OTA - can NOT get SchedulesDirect plugin to work on MP1 or MP2 --> how do I get OTA schedule? General 5
    E aktuelle englische Forums Webseite von - Showtime Plugin v3 Plugins & Erweiterungen 4
    mrmojo666 [Tv Server Plugin ]Direct Show Video Control Plugin 0.0.0.1 for Hauppauge PVR cards MediaPortal 1 Plugins 0
    joecrow MultiShortcut Plugin (Uavailable) in DWHD skin General Support 58
    vapourEyes Building TV Plugin General Development (no feature request here!) 49
    Golf4 Nach Windows-Updates läuft TV-Plugin nicht mehr Allgemeines Support- und Diskussionsforum 0
    joecrow How about a Launcher plugin for MP1? MediaPortal 1 6
    D [solved] TVServer Plugin must be missing something. General Development (no feature request here!) 1
    framug Nouveau plugin XmlTvFR pour récupérer le guide télé français Kazer / ZguideTv (WebEPGfr) 11
    emphatic Allow remote control mapping of all plugins Improvement Suggestions 0
    D Where should plugins be located on hard drive? General Support 0
    D how to disengage from one version of a plugin to use another Newcomers Forum 0
    cbr954rr How to disable a pre-configured plugin? General 2
    mrmojo666 [Plugin]Marantz Control Plugin 0.0.0.2 MediaPortal 1 Plugins 2
    mrmojo666 beginner: trying to write a plugin, need help to catch event General Development (no feature request here!) 3
    framug [Rejected] Fix PowerScheduler plugin for MP2 single seat Submit: Code Patches 9
    doskabouter [Question] Stale plugins Developer Discussions 9
    M MP1 stops responding after Starting Plugins General Support 14
    Terra LAVFilter Plugin cannot be updated (MP1.23) MediaPortal 1 Plugins 10
    L Mediaportal 1.21 and Windows 10: user schedules de-activated when powerscheduler plugin is selected General Support 1
    C Can the XmlTv Plugin handle 600+ channels? General 3
    M Online Video Plugin V.2.32 keine Installtion unter MediaPortal 1.22 ? TV / Streaming 3
    Similar threads

























    Top Bottom