OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TMci Class Reference

TMci is a Windows MCI (Media Control Interface) encapsulation class. More...

#include <owl/mci.h>

Inheritance diagram for owl::TMci:
owl::TMciWaveAudio

Public Member Functions

 TMci ()
 Creates a hidden window for catching messages.
 
virtual ~TMci ()
 If the MCI device is still open, this closes it now. Deletes the hidden window.
 
MCIERROR Open (const MCI_OPEN_PARMS &, DWORD_PTR flags=0)
 Opens the MCI device.
 
MCIERROR Close ()
 Stops the MCI device and closes it.
 
MCIERROR Play (const MCI_PLAY_PARMS &, DWORD_PTR flags=0)
 Plays the MCI device.
 
MCIERROR Stop (DWORD_PTR flags=0)
 Stops the MCI device.
 
MCIERROR Pause (DWORD_PTR flags=0)
 Pauses the MCI device.
 
MCIERROR Resume (DWORD_PTR flags=0)
 Resumes playing of the MCI device.
 
MCIERROR Seek (const MCI_SEEK_PARMS &, DWORD_PTR flags=0)
 Seeks a particular position on the MCI device.
 
MCIERROR Seek (DWORD to, DWORD_PTR flags=0)
 Seeks a particular position on the MCI device.
 
MCIERROR Load (const tstring &fileName, DWORD_PTR flags=0)
 Loads the file into the MCI device.
 
virtual TResult MciNotify (TParam1, TParam2)
 The default MciNotify is to return 0.
 
bool IsBusy () const
 Returns true if the MCI is currently busy doing something.
 
void SetBusy (bool)
 Sets the busy flag for the MCI device.
 
MCIDEVICEID GetDeviceId () const
 Returns the ID of the open MCI device.
 
HWND GetCallbackWindow () const
 Returns the callback. If the window exists, the handle of the window is returned.
 
MCIERROR SendCommand (UINT msg, DWORD_PTR flags, DWORD_PTR param)
 Sends the MCI command message to the device if it's not busy.
 

Static Public Member Functions

static MCIERROR SendCommand (MCIDEVICEID deviceId, UINT msg, DWORD_PTR flags, DWORD_PTR param)
 Sends the MCI command message to the opened device.
 

Detailed Description

TMci is a Windows MCI (Media Control Interface) encapsulation class.

Definition at line 49 of file mci.h.

Constructor & Destructor Documentation

◆ TMci()

owl::TMci::TMci ( )

Creates a hidden window for catching messages.

Definition at line 77 of file mci.cpp.

References owl::TWindow::Create().

◆ ~TMci()

owl::TMci::~TMci ( )
virtual

If the MCI device is still open, this closes it now. Deletes the hidden window.

Definition at line 91 of file mci.cpp.

References Close().

Member Function Documentation

◆ Close()

MCIERROR owl::TMci::Close ( )

Stops the MCI device and closes it.

Definition at line 140 of file mci.cpp.

References SendCommand(), SetBusy(), and Stop().

◆ GetCallbackWindow()

HWND owl::TMci::GetCallbackWindow ( ) const

Returns the callback. If the window exists, the handle of the window is returned.

Definition at line 102 of file mci.cpp.

References owl::TWindow::GetHandle().

◆ GetDeviceId()

uint owl::TMci::GetDeviceId ( ) const
inline

Returns the ID of the open MCI device.

Definition at line 128 of file mci.h.

◆ IsBusy()

bool owl::TMci::IsBusy ( ) const
inline

Returns true if the MCI is currently busy doing something.

Definition at line 135 of file mci.h.

◆ Load()

MCIERROR owl::TMci::Load ( const tstring & fileName,
DWORD_PTR flags = 0 )

Loads the file into the MCI device.

Definition at line 252 of file mci.cpp.

References GetCallbackWindow(), and SendCommand().

◆ MciNotify()

TResult owl::TMci::MciNotify ( TParam1 ,
TParam2  )
virtual

The default MciNotify is to return 0.

Definition at line 268 of file mci.cpp.

◆ Open()

MCIERROR owl::TMci::Open ( const MCI_OPEN_PARMS & parms,
DWORD_PTR flags = 0 )

Opens the MCI device.

Definition at line 125 of file mci.cpp.

References SendCommand().

◆ Pause()

MCIERROR owl::TMci::Pause ( DWORD_PTR flags = 0)

Pauses the MCI device.

Definition at line 168 of file mci.cpp.

References GetCallbackWindow(), SendCommand(), and SetBusy().

◆ Play()

MCIERROR owl::TMci::Play ( const MCI_PLAY_PARMS & parms,
DWORD_PTR flags = 0 )

Plays the MCI device.

Definition at line 212 of file mci.cpp.

References SendCommand().

◆ Resume()

MCIERROR owl::TMci::Resume ( DWORD_PTR flags = 0)

Resumes playing of the MCI device.

Definition at line 185 of file mci.cpp.

References GetCallbackWindow(), SendCommand(), and SetBusy().

◆ Seek() [1/2]

MCIERROR owl::TMci::Seek ( const MCI_SEEK_PARMS & parms,
DWORD_PTR flags = 0 )

Seeks a particular position on the MCI device.

This function requires the parameters to be specified in a structure.

Definition at line 224 of file mci.cpp.

References SendCommand().

◆ Seek() [2/2]

MCIERROR owl::TMci::Seek ( DWORD to,
DWORD_PTR flags = 0 )

Seeks a particular position on the MCI device.

This function is provided for convenience.

Definition at line 236 of file mci.cpp.

References GetCallbackWindow(), and Seek().

◆ SendCommand() [1/2]

MCIERROR owl::TMci::SendCommand ( MCIDEVICEID deviceId,
UINT msg,
DWORD_PTR flags,
DWORD_PTR param )
static

Sends the MCI command message to the opened device.

Definition at line 277 of file mci.cpp.

References owl::TWinMM::mciSendCommand().

◆ SendCommand() [2/2]

MCIERROR owl::TMci::SendCommand ( UINT msg,
DWORD_PTR flags,
DWORD_PTR param )

Sends the MCI command message to the device if it's not busy.

Definition at line 113 of file mci.cpp.

References GetDeviceId(), IsBusy(), and SendCommand().

◆ SetBusy()

void owl::TMci::SetBusy ( bool b)
inline

Sets the busy flag for the MCI device.

Definition at line 142 of file mci.h.

◆ Stop()

MCIERROR owl::TMci::Stop ( DWORD_PTR flags = 0)

Stops the MCI device.

Definition at line 151 of file mci.cpp.

References GetCallbackWindow(), SendCommand(), and SetBusy().


The documentation for this class was generated from the following files: