[jokosher-devel] [PATCH] Fixed solo button behaviour



Hello again,

I noticed that if you have soloed an instrument, when you press the solo button of another instrument, the previous instrument
will still have solo status. The intuitive behavior is that if another instrument gets solo status, the solo status for the original instrument will be disabled.
I've added code so that when the solo button is pressed, any other instruments with solo status are "unsoloed".

Regards,
Knut Erik Teigen
Index: Jokosher/InstrumentViewer.py
===================================================================
--- Jokosher/InstrumentViewer.py	(revision 1417)
+++ Jokosher/InstrumentViewer.py	(working copy)
@@ -233,9 +233,14 @@
 	def OnSolo(self, widget):
 		"""
 		Toggles soloing the instrument on/off.
-		It will also update the pressed in/out look of the button.
+		It will also update the pressed in/out look of the button,
+                and update all the other solo buttons. Only one Instrument is allowed 
+                solo status at a time.
 		"""
 		if not self.Updating:
+                        for instrument in self.project.instruments:
+                                if instrument.isSolo and instrument is not self.instrument:
+                                        instrument.ToggleSolo(instrument.isMuted)
 			self.instrument.ToggleSolo(False)
 		
 	#_____________________________________________________________________


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]