Questions on writing my first plugin (1 Viewer)

huha

Extension Developer
January 3, 2008
890
556
Germany Germany
  • Thread starter
  • Moderator
  • #22
Albert,
attached the complete log files and the plugin.xml of the hello world plugin with a dependency on the slim tv plugin.
I would be interested if the error can be reproduced on another system or it is only me.
Thanks in advance for your help!
 

Attachments

Last edited:

Albert

MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    41
    Freiburg im Breisgau, Germany
    Germany Germany
    huha, the plugin manager was one of our most stable components for about 4 years now.
    You're the first one (excluding me) who found a bug in the plugin manager :)
    Fixed in branch dev. Thanks very much!
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Germany Germany
    • Thread starter
    • Moderator
    • #25
    Albert,
    glad i could help :) and thanks for fixing. I have not changed yet to another version (still on the Easter built).

    Another thing I observed is that about one out of 40 times the Client does not close correctly. The window is closing, but another process is still running. I need to open the process explorer to kill it. If this is unknown i will try to catch a log the next time it happens. I thaugt originally its me with a plugin, but this came at to many different situations.

    I have started now to work on TvWishlist after I have collected all my code pieces and I am making good progress. But there is still a long way ahead.
    greetings, huha
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    41
    Freiburg im Breisgau, Germany
    Germany Germany
    It might be the case that the inproper closure of the client is already fixed in the current dev version. Some weeks ago, I did some bugfixes in the UPnP library which could lead to inproper close orders.
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Germany Germany
    • Thread starter
    • Moderator
    • #27
    I am nearly done with tvwishlist, but i am running into a roadblock on the last task. I am trying to implement the "Pog" button, where I can "steal" from another screen information and transfer to TvWishlist.
    I tried to modify the SlimTv DialogprogramActionsFull.xaml and added successfully another button.
    This button should call a function in a different model (and later transfer via parameter the selected program from the EPG guide)



    <?xml version="1.0" encoding="utf-8"?>
    <Include
    xmlns="www.team-mediaportal.com/2008/mpf/directx"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Source="screens\simple_dialog_menu.xaml"
    >
    <Include.Resources>
    <Service x:Key="ScreenManager" InterfaceName="ScreenManager"/>

    <!-- Dialog title -->
    <ResourceWrapper x:Key="Dialog_Header_Text" Resource="[SlimTvClient.ChooseProgramAction]"/>

    <!-- SlimTvMultiChannelGuide model -->
    <Model x:Key="SlimTvMultiChannelGuide" Id="5054408D-C2A9-451f-A702-E84AFCD29C10"/>
    <Model x:Key="MyTestPluginSlimTv" Id="023c44f2-3329-4781-9b4a-c974444c0b0d"/>


    <!-- Command -->
    <CommandStencil x:Key="Execute_Command_Stencil"
    Source="{StaticResource SlimTvMultiChannelGuide}" Path="ExecProgramAction"/>


    <ControlTemplate x:Key="Contents_Template">


    <DockPanel Context="{Model Id=5054408D-C2A9-451f-A702-E84AFCD29C10}" LastChildFill="False">

    <Grid HorizontalAlignment="Stretch">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>

    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>

    </Grid.RowDefinitions>
    <ListView Name="DialogMenu" Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Source={StaticResource SlimTvMultiChannelGuide},Path=ProgramActions,Mode=OneTime}" Style="{ThemeResource MenuListViewStyle}">

    </ListView>


    <!--<Command Source="{Service ScreenManager}" Path="ShowDialog" Parameters="dialogWeatherSearchResult"/>-->
    <!--<Command Path="SearchLocations" Parameters="{LateBoundValue BindingValue={Binding Path=SearchCity}}"/>-->
    <!--Command="{Command Source={Service WorkflowManager},Path=NavigatePop,Parameters=1}"/>-->
    <!--Command="{Command Source={Service WorkflowManager},Path=NavigatePush,Parameters={StaticResource EditShareNameStateId}}"/>-->

    <Button Style="{ThemeResource DialogButtonStyle}" Grid.Column="0" Grid.Row="1" Context="{Model Id=023c44f2-3329-4781-9b4a-c974444c0b0d}" Content="TvWish" HorizontalAlignment="Center">
    <Button.Command>
    <CommandList>
    <Command Source="{StaticResource MyTestPluginSlimTv}" Path="SlimTv"/>
    <Command Source="{Service ScreenManager}" Path="CloseTopmostDialog"/>
    </CommandList>
    </Button.Command>
    </Button>

    </Grid>

    </DockPanel>
    </ControlTemplate>
    </Include.Resources>
    </Include>

    I have modified the skin in the following way, that I defined first a second Model reference MyTestPluginSlimTV pointing to MyTestPlugin and defined then a button calling a function SlimTv() in my test plugin. The function in the MyTestPlugin model is simply to log the event

    public void SlimTv()
    {
    HelloString = "message from slimtv";
    mylogger.Debug("SlimTv called");
    }

    The error message is
    [InputMgr ] [WARN ] - CommandBaseMarkupExtension: Could not find method, could not execute command ({Command Source=MyTestPlugin.Models.MyTestPlugin,Path=SlimTv})
    It looks like it cannot find the actual instance of the model. The complete log file is attached. Any ideas how this can be done?
     
    Last edited:

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    41
    Freiburg im Breisgau, Germany
    Germany Germany
    Hmm, strange. For me it all looks fine. I guess the code above is located in file "DialogProgramActionsFull.xaml" and your "MyTestPlugin" is a model which is correctly registered in "plugin.xml" and that class is located in plugin "TvWishListMP2".
    The model seems to be found by the workflow manager, the log output of the Command markup extension writes down the namespace of your model class. The only thing I could imagine is that you run another code of the model class which doesn't contain the "SlimTv" method yet or with another signature.
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Germany Germany
    • Thread starter
    • Moderator
    • #29
    Albert,
    a big thanks for your help again. You were right on your suspicion with the model. I got it to work now and will continue with the parameters.
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Germany Germany
    • Thread starter
    • Moderator
    • #30
    It's Working! :):):)

    Changing the test plugin function to
    public void SlimTv(string text)
    {
    HelloString = "message from slimtv="+text;
    mylogger.Debug("SlimTv called parameter="+text);
    }

    and using

    <?xml version="1.0" encoding="utf-8"?>
    <Include
    xmlns="www.team-mediaportal.com/2008/mpf/directx"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Source="screens\simple_dialog_menu.xaml"
    >
    <Include.Resources>
    <Service x:Key="ScreenManager" InterfaceName="ScreenManager"/>

    <!-- Dialog title -->
    <ResourceWrapper x:Key="Dialog_Header_Text" Resource="[SlimTvClient.ChooseProgramAction]"/>

    <!-- SlimTvMultiChannelGuide model -->
    <Model x:Key="SlimTvMultiChannelGuide" Id="5054408D-C2A9-451f-A702-E84AFCD29C10"/>
    <Model x:Key="MyTestPluginSlimTv" Id="023c44f2-3329-4781-9b4a-c974444c0b0d"/>


    <!-- Command -->
    <CommandStencil x:Key="Execute_Command_Stencil"
    Source="{StaticResource SlimTvMultiChannelGuide}" Path="ExecProgramAction"/>


    <ControlTemplate x:Key="Contents_Template">


    <DockPanel Context="{Model Id=5054408D-C2A9-451f-A702-E84AFCD29C10}" LastChildFill="False">

    <Grid HorizontalAlignment="Stretch">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>

    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>

    </Grid.RowDefinitions>
    <ListView Name="DialogMenu" Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Source={StaticResource SlimTvMultiChannelGuide},Path=ProgramActions,Mode=OneTime}" Style="{ThemeResource MenuListViewStyle}">

    </ListView>


    <Button Style="{ThemeResource DialogButtonStyle}" Grid.Column="0" Grid.Row="1" Content="TvWish" HorizontalAlignment="Center">
    <Button.Command>
    <CommandList>

    <!--<Command Source="{StaticResource MyTestPluginSlimTv}" Path="SlimTv" Parameters="huhatest"/>-->
    <!--Parameters="{LateBoundValue BindingValue={Binding Path=SearchCity}}"/>-->

    <Command Source="{StaticResource MyTestPluginSlimTv}" Path="SlimTv" Parameters="{LateBoundValue BindingValue={Binding Source={StaticResource SlimTvMultiChannelGuide},Path=CurrentProgram.Title}}"/>
    <Command Source="{Service ScreenManager}" Path="CloseTopmostDialog"/>
    </CommandList>
    </Button.Command>
    </Button>

    </Grid>

    </DockPanel>
    </ControlTemplate>
    </Include.Resources>
    </Include>

    is transferring now the selected program title from SlimTv to MyTestplugin via parameters.
     
    Last edited:

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

    OP Similar threads Forum Replies Date
    Rob Hexenmeister Quick question - skinning MyPics General Support 7
    Lichloathe Trakt for MP2 question General 7
    J TV Server setup question Newcomers Forum 0
    A Question about Google Drive sync Feature Requests 0
    C Looking at transitioning from SageTV, but have some questions Newcomers Forum 1
    X Question about Google Token activation of Youtube MediaPortal 1 Talk 0
    P Another Fast Forward/Rewind/Skip/Replay Question General 3
    doskabouter Skin question Skins and Plugins Installer (MPEI) 1
    S Newbie questions Newcomers Forum 17
    M Tuning channels with quad tuner question General 6
    ajs [Help Us!] Extensions plugin question MediaPortal 1 8
    J Trying out MP 1 again, have some questions and a few log files Newcomers Forum 5
    J Question about thumbnail decorations MediaPortal 1 Talk 0
    D A couple of DVD questions General 2
    J A question regarding Slingbox-like capability online General 3
    U 2 questions Newcomers Forum 1
    J silly question: where do I add my login details!! OnlineVideos for MediaPortal 2 5
    BlueMax1916 Titanium Extended Theme Screensaver Question Skins and Design 6
    D Ver 1.18 on Win 10 question General Support 15
    Alberto83 Questions about MP2.2 General 8
    BlueMax1916 [solved] Question about MP2 dynamic refresh rate mapping and audio output MediaPortal 2 3
    mrmojo666 beginner: trying to write a plugin, need help to catch event General Development (no feature request here!) 3
    lacanox XMLTV not writing the tv schedule Electronic Program Guide 3
    M Need advice on writing plugin that modifies EPG database TV-Server 2
    joecrow 1.25.0 Radio Time plugin fails after Resume from Sleep with MP 1.25 Bugreports 3
    Top Bottom