Open/Close CD tray Plugin (1 Viewer)

natrlhy

Retired Team Member
  • Premium Supporter
  • August 2, 2006
    324
    0
    Bay Area, CA
    Home Country
    United States of America United States of America
    I wanted to pose the question to anyone that can answer.

    Something I really liked with my TiVo unit (Pioneer DVR-810H) was the fact that I could open and close the CD tray with the remote. ( I sold this unit after getting MP running!)

    I'm not a programmer/coder by any means but I was wondering if there is someone that can possibly create a plugin or somehow integrate this into MediaPortal?

    I know, its the lazy way to do it, but it's a great feature I think. One would wonder why you wouldn't just press the eject button again if you just inserted a DVD/CD in the tray but hey, it's all about the convenience right? :)

    Just a suggestion if anyone is willing! I'll do what I can as well with some guidance!
     

    Efros

    Portal Pro
    January 23, 2006
    511
    2
    Maine
    Home Country
    England England
    Don't know if this is of any use but stumbled upon this code fragment which uses winmm.dll to open and close the cd tray

    Code:
    using System;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;
     
    namespace WindowsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
             
            }
     
            private void button1_Click(object sender, EventArgs e)
            {
                int ret = mciSendString("set cdaudio door open", null, 0, IntPtr.Zero);
     
            }
     
            private void button2_Click(object sender, EventArgs e)
            {
                int ret = mciSendString("set cdaudio door closed", null, 0, IntPtr.Zero);
            }
     
            [DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi)]
            protected static extern int mciSendString(string lpstrCommand,
                                                       StringBuilder lpstrReturnString,
                                                       int uReturnLength,
                                                       IntPtr hwndCallback);
     
    }
     
    }
     

    mPod

    Portal Pro
    January 26, 2005
    2,084
    3
    Berlin
    Home Country
    Germany Germany
    Depending on what kind of remote you're using, you can map the action "Ejectcd" to a button. In combination with some smart conditional mapping, e.g. when being in movie screen, you might wanna map it on your own. All remotes listed in configuration.exe in "Remote" & "DirectInput" support this.
     

    natrlhy

    Retired Team Member
  • Premium Supporter
  • August 2, 2006
    324
    0
    Bay Area, CA
    Home Country
    United States of America United States of America
    mPod walked me through mapping the My Videos button (as an example) on my US MCE remote to the EjectCD action in IRC. It does eject the CD tray but it doesn't close it. The way this action is setup currently does what it's supposed to do, but having the functionality of closing an open CD tray is another matter at present...

    The steps to do this were:

    1. Run MediaPortal Setup
    2. Select Remote. On the Microsoft MCE tab click Mapping
    3. Expand the Extended buttons and expand My Videos and All Layers
    4. Select Fullscreen Video
    5. In the Action section select Ejectcd instead of the default Show GUI
    6. Click OK and OK and run MediaPortal and test in a fullscreen video.

    It worked but I went back to the default Show GUI action ;)
     

    thiskl

    MP Donator
  • Premium Supporter
  • April 10, 2005
    48
    0
    Perth, Western Australia
    Home Country
    I'm sure I've seen a version of the BlueTwo skin that had an "Eject" menu item on the "My Videos" page.

    Unfortunately, there's no getting around having to leave your seat to physically exchange the CD/DVD once the door is open. :p
     

    mPod

    Portal Pro
    January 26, 2005
    2,084
    3
    Berlin
    Home Country
    Germany Germany
    mPod walked me through mapping the My Videos button (as an example) on my US MCE remote to the EjectCD action in IRC. It does eject the CD tray but it doesn't close it. The way this action is setup currently does what it's supposed to do, but having the functionality of closing an open CD tray is another matter at present...

    The steps to do this were:

    1. Run MediaPortal Setup
    2. Select Remote. On the Microsoft MCE tab click Mapping
    3. Expand the Extended buttons and expand My Videos and All Layers
    4. Select Fullscreen Video
    5. In the Action section select Ejectcd instead of the default Show GUI
    6. Click OK and OK and run MediaPortal and test in a fullscreen video.

    It worked but I went back to the default Show GUI action ;)
    That was just an example... I'd recommend a different button for that, especially because you have the US-version of the remote which lacks the red button (toggles fullscreen). Otherwise it's not very comfortable to toggle fullscreen mode for you... Just a hint. ;)
     

    Users who are viewing this thread

    Top Bottom