The program is finding the media files ok, I just wasn't sure if there was a way to specify a desktop environment. No problems, I can work around it, but it might be a development option on the horizon?
I haven't really been planning on it - I don't think I've heard any other requests for it, and I'd prefer not to add further complications to the media search process given how complex it already is.
However, I think you could implement a desktop mode option using Javascript, so I might look into it as a worked example for the help at some point. I probably won't be able to get to that any time soon, so if you want to give it a try, here's the basic outline I have in mind:
- First, create custom media types for Desktop Table Image and Desktop Table Video. See Javascript scripting > Media Types in the help for details.
- Next, write a handler in the main window for the mediasyncload event. That event is fired just before a new playfield image/video is loaded, and it has access to the filenames of the media items that the system proposes to load. You'd get the GameInfo object from the event's game property, and call its resolveMedia() method to look for desktop versions of the image and video files. If found, you'd replace the video and image properties in the event object with the names of your alternate resolved files. On return, the system will load those files instead of the ones it found (which will have come from the normal "cabinet" table image/video media folders).
I think that's pretty much all there is to it. I haven't tested this, but here's a stab at the code, if you want to play around with it...
// create the desktop video/image media types
GameList.createMediaType({
id: "desktop table image",
configId: "desktopTableImage",
name: "Desktop Table Image",
menuOrder: 430,
folder: "Table Images Desktop",
perSystem: true,
format: "Image",
extensions: ".jpg .jpeg .png .apng .gif",
hasDropButton: true,
rotation: 0
});
GameList.createMediaType({
id: "desktop table video",
configId, "desktopTableVideo",
name: "Desktop Table Video",
menuOrder: 440,
folder: "Table Videos Desktop",
perSystem: true,
format: "VideoWithAudio",
extensions: ".f4v .mp4 .mov .mpg .mkv .wmv .m4v .avi",
hasDropButton: true,
rotation: 0
});
// on media load in main window, override table video/image with desktop version
mainWindow.on("mediasyncload", ev => {
if (ev.game) {
let video = ev.game.resolveMedia("desktop table video", true);
let image = ev.game.resolveMedia("desktop table image", true);
if (video)
ev.video = video;
if (image)
ev.image = image;
}
});
If you give that a try, let me know how it goes. If you have to make any changes to get it working, I'd appreciate if you could send me back the working version - knowing that it's tested and working would save me that time and make it pretty quick to write it up as a worked example for the help.
One other little embellishment that you might want to make if you want to put this into real use would be to extend it to cover the defaultVideo and defaultImage properties of the event, to select the desktop versions of the defaults for tables without any media. You might also want to play around with priorities: if the method finds an image but no video, you might want to explicitly set the video property to undefined so that the system won't load a Cabinet Video in preference to a Desktop Image. But that sort of thing is up to you; I'm not exactly sure what the right policy is there. (One more reason I'm reluctant to add this to the native media search - it seems like there might have to be some additional option settings that come with it, ratcheting up the complexity for everyone.)