Browsetheweb for mediaportal 2 (1 Viewer)

doskabouter

Development Group
  • Team MediaPortal
  • September 27, 2009
    3,957
    2,196
    Nuenen
    Home Country
    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,752
    7,115
    Home Country
    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,957
    2,196
    Nuenen
    Home Country
    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,752
    7,115
    Home Country
    Germany Germany
    Country flag

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    3,957
    2,196
    Nuenen
    Home Country
    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,957
    2,196
    Nuenen
    Home Country
    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,752
    7,115
    Home Country
    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,957
    2,196
    Nuenen
    Home Country
    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,752
    7,115
    Home Country
    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,957
    2,196
    Nuenen
    Home Country
    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

    We are proud to present MediaPortal 2.3.1 MediaPortal 2.3.1 is a full-blown media center software that addresses the most common user requirements out of the box. Aside from its support for Live TV and Radio, it offers a complete media server for music, movies, and TV shows. Info is automatically downloaded from various sources to...
    We are proud to present MediaPortal 2.3.1 MediaPortal 2.3.1 is a full-blown media center software that addresses the most common...
    We are proud to present MediaPortal 2.3.1 MediaPortal 2.3.1 is a full-blown media center software that addresses the most common...
    Replies
    0
    Views
    829
    Many thanks for your fast response. Hopefully I'll get to work through these items in the next few days. Kind regards.
    Many thanks for your fast response. Hopefully I'll get to work through these items in the next few days. Kind regards.
    Hi, I'm new to the world of HTPC and Media Portal but I've decided to give it a go since my Pioneer DVR-LX60D PVR failed and is...
    Replies
    2
    Views
    661
    Good work guys!
    Good work guys!
    We are proud to present MediaPortal 2.2.1 After the release of MediaPortal 2.2 Final the team focussed on improving usability and...
    Replies
    1
    Views
    3K
    1.4.x - Themes: BasicHome, Clear Art's support for Titan, Weather icon on screen, bugfixes and more. -- WBR, ajs :):whistle::coffee:
    1.4.x - Themes: BasicHome, Clear Art's support for Titan, Weather icon on screen, bugfixes and more. -- WBR, ajs :):whistle::coffee:
    When I start the Trakt-plugin from the plugin menu I get a black screen and the error "Invalid or missing file:". Yep, that's the...
    Replies
    8
    Views
    668
    Also maybe try increasing the 'Tune' timeout in the TV Serve Configuration -> General tab -> Scan tab - see: General Configuration Default is 2 seconds - maybe try 5 seconds?
    Also maybe try increasing the 'Tune' timeout in the TV Serve Configuration -> General tab -> Scan tab - see: General Configuration...
    Hello! I'm new to all this, and new to the forum. I have bought a DVB-T tuner, and I can't seem to get it working with MediaPortal...
    Replies
    12
    Views
    3K
    Top Bottom