Browsetheweb for mediaportal 2 (1 Viewer)

doskabouter

Development Group
  • Team MediaPortal
  • September 27, 2009
    3,887
    2,118
    Nuenen
    Netherlands Netherlands
    Country flag
    In this case I want to know if a user has pressed a number, and execute some code when that happens.

    Edit: so just add an eventhandler like SkinContext.Form.KeyDown += frm_KeyDown ? Is that the preferred way?

    Edit2: No way that can be used, it never accounts for keybindings/remote control presses etc. What I'm looking for is the MP2 counterpart of MP1's OnAction event
     
    Last edited:

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,751
    7,114
    Germany Germany
    Country flag
    Please check the IInputManager service: https://github.com/MediaPortal/Medi...ntrol/InputManager/IInputManager.cs#L125-L144. It's accessible via ServiceRegistration.Get<IInputManager>().

    The highlighted methods allow you to register global key bindings, like I do with F10 to toggle StatisticsRenderer.

    But preferrably you should define the KeyBindings in the screen where you want to react on them. See the "FullscreenContentTV" for an example: https://github.com/MediaPortal/Medi...nium/screens/FullScreenContentTv.xaml#L49-L66.

    This means, for all cases where you have a screen, you should use the XAML way like the 2nd example.
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    3,887
    2,118
    Nuenen
    Netherlands Netherlands
    Country flag
    Ok, what are the restrictions/demands on that? I've put a
    <KeyBinding Key="1" Command="{Command NumberPressed}"/>
    in my main xaml, but I keep getting
    CommandBaseMarkupExtension: Could not find source value, could not execute command ({Command Path=NumberPressed})
    Also tried Command BrowseTheWebModel.NumberPressed but that didn't help

    Numberpressed is declared as:

    public class BrowseTheWebModel : IWorkflowModel
    {
    public void NumberPressed()
    {
    throw new NotImplementedException();
    }
    }
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,751
    7,114
    Germany Germany
    Country flag

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    3,887
    2,118
    Nuenen
    Netherlands Netherlands
    Country flag
    Yes, this works, thanks a lot!

    Small steps forward every time...

    Edit: Can I add a parameter to the commands, so that I don't need to add 10 methods for each number?
    Edit2: Found some example for this, but not working :(
     
    Last edited:

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    3,887
    2,118
    Nuenen
    Netherlands Netherlands
    Country flag
    I think I've made a bit of a mess of MP2 :(
    One of the symptoms is regular crashes (without triggering exceptions when run in visual studio)
    Another one is the inability to find Mediaportal.Common.XmlSerializers (exception thrown on line 154 of PathManager.cs (
    XmlSerializer s = new XmlSerializer(typeof(PathListFile)); )

    An important question on how to fix all this is: Will MP2-client run from visual studio without MP2 being installed on the system, or do I need to remove all MP2-related stuff and do an install again?
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,751
    7,114
    Germany Germany
    Country flag
    Will MP2-client run from visual studio without MP2 being installed on the system
    If you can compile MP2-Client, it will run :) I have several checkouts of MP2 code in parallel so I can develop on different parts. Each working copy can run by itself without inteferring others. So no worries here.

    Only settings from ProgramData will be used by all instances, so if you have problems with settings, you might try to remove ProgramData\Team MediaPortal\MP2-Client\Config folder
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    3,887
    2,118
    Nuenen
    Netherlands Netherlands
    Country flag
    Well, that problem is solved.
    But again, I have a new one. Since I removed the MP2 installation (which my project referenced) I can't get my project to compile again.

    The source of this I don't really grasp, but the messages are the same as with the regular sources of the MP2 client, after you add the test-border.xaml to the guitestplugin.
    Don't know if these kind of xaml's (with a Screen node as root) are supposed to not being included in the sources, or that they are just some leftovers from refactoring and should be changed to root nodes "Include"

    Edit: adding <?xml version="1.0" encoding="utf-8"?> as first line to test-border.xaml fixes some errors, but by far not all
     
    Last edited:

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,751
    7,114
    Germany Germany
    Country flag
    I'd suggest that you add your plugin for development into the "incubator" folder of MP2 and to the MP2-Client solution, so you can reference the projects instead of compiled binaries. This also makes debugging easier, as all sources are available in MP2.
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    3,887
    2,118
    Nuenen
    Netherlands Netherlands
    Country flag
    Well that's indeed one thing.
    Still doesn't explain the compiling errors when that test-border.xaml is added to the project.
    This is on the current weekly branch, can you please explain/clarify that?

    Well, carnaval costed me more than I bargained for... The source of all compiler errors boiled down to me overseeing that adding my plugin changed the build target from x86 to anycpu :sleep:
     
    Last edited:

    Users who are viewing this thread

    Similar threads
    OP Title Forum Replies Date
    A MediaPortal is still the best! (At least as far as I know...) MediaPortal 1 Talk 1
    ajs 1.28.0 MediaPortal 1.28 Pre-Release ready for testing! News and Announcements 39
    K MediaPortal 2.3.1 live tv freezes when inserting a usb memory stick or when mounting an external drive General 8
    C Can't Install MediaPortal 2 On Windows 10 Home General 13
    A mediaportal 1.27 embedded subtitles not working MediaPortal 1 Talk 3
    A MediaPortal Error log issue MediaPortal 1 Talk 26
    gpnash 1.27.0 mediaportal split between two monitors? MediaPortal 1 Talk 8
    Steve.Rayner61 MediaPortal won't start following W10 Update General Support 5
    Scheibes I must leave MediaPortal Team Lounge 2
    V Einstellen von ServusTV zum Aufnehmen provoziert Neustart von Mediaportal TV / Streaming 0
    R MpExtended fails to find MediaPortal TV Server Installation, configuration support 0
    T Madvr with GeForce 30xx - can't play SDR content after playing HDR General Support 26
    ajs 1.27.0 MediaPortal 1 - 1.27 Released! News and Announcements 0
    M TechniSat CableStar HD2 / Windows 10? Und dann natürlich auch unter Mediaportal? TV / Streaming 1
    ge2301 MediaPortal 2.3.2 Release News and Announcements 0
    S mediaportal with headphone General Support 13
    ge2301 MediaPortal 2.3.1 Release News and Announcements 0
    ajs 1.27.0 MediaPortal 1.27 Pre-Release ready for testing! News and Announcements 2
    T Change tv subtitle in MediaPortal 1.26 Newcomers Forum 12
    T Change tv subtitle in MediaPortal 1.26 MediaPortal 1 Talk 0
    G 1.26.0 Errors when exiting Mediaportal GUI using StreamedMP 3.2.2.0 skin. StreamedMP 0
    S MP2 - V2.3 MediaPortal 2.3 Client stürzt ab - freetype6.dll nicht gefunden General 1
    ajs 1.26.0 MediaPortal 1 - 1.26 Released! News and Announcements 1
    T Neuer MediaPortal Rechner Barebones/PC-Systeme/Kaufberatung 2
    morpheus_xx [News] MediaPortal 2.3 Release News and Announcements 4

    Similar threads

    Top Bottom