Automatically start MP fullscreen on secondary display

Discussion in 'Tips and Tricks' started by dhannema, January 4, 2006.

  1. dhannema

    dhannema Portal Member

    Joined:
    January 4, 2006
    Messages:
    29
    Likes Received:
    0
    Ratings:
    +0 / 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 (Text):
    1.  
    2.   <section name="debug">
    3.     <entry name="adapterOrdinal">1</entry>
    4.   </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 (Text):
    1.  
    2.         // Create the device
    3.         GUIGraphicsContext.DX9Device = new Microsoft.DirectX.Direct3D.Device(graphicsSettings.AdapterOrdinal,
    4.                                                                              graphicsSettings.DevType,
    5.                                                                              windowed ? ourRenderTarget : this,
    6.                                                                              createFlags | CreateFlags.MultiThreaded,
    7.                                                                              presentParams);
    To:
    Code (Text):
    1.  
    2.         int adapterOrdinal = 1;
    3.  
    4.         using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
    5.         {
    6.             adapterOrdinal = xmlreader.GetValueAsInt("debug", "adapterOrdinal", 1);
    7.         }
    8.  
    9.         // Create the device
    10.         GUIGraphicsContext.DX9Device = new Microsoft.DirectX.Direct3D.Device(adapterOrdinal,
    11.                                                                              graphicsSettings.DevType,
    12.                                                                              windowed ? ourRenderTarget : this,
    13.                                                                              createFlags | CreateFlags.MultiThreaded,
    14.                                                                              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
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. jawbroken

    jawbroken Portal Pro

    Joined:
    August 13, 2005
    Messages:
    706
    Likes Received:
    0
    Ratings:
    +0 / 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.
     
  4. tkortell

    tkortell Portal Pro

    Joined:
    April 13, 2005
    Messages:
    320
    Likes Received:
    0
    Location:
    Vaasa / Sulva
    Ratings:
    +0 / 0
    Home Country:
    Finland Finland
    I'm confused :? do you mean MediaPlayer or MediaPortal?? Or can it be used on any exe file?

    Regards // Tomas
     
  5. dhannema

    dhannema Portal Member

    Joined:
    January 4, 2006
    Messages:
    29
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Netherlands Netherlands
    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.
     
  6. jawbroken

    jawbroken Portal Pro

    Joined:
    August 13, 2005
    Messages:
    706
    Likes Received:
    0
    Ratings:
    +0 / 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.
     
  7. dhannema

    dhannema Portal Member

    Joined:
    January 4, 2006
    Messages:
    29
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Netherlands Netherlands
    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.
     
  8. tkortell

    tkortell Portal Pro

    Joined:
    April 13, 2005
    Messages:
    320
    Likes Received:
    0
    Location:
    Vaasa / Sulva
    Ratings:
    +0 / 0
    Home Country:
    Finland Finland
    Good work ;)
     
  9. GlobalFusion

    GlobalFusion Portal Member

    Joined:
    December 11, 2005
    Messages:
    24
    Likes Received:
    0
    Ratings:
    +0 / 0
    (* click *)

    Trying now. will post results later.
     
  10. Rick164
    • Super User

    Rick164 Super User

    Joined:
    January 7, 2006
    Messages:
    1,335
    Likes Received:
    918
    Ratings:
    +1,359 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    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)?
     
  11. Hammer9600

    Hammer9600 Portal Member

    Joined:
    May 26, 2005
    Messages:
    15
    Likes Received:
    0
    Ratings:
    +0 / 0
    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?
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!