Home   Index   About
Ultimate Pack


Custom Search
Overview
Group
Quick Info

mixerOpen

The mixerOpen function opens a specified mixer device and ensures that the device will not be removed until the application closes the handle.

MMRESULT mixerOpen(

LPHMIXER phmx,

UINT uMxId,

DWORD dwCallback,

DWORD dwInstance,

DWORD fdwOpen

);

Parameters

phmx

Address of a variable that will receive a handle identifying the opened mixer device. Use this handle to identify the device when calling other audio mixer functions. This parameter cannot be NULL.

uMxId

Identifier of the mixer device to open. Use a valid device identifier or any HMIXEROBJ (see the mixerGetID function for a description of mixer object handles). A "mapper" for audio mixer devices does not currently exist, so a mixer device identifier of pics/MMEDIA00090000.gif 1 is not valid.

dwCallback

Handle of a window called when the state of an audio line and/or control associated with the device being opened is changed. Specify zero for this parameter if no callback mechanism is to be used.

dwInstance

User instance data passed to the callback function. This parameter is not used with window callback functions.

fdwOpen

Flags for opening the device. The following values are defined:

CALLBACK_WINDOW

The dwCallback parameter is assumed to be a window handle.

MIXER_OBJECTF_AUX

The uMxId parameter is an auxiliary device identifier in the range of zero to one less than the number of devices returned by the auxGetNumDevs function.

MIXER_OBJECTF_HMIDIIN

The uMxId parameter is the handle of a MIDI input device. This handle must have been returned by the midiInOpen function.

MIXER_OBJECTF_HMIDIOUT

The uMxId parameter is the handle of a MIDI output device. This handle must have been returned by the midiOutOpen function.

MIXER_OBJECTF_HMIXER

The uMxId parameter is a mixer device handle returned by the mixerOpen function. This flag is optional.

MIXER_OBJECTF_HWAVEIN

The uMxId parameter is a waveform-audio input handle returned by the waveInOpen function.

MIXER_OBJECTF_HWAVEOUT

The uMxId parameter is a waveform-audio output handle returned by the waveOutOpen function.

MIXER_OBJECTF_MIDIIN

The uMxId parameter is the identifier of a MIDI input device. This identifier must be in the range of zero to one less than the number of devices returned by the midiInGetNumDevs function.

MIXER_OBJECTF_MIDIOUT

The uMxId parameter is the identifier of a MIDI output device. This identifier must be in the range of zero to one less than the number of devices returned by the midiOutGetNumDevs function.

MIXER_OBJECTF_MIXER

The uMxId parameter is a mixer device identifier in the range of zero to one less than the number of devices returned by the mixerGetNumDevs function. This flag is optional.

MIXER_OBJECTF_WAVEIN

The uMxId parameter is the identifier of a waveform-audio input device in the range of zero to one less than the number of devices returned by the waveInGetNumDevs function.

MIXER_OBJECTF_WAVEOUT

The uMxId parameter is the identifier of a waveform-audio output device in the range of zero to one less than the number of devices returned by the waveOutGetNumDevs function.

Return Values

Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following:

MMSYSERR_ALLOCATED
The specified resource is already allocated by the maximum number of clients possible.
MMSYSERR_BADDEVICEID
The uMxId parameter specifies an invalid device identifier.
MMSYSERR_INVALFLAG
One or more flags are invalid.
MMSYSERR_INVALHANDLE
The uMxId parameter specifies an invalid handle.
MMSYSERR_INVALPARAM
One or more parameters are invalid.
MMSYSERR_NODRIVER
No mixer device is available for the object specified by uMxId. Note that the location referenced by uMxId will also contain the value pics/MMEDIA00090000.gif 1.
MMSYSERR_NOMEM
Unable to allocate resources.

Remarks

Use the mixerGetNumDevs function to determine the number of audio mixer devices present in the system. The device identifier specified by uMxId varies from zero to one less than the number of devices present.

If a window is chosen to receive callback information, the MM_MIXM_LINE_CHANGE and MM_MIXM_CONTROL_CHANGE messages are sent to the window procedure function to indicate when an audio line or control state changes. For both messages, the wParam parameter is the handle of the mixer device. The lParam parameter is the line identifier for MM_MIXM_LINE_CHANGE or the control identifier for MM_MIXM_CONTROL_CHANGE that changed state.

To query for audio mixer support or a media device, use the mixerGetID function.

See Also

mixerGetID
, auxGetNumDevs, midiInOpen, midiOutOpen, waveInOpen, waveOutOpen, midiInGetNumDevs, midiOutGetNumDevs, mixerGetNumDevs, waveInGetNumDevs, waveOutGetNumDevs, MM_MIXM_LINE_CHANGE, MM_MIXM_CONTROL_CHANGE


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