OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
mciwav.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Implements TMciWaveAudio
7//----------------------------------------------------------------------------
8#include <owl/pch.h>
9#include <owl/mci.h>
10
11
12namespace owl {
13
15
16//
17// Initialize the structure for the waveaudio device.
18//
19static void InitParms(MCI_OPEN_PARMS& parms, uint32& command, LPCTSTR deviceName,
20 LPCTSTR elementName = 0, uint16 id = 0)
21{
23 if (elementName != nullptr) {
25 parms.lpstrElementName = elementName;
26 }
27
28 parms.lpstrDeviceType = (id == 0) ? deviceName :
30}
31
32//
33/// Constructs an MCI waveaudio (.WAV) device.
34//
43
44//
45/// String-aware overload
46//
54
55//
56/// Plays the file on the waveaudio device.
57//
60{
62
63 if (flags & MCI_NOTIFY)
64 parms.dwCallback = reinterpret_cast<DWORD_PTR>(GetCallbackWindow());
65
66 flags |= MCI_FROM;
67 parms.dwFrom = from;
68
69 if (to != 0) {
70 flags |= MCI_TO;
71 parms.dwTo = to;
72 }
73
74 return TMci::Play(parms, flags);
75}
76
77} // OWL namespace
78/* ========================================================================== */
79
MCIERROR Play(const MCI_PLAY_PARMS &, DWORD_PTR flags=0)
Plays the MCI device.
Definition mci.cpp:212
HWND GetCallbackWindow() const
Returns the callback. If the window exists, the handle of the window is returned.
Definition mci.cpp:102
MCIERROR Open(const MCI_OPEN_PARMS &, DWORD_PTR flags=0)
Opens the MCI device.
Definition mci.cpp:125
MCIERROR Play(DWORD_PTR flags=0, DWORD from=0, DWORD to=0)
Plays the file on the waveaudio device.
Definition mciwav.cpp:59
TMciWaveAudio(LPCTSTR elementName=0, LPCTSTR deviceName=0, uint16 id=0)
Constructs an MCI waveaudio (.WAV) device.
Definition mciwav.cpp:35
#define _T(x)
Definition cygwin.h:51
Windows MCI (Media Control Interface) encapsulation classes.
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
uint32 MkUint32(uint16 lo, uint16 hi)
Definition defs.h:261
unsigned long uint32
Definition number.h:34
OWL_DIAGINFO
Definition animctrl.cpp:14
unsigned short uint16
Definition number.h:33
std::string tstring
Definition defs.h:79