Home   Index   About
Ultimate Pack


Custom Search
Overview
Group
Quick Info

play

The play command starts playing a device. CD audio, digital-video, MIDI sequencer, videodisc, VCR, and waveform-audio devices recognize this command.

wsprintf(lpstrCommand, "play %s %s %s", lpszDeviceID, lpszPlayFlags,
lpszFlags);

Parameters

lpszDeviceID

Identifier of an MCI device. This identifier or alias is assigned when the device is opened.

lpszPlayFlags

Flag for playing a device. The following table lists device types that recognize the play command and the flags used by each type:

cdaudio
from position
to position
digitalvideo
from position
fullscreen
repeat
reverse
to position
window
sequencer
from position
to position
  • cr
at time
from position
reverse
scan
to position
  • ideodisc
fast
from position
reverse
scan
slow
speed integer
to position
waveaudio
from position
to position

The following table lists the flags that can be specified in the lpszPlayFlags parameter and their meanings:

at time
Indicates when the device should begin performing this command, or, if the device has been cued, when the cued command begins. For more information, see the cue command.
fast
Indicates that the device should play faster than normal. To determine the exact speed on a videodisc player, use the "speed" flag of the status command. To specify the speed more precisely, use the "speed" flag of this command.
from position
Specifies a starting position for the playback. If the "from" flag is not specified, playback begins at the current position. For cdaudio devices, if the "from" position is greater than the end position of the disc, or if the "from" position is greater than the "to" position, the driver returns an error. For videodisc devices, the default positions are in frames for CAV discs and in hours, minutes, and seconds for CLV discs.
fullscreen
Specifies that a full-screen display should be used. Use this flag only when playing compressed files. (Uncompressed files won't play full-screen.)
repeat
Specifies that playback should restart when the end of the content is reached.
reverse
Specifies that the play direction is backward. You cannot specify an ending location with the "reverse" flag. For videodiscs, "scan" applies only to CAV format.
scan
Plays as fast as possible without disabling video (although audio might be disabled). For videodiscs, "scan" applies only to CAV format.
slow
Plays slowly. To determine the exact speed on a videodisc player, use the "speed" flag of the status command. To specify the speed more precisely, use the "speed" flag of this command. For videodiscs, "slow" applies only to CAV format.
speed integer
Plays a videodisc at the specified speed, in frames per second. This flag applies only to CAV discs.
to position
Specifies an ending position for the playback. If the "to" flag is not specified, playback stops at the end of the content. For cdaudio devices, if the "to" position is greater than the end position of the disc, the driver returns an error. For videodisc devices, the default positions are in frames for CAV discs and in hours, minutes, and seconds for CLV discs.
window
Specifies that playing should use the window associated with the device instance. This is the default setting.

lpszFlags

Can be "wait", "notify", or both. For digital-video and VCR devices, "test" can also be specified. For more information about these flags, see The Wait, Notify, and Test Flags.

Return Values

Returns zero if successful or an error otherwise.

Remarks

Before issuing commands that use position values, you should set the desired time format by using the set command. This command begins playing at the current speed, as set with the set "speed" command. The direction is reverse if the "reverse" flag is specified, or if the "to" flag is specified as a value less than the "from" flag. If the "from" flag is not specified, playback begins at the current position. The "to" and "reverse" flags cannot be used together.

The following command plays the "mysound" device from position 1000 through position 2000, sending a notification message when the playback completes:

play mysound from 1000 to 2000 notify

See Also

cue
, set, status


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2011 Free Tech Secrets ;) greatis just4fun network just4fun