This is a description of the samples on the MM Sys BBS. If they are not listed, please send email to matts@microsoft.com. Microsoft Multimedia Support BBS. 206 936-4082 ----------------------------------------------------------------------- If you run into any bugs, and especially if you fix any of them, please let me know. You can FAX me at 206 883-8101 or send US Mail to Matt Saettler Microsoft One Microsoft Way Redmond, WA 98052 ----------------------------------------------------------------------- Thanks, Matt ----------------------------------------------------------------------------- (pkunzip this with the /d option) TRI / TRIQ This is one of the most complex sample applications that I've seen. I tend toward liking 'real' examples, and I find that the simple samples don't really show people what is needed. Therefore, I have taken this (big) step into doing a pretty complex sample app. If you have strong feelings about the complexity (good or bad) please send your comments to me (see below). 1) using the DIB driver to draw directly into DIB memory 2) writing 286 and 386 specific code (in assembler, obviously) 3) using custom resources I wanted to expand this example to show a better display for the example, and I got into the 3D stuff. However, I didn't have enough time to get everything done. Instead of just releasing this file and none of the other parts, I decided to release both. Start with Tri first. TriQ is much more complex. Also take a big grain of salt with the 4D libraries... almost nothing has been tested, but I thought you'd like to see them. ----------------------------------------------------------------------------- | rleapp.c - Sample Code for creating and playing RLE animations | This is very important sample code that shows how to do animations. It does not require Multimedia; it works on regular windows. Get this and understand it if you want fast animations. ----------------------------------------------------------------------------- * REVERSE is a Windows with Multimedia sample application that * illustrates how to use the low-level waveform playback services. * It also shows how to use the multimedia file I/O services to read * data from a WAVE file. * * REVERSE plays a WAVE waveform audio file backwards. * * MMPLAY is a Windows with Multimedia sample application that * illustrates how to use the Multimedia Movie Player (MMP). * You can use MMPLAY to play any movie file. MMPLAY shows how * to load and play a movie, manage the stage window, and single-step * animation. * * MMPLAY also shows how to use a frame-callback function to * monitor script-channel text to recognize break, goto, loop, * and close commands. The frame-callback source code is in the * FRAMEHK.C module. SAMPLE.MMM, the movie file included with this * project, contains custom script commands that MMPLAY recognizes. * ----------------------------------------------------------------------------- PROGRAM: MMPF.c PURPOSE: Pull apart the MMP file format for inspection. Since the MDK docs on the MMP file format are lacking, this serves as a guide. ----------------------------------------------------------------------------- * * MIDIMon is a Windows with Multimedia application that records and displays * incoming MIDI information. It uses a low-level callback function to * get timestamped MIDI input. The callback function puts the incoming * MIDI event information (source device, timestamp, and raw MIDI * data) in a circular input buffer and notifies the application by posting * a MM_MIDIINPUT message. When the application processes the MM_MIDIINPUT * message, it removes the MIDI event from the input buffer and puts it in * a display buffer. Information in the display buffer is converted to * text and displayed in a scrollable window. Incoming MIDI data can be sent * to the MIDI Mapper if the user chooses. Filtering is provided for the * display buffer, but not for data sent to the Mapper. * ----------------------------------------------------------------------------- /** midikeyb.c * * DESCRIPTION: * This is a custom control that implements a MIDI style keyboard. * It's not exactly the best keyboard for a jam session; don't expect * to hit a bunch of hemidemisemiquavers at correct tempo... * * In any case, this custom control responds to and sends MIDI short * messages. This could be expanded on, but this is a good start. * The right mouse button is used for 'sticky keys' and will toggle * the state appropriately. If you drag the pointer off of a key * with the left mouse button pressed, you will notice that the key * stays down. This is because I do not SetCapture--and I should. * Another enhancement might be to add CTRL key and SHIFT key * modifiers to allow key selection like a multi-select list box. * * Before you can use this control, you MUST first export the window * procedure for the control: * * EXPORTS midiKeyBProc * * You then need initialize the class before you use it: * * if ( !midiKeyBInit( hInst ) ) * die a horrible death * else * you are good to go * * The colors used by the control default to black and white (black * for the accidental keys and white for the normal keys). This should * work just dandy on all displays. * * To select your own colors, you can send the KEYB_SETFGCOLOR and * KEYB_SETBKCOLOR messages to set the foreground (accidental) and * background (normal) key colors. The lParam is the RGB() value-- * wParam is a BOOL telling the control to repaint immediately if * set to TRUE. * * The layout of the keyboard is set using the MIDI key values with * C0 being MIDI note number 0, C2 is 48 (middle C), etc. The default * layout is: start = 48 (middle C), for 36 keys (3 octaves), ending * on 83. I chose this by throwing darts at my MIDI poster... * * You can set the layout to whatever you want by sending the * KEYB_SETLAYOUT message to the control. The HIWORD() of lParam * is the starting key, the LOWORD() of lParam is the number of keys. * wParam is a BOOL telling the control to repaint immediately if * set to TRUE (actually non-zero...). You can get the current * layout by sending the KEYB_GETLAYOUT message--the LONG return * value can be decoded as the lParam of KEYB_SETLAYOUT is encoded. * * You also have the option of having labels printed on the keys * for MIDI note referencing. Set the KEYBS_LABELS style flag to * get labels. * * The font used for the label text can be set using the standard * WM_SETFONT message. You can get the current font at any time with * the WM_GETFONT message. * * For other messages and the documentation, see the header block * for midiKeyBProc at the end of this source file. * ----------------------------------------------------------------------------- * MCITest is a Windows with Multimedia sample application illustrating * the use of the Media Control Interface (MCI). MCITest puts up a dialog * box allowing you to enter and execute MCI string commands. * ----------------------------------------------------------------------------- * LOWPASS is a sample application illustrating how to use the multimedia * file I/O services to read and write RIFF files. * * LOWPASS runs a simple low-pass filter over an 8-bit-per-sample * mono WAVE file. Note that this program does not copy unknown chunks * to the output file. * * ----------------------------------------------------------------------------- LAVA Lava Flow Simulator. This code demonstrates palette animation and pop-up menus. It does not require MM to run; it runs under Windows 3.0. Click on the program's window to get a menu. If you make the application 'full screen' (by double-clicking on the title bar) it makes the area the full size of the screen (and not just the usual client area which excludes the title bar). This allows creation of a full screen image. The image can be copied to the clipboard and then pasted into paint brush and then saved as a DIB. You can then load the image (from control panel) as a desktop image. The image will continue to palette animate (even on the desktop) while the program is still running. You can iconize the application and leave the palette animation going. Include with the windows SDK is the program MyPal. This displays the current physical palette from windows. This is an interesting program to run during palette animation. The 64-bit square-root code is 386 specific. * JOYTOY is a Windows with Multimedia application that illustrates * how to use the joystick services. When run, it presents the user * with a crosshair cursor. When the joystick or the mouse is moved, * the cursor follows. When a joystick button is pressed, JOYTOY * produces a sound and draws a bullet hole icon onto the screen. * * ------------------------------------------------------------------------------ * BOUNCER is a sample screen saver application. It bounces a * bitmap across the display and produces a sound when the * bitmap image is at the bottom of the screen. * ------------------------------------------------------------------------------ * CropDIB.c is a Windows with Multimedia application that crops a * series of DIBs. It uses the DIB driver; although this is the only * multimedia component that it demonstrates, the DIB.C module contains * many useful functions for working with DIBs and palettes. * * This application crops and "brighten" (add a specified increment to * the palette entries) a series of DIBs. * * If an input "pattern" is specified, it opens a series of input files; * otherwise, it opens only the specified filename. From each input file, * it can read one or a series of DIBs. * * If an output "pattern" is specified, it writes the DIBs to a series * of output files; otherwise, it writes all the DIBs to the single * specified filename. * * Demonstrates: * Use of DIB Driver * Direct manipulation of DIB pixel data * Direct manipulation of DIB palette data * Cacheing of Driver to avoid re-load * ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------ MergeDIB Merges a primary DIB (with any palette) and a secondary DIB (with a different palette) into a single, merged DIB (with special palette). The special dib and palette are a combination of the two images and palettes so that when the palette is gradually crossfaded (animated), the first and second DIB are partially displayed. At complete fade, only one of the bitmaps is 'visible', while at a 50-50 mix, both are equally visible (merged). Pixels are not dithered betweent he images, but are mixed in the palettes. This technique is limited in the number of pixels that have different targets between bitmaps, but it can create very nice effects when just text is 'faded' in for the target bitmap. This code is limited so that the two DIBs must be the same size, but this limitation could easily be eliminated by creating an artificial bitmap that is the desired size with a 'blank' (where blank is a chosen color) background. The smaller image could be centered or otherwise placed in the background (easy to do using the DIB Driver). This sample code requires COMMDLG from Windows 3.1. ------------------------------------------------------------------------------- transblt Draws an images with transparent portions. The transparent areas are a color in the source image. Demonstrates the 'old' way and the new MM way to do transparent drawings. -------------------------------------------------------------------------------