[Finished] [MP2-820] Eject command for CD/DVD/Blu-ray disc media (2 Viewers)

ge2301

Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    @henso
    to bind a command to a button I need source states I think.

    Example Home Button:
    XML:
              <Button x:Name="HomeButton" Style="{ThemeResource HomeButtonStyle}" HorizontalAlignment="Left" VerticalAlignment="Center"
                      Command="{Command Source={Service WorkflowManager},Path=NavigatePush,Parameters=7F702D9C-F2DD-42da-9ED8-0BA92F07787F}"/>
    XML:
        <WorkflowContributorAction Id="17D2390E-5B05-4fbd-89F6-24D60CEB427F"
            Name="Home->BrowseLocalMedia"
            DisplayCategory="a-Media"
            SortOrder="a"
            SourceStates="7F702D9C-F2DD-42da-9ED8-0BA92F07787F"
            ContributorModelId="6455D863-CCF2-403d-8C36-754299B61319"/> <!-- LocalMedia action -->

    For the exject button the source state is "*" though. Can I just create a source state with a Guid generator or is there a reason for the "*"?
    XML:
        <WorkflowContributorAction Id="9EE2C4A6-70FD-4947-9418-A40012925DA6"
            Name="*->EjectOpticalDisc"
            DisplayCategory="a-Media"
            SortOrder="x"
            Group="Global"
            SourceStates="*"
            ContributorModelId="5D67150A-3B09-43C1-8618-FFE3C763AFD1"/>
     

    henso

    Development Group
  • Team MediaPortal
  • February 16, 2012
    2,341
    829
    Home Country
    Denmark Denmark
    to bind a command to a button I need source states I think.
    I'm not an expert on the workflow manager but it seems like you just push the action Id to the navigation stack and that should be it. Have you tried it?
    The source states I don't know exactly how are used but for the BrowseLocalMedia action it states that it should be on the home screen before that action can be used.
    * means there is no required source state, so you can be on any screen and the action should still work.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    I'm not an expert on the workflow manager but it seems like you just push the action Id to the navigation stack and that should be it. Have you tried it?
    The source states I don't know exactly how are used but for the BrowseLocalMedia action it states that it should be on the home screen before that action can be used.
    * means there is no required source state, so you can be on any screen and the action should still work.
    I've tried the ActionID and the ContributorModelId just to cover all possibilities. Both throw errors is logs:
    [2020-01-05 16:59:54,567] [29667 ] [InputMgr ] [ERROR] - CommandBaseMarkupExtension: Error executing command '{Command Source=MediaPortal.UI.Services.Workflow.WorkflowManager,Path=NavigatePush}'
    System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.ArgumentException: WorkflowManager: Workflow state '5d67150a-3b09-43c1-8618-ffe3c763afd1' is not available
    bei MediaPortal.UI.Services.Workflow.WorkflowManager.NavigatePushInternal(Guid stateId, NavigationContextConfig config) in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Source\Core\MediaPortal.UI\Services\Workflow\WorkflowManager.cs:Zeile 878.
    bei MediaPortal.UI.Services.Workflow.WorkflowManager.NavigatePush(Guid stateId, NavigationContextConfig config) in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Source\Core\MediaPortal.UI\Services\Workflow\WorkflowManager.cs:Zeile 1133.
    bei MediaPortal.UI.Services.Workflow.WorkflowManager.NavigatePush(Guid stateId) in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Source\Core\MediaPortal.UI\Services\Workflow\WorkflowManager.cs:Zeile 1144.
    --- Ende der internen Ausnahmestapelüberwachung ---
    bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    bei System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
    bei MediaPortal.UI.SkinEngine.MarkupExtensions.CommandBaseMarkupExtension.Execute(IEnumerable`1 parameters)
    [2020-01-05 16:57:48,277] [50301 ] [InputMgr ] [ERROR] - CommandBaseMarkupExtension: Error executing command '{Command Source=MediaPortal.UI.Services.Workflow.WorkflowManager,Path=NavigatePush}'
    System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.ArgumentException: WorkflowManager: Workflow state '9ee2c4a6-70fd-4947-9418-a40012925da6' is not available
    bei MediaPortal.UI.Services.Workflow.WorkflowManager.NavigatePushInternal(Guid stateId, NavigationContextConfig config) in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Source\Core\MediaPortal.UI\Services\Workflow\WorkflowManager.cs:Zeile 878.
    bei MediaPortal.UI.Services.Workflow.WorkflowManager.NavigatePush(Guid stateId, NavigationContextConfig config) in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Source\Core\MediaPortal.UI\Services\Workflow\WorkflowManager.cs:Zeile 1133.
    bei MediaPortal.UI.Services.Workflow.WorkflowManager.NavigatePush(Guid stateId) in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Source\Core\MediaPortal.UI\Services\Workflow\WorkflowManager.cs:Zeile 1144.
    --- Ende der internen Ausnahmestapelüberwachung ---
    bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    bei System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
    bei MediaPortal.UI.SkinEngine.MarkupExtensions.CommandBaseMarkupExtension.Execute(IEnumerable`1 parameters)
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    It should be visible in all media views in the side menu (where filtering, sorting etc. is located).
    It’s not (#95, BV/Win10). But as you wrote, maybe because it’s a virtual drive, although Explorer has an Eject command for it.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Try with TryExecuteAction instead of NavigatePush.
    No reaction, but this time the logs do also not recognize the click of the button, tried it two times.

    I pushed my changes with the ActionID, which is not working yet as temporal solution in case you also want to try something.
    The eject function is working well with the menu entry by the way.
     

    henso

    Development Group
  • Team MediaPortal
  • February 16, 2012
    2,341
    829
    Home Country
    Denmark Denmark
    No reaction, but this time the logs do also not recognize the click of the button, tried it two times.
    I think it is right now, but I need to allow the action also from the OSD.
     

    Users who are viewing this thread

    Top Bottom