Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Win/Windows Audio Mixer
Function:
Required plugins for this example: MBS Audio Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Win/Windows Audio Mixer
This example is the version from Sun, 17th Mar 2012.
Project "Windows Audio Mixer.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "Quit"
Const kFileQuitShortcut = ""
End Class
Class wndMain Inherits Window
Control lstMain Inherits Listbox
ControlInstance lstMain Inherits Listbox
EventHandler Sub CellAction(row As Integer, column As Integer) Dim xAudio As New WindowsAudioMixerMBS Select Case me.Cell(row,0) Case "DestinationDigitalMute" xAudio.DestinationDigitalMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationDigitalVolume" xAudio.DestinationDigitalVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationHeadPhonesMute" xAudio.DestinationHeadPhonesMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationHeadPhonesVolume" xAudio.DestinationHeadPhonesVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationLineMute" xAudio.DestinationLineMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationLineVolume" xAudio.DestinationLineVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationMonitorMute" xAudio.DestinationMonitorMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationMonitorVolume" xAudio.DestinationMonitorVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationSpeakersMute" xAudio.DestinationSpeakersMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationSpeakersVolume" xAudio.DestinationSpeakersVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationTelephoneMute" xAudio.DestinationTelephoneMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationTelephoneVolume" xAudio.DestinationTelephoneVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationVoiceInMute" xAudio.DestinationVoiceInMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationVoiceInVolume" xAudio.DestinationVoiceInVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationWaveInMute" xAudio.DestinationWaveInMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "DestinationWaveInVolume" xAudio.DestinationWaveInVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceAnalogMute" xAudio.SourceAnalogMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceAnalogVolume" xAudio.SourceAnalogVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceAuxiliaryMute" xAudio.SourceAuxiliaryMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceAuxiliaryVolume" xAudio.SourceAuxiliaryVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceCompactDiscMute" xAudio.SourceCompactDiscMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceCompactDiscVolume" xAudio.SourceCompactDiscVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceDigitalMute" xAudio.SourceDigitalMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceDigitalVolume" xAudio.SourceDigitalVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceLineMute" xAudio.SourceLineMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceLineVolume" xAudio.SourceLineVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceMicrophoneMute" xAudio.SourceMicrophoneMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceMicrophoneVolume" xAudio.SourceMicrophoneVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourcePCSpeakerMute" xAudio.SourcePCSpeakerMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourcePCSpeakerVolume" xAudio.SourcePCSpeakerVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceSynthesizerMute" xAudio.SourceSynthesizerMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceSynthesizerVolume" xAudio.SourceSynthesizerVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceTelephoneMute" xAudio.SourceTelephoneMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceTelephoneVolume" xAudio.SourceTelephoneVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceWaveOutMute" xAudio.SourceWaveOutMute = lstMain.CellCheck(row,1) lstMain.Cell(row,2) = Str(xAudio.LastError) Case "SourceWaveOutVolume" xAudio.SourceWaveOutVolume = Val(me.Cell(row,1)) lstMain.Cell(row,2) = Str(xAudio.LastError) End Select End EventHandler
End Control
EventHandler Sub Open() Dim xAudio As New WindowsAudioMixerMBS lstMain.AddRow("DestinationDigitalMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.DestinationDigitalMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationDigitalVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.DestinationDigitalVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationHeadPhonesMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.DestinationHeadPhonesMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationHeadPhonesVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.DestinationHeadPhonesVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationLineMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.DestinationLineMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationLineVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.DestinationLineVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationMonitorMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.DestinationMonitorMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationMonitorVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.DestinationMonitorVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationSpeakersMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.DestinationSpeakersMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationSpeakersVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.DestinationSpeakersVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationTelephoneMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.DestinationTelephoneMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationTelephoneVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.DestinationTelephoneVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationVoiceInMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.DestinationVoiceInMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationVoiceInVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.DestinationVoiceInVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationWaveInMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.DestinationWaveInMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("DestinationWaveInVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.DestinationWaveInVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceAnalogMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourceAnalogMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceAnalogVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourceAnalogVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceAuxiliaryMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourceAuxiliaryMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceAuxiliaryVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourceAuxiliaryVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceCompactDiscMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourceCompactDiscMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceCompactDiscVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourceCompactDiscVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceDigitalMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourceDigitalMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceDigitalVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourceDigitalVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceLineMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourceLineMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceLineVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourceLineVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceMicrophoneMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourceMicrophoneMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceMicrophoneVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourceMicrophoneVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourcePCSpeakerMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourcePCSpeakerMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourcePCSpeakerVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourcePCSpeakerVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceSynthesizerMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourceSynthesizerMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceSynthesizerVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourceSynthesizerVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceTelephoneMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourceTelephoneMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceTelephoneVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourceTelephoneVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceWaveOutMute") lstMain.CellType(lstMain.LastIndex,1) = 2 lstMain.CellCheck(lstMain.LastIndex,1) = (xAudio.SourceWaveOutMute) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) lstMain.AddRow("SourceWaveOutVolume") lstMain.CellType(lstMain.LastIndex,1) = 3 lstMain.Cell(lstMain.LastIndex,1) = Str(xAudio.SourceWaveOutVolume) lstMain.Cell(lstMain.LastIndex,2) = Str(xAudio.LastError) End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Win Plugin.




Links
MBS Xojo PDF Plugins