Jump to content
LaunchBox Community Forums

ISystemEventsPlugin event when entering/leaving platform?


Recommended Posts

Hi,

In my machine I have a monitor that can be physically rotated from a horizontal to a vertical position.

I'm looking to create a plugin so that I can control the rotation of my monitor.

However, I'm running into an issue in that I don't believe the system event triggers/exists for the situation that I want (entering/leaving a platform).

To better explain..

(When I say horizontal or vertical I'm referring to the screen physically rotating.)


I will be running in big box mode and will have 2 platforms. Arcade (MAME) and Pinball (Visual Pinball).

When launchbox first starts the main menu (platforms) will be horizontal.

When the Arcade platform is entered it will stay horizontal, but when a game is started it could switch to vertical based on the orientation of the selected game.
On game exit it will return back to horizontal (in the Arcade platform game list).
Then if returned to the main menu, again will stay horizontal.

When the Pinball platform is chosen it will rotate to vertical (w/ hopefully a 'vertical' theme').  All games when started will also be vertical.
On game exit it will stay vertical (in the Pinball platform game list).
Then if returned to the main menu, will rotate back to horizontal.

Hopefully that all makes sense..

The trouble is that the ISystemEventsPlugin doesn't seem to send an event when the platform is entered/exited, so I have no way of rotating the screen when I enter the Pinball platform game list.

Would this be an api feature request, or am I just missing something obvious?

I guess I'm looking to always get an event when entering/leaving each of the menus/submenus.

Also, It seems like the 'events' are there as LEDBlinky gets the 7 message when the initial 'Platforms' starts, the 'Arcade' platform or the 'Pinball' platform is entered and an 8 when they are exited out of.

I know I can probably create an exe and call it ledblinky.exe and use this as a workaround (which is what I used to do in HyperSpin), but wanted to try my hand at a DLL plugin for cleanliness.


Any suggestions?

Thanks

Reehmicks

Link to comment
Share on other sites

You can set the specific Platforms to use a specific Theme independent of other Platforms.  There are a couple vertical themes in the download section. So set the Default theme and Arcade theme to a horizontal one you like, and then VPX to a vertical theme.

As for catching the event when entering the different platforms, a longshot may be "BigBoxThemeChanged".  Technically the theme will have changed, but not sure if that's what the event is actually looking 'at'.  Vs. say setting/changing it in Options or changing it via a keyboard shortcut.  But there's one sure way to find out. ;) 

 

Link to comment
Share on other sites

10 minutes ago, JoeViking245 said:

You can set the specific Platforms to use a specific Theme independent of other Platforms.  There are a couple vertical themes in the download section. So set the Default theme and Arcade theme to a horizontal one you like, and then VPX to a vertical theme.

As for catching the event when entering the different platforms, a longshot may be "BigBoxThemeChanged".  Technically the theme will have changed, but not sure if that's what the event is actually looking 'at'.  Vs. say setting/changing it in Options or changing it via a keyboard shortcut.  But there's one sure way to find out. ;) 

 

Thanks for the response.

I saw the BigBoxThemeChanged event as well and thought that might also work, but, yeah that only triggers when the user actually changes themes through options. ☹️

Unfortunately, the only event I ever see when moving around between the main platforms view choices and the game list views choices is "SelectionChanged".  If I got any event when entering/leaving the game list view then I could work with that, but no luck so far.

As for the themes, I saw a couple nice ones, but didn't want to get too far down the theming rabbit hole just yet. 😁

 

I just noticed there is a way to submit a feature request. I'll give that a go as well if I don't hear anything.

 

Thanks again.

  • Like 1
Link to comment
Share on other sites

This is a little different than what you're asking for so I'm not sure if it would work for you and I'm unable to test it out at this time to confirm it would work.  But what about ISystemEventPlugin.OnEventRaised and for EventType of SelectionChanged?  This is supposed to fire when a game selection is changed.  Then you could use PluginHelper.StateManager.GetSelectedPlatform to get the platform.  This could work if you're able to check your monitor's rotation state and fire off the command to rotate it if the platform requires it.  That'd be bad if you went into a playlist that mixed arcade and pinball games but I'd think it would work if you're going through platforms the way that you described in your original post.  

Link to comment
Share on other sites

35 minutes ago, Fry said:

This is a little different than what you're asking for so I'm not sure if it would work for you and I'm unable to test it out at this time to confirm it would work.  But what about ISystemEventPlugin.OnEventRaised and for EventType of SelectionChanged?  This is supposed to fire when a game selection is changed.  Then you could use PluginHelper.StateManager.GetSelectedPlatform to get the platform.  This could work if you're able to check your monitor's rotation state and fire off the command to rotate it if the platform requires it.  That'd be bad if you went into a playlist that mixed arcade and pinball games but I'd think it would work if you're going through platforms the way that you described in your original post.  

Unfortunately this doesn't work either.

Basically if I'm in the Platforms view (Ex. PlatformWheel1FiltersView.xaml) and move through the wheels, I get the SelectionChanged events.
But if I select a wheel and hit Enter to go into the Games View (Ex. GameDetailsView.xaml) I receive no event.
If I hit Escape to leave the Games View and come back to the Platforms view I also do not receive an event.

Appreciate the responses though.

Link to comment
Share on other sites

Currently the only way to do what you are wanting (as far as I know of off the top of my head) is to create a IBigBoxThemeElementPlugin and then embed it into the view then can tie your logic to the OnSelectionChanged function to perform the logic you're interested in. You could also POTENTIALLY do something like using LEDBlinky if you can tie into the feed the application regarding entering and exiting platforms, though I am not experienced enough to tell you whether THAT avenue would definitely work or not.

  • Like 1
Link to comment
Share on other sites

4 minutes ago, C-Beats said:

Currently the only way to do what you are wanting (as far as I know of off the top of my head) is to create a IBigBoxThemeElementPlugin and then embed it into the view then can tie your logic to the OnSelectionChanged function to perform the logic you're interested in. You could also POTENTIALLY do something like using LEDBlinky if you can tie into the feed the application regarding entering and exiting platforms, though I am not experienced enough to tell you whether THAT avenue would definitely work or not.

I was looking at the iBigBoxThemeElementPlugin, but it just seemed like it wasn't what I should have been using.  I know I keep mentioning rotation, but I'm also going to eventually be putting pacled control into it as well and it just seemed like a usercontrol wasn't the right place for this.  I'm not really that good with xaml anyway, so that's probably another reason I shied away from it. lol.  I will try giving it a go.

The LEDBlinky approach was how I was doing this in my HyperSpin setup.  I just figured with LaunchBox having it's own plugin support that it would have been something in there already.

I'm going to put in in a feature request and see how that goes in the mean time.

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...