olaf
Joined: 20 Apr 2005 Posts: 25
|
Posted: Sat May 07, 2005 5:23 pm Post subject: Madplay Mixer SoundOsCheck |
|
|
Although it's simple to have a bat file with
X:\path\to\MADPLAY.EXE -v %1
CLS
and then create a shortcut to the bat file in which mp3s can be dropped on,
I wanted a madplay http://members.home.nl/w.speek/mad_frontend.htm
with a volume.
Note: I just noticed the -v currently stuck on.
Madplay.ahk
| Code: |
madpath = X:\path\to\madplay.exe
SoundGet, master_volume, MASTER, Volume
SoundGet, wave_volume, WAVE, Volume
SoundGet, master_bass, MASTER, BASS
SoundGet, master_treble, MASTER, TREBLE
SoundGet, master_mute, MASTER, MUTE
if master_mute = ON
master_mute_status =1
else
master_mute_status =0
SoundGet, wave_mute, WAVE, MUTE
if wave_mute = ON
wave_mute_status =1
else
wave_mute_status =0
Gui, Add, Text, ym, Volume
Gui, Add, Slider, Center Thick25 Vertical Invert Range0-100 TickInterval25 ToolTipRight h300 vMasterVolSlider gMasterVol AltSubmit, %master_volume%
Gui, Add, Checkbox, x+-30 y+5 vMasterMuteCheckbox gMasterMuteCheck Checked%master_mute_status%, Mute
Gui, Add, Text, ym, %A_Space%Wave
Gui, Add, Slider, Center Thick25 Vertical Invert Range0-100 TickInterval25 ToolTipRight h300 vWaveVolSlider gWaveVol AltSubmit, %wave_volume%
Gui, Add, Checkbox, x+-30 y+5 vWaveMuteCheckbox gWaveMuteCheck Checked%wave_mute_status%, Mute
Gui, Add, Text, ym y100, Bass
Gui, Add, Slider, Center Thick25 Range0-100 TickInterval20 ToolTipRight w150 vMasterBassSlider gMasterBass AltSubmit, %master_bass%
Gui, Add, Text,, Treble
Gui, Add, Slider, Center Thick25 Range0-100 TickInterval20 ToolTipRight w150 vMasterTrebleSlider gMasterTreble AltSubmit, %master_treble%
Gui, Add, Checkbox, x+-130 y+30 vmadverbose Checked, -&v
Gui, Add, Button, x+10 y+-20 w60 h30 Default, &Play
Gui, Add, Button, x+-50 y+20, &Quit
Gui, Show, h360, Madplay
Return
ButtonPlay:
Gui, Submit, NoHide
Exec = %madpath%
if (madverbose)
Exec = %Exec% -v
FileSelectFile, in1,,,"Choose From file",(*.*)
if ErrorLevel <> 0
return
Run, %Exec% %madverbose1% %in1%
Return
MasterVol:
SoundSet, MasterVolSlider, MASTER, Volume
return
WaveVol:
SoundSet, WaveVolSlider, WAVE, Volume
return
MasterBass:
SoundSet, MasterBassSlider, MASTER, BASS
return
MasterTreble:
SoundSet, MasterTrebleSlider, MASTER, TREBLE
return
MasterMuteCheck:
Gui, Submit, NOHIDE
SoundSet, MasterMuteCheckbox, MASTER, MUTE
return
WaveMuteCheck:
Gui, Submit, NOHIDE
SoundSet, WaveMuteCheckbox, WAVE, MUTE
return
ButtonQuit:
Gui, Destroy
GuiClose:
GuiEscape:
ExitApp
|
For no other reason than to learn how to use the sound settings.
This may not be complete for your soundcard.
Use at your own risk.
A lot of the errorlevel checking can be removed once you know
that control works.
Note: The Synth Mute error checking is commented, since it did not
work for me. To try it, uncommented the two error level lines in the
Mute SoundGet section AND remove "Disabled" from it's Checkbox.
Mixerahk.ahk
| Code: |
Gui, +Resize
; Volume
SoundGet, master_volume, MASTER, Volume
if ErrorLevel <> 0
MsgBox, Error Description: Master Volume`n%ErrorLevel%
SoundGet, wave_volume, WAVE, Volume
if ErrorLevel <> 0
MsgBox, Error Description: Wave Volume`n%ErrorLevel%
SoundGet, synth_volume, SYNTH, Volume
if ErrorLevel <> 0
MsgBox, Error Description: Synth Volume`n%ErrorLevel%
SoundGet, CD_volume, CD, Volume
if ErrorLevel <> 0
MsgBox, Error Description: CD Volume`n%ErrorLevel%
SoundGet, line_volume, LINE, Volume
if ErrorLevel <> 0
MsgBox, Error Description: Line Volume`n%ErrorLevel%
SoundGet, microphone_volume, MICROPHONE, Volume
if ErrorLevel <> 0
MsgBox, Error Description: Microphone Volume`n%ErrorLevel%
SoundGet, pcspeaker_volume, PCSPEAKER, Volume
if ErrorLevel <> 0
MsgBox, Error Description: PC Speaker`n%ErrorLevel%
; Mute
SoundGet, master_mute, MASTER, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: Master MUTE`n%ErrorLevel%
if master_mute = ON
master_mute_status =1
else
master_mute_status =0
SoundGet, wave_mute, WAVE, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: WAVE MUTE`n%ErrorLevel%
if wave_mute = ON
wave_mute_status =1
else
wave_mute_status =0
SoundGet, synth_mute, SYNTH, MUTE
;if ErrorLevel <> 0
; MsgBox, Error Description: Synth MUTE`n%ErrorLevel%
if synth_mute = ON
synth_mute_status =1
else
synth_mute_status =0
SoundGet, cd_mute, CD, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: CD MUTE`n%ErrorLevel%
if cd_mute = ON
cd_mute_status =1
else
cd_mute_status =0
SoundGet, line_mute, LINE, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: LINE MUTE`n%ErrorLevel%
if line_mute = ON
line_mute_status =1
else
line_mute_status =0
SoundGet, microphone_mute, MICROPHONE, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: Microphone MUTE`n%ErrorLevel%
if microphone_mute = ON
microphone_mute_status =1
else
microphone_mute_status =0
SoundGet, pcspeaker_mute, PCSPEAKER, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: %ErrorLevel%
if pcspeaker_mute = ON
pcspeaker_mute_status =1
else
pcspeaker_mute_status =0
; Extra
SoundGet, master_bass, MASTER, BASS
if ErrorLevel <> 0
MsgBox, Error Description: Bass Volume`n%ErrorLevel%
SoundGet, master_treble, MASTER, TREBLE
if ErrorLevel <> 0
MsgBox, Error Description: TREBLE VOLUME`n%ErrorLevel%
/* Not Working
SoundGet, master_pan, MASTER, PAN
if ErrorLevel <> 0
MsgBox, Error Description: Master PAN`n%ErrorLevel%
SoundGet, analog_mute, ANALOG, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: ANALOG MUTE`n%ErrorLevel%
if analog_mute = ON
analog_mute_status =1
else
analog_mute_status =0
*/
; Buddy1var Buddy2var
Gui, Add, Text, ym, Volume
Gui, Add, Slider, Center Thick25 Vertical Invert Range0-100 TickInterval25 ToolTipRight h300 vMasterVolSlider gMasterVol AltSubmit, %master_volume%
Gui, Add, Checkbox, x+-30 y+5 vMasterMuteCheckbox gMasterMuteCheck Checked%master_mute_status%, Mute
Gui, Add, Text, ym, %A_Space%Wave
Gui, Add, Slider, Center Thick25 Vertical Invert Range0-100 TickInterval25 ToolTipRight h300 vWaveVolSlider gWaveVol AltSubmit, %wave_volume%
Gui, Add, Checkbox, x+-30 y+5 vWaveMuteCheckbox gWaveMuteCheck Checked%wave_mute_status%, Mute
Gui, Add, Text, ym, %A_Space%%A_Space%Midi
Gui, Add, Slider, Center Thick25 Vertical Invert Range0-100 TickInterval25 ToolTipRight h300 vSynthVolSlider gSynthVol AltSubmit, %synth_volume%
Gui, Add, Checkbox, x+-30 y+5 vSynthMuteCheckbox gSynthMuteCheck Checked%synth_mute_status% Disabled, Mute
Gui, Add, Text, ym, CD
Gui, Add, Slider, Center Thick25 Vertical Invert Range0-100 TickInterval25 ToolTipRight h300 vCDVolSlider gCDVol AltSubmit, %CD_volume%
Gui, Add, Checkbox, x+-30 y+5 vCDMuteCheckbox gCDMuteCheck Checked%cd_mute_status%, Mute
Gui, Add, Text, ym, Line-In
Gui, Add, Slider, Center Thick25 Vertical Invert Range0-100 TickInterval25 ToolTipRight h300 vLineVolSlider gLineVol AltSubmit, %line_volume%
Gui, Add, Checkbox, x+-30 y+5 vLineMuteCheckbox gLineMuteCheck Checked%line_mute_status%, Mute
Gui, Add, Text, ym, Mic
Gui, Add, Slider, Center Thick25 Vertical Invert Range0-100 TickInterval25 ToolTipRight h300 vMicrophoneVolSlider gMicrophoneVol AltSubmit, %microphone_volume%
Gui, Add, Checkbox, x+-30 y+5 vMicrophoneMuteCheckbox gMicrophoneMuteCheck Checked%microphone_mute_status%, Mute
Gui, Add, Text, ym, PCSpeaker
Gui, Add, Slider, Center Thick25 Vertical Invert Range0-100 TickInterval25 ToolTipRight Buddy2pcspeaker_mute h300 vPCSpeakerVolSlider gPCSpeakerVol AltSubmit, %pcspeaker_volume%
Gui, Add, Checkbox, x+-30 y+5 vPCSpeakerMuteCheckbox gPCSpeakerMuteCheck Checked%pcspeaker_mute_status%, Mute
; Extra
Gui, Add, Text, ym y100, Bass
Gui, Add, Slider, Center Thick25 Range0-100 TickInterval20 ToolTipRight w150 vMasterBassSlider gMasterBass AltSubmit, %master_bass%
Gui, Add, Text,, Treble
Gui, Add, Slider, Center Thick25 Range0-100 TickInterval20 ToolTipRight w150 vMasterTrebleSlider gMasterTreble AltSubmit, %master_treble%
Gui, Show, h400, MixerAhk
Return
; Volume
; SoundSet, NewSetting [, ComponentType, ControlType, DeviceNumber]
MasterVol:
SoundSet, MasterVolSlider, MASTER, Volume
return
WaveVol:
SoundSet, WaveVolSlider, WAVE, Volume
return
SynthVol:
SoundSet, SynthVolSlider, SYNTH, Volume
return
CDVol:
SoundSet, CDVolSlider, CD, Volume
return
LineVol:
SoundSet, LineVolSlider, LINE, Volume
return
MicrophoneVol:
SoundSet, MicrophoneVolSlider, MICROPHONE, Volume
return
PCSpeakerVol:
SoundSet, PCSpeakerVolSlider, PCSPEAKER, Volume
return
; Mute
MasterMuteCheck:
Gui, Submit, NOHIDE
SoundSet, MasterMuteCheckbox, MASTER, MUTE
return
WaveMuteCheck:
Gui, Submit, NOHIDE
SoundSet, WaveMuteCheckbox, WAVE, MUTE
return
SynthMuteCheck:
Gui, Submit, NOHIDE
SoundSet, SynthMuteCheckbox, SYNTH, MUTE
return
CDMuteCheck:
Gui, Submit, NOHIDE
SoundSet, CDMuteCheckbox, CD, MUTE
return
LineMuteCheck:
Gui, Submit, NOHIDE
SoundSet, LineMuteCheckbox, LINE, MUTE
return
MicrophoneMuteCheck:
Gui, Submit, NOHIDE
SoundSet, MicrophoneMuteCheckbox, MICROPHONE, MUTE
return
PCSpeakerMuteCheck:
Gui, Submit, NOHIDE
SoundSet, PCSpeakerMuteCheckbox, PCSPEAKER, MUTE
return
; Extra
MasterBass:
SoundSet, MasterBassSlider, MASTER, BASS
return
MasterTreble:
SoundSet, MasterTrebleSlider, MASTER, TREBLE
return
GuiClose:
GuiEscape:
ExitApp
|
Expanded from the example in the AutoHotKey help file.
This also may not be complete for your card.
SoundOsCheck.ahk
| Code: |
; Mute
SoundGet, master_mute, MASTER, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: Master MUTE`n%ErrorLevel%
else
MsgBox, Master Mute is currently %master_mute%.`nThe Wave Mute is currently
SoundGet, wave_mute, WAVE, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: WAVE MUTE`n%ErrorLevel%
else
MsgBox, The Wave Mute is currently %wave_mute%.
SoundGet, synth_mute, SYNTH, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: Synth MUTE`n%ErrorLevel%
else
MsgBox, The Synth Mute is %synth_mute%.
SoundGet, cd_mute, CD, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: CD MUTE`n%ErrorLevel%
else
MsgBox, The CD Mute is %cd_mute%.
SoundGet, line_mute, LINE, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: LINE MUTE`n%ErrorLevel%
else
MsgBox, The Line Mute is %line_mute%.
SoundGet, microphone_mute, MICROPHONE, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: Microphone MUTE`n%ErrorLevel%
else if microphone_mute = Off
MsgBox, The microphone is not muted. Microphone MUTE is %microphone_mute%
else
Msgbox, The microphne is muted. Microphone MUTE is %microphone_mute%
SoundGet, pcspeaker_mute, PCSPEAKER, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: %ErrorLevel%
else
MsgBox, The PC Speaker Mute is %pcspeaker_mute%.
; Volume
; Default
SoundGet, master_volume, MASTER, Volume
if ErrorLevel <> 0
MsgBox, Error Description: Master Volume`n%ErrorLevel%
else
MsgBox, Master volume is %master_volume% percent.
SoundGet, wave_volume, WAVE, VOL
if ErrorLevel <> 0
MsgBox, Error Description: Wave Volume`n%ErrorLevel%
else
MsgBox, The Wave Volume is %wave_volume% percent.
SoundGet, synth_volume, SYNTH, VOL
if ErrorLevel <> 0
MsgBox, Error Description: Synth Volume`n%ErrorLevel%
else
MsgBox, The Synth Volume is %synth_volume% percent.
SoundGet, cd_volume, CD, VOL
if ErrorLevel <> 0
MsgBox, Error Description: CD Volume`n%ErrorLevel%
else
MsgBox, The CD Volume is %cd_volume% percent.
SoundGet, line_volume, LINE, VOL
if ErrorLevel <> 0
MsgBox, Error Description: Line Volume`n%ErrorLevel%
else
MsgBox, The Line Volume is %line_volume% percent.
SoundGet, microphone_volume, MICROPHONE, Volume
if ErrorLevel <> 0
MsgBox, Error Description: Microphone Volume`n%ErrorLevel%
else
MsgBox, The Microphone Volume is %microphone_volume% percent.
SoundGet, pcspeaker_volume, PCSPEAKER, VOL
if ErrorLevel <> 0
MsgBox, Error Description: PC Speaker`Volume`n%ErrorLevel%
else
MsgBox, The PC Speaker Volume is %pcspeaker_volume% percent.
; Extra
SoundGet, master_bass, MASTER, BASS
if ErrorLevel <> 0
MsgBox, Error Description: Master Bass`n%ErrorLevel%
else
MsgBox, The MASTER Bass level is %master_bass% percent.
SoundGet, master_treble, MASTER, TREBLE
if ErrorLevel <> 0
MsgBox, Error Description: Master Treble`n%ErrorLevel%
else
MsgBox, The MASTER Treble is %master_treble% percent.
;/* May not work. Uncomment the section comments to comment.
SoundGet, master_pan, MASTER, PAN
if ErrorLevel <> 0
MsgBox, Error Description: Master PAN`n%ErrorLevel%
else
MsgBox, The Master Pan is %master_pan% percent.
SoundGet, microphone_pan, MICROPHONE, PAN
if ErrorLevel <> 0
MsgBox, Error Description: Microphone PAN`n%ErrorLevel%
else
MsgBox, The Microphone Pan is %microphone_var% percent.
SoundGet, analog_mute, ANALOG, MUTE
if ErrorLevel <> 0
MsgBox, Error Description: ANALOG MUTE`n%ErrorLevel%
else
MsgBox, The Analog Mute is currently %analog_mute%.
;*/
|
Comments or suggestions are welcome.
Can the ToolTip for a Slider be inverted?
olaf _________________ Berserker |
|