Automatically start MP fullscreen on secondary display (1 Viewer)

dhannema

Portal Member
January 4, 2006
29
0
Home Country
Netherlands Netherlands
*** UPDATE 13/1/2007 - Works with MediaPortal 0.2.2.0 ***

Happy newyear ;)

With the following executable (attached is also the source code) you can start MediaPortal automatically in fullscreen mode on the secondary display.

http://www.geocities.com/don_hannema/mp_start_1.4.zip (only for version 0.2.2.0)

This version does not rely on the File->Set Device option in the menu anymore, since this was removed when the final 0.2 version came out, and works like this:
1. start MediaPortal.exe
2. move the window to the second display position (e.g. 1280x0)
3. make the window fullscreen

Since, the set device option is not available I recompiled the 0.2.2 version to support a configurable device selection. Please copy the executable in the following zip over the original: http://www.geocities.com/don_hannema/MediaPortal_0.2.2.0.zip

This will make sure the secondary display is the primary one. If you want to override this, you can do this by adding the following section to MediaPortal.xml
Code:
  <section name="debug">
    <entry name="adapterOrdinal">1</entry>
  </section>
A value of 0 will mean the primary display, 1 is the secondary display, 2 is your third display, etc.

Make sure that only the options "Auto hide mouse cursor in fullscreen mode when idle" and "Start Media Portal in fullscreen mode" are checked.

The program can also be started a second time, after which the focus is set to MediaPortal again. I use this program myself to activate MP with my remote control without the need to use my PC.

The code that I changed is the following in the d3dapp.cs file. From:
Code:
        // Create the device
        GUIGraphicsContext.DX9Device = new Microsoft.DirectX.Direct3D.Device(graphicsSettings.AdapterOrdinal,
                                                                             graphicsSettings.DevType,
                                                                             windowed ? ourRenderTarget : this,
                                                                             createFlags | CreateFlags.MultiThreaded,
                                                                             presentParams);

To:
Code:
        int adapterOrdinal = 1;

        using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
        {
            adapterOrdinal = xmlreader.GetValueAsInt("debug", "adapterOrdinal", 1);
        }

        // Create the device
        GUIGraphicsContext.DX9Device = new Microsoft.DirectX.Direct3D.Device(adapterOrdinal,
                                                                             graphicsSettings.DevType,
                                                                             windowed ? ourRenderTarget : this,
                                                                             createFlags | CreateFlags.MultiThreaded,
                                                                             presentParams);


The old version for MediaPortal 0.2.0.0 RC2 & RC3 is also still available here: http://www.geocities.com/don_hannema/mp_start_1.2.zip

This version assumes that the File->Set Device option in the menu is available and works in the following way:
1. start MediaPortal.exe
2. wait for the window to start and then open the Device Settings
3. select the second display
4. move the window to the second display position (e.g. 1280x0)
5. make the window fullscreen
 

jawbroken

Portal Pro
August 13, 2005
706
0
Home Country
Afghanistan Afghanistan
Am I right in thinking that this will only work with 1280 wide resolutions? It would be good to make that configurable somehow, I think.
 

dhannema

Portal Member
January 4, 2006
29
0
Home Country
Netherlands Netherlands
tkortell said:
I'm confused :? do you mean MediaPlayer or MediaPortal?? Or can it be used on any exe file?

Regards // Tomas

Sorry guys, I mean MediaPortal. I've edited the post.

I agree that nothing should be hardcoded (e.g. the 1280), but since I first wanted to know if others would find it useful, I didn't spend time making things configurable.
 

jawbroken

Portal Pro
August 13, 2005
706
0
Home Country
Afghanistan Afghanistan
I'm sure some people will find it very useful, but I only have the single display. Perhaps just a simple command line argument to replace the 1280 would be useful? The same thing would work for the path to MediaPortal as well.
 

dhannema

Portal Member
January 4, 2006
29
0
Home Country
Netherlands Netherlands
jawbroken said:
I'm sure some people will find it very useful, but I only have the single display. Perhaps just a simple command line argument to replace the 1280 would be useful? The same thing would work for the path to MediaPortal as well.

OK, I just added automatic detection of your screen size and I made the path an optional command line parameter.
Now, if you omit the first arugment (therefore start without any arguments) it will try to start MediaPlayer from the default location.
 

Rick164

MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    First of all thanks for your work, been waiting along time for this :)

    However it seems to hang when starting(99% cpuload load from mpstart.exe), it happends when mediaportal is intializing the skin and it says waiting for popup in the mpstart.exe).

    When i close mpstart.exe mediaportal goes further and does open the device properties(but does only open it)
    Hoping you can fix this :) , my config:

    Mediaportal 2.0 RC2
    Nvidia 6600 GT -> Dualview mode, CRT primary 1024x768, TV secondary 800x600

    Also another tiny question how can you make mpstart.exe run with the media center 2005 remote(green button now loads MS mce2005)?
     

    Hammer9600

    Portal Member
    May 26, 2005
    15
    0
    dhannema said:
    OK, I just added automatic detection of your screen size and I made the path an optional command line parameter.
    Now, if you omit the first arugment (therefore start without any arguments) it will try to start MediaPlayer from the default location.

    Hi, I would be extremely grateful to get this up and running on my system. I have looked for this kind of soultion for a long time now.

    I just wonder how I should change the the location of Media portal, do I have to install Borland Builder on my comp to change this myself, or is there an easier way?
     

    Users who are viewing this thread

    Top Bottom