C# Class VideoPlayerController.AudioManager

Controls audio using the Windows CoreAudio API from: http://stackoverflow.com/questions/14306048/controling-volume-mixer and: http://netcoreaudio.codeplex.com/
ファイルを表示 Open project: sverrirs/XboxBigButton

Public Methods

Method Description
GetApplicationMute ( int pid ) : bool?
GetApplicationVolume ( int pid ) : float?
GetMasterVolume ( ) : float

Gets the current master volume in scalar values (percentage)

GetMasterVolumeMute ( ) : bool

Gets the mute state of the master volume. While the volume can be muted the GetMasterVolume will still return the pre-muted volume value.

SetApplicationMute ( int pid, bool mute ) : void
SetApplicationVolume ( int pid, float level ) : void
SetMasterVolume ( float newLevel ) : void

Sets the master volume to a specific level

SetMasterVolumeMute ( bool isMuted ) : void

Mute or unmute the master volume

StepMasterVolume ( float stepAmount ) : float

Increments or decrements the current volume level by the stepAmount.

ToggleMasterVolumeMute ( ) : bool

Switches between the master volume mute states depending on the current state

Private Methods

Method Description
GetMasterVolumeObject ( ) : IAudioEndpointVolume
GetVolumeObject ( int pid ) : ISimpleAudioVolume

Method Details

GetApplicationMute() public static method

public static GetApplicationMute ( int pid ) : bool?
pid int
return bool?

GetApplicationVolume() public static method

public static GetApplicationVolume ( int pid ) : float?
pid int
return float?

GetMasterVolume() public static method

Gets the current master volume in scalar values (percentage)
public static GetMasterVolume ( ) : float
return float

GetMasterVolumeMute() public static method

Gets the mute state of the master volume. While the volume can be muted the GetMasterVolume will still return the pre-muted volume value.
public static GetMasterVolumeMute ( ) : bool
return bool

SetApplicationMute() public static method

public static SetApplicationMute ( int pid, bool mute ) : void
pid int
mute bool
return void

SetApplicationVolume() public static method

public static SetApplicationVolume ( int pid, float level ) : void
pid int
level float
return void

SetMasterVolume() public static method

Sets the master volume to a specific level
public static SetMasterVolume ( float newLevel ) : void
newLevel float Value between 0 and 100 indicating the desired scalar value of the volume
return void

SetMasterVolumeMute() public static method

Mute or unmute the master volume
public static SetMasterVolumeMute ( bool isMuted ) : void
isMuted bool true to mute the master volume, false to unmute
return void

StepMasterVolume() public static method

Increments or decrements the current volume level by the stepAmount.
public static StepMasterVolume ( float stepAmount ) : float
stepAmount float Value between -100 and 100 indicating the desired step amount. Use negative numbers to decrease /// the volume and positive numbers to increase it.
return float

ToggleMasterVolumeMute() public static method

Switches between the master volume mute states depending on the current state
public static ToggleMasterVolumeMute ( ) : bool
return bool