Media X Menu Version 0.8 Beta NOTE: Do not use 0.5 or 0.6 on a DVD-R. There was a bug that is now fixed in 0.7 and above... sorry for the confusion. Media X Menu is a menu system to launch applications from a DVD collection or from a hard drive. It is intended to be very configurable and allow new "themes" to be added in, both with simple visual changes, or adding 3D effects to the presentation of the menus by re-writing the software. It is now in "Beta" status. It should be stable to use on DVD-R discs, but who knows? As usual, use at your own risk. I am releasing this source code for others to use for both their own projects, and hopefully, to enhance this project. The current features are as follows: There *ARE* still some bugs with this thing.... but I've tried to do as much testing as possible without spending three weeks on it. I believe most of it relates to the handling of the soundtracks at the moment, but tracking down everything is time consuming and at the moment, it seems to work 99.9% of the time. My suggestion would be to not use "random" soundtrack play, and it will be turned of by default. * Impliments the "Simple" theme, allowing a title screen, menu screen, loading screen and saver screen, each with configurable elements (custom backgrounds, custom bouncing logo for the screen saver) * Simple theme uses Skins based in subdirectories, and can use randomly selected skins on every run of the program. * Launches applications from the hard drive and the CD/DVD drive. * Screen saver! * Can play one or more music tracks, with multiple options, such as- - Disc-specific tracks (played from subdirectory, for example) - Can play from the XBox soundtracks the user has on his hard drive - Can play random or in order * Supports BMP, PNG, TGA, and JPG image formats * All settings are done via INI file support, a format familiar to most users. * Supports 640x480 at the moment. Sorry, just ran out of time to get the multi-res support in. =================================================================== FAQ: =================================================================== Q: I've got an Enigmah Beta, why doesn't this run? A: I don't have a patch tool for Enigmah users. Sorry.... if you have such a tool, please get a hold of me at xbox-scene or xboxhacker.net. Q: I don't like the title screen. Can you get rid of it? A: Well, it's simple enough to give the title screen delay a value of '0' to skip by it. Q: I don't like the screen saver feature, how do I get rid of that? A: Same thing, a delay time of zero will de-activate the saver. Q: Where can I find skins? A: I'll try and release a few, but at the moment, nobody is hosting skins specifically for my menu system; HOWEVER, since the 'default' layout for simple happens to match up to Complex MenuX, you can use skins created for that system with this menu (of course, MXM is far more flexible in positioning screens and items) Q: How about a tutorial on using this? A: I'd love to put one together for it, but to be honest, I'm probably the wrong person to do the job (as the developer, I'd have a hard time making a tutorial from a nontechnical perspective). If anybody out there feels up to the task, please do and send it to our good friends at xbox-scene. Q: I can't get this to boot. A: Well, I need a copy of your INI file, at the very least, in order to determine what the problem is. Try checking your image files and make sure they are there and are correctly formatted. Get a hold of me at xbox-scene if all else fails. =================================================================== HISTORY: =================================================================== Alpha 0.2 Minor bug fix release * Fixed problem identifying the correct partitions. (Thanks ITM of xboxhacker.net for the fix) * Added speed enhancement, again, thanks ITM for this code. * Moved soundtrack to it's own thread to prevent pausing in screen saver * "About" box added when pressing "White button" in the menu screen * Added the PersistDisplay() call, but didn't notice a difference. No loading screen joy. * Added "DrawDescription" to Menu section to allow you the ability to turn off the description. * Keyboard support - Cursor Up/Down, ENTER to select. Keys skip title and saver, F1 brings up "about box" and PrintScreen key will reboot to the dashboard. Alpha 0.3 Minor bug fix release * Fixed problem identifying the correct partition for F:. AGAIN. Bah! The generic code didn't want to work, even after I identified a problem with the code. Fixed it with a specific case for F: Alpha 0.4 * More bug fixes! Didn't realize that C:, E:, and F: were unmounted, causing problems when the image files didn't "live" in the directory below the menu system and get called as "D:\***" This problem is now fixed. * Changed option "Theme" in section [Main] to "Style" This will represent the type of menu displayed (simple, or in the future, 3-D styles) * Smooth scrolling menu items and descriptions. * Menus and description placement are fully configurable. Defaults to MenuX style, to be compatible with existing MenuX skins. Now menus, screenshots, and the description can be placed anywhere on the screen and in just about any size. You can also select the maximum number of options displayed at any given time (that is, how many item rows are displayed in the menu item box) Alpha 0.5 * Phew. Bug fix. Sorry about that, people, but there was a big bug causing instability in the system. It's very difficult to debug an app wthout a debug console. Many problems solved now. * SKINS! SKINS! SKINS! SKINS! This is the first release supporting self-contained skins! "DefaultSkin" is included with the release, basically the same images and sounds as in the previous releases, now in a handly subdirectory with their own ini file. Beta 0.6 * Cleaned up a couple of cosmetic bugs. * Fixed a problem with the skin soundtracks * Implimented a few more skin attributes. Not all are there yet. * Changed the screensaver slightly. * Release will be a bit cleaner than before, with the ini files cleaned up. Beta 0.7 * Fixed a bug that prevented skins from working in 0.5 and 0.6 I now will test each release with a XDFS formatted CD-RW (problems and time make testing on DVD-RW or DVD-R prohibitive at the moment) Beta 0.8 * Fixed issue with descriptions that are missing. * Cleaned up message box popping up when a screenshot is missing. KNOWN ISSUES: * Speed when cycling items - At the moment, all I can say is that it will take a while. The issue is that screenshot images must be loaded when you select an item, and this takes a moment to happen. I need to work up a good solution, since I can't load all of those images at once. * Not all skinning options supported yet - Still working on these. * Setting Random on with Global off prevents local skin track from working. * More themes needed =================================================================== Things that couldn't make it into this release, but are planned: =================================================================== * More detailed directions. Look, this stuff takes forever, and this will have to do until the later. Sorry. * Video based images, clips can be used for screen shots or backgrounds. * Automatic menu population... drop this system on a disc with multiple subdirectories, each containing "item" configuration files, and the menu system can automatically set them up. (i.e. the game directory might contain an MXM_ITEM.ini and an MXM_ITEM.png file) * Smarter relative paths. For now, we must assume any relative path is a CD/DVD. There is still work to be done to examine symbolic links so the menu system knows "where" it actually is being run from. * More eye-candy. - Animated menus (M$ Dash style or a rotating screenshot cube, for example) - Soundtrack-aware visuals in a screensaver * Support for all video modes (HDTV, PAL). * Full support for external fonts. =================================================================== Other ideas: =================================================================== * Remote control support * A PC-side app to handhold through the process of making and verifying a menu. =================================================================== Configuring MXM: =================================================================== Most users only need to modify the Menu Item entries and a couple of "Main" items (DiscTitle and DiscSubTitle). Everything else can be left alone or modified using the "skin" feature. They are only included for backwards compatibility now. Items marked with "*" are now better handled by the skin configuration files. Please refer to the skin configuration files for more information. ------------------- Menu items: ------------------- Each menu item will be listed in its own section, using "Item_x" as the name. It will read each item in order, starting with Item_1, until it fails to find the "next" one.... See the sample INI file for a detailed example. Example: [Item_1] Title=ToeJam and Earl III Description=Platforming classic returns! Media=TOEJAM3.png Dir=TOEJAM Title= The title that's displayed in the menu selection Description=<text to be displayed at the bottom of the selection menu> The text displayed at teh bottom of the menu selection box Media=<filename (may include absolute or relative path) of image> The bitmap (BMP,TGA,PNG,JPG) used to display a screenshot or title screen Dir=<Relative or absolute path to program> The directory the exeutable resides in Exe=<executable filename> The executable filename, defaults to default.xbe Main options: DiscTitle=<Title String Here> The title displayed in the title screen DiscSubtitle=<Subtitle String Here> Text displayed below title in title screen *TitleScreen=<Filepath of title background bitmap> Background used for title screen *MenuBack=<Filepath of menu background bitmap> Background for menu screen *SaverLogo=<Filepath of SaverLogo bitmap> Logo used for screen saver (Solid black is transparent) *WaitScreen=<Filepath of Wait screen background bitmap> Displayed when program is launched. Theme=<Theme ID> Theme ID, currently unsupported *TitleDelay=<Delay in seconds> Delay, in seconds, for the display of the title screen on startup. (Default 20sec) Hitting a button will bypass the title screen. *SaverDelay=<Delay in seconds> Delay before launching the screen saver from the menu screen. (Default 300sec, or 5 min) *TitleColor=<32-bit color value, in decimal or hex> *SubTitleColor=<32-bit color value, in decimal or hex> Colors used in display of title *ShadowTitle=<on/true/1/yes or off/false/0/no> *ShadowSubTitle=<on/true/1/yes or off/false/0/no> Display shadows MXMPath=<Absolute path> Defaults to D:\, this represents the path the menu is being run from. Used to launch apps run from relative paths. This is only useful when running the app from the hard drive, otherwise, just leave it off. [Main] DiscTitle=MediaX Menu DiscSubtitle= TitleScreen= MenuBack= SaverLogo= WaitScreen= Style=-1 TitleDelay=20 SaverDelay=300 TitleColor=0xffffffff SubTitleColor=0xffffffff ShadowTitle=on ShadowSubTitle=on MXMPath=D:\ ScreenShot Options: *Top=<pixel row> *Left=<pixel column> *Width=<Pixel width> *Height=<Pixel Height> Defines the location of the screenshot on the menu screen Example: [ScreenShot] Top=120 Left=334 Width=193 Height=260 Menu section options: *Top=<pixel row> *Left=<Pixel column> Location of upper left of selection menu *Width=<pixel width> *Height=<pixel height> Size of the menu item box *Items=<number of display items> Number of selection items that may be displayed in the menu box. This does not limit the number of menu items, only the number of items that show in the box at any given time. *MenuBorderColor=<32-bit color value, in decimal or hex> *MenuBackColor=<32-bit color value, in decimal or hex> *SelItemColor=<32-bit color value, in decimal or hex> *ItemColor=<32-bit color value, in decimal or hex> *DescrColor=<32-bit color value, in decimal or hex> Colors used in menu elements *DrawDescription=<on/true/1/yes or off/false/0/no> This could also be the done by using "DescrColor=0" *ShadowSelItem=<on/true/1/yes or off/false/0/no> *ShadowItem=<on/true/1/yes or off/false/0/no> *ShadowDescr=<on/true/1/yes or off/false/0/no> AllowSaverMusic=<on/true/1/yes or off/false/0/no> AllowSaverSound=<on/true/1/yes or off/false/0/no> These are pretty much self-explanatory *SndUp=<file path> *SndDn=<file path> *SndLaunch=<file path> Use these to choose differrent sound files Example: [Menu] Top=100 Left=63 Width=230 Height=200 Items=7 MenuBorderColor=0xa04444ff MenuBackColor=0x80000000 SelItemColor=0xffffffff ItemColor=0xa0808080 DescrColor=0xffffffff ShadowSelItem=on ShadowItem=on ShadowDescr=on AllowSaverMusic=on AllowSaverSound=on SndUp= SndDn= SndLaunch= Descr section options: *Top=<pixel row> *Left=<Pixel column> Location of upper left of description "box" *Width=<pixel width> *Height=<pixel height> Size of the description "box" NOTE: these default to -1, which means it will automatically be positioned under the menu box. *SmoothScroll=<on/true/1/yes or off/false/0/no> Enables the smooth scrolling of this item. Defaults to "on" [Descr] Top=-1 Height=-1 Left=-1 Width=-1 SmoothScroll=on Adding music tracks to the menu system You have several basic options: 1. Playing a specific file 2. Playing a directory of music 3. Playing the Xbox's own soundtrack You should always have something to play. Options under [Music]: UseMusic=<on/off> If on (Default), music will play, if off, no music will be played. Background=<filename> This option allows you to place a single file into the "local" soundtrack. Use this to select a single file to play during the menu operation. Directory=<directory> This option will cause the menu system to read an entire directory and add it to the "local" soundtrack. Global=<on/off> This option, when activated (default) will play any tracks contained on the Xbox's regular soundtracks. Random=<on/off> Default is on. This randomizes the order used to play the soundtrack files. If off, it will play the local soundtrack (in order) followed by the Xbox soundtracks (if Global is on, of course) [Music] UseMusic=true Background=MyTrack.wma Directory=MUSIC Global=true Random=off Note to developers: Sorry this is in such a messy state. I'd like to acknowledge CodeProject as the source of the CStdString class. I've discovered that it really helps with the Xbox APIs, particularly with conversion, but it's a bit kludgy. Best to use CStdString natively (compiles as 8-bit ASCII strings) and whenever you need wchar_t types, simply assign to a temporary CStdStringW object and pass out "wsTemp.c_str()" for the desired wchar format. You could even use: CStdString sThis String(_T("test")); SomeFunctionW( CStdStringW(sThis).c_str() ); to pass in the value. The INI classes were built specifically with the Xbox in mind, They utilize STL templates for mapping the parameters and CStdString as the basis for the strings. Feel free to port this to your own applications. I intended this implementation to support other formats as well, on multiple platforms, such as XML and registry configurations on desktop systems or handhelds. Support may be added for more data types, as well. The application is laid out with the idea of operating the applications in different states. Each state has it's own initialization, activation, movement and rendering functions. This makes it easier to bounce between the different modes. This is in it's second incarnation, and I've got some ideas to improve it further. I plan on integrating the music manager further as well as more utility functions. Did I mention it's rather messy right now? Ugh. I'm working on cleaning it up. The music manager required quite a bit of work to make it more robust. Please keep in mind I'm not working with a debug console, so when something breaks, the system just doesn't work at all.... MusicManager was a big headache. I plan enhancing the current classes with more dynamic support in the future, but for now, it's pretty complete. Callbacks into the Application class (or access to buffers for the app) would be nice, particularly for the visualization stuff. "xntdll.h" The magic NTDLL routines are generally the realm of device driver programmers. There's a lot of cool stuff in here. As I said online, I think new BIOSes could theoretically support LAN drives through enhancing the driver support in the BIOS. This file will hopefully grow with other functions, as well. CStdString GetRealCDROMPath( void ): :::sigh::: This should have worked, but it's not at the moment. If anybody can figure this one out, I'd greatly appreciate it. I'd prefer not to have to kludge up some detect based on writing to D:\ to see if I'm on the hard drive or not - and it makes it absolutely impossible to see if I'm running from a subdirectory of the hard drive. This routine was supposed to unravel the symbolic links that convert the menu program's directory to be seen as "D:\" instead of what it really is. Microsoft has even been so kind as to change the parameters used by NtOpenSymbolicLinkObject() call in the Xbox. Video support: I'm probably missing something simple, something I'll see a half hour after I send this whole thing out.... but it's not working at the moment. Everything is in place.... it's just broken as it sits. Dunno why at the moment. It should load up the video info initially, then when "getting" the texture, load up the next frame, and send the texture from the "current" frame. Seems pretty simple. Once it's working, any video should be able to be used where a bitmap is. Modularizing the themes: I'd like to look at doing sections for this, but even better if there is a way to do it like a DLL. Again, I don;t know if this will be possible, given the way the XBEs are loaded, but I get the impression the dashboard uses standard XBEs in EXACTLY this fashion, when they are renamed .xip's. I suspect there is a kernel function to load these by section to run. Anybody look at this?