From 441abb4c8fa5f37c9dd24dd2478c6df57860534c Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 2 Nov 1998 22:48:56 +0000 Subject: [PATCH] Added a None button to turn off all input sources. --- Tools/audiopy/audiopy | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Tools/audiopy/audiopy b/Tools/audiopy/audiopy index 0ef5c4eec56..726fa2e99d5 100755 --- a/Tools/audiopy/audiopy +++ b/Tools/audiopy/audiopy @@ -70,13 +70,27 @@ class MainWindow: label = Label(frame, text='Input From:') label.grid(row=0, column=0, sticky=E) self.__inputvar = IntVar() + ## + btn = Radiobutton(frame, + text='None', + variable=self.__inputvar, + value=0, + command=self.__pushtodev, + underline=0) + btn.grid(row=0, column=1, sticky=W) + root.bind('', self.__none) + root.bind('', self.__none) + if not info.i_avail_ports & MICROPHONE: + btn.configure(state=DISABLED) + buttons.append(btn) + ## btn = Radiobutton(frame, text='Microphone', variable=self.__inputvar, value=MICROPHONE, command=self.__pushtodev, underline=0) - btn.grid(row=0, column=1, sticky=W) + btn.grid(row=1, column=1, sticky=W) root.bind('', self.__mic) root.bind('', self.__mic) if not info.i_avail_ports & MICROPHONE: @@ -89,7 +103,7 @@ class MainWindow: value=LINE_IN, command=self.__pushtodev, underline=5) - btn.grid(row=1, column=1, sticky=W) + btn.grid(row=2, column=1, sticky=W) root.bind('', self.__linein) root.bind('', self.__linein) if not info.i_avail_ports & LINE_IN: @@ -104,7 +118,7 @@ class MainWindow: value=CD, command=self.__pushtodev, underline=0) - btn.grid(row=2, column=1, sticky=W) + btn.grid(row=3, column=1, sticky=W) root.bind('', self.__cd) root.bind('', self.__cd) if not info.i_avail_ports & CD: @@ -228,12 +242,16 @@ class MainWindow: self.__devctl.setinfo(info) def __getset(self, var, onvalue): - if var.get(): + if var.get() == onvalue: var.set(0) else: var.set(onvalue) self.__pushtodev() + def __none(self, event=None): + self.__inputvar.set(0) + self.__pushtodev() + def __mic(self, event=None): self.__getset(self.__inputvar, MICROPHONE)