OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mci.h
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/// Windows MCI (Media Control Interface) encapsulation classes.
7//----------------------------------------------------------------------------
8
9#if !defined(OWL_MCI_H)
10#define OWL_MCI_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/window.h>
18#include <mmsystem.h>
19
20
21namespace owl {
22
23#include <owl/preclass.h>
24
25class _OWLCLASS TMci;
26
27//
28/// \class TMciHiddenWindow
29// ~~~~~ ~~~~~~~~~~~~~~~~
30/// A private TWindow derivative used by TMci to capture events.
31//
33 public:
35
36 TResult EvMciNotify(TParam1, TParam2);
37
38 private:
39 TMci& Mci;
40
42};
43
44//
45/// \class TMci
46// ~~~~~ ~~~~
47/// TMci is a Windows MCI (Media Control Interface) encapsulation class.
48//
50 public:
51 // Constructors and destructors
52 //
53 TMci();
54 virtual ~TMci();
55
56 // Available commands on any MCI device
57 //
58 MCIERROR Open(const MCI_OPEN_PARMS&, DWORD_PTR flags = 0);
59 MCIERROR Close();
60 MCIERROR Play(const MCI_PLAY_PARMS&, DWORD_PTR flags = 0);
61 MCIERROR Stop(DWORD_PTR flags = 0);
62 MCIERROR Pause(DWORD_PTR flags = 0);
63 MCIERROR Resume(DWORD_PTR flags = 0);
64 MCIERROR Seek(const MCI_SEEK_PARMS&, DWORD_PTR flags = 0);
65 MCIERROR Seek(DWORD to, DWORD_PTR flags = 0);
66 MCIERROR Load(const tstring& fileName, DWORD_PTR flags = 0);
67
68 // Virtual function to override in derived classes to know when
69 // an MCI event is finished.
70 //
71 virtual TResult MciNotify(TParam1, TParam2);
72
73 // State information
74 //
75 bool IsBusy() const;
76 void SetBusy(bool);
77
78 // General wrappers and properties
79 //
80 MCIDEVICEID GetDeviceId() const;
81 HWND GetCallbackWindow() const;
82 MCIERROR SendCommand(UINT msg, DWORD_PTR flags, DWORD_PTR param);
83 static MCIERROR SendCommand(MCIDEVICEID deviceId, UINT msg, DWORD_PTR flags, DWORD_PTR param);
84
85 private:
86 void SetBusyIfNeeded(DWORD_PTR flags);
87
88 MCIDEVICEID DeviceId; ///< Id for the MCI device
89 bool WaitingForNotification; ///< Flag for asynchronous busy
90 TWindow* Window; ///< Owner
91};
92
93//
94/// \class TMciWaveAudio
95// ~~~~~ ~~~~~~~~~~~~~
96/// Wrapper to play .WAV files.
97//
99 public:
101 uint16 id = 0);
102
104
105 MCIERROR Play(DWORD_PTR flags = 0, DWORD from = 0, DWORD to = 0);
106};
107
108//
109/// \class TWinMM
110// ~~~~~ ~~~~~~
111/// delay loading WINMM.DLL
113 public:
114 static MCIERROR mciSendCommand(MCIDEVICEID, UINT msg, DWORD_PTR flags, DWORD_PTR param);
115 static TModule& GetModule();
116};
117
118#include <owl/posclass.h>
119
120
121//----------------------------------------------------------------------------
122// Inline implementations
123//
124
125//
126/// Returns the ID of the open MCI device.
127//
128inline uint TMci::GetDeviceId() const {
129 return DeviceId;
130}
131
132//
133/// Returns true if the MCI is currently busy doing something.
134//
135inline bool TMci::IsBusy() const {
136 return WaitingForNotification;
137}
138
139//
140/// Sets the busy flag for the MCI device.
141//
142inline void TMci::SetBusy(bool b) {
143 WaitingForNotification = b;
144}
145
146
147} // OWL namespace
148
149#endif // OWL_MCI_H
A private TWindow derivative used by TMci to capture events.
Definition mci.h:32
TMci is a Windows MCI (Media Control Interface) encapsulation class.
Definition mci.h:49
MCIDEVICEID GetDeviceId() const
Returns the ID of the open MCI device.
Definition mci.h:128
void SetBusy(bool)
Sets the busy flag for the MCI device.
Definition mci.h:142
bool IsBusy() const
Returns true if the MCI is currently busy doing something.
Definition mci.h:135
Wrapper to play .WAV files.
Definition mci.h:98
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
delay loading WINMM.DLL
Definition mci.h:112
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
#define DECLARE_RESPONSE_TABLE(cls)
Definition eventhan.h:436
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
LPARAM TParam2
Second parameter type.
Definition dispatch.h:55
WPARAM TParam1
First parameter type.
Definition dispatch.h:54
unsigned short uint16
Definition number.h:33
std::string tstring
Definition defs.h:79
#define _OWLCLASS
Definition defs.h:338
Base window class TWindow definition, including HWND encapsulation.