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

henso

Development Group
  • Team MediaPortal
  • February 16, 2012
    2,341
    829
    Home Country
    Denmark Denmark
    Can you post a screenshot? Maybe I am looking at the wrong place.
    Eject.png
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Ah, there. Ok, I see it with #97:
    1. Ejecting the virtual drive doesn’t work. Somebody with a physical drive should test this.
    2. After ejecting in Explorer the menu entry is still visible. Is this how you designed it?
     

    henso

    Development Group
  • Team MediaPortal
  • February 16, 2012
    2,341
    829
    Home Country
    Denmark Denmark
    After ejecting in Explorer the menu entry is still visible. Is this how you designed it?
    What do you mean? You mean it should not be visible if there is no disc in the drive? How would you eject the tray to put in a disc?
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    How would you eject the tray to put in a disc?
    There are two types of drives. Tray and slot ones. The former always have an eject button, the latter don’t.

    This reminds me of a similar discussion many years ago in MP1 where I argued that an eject command for a tray drive was not really meaningful since you still had to get up to exchange the disc.

    But in my use case there is no drive, so the command is not really necessary. Ideally its display would be linked to the presence of a drive:

    PC has a disc drive - eject command in menu
    PC has no drive - no eject command
     

    henso

    Development Group
  • Team MediaPortal
  • February 16, 2012
    2,341
    829
    Home Country
    Denmark Denmark
    The former always have an eject button, the latter don’t.
    I can't see the difference from code, so I always assume it's a slot one.
    PC has a disc drive - eject command in menu
    PC has no drive - no eject command
    That's how it should work. If Windows tells me there's an optical drive I set the action visible.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Try with my latest changes.
    TryExecuteAction with your changes works, the disc is ejecting from OSD (y)
    But next problem occurs, MP2 crashes directly, even I pause the playback before ejecting. I think MP2 should handle ejecting during playback like stopping the playback (just before it ejects the disc).

    [2020-01-05 19:16:45,691] [37934 ] [44 ] [ERROR] - ApplicationLauncher: Unhandled exception in application
    System.Runtime.InteropServices.InvalidComObjectException: Ein COM-Objekt, das vom zugrunde liegenden RCW getrennt wurde, kann nicht verwendet werden.
    bei System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
    bei DirectShow.IMediaSeeking.GetRate(Double& pdRate)
    bei MediaPortal.UI.Players.Video.BaseDXPlayer.get_PlaybackRate()
    bei MediaPortal.UI.Players.Video.BaseDXPlayer.get_IsPlayingAtNormalRate()
    bei MediaPortal.UI.Players.Video.BaseDXPlayer.get_IsSeeking()
    bei MediaPortal.UI.Services.Players.PlayerContext.get_PlaybackState() in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Source\Core\MediaPortal.UI\Services\Players\PlayerContext.cs:Zeile 231.
    bei MediaPortal.Plugins.WifiRemote.Messages.MessageStatus.get_IsPaused() in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Incubator\WifiRemote\Messages\MessageStatus.cs:Zeile 72.
    bei MediaPortal.Plugins.WifiRemote.Messages.MessageStatus.IsChanged() in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Incubator\WifiRemote\Messages\MessageStatus.cs:Zeile 151.
    bei MediaPortal.Plugins.WifiRemote.Messages.StatusUpdater.DoStatusUpdate() in C:\Users\ge230\Documents\Mediaportal 2\Git_WIP2.3\MediaPortal\Incubator\WifiRemote\Messages\StatusUpdater.cs:Zeile 61.
    bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    bei System.Threading.ThreadHelper.ThreadStart()
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    That's how it should work. If Windows tells me there's an optical drive I set the action visible.
    Is this dynamic? I ejected the drive in Explorer parallel to the running client app and the menu entry was still displayed. If it’s not dynamic I just need to restart the client. And indeed after that the entry is gone.

    Good solution if you are looking for absolute perfection you would need to register the respective Windows event of creation and removal of drives.
     

    henso

    Development Group
  • Team MediaPortal
  • February 16, 2012
    2,341
    829
    Home Country
    Denmark Denmark
    Good solution if you are looking for absolute perfection you would need to register the respective Windows event of creation and removal of drives.
    I did not design it for virtual drives but for physical ones. How do you imagine the scenario you describe would happen on a living room HTPC? What should trigger the creation and removal of virtual drives?
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Physical drives can also be USB DVD drives. In fact that is a typical scenario here: I bring home a DVD/BE drive from the office to occasionally play a disc. This drive is then plugged into my HTPC and played via MediaPortal.

    But as I already said, your solution covers everything except rate exceptions for which I am certainly not asking to spend any additional effort for.
     

    Users who are viewing this thread

    Top Bottom