Browsetheweb for mediaportal 2 (1 Viewer)

doskabouter

Development Group
  • Team MediaPortal
  • September 27, 2009
    3,524
    1,724
    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,400
    6,971
    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,524
    1,724
    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,400
    6,971
    Germany Germany
    Country flag

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    3,524
    1,724
    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,524
    1,724
    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,400
    6,971
    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,524
    1,724
    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,400
    6,971
    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,524
    1,724
    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 (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    Symphy Version 0.2.9.0 for MediaPortal 1.25 ASIO music player 0
    doskabouter Installing mediaportal MediaPortal 1 3
    A Mediaportal Allgemeines Support- und Diskussionsforum 0
    G Update von MediaPortal Installationsprobleme? 0
    ajs [News] MediaPortal 1 - 1.25 Released! News and Announcements 1
    horned_reaper Standby is prevented by MediaPortal client General Support 0
    U [solved] MediaPortal crashing on startup General Support 10
    g0rsq Info box randomly popping up when watching TV or other video MediaPortal 2 Newcomers Forum 1
    high [unanswered] Hallo möchte gerne Mediaportal. nutzen kann mich jemand anrufen? contactform feedback and requests 2
    ajs [News] MediaPortal 1.25 Pre-Release ready for testing! News and Announcements 0
    ajs [Rejected] Mediaportal Codename MediaPortal 1 41
    M 2nd (Touch-)Display Support on MediaPortal 2 such MPDisplay++? General 2
    N Steam release of MediaPortal MediaPortal 1 Talk 0
    torone Dritter versuch mit Mediaportal 2 Allgemeines Support- und Diskussionsforum 1
    M Fehlerhafter Link auf der aktuellen MediaPortal Seite Page- und Forumsfeedback 0
    H 1.24.0 MP 1.24 high CPU utilization when 'Keep MediaPortal always on top' option enabled Bugreports 4
    mickb [solved] Mediaportal Stops working General Support 5
    J [solved] Newbie to MediaPortal 2 - Cannot open/run TV programs Newcomers Forum 4
    atlantic How to use Spotify inside Mediaportal? Listen Music 18
    horned_reaper MediaPortal configuration error log message General Support 1
    Rob Hexenmeister Mediaportal Properties #plot etc... General Support 3
    ajs [News] MediaPortal 1 - 1.24 Released! News and Announcements 3
    S [solved] access the desktop without leaving mediaportal General Support 5
    J New computer with win10 and how will i set Mediaportal up ? Newcomers Forum 55
    T MediaPortal Extensions Manager Fehlermeldung bei Installation einer Erweiterung Installationsprobleme? 1
    Similar threads

























    Top Bottom