From: g0dil Date: Fri, 19 Oct 2007 14:10:57 +0000 (+0000) Subject: Audio/AudioControl: Allow muting mixer channels from config.py X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=97b83b23e43e16f98cc8e2f9d1ac3f55d0de580c;p=audiocontrol.git Audio/AudioControl: Allow muting mixer channels from config.py Emacs/cc-ide: Fix template specialization support Emacs/cc-ide: Add missing .ih include to .cci file Shell: Add latex2png tool with alpha-transparency support. --- diff --git a/Mixer.py b/Mixer.py index 264184d..4ef57fe 100644 --- a/Mixer.py +++ b/Mixer.py @@ -52,19 +52,32 @@ class Mixer(Views.View): # channel_count self._channels = int(data[0]) self._volume = [ None ] * self._channels + premutes = None + if self._muteState is not None: + premutes = self._muteState self._muteState = [ self.ACTIVE ] * self._channels + if premutes: + for i in range(len(self._muteState)): + if i < len(premutes): + self._muteState[i] = premutes[i] while len(self._channelNames) < self._channels: self._channelNames.append("Channel %d" % (len(self._channelNames)+1)) self._redraw() for i in range(self._channels): - self._get(i+1) + self._set(i+1, 0.0) return [] def mute(self, channel): - if self._muteState[channel-1] == self.ACTIVE: + if self._channels is None: + if self._muteState is None: + self._muteState = [] + while(len(self._muteState) < channel) : self._muteState.append( self.ACTIVE ) self._muteState[channel-1] = self.PENDING - self._get(channel) + else: + if self._muteState[channel-1] == self.ACTIVE: + self._muteState[channel-1] = self.PENDING + self._get(channel) def unmute(self, channel): if self._muteState[channel-1] != self.ACTIVE: diff --git a/config.py b/config.py index 3ec155c..93d5654 100644 --- a/config.py +++ b/config.py @@ -168,14 +168,14 @@ if ctl is not None: Action.register( Looper.AssignController( 'looper_parm_rate', looper, ctl, 'Rate', 'rate', 0.5, 2.0, steps ) ) - looper_param_map.add( Binding( Event('jb0',5), 'Feedb', Action['looper_parm_feedback'] ) ) - looper_param_map.add( Binding( Event('jb0',6), 'Dry', Action['looper_parm_dry'] ) ) - looper_param_map.add( Binding( Event('jb0',7), 'Wet', Action['looper_parm_wet'] ) ) - looper_param_map.add( Binding( Event('jb0',8), 'Gain', Action['looper_parm_igain'] ) ) - looper_param_map.add( Binding( Event('jb0',9), 'Rec T', Action['looper_parm_rec_thresh'] ) ) - looper_param_map.add( Binding( Event('jb0',12), '', Actions.Nop() ) ) - looper_param_map.add( Binding( Event('jb0',13), 'Rev', Action['looper_reverse'] ) ) - looper_param_map.add( Binding( Event('jb0',14), 'Rate', Action['looper_parm_rate'] ) ) + looper_param_map.add( Binding( Event('jb0',5), '(Feedb)', Action['looper_parm_feedback'] ) ) + looper_param_map.add( Binding( Event('jb0',6), '(Dry)', Action['looper_parm_dry'] ) ) + looper_param_map.add( Binding( Event('jb0',7), '(Wet)', Action['looper_parm_wet'] ) ) + looper_param_map.add( Binding( Event('jb0',8), '(Gain)', Action['looper_parm_igain'] ) ) + looper_param_map.add( Binding( Event('jb0',9), '(Rec T)', Action['looper_parm_rec_thresh'] ) ) + looper_param_map.add( Binding( Event('jb0',12), '', Actions.Nop() ) ) + looper_param_map.add( Binding( Event('jb0',13), 'Rev', Action['looper_reverse'] ) ) + looper_param_map.add( Binding( Event('jb0',14), '(Rate)', Action['looper_parm_rate'] ) ) looper_param_map.add( Binding( Event('jb0',11), '[Main]', Action['unset_this_map'] ) ) @@ -222,33 +222,31 @@ gain = Mixer.register( remote = ('127.0.0.1', 9902), ) -Action.register( Mixer.AssignController( 'mixer_guitar_level', mixer, ctl, 'Guitar', 1 ) ) -Action.register( Mixer.ToggleMuteChannel( 'mixer_mute_guitar', mixer, 1 ) ) -Action.register( Mixer.AssignController( 'mixer_voice_level', mixer, ctl, 'Voice', 2 ) ) -Action.register( Mixer.ToggleMuteChannel( 'mixer_mute_voice', mixer, 2 ) ) -Action.register( Mixer.AssignController( 'mixer_master_level', mixer, ctl, 'Master', 0 ) ) -Action.register( Mixer.ToggleMuteAll( 'mixer_mute_all', mixer ) ) -Action.register( Mixer.CycleVolume( 'mixer_cycle_gain', gain, 1, ( 0.0, 2.0, 4.0 ) ) ) - -mixer_map.add( Binding( Event('jb0',0), 'Rec', Action['looper_record'] ) ) -mixer_map.add( Binding( Event('jb0',1), 'Over', Action['looper_overdub'] ) ) -mixer_map.add( Binding( Event('jb0',2), 'Mult', Action['looper_multiply'] ) ) -mixer_map.add( Binding( Event('jb0',3), 'Undo', Action['looper_undo'] ) ) -mixer_map.add( Binding( Event('jb0',4), 'Redo', Action['looper_redo'] ) ) -mixer_map.add( Binding( Event('jb0',5), 'Un All', Action['looper_undo_all'] ) ) - -mixer_map.add( Binding( Event('jb0',6), 'Lead', Action['mixer_cycle_gain'] ) ) -mixer_map.add( Binding( Event('jb0',7), 'Mute G', Action['mixer_mute_guitar'] ) ) -mixer_map.add( Binding( Event('jb0',8), 'Mute V', Action['mixer_mute_voice'] ) ) -mixer_map.add( Binding( Event('jb0',9), 'Mute', Action['mixer_mute_all'] ) ) - -mixer_map.add( Binding( Event('jb0',13), 'Vol G', Action['mixer_guitar_level'] ) ) -mixer_map.add( Binding( Event('jb0',14), 'Vol V', Action['mixer_voice_level'] ) ) - -mixer.set(1,0.0) -mixer.set(2,0.0) +Action.register( Mixer.AssignController ( 'mixer_guitar_level', mixer, ctl, 'Guitar', 1 ) ) +Action.register( Mixer.ToggleMuteChannel ( 'mixer_mute_guitar', mixer, 1 ) ) +Action.register( Mixer.AssignController ( 'mixer_voice_level', mixer, ctl, 'Voice', 2 ) ) +Action.register( Mixer.ToggleMuteChannel ( 'mixer_mute_voice', mixer, 2 ) ) +Action.register( Mixer.AssignController ( 'mixer_master_level', mixer, ctl, 'Master', 0 ) ) +Action.register( Mixer.ToggleMuteAll ( 'mixer_mute_all', mixer ) ) +Action.register( Mixer.CycleVolume ( 'mixer_cycle_gain', gain, 1, ( 0.0, 2.0, 4.0 ) ) ) + +mixer_map.add( Binding( Event('jb0',0), 'Rec', Action['looper_record'] ) ) +mixer_map.add( Binding( Event('jb0',1), 'Over', Action['looper_overdub'] ) ) +mixer_map.add( Binding( Event('jb0',2), 'Mult', Action['looper_multiply'] ) ) +mixer_map.add( Binding( Event('jb0',3), 'Undo', Action['looper_undo'] ) ) +mixer_map.add( Binding( Event('jb0',4), 'Redo', Action['looper_redo'] ) ) +mixer_map.add( Binding( Event('jb0',5), 'Un All', Action['looper_undo_all'] ) ) + +mixer_map.add( Binding( Event('jb0',6), 'Lead', Action['mixer_cycle_gain'] ) ) +mixer_map.add( Binding( Event('jb0',7), 'Mute G', Action['mixer_mute_guitar'] ) ) +mixer_map.add( Binding( Event('jb0',8), 'Mute V', Action['mixer_mute_voice'] ) ) +mixer_map.add( Binding( Event('jb0',9), 'Mute', Action['mixer_mute_all'] ) ) + +mixer_map.add( Binding( Event('jb0',13), '(Vol G)', Action['mixer_guitar_level'] ) ) +mixer_map.add( Binding( Event('jb0',14), '(Vol V)', Action['mixer_voice_level'] ) ) + +mixer.mute(2) mixer.assignController( ctl, 'Guitar', 1 ) -gain.set(1,0.0) ########################################################################### diff --git a/start.sh b/start.sh index 6adb08b..c5c68a5 100755 --- a/start.sh +++ b/start.sh @@ -1,6 +1,7 @@ #!/bin/sh cd "`dirname "$0"`" +base="`pwd`" displaysize="`xdpyinfo | awk '/^ dimensions:/{print $2}'`" displaywidth="${displaysize%x*}" @@ -25,7 +26,7 @@ move() { winid=`xwininfo -name "$name" | awk '/^xwininfo:/{print $4}'` [ -n "$winid" ] || sleep 1 done - ./winmove $winid $x $y $w $h + $base/winmove $winid $x $y $w $h } start() { @@ -73,12 +74,14 @@ start 582 25 794 220 "SooperLooper" \ slgui cd .. +cd conf # start 0 153 496 600 "JACK Rack (voice) - voice.rack" \ start 0 153 496 972 "JACK Rack (voice) - voice.rack" \ jack-rack -c 1 -s voice voice.rack # start 0 781 496 344 "JACK Rack (guitar) - guitar.rack" \ # jack-rack -c 1 -s guitar guitar.rack +cd .. start 502 25 74 210 "dpm meter" \ meterbridge -r 0 -t dpm -n meter alsa_pcm:capture_1 jack_rack_voice:out_1 @@ -109,7 +112,7 @@ jack_connect minimixer:out_right alsa_pcm:playback_2 x=`expr $offset + 502` xterm -fn '-dejavu-dejavu sans mono-medium-r-normal--*-260-75-75-m-0-iso10646-1' \ -bg black -fg white -cr white -geometry 88x22+${x}+273 +sb \ - -title "Audio Controller" # -e /bin/sh -c "while ./audiocontroller; do true; done" + -title "Audio Controller" -e /bin/sh -c "while ./audiocontroller; do true; done" kill $clients 2>/dev/null killall jackd 2>/dev/null