diff options
author | Barry Warsaw <barry@python.org> | 1998-11-02 22:48:56 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1998-11-02 22:48:56 (GMT) |
commit | 441abb4c8fa5f37c9dd24dd2478c6df57860534c (patch) | |
tree | a2cbfa966bc51388a6ff5f8a3886682c6618ab81 /Tools/audiopy | |
parent | 2510d220482fa258d0ffe0d7ed5f5749550fb2bd (diff) | |
download | cpython-441abb4c8fa5f37c9dd24dd2478c6df57860534c.zip cpython-441abb4c8fa5f37c9dd24dd2478c6df57860534c.tar.gz cpython-441abb4c8fa5f37c9dd24dd2478c6df57860534c.tar.bz2 |
Added a None button to turn off all input sources.
Diffstat (limited to 'Tools/audiopy')
-rwxr-xr-x | Tools/audiopy/audiopy | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Tools/audiopy/audiopy b/Tools/audiopy/audiopy index 0ef5c4e..726fa2e 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('<Alt-n>', self.__none) + root.bind('<Alt-N>', 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('<Alt-m>', self.__mic) root.bind('<Alt-M>', 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('<Alt-i>', self.__linein) root.bind('<Alt-I>', 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('<Alt-c>', self.__cd) root.bind('<Alt-C>', 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) |