Mixer Class |
Namespace: Alvas.Audio
The Mixer type exposes the following members.
Name | Description | |
---|---|---|
CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) | |
Dispose | Releases all resources used by the Component. (Inherited from Component.) | |
Equals | (Inherited from Object.) | |
GetDestination |
Gets the destination line.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
GetMixerName |
Gets the name of the mixer by index.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
ToString | Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.) |
Name | Description | |
---|---|---|
Container | Gets the IContainer that contains the Component. (Inherited from Component.) | |
MixerCount |
Gets mixer quantity.
| |
MixerID |
Gets the mixer ID.
| |
MixerName |
Gets the name of the mixer.
| |
MixerNo |
Gets or sets the current mixer number.
| |
Site | (Inherited from Component.) |
Name | Description | |
---|---|---|
ControlChange |
ControlChange event
| |
Disposed | Occurs when the component is disposed by a call to the Dispose method. (Inherited from Component.) |
public static void TestMixer() { PlayerEx plex = new PlayerEx(); int playerMixerNo = plex.GetMixerNo(); bool isMute = GetPlayerMute(playerMixerNo); SetPlayerMute(playerMixerNo, !isMute); RecorderEx rex = new RecorderEx(); SetRecorderVolumeMax(rex.GetMixerNo()); } private static void SetRecorderVolumeMax(int recorderMixerNo) { Mixer mx = new Mixer(); mx.MixerNo = recorderMixerNo; DestinationLine dl = mx.GetDestination(Mixer.Recording); if (dl != null) { foreach (MixerControl mc in dl.Controls) { if (mc is MixerIntControl) { MixerIntControl mic = mc as MixerIntControl; mic.Value = mic.Maximum; break; } else if (mc is MixerListControl) { MixerListControl mlc = dl.Controls[0] as MixerListControl; MixerLine ml = mlc.Lines[mlc.Value]; foreach (MixerControl ctrl in ml.Controls) { if (ctrl is MixerIntControl) { MixerIntControl mic = ctrl as MixerIntControl; mic.Value = mic.Maximum; break; } } } } } } private static bool GetPlayerMute(int playerMixerNo) { Mixer mx = new Mixer(); mx.MixerNo = playerMixerNo; DestinationLine dl = mx.GetDestination(Mixer.Playback); if (dl != null) { foreach (MixerControl ctrl in dl.Controls) { if (ctrl is MixerMuteControl) { return ((MixerMuteControl)ctrl).Value != 0; } } } return false; } private static void SetPlayerMute(int playerMixerNo, bool value) { Mixer mx = new Mixer(); mx.MixerNo = playerMixerNo; DestinationLine dl = mx.GetDestination(Mixer.Playback); if (dl != null) { foreach (MixerControl ctrl in dl.Controls) { if (ctrl is MixerMuteControl) { ((MixerMuteControl)ctrl).Value = (value) ? 1 : 0; break; } } } }