Jump to content

MMAPG - Multimedia Application Programming Environment: Difference between revisions

From EDM2
Created page with "{{MMAPG}} {{IBM-Reprint}} 400px OS/2 multimedia (referred to as MMPM/2 or Multimedia Presentation Manager/2 in previous releases) is the multimedia platform for today because it takes advantage of OS/2 features to provide an effective multimedia environment. OS/2 multitasking capability supports synchronization and concurrent playback of multiple devices. The flat memory model supports the management of large data objects. OS/2 multimedia is al..."
(No difference)

Revision as of 22:48, 4 November 2025

Multimedia Application Programming Guide
  1. Introduction
  2. What's New...
  3. Multimedia Application Programming Environment
  4. Media Control Interface
  5. Multimedia Logical Devices
  6. Amplifier-Mixer Device
  7. Waveform Audio Device
  8. Sequencer Device
  9. CD Audio Device
  10. CD-XA Device
  11. Videodisc Device
  12. Digital Video Device
  13. Direct Interface Video Extensions (DIVE)
  14. Captioning
  15. OS/2 Multimedia Controls
  16. Multimedia I/O File Services
  17. Resource Interchange File Format (RIFF) Services
  18. Sample Application Programs
  19. Installing a Program Using MINSTALL
  20. Caption DLL
  21. High-Level Service API
  22. Notices
  23. Glossary

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation

OS/2 multimedia (referred to as MMPM/2 or Multimedia Presentation Manager/2 in previous releases) is the multimedia platform for today because it takes advantage of OS/2 features to provide an effective multimedia environment. OS/2 multitasking capability supports synchronization and concurrent playback of multiple devices. The flat memory model supports the management of large data objects.

OS/2 multimedia is also the multimedia platform for tomorrow because of its extendable architecture, which enables new functions, devices, and multimedia data types to be added as the technology of multimedia advances.

Because OS/2 multimedia and its devices are designed to support synchronization activities, Presentation Manager (PM) applications can easily incorporate multimedia function for playing multiple devices concurrently and synchronizing audio and video as media drivers become available.

Application Programming Model

The application programming model for an OS/2 multimedia application is an extension of the OS/2 Presentation Manager programming model, providing both messaging and procedural programming interfaces. OS/2 multimedia API procedures allow applications to manage data and control devices while messages from the OS/2 multimedia system notify applications of asynchronous events.

The media control interface provides a view of the OS/2 multimedia system to both application developers and users that is similar to that of a video and audio home entertainment system. Operations are performed by controlling the processors of media information, known as media devices. Media devices can be internal or external hardware devices, or they can be software libraries that perform a defined set of operations by manipulating lower-level hardware components and system software functions.

Multiple media devices can be used in an operation. For example, the playback of an audio compact disc can be implemented by coordinating the control of a compact disc player and an amplifier-mixer device.

The Media Device Manager (MDM) shown in the following figure provides resource management for media devices and enables the command message and command string interface. The Media Device Manager provides device independence to an application developer.

 ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐
 │   Data    │ │           │ │   Media   │ │           │ │  Volume   │ │    CD     │ │  Digital  │
 │Converter  │ │  Install  │ │  Players  │ │   Setup   │ │  Control  │ │  Player   │ │   Audio   │
 └┬──────────┘ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ └─┬─────────┘
  │                  │             │             │             │             │         │           Applications
 -│- - - - - - - - - │ - - - - - - │ - - - - - - │ - - - - - - │ - - - - - - │ - - - - │ - - - - - - - - - - -
  │    ┌─────────────┴─────────────┴─────────────┴─────────────┴─────────────┴─────────┴─────────────────────┐
  │    │                      Media Device Manager Interface Layer                                           │
  │    └──────┬──────────────┬──────────────┬──────────────┬──────────────┬──────────────┬──────────────┬────┘
  │           │              │              │              │              │              │              │
  │     ┌─────┴──────┐ ┌─────┴──────┐ ┌─────┴──────┐ ┌─────┴──────┐ ┌─────┴──────┐ ┌─────┴──────┐ ┌─────┴──────┐
  │     │ CD-ROM/XA  │ │  CD Audio  │ │Wave Audio  │ │  Sequencer │ │Digitalvideo│ │ Amp/Mixer  │ │ Videodisc  │
  │     │  Driver    │ │   Driver   │ │  Driver    │ │    Driver  │ │  Driver    │ │  Driver    │ │   Driver   │
  │     └─────────┬┬─┘ └─┬──────┬───┘ └────────┬───┘ └────┬───────┘ └───┬────────┘ └┬─┬─────────┘ └─────┬──────┘
  │ Application   ││     │      │              └────────┐ │             │           │ │                 │
  │     or        ││     │      └─────────────────────┐ │ │ ┌───────────┘           │ │                 │
  │ Media Driver  │└─────┼──────────────────────────┐ │ │ │ │ ┌─────────────────────┘ └───────┐         │
  │               │    ┌─┘                          │ │ │ │ │ │                               │         │
 ┌┴────────┐      │    │  Stream Handlers           │ │ │ │ │ │                           ┌───┴────┐    │
 │  MMIO   ├───┐  │    │  ┌──────────────┐          │ │ │ │ │ │      ┌──────────────┐     │ Audio  │    │
 │ Manager │   │  │    │┌─┤ File System  │          │ │ │ │ │ │    ┌─┤    Audio     ├─────┤  VSD   │    │
 └────┬────┘   └──┼────┼┤ └──────────────┘          │ │ │ │ │ │    │ └──────────────┘     │        │    │
 ┌────┴─────────┐ │    ││ ┌──────────────┐          │ │ │ │ │ │    │ ┌──────────────┐     └───┬────┘    │
 │I/O Procedures│ │    ││ │ Multi-track  ├─┐   ┌────┴─┴─┴─┴─┴─┴┐   ├─┤   Memory     │         │         │
 └────┬─────────┘ │    ││ └──────────────┘ │   │┌─────────────┐│   │ └──────────────┘         │         │
      │           │    ││ ┌──────────────┐ ├───┼┤ Sync/Stream ││   │ ┌──────────────┐         │         │
      │           │    │└─┤   Video      ├─┤   ││ Manager DLL ├┼───┼─┤  CD-ROM/XA   │         │         │
      │           └───┐│  └──────────────┘ │   │└──────┬──────┘│   │ └──────────────┘         │         │
      │               ││  ┌──────────────┐ │   │       │       │   │ ┌──────────────┐         │         │
   ┌──┴────────┐      ││  │  MIDI Mapper ├─┘   │       │       │   └─┤    CD/DA     │         │         │  RING 3
   │File System│      ││  └──────────────┘     │       │       │     └──────────────┘         │         │  DLL
- -│- - - - - -│- - - ││- - - - - - - - - - - -│- - - -│- - - -│- - - - - - - - - - - - - - - │ - - - - │- - - - -
   │FAT/HPFS/XA│      ││                       │┌──────┴──────┐│                              │         │  RING 0
   └─┬────┬──┬┬┘      ││                       ││ Sync/Stream ││                              │         │  PDD
     │    │  │└──────┐││                       ││ Manager PDD ││                              │         │
 ┌───┴───┐│┌─┴─────┐ │││                       │└─────────────┘│                              │ IOCtl   │
 │ Hard  │││  R/W  │ │││                       └───────┬───────┘                              │         │
 │ Disk  │││Optical│ │││                               │                                      │         │
 │ PDD   │││  PDD  │ │││                               │                                      │         │ IOCtl
 └─┬─────┘│└─┬─────┘ │││                               │                                      │         │
   │      │  │       │││                           ┌───┴─────────────────────┐                │         │
   │      │  └┐      │││                       ┌───┤Ring 0 Stub Device Driver├────────────────┤         │
   │      │   │      │││                       │   └───────────┬─────────────┘                │         │
   │┌─────┴──┐│  ┌───┴┴┴───┐                   │   ┌───────────┼────────────┐                 │         │
   ││Diskette││  │CD-ROM/XA│               IDC │   │┌──────────┴───────────┐│                 │         │
   ││   PDD  ││  │   PDD   │                   │   ││Common Audio Interface├┼─────────────────┘         │
   │└─┬──────┘│  └───┬─────┘                   │   │└──────────┬───────────┘│                           │
   │  │       │    ┌─┴──────────┐              │   │     ┌─────┴─────┐      │                       ┌───┴───┐
   │  │       │    │Generic SCSC│              │   │     │ OEM Audio │      │                       │ OS/2  │
   │  │       └────┤     DD     │              └───┼─────┤   Device  │      │                       │  COM  │
   │  │            └─────┬──────┘                  │     │   Driver  │      │                       │  PDD  │
   │  │                  │                         │     └─────┬─────┘      │                       └───┬───┘
   │  │                  │                         └───────────┼────────────┘                           │
- -│- │ - - - - - - - - -│- - - - - - - - - - - - - - - - - - -│- - - - - - - - - - - - - - - - - - - - │- - - -
   │  └────────┐         ├─────────┐                           │                                        │
   ┴           ┴         ┴         ┴                       ┌───┴─────┐                                RS-232
  Hard      Diskette  Optical   CD-ROM                     │OEM Audio│
  Drive      Drive     Drive     Drive                     └──────┐  │                                    Physical
                                                                  └──┘                                    Devices

Refer to the OS/2 Multimedia Subsystem Programming Guide for information on multimedia subsystem programming including media drivers and stream handlers.

To assist you in creating a standardized user interface for your OS/2 multimedia application, OS/2 provides multimedia window controls, which have been implemented in OS/2 multimedia applications such as Volume Control. See the following figure.

Graphic buttons are two-state buttons that can be toggled up and down. They can display text, or graphics, or both. They can also be animated. Their versatility makes graphic buttons ideal to use for device control panels.

Circular sliders lend realism to your panel by providing familiar-looking dials. The dials are easy to operate and do not hog screen real estate.

Secondary windows provide a sizeable dialog window to contain your multimedia device controls.

OS/2 Multimedia Application Requirements

The IBM Developer's Toolkit for OS/2 Warp includes the bindings, header files, and libraries for developing OS/2 multimedia applications.

A PM message queue is required for all OS/2 multimedia applications because it enables the efficient sharing of devices in the OS/2 multimedia environment.

The minimum stack size for an OS/2 multimedia application is 32KB; however, for better performance, use a stack size of 64KB.

All OS/2 multimedia public interfaces, for example error message defines and common definitions, are accessible through the OS2ME.H file. Constants and prototypes for multimedia window control functions, MMIO file services functions, and high-level interfaces are accessible after the following defines are included in your application:

   Define        Services 
#define INCL_SW         Window Control Functions 
#define INCL_MMIOOS2    MMIO File Services 
#define INCL_MACHDR     High-Level Services 

OS/2 multimedia applications should link with the MMPM2.LIB library.

Note
OS/2 multimedia header files have naming conventions compatible with the standard OS/2 format. Applications using previous versions of the MMPM/2 header files will still use those header files by default when the applications are compiled. In order to use the OS/2-consistent header files in an application, define INCL_OS2MM in the program. Defining INCL_OS2MM automatically defines the following:
INCL_MCIOS2

MCI-related include files (MCIOS2.H and MMDRVOS2.H)

INCL_MMIOOS2
MMIO include file (MMIOOS2.H)

All existing applications remain binary compatible. If they are recompiled a choice of which set of headers to use is available. If new header files are used, the source code must be modified to conform to the name changes.

Extendable Device Support

The system architecture of OS/2 multimedia extensions is designed to be extendable. This level of modularity allows independent development of support for new hardware devices, logical media devices, and file formats.

Examples of media control interface devices are listed in the following table. The table shows the logical device types that can be supported and already have media control interface definitions. Devices currently supported by OS/2 multimedia are indicated by (X) marks.

┌──────────────┬──────────┬──────────────┬──────────────────────────────────┐
│Media Device  │OS/2      │String        │Constant                          │
│Type          │Multimedia│              │                                  │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Amplifier     │X         │ampmix        │MCI_DEVTYPE_AUDIO_AMPMIX          │
│mixer         │          │              │                                  │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Audio tape    │          │audiotape     │MCI_DEVTYPE_AUDIO_TAPE            │
│player        │          │              │                                  │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│CD audio      │X         │cdaudio       │MCI_DEVTYPE_CD_AUDIO              │
│player        │          │              │                                  │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│CD-XA player  │X         │cdxa          │MCI_DEVTYPE_CDXA                  │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Digital audio │          │dat           │MCI_DEVTYPE_DAT                   │
│tape          │          │              │                                  │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Digital video │X         │digitalvideo  │MCI_DEVTYPE_DIGITAL_VIDEO         │
│player        │          │              │                                  │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Headphone     │          │headphone     │MCI_DEVTYPE_HEADPHONE             │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Microphone    │          │microphone    │MCI_DEVTYPE_MICROPHONE            │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Monitor       │          │monitor       │MCI_DEVTYPE_MONITOR               │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Other         │          │other         │MCI_DEVTYPE_OTHER                 │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Video overlay │          │videooverlay  │MCI_DEVTYPE_OVERLAY               │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Sequencer     │X         │sequencer     │MCI_DEVTYPE_SEQUENCER             │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Speaker       │          │speaker       │MCI_DEVTYPE_SPEAKER               │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Videodisc     │X         │videodisc     │MCI_DEVTYPE_VIDEODISC             │
│player        │          │              │                                  │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Video         │          │videotape     │MCI_DEVTYPE_VIDEOTAPE             │
│tape/cassette │          │              │                                  │
├──────────────┼──────────┼──────────────┼──────────────────────────────────┤
│Waveform audio│X         │waveaudio     │MCI_DEVTYPE_WAVEFORM_AUDIO        │
│player        │          │              │                                  │
└──────────────┴──────────┴──────────────┴──────────────────────────────────┘
Note
M-Control Program 2.01, which supports the M-Motion Video Adapter/A, provides overlay extensions for OS/2 multimedia.