From: Shane Pepperell Date: Sat, 14 Jan 2023 02:03:39 +0000 (+0000) Subject: added mute button X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=28dd006fbf31054bba0708a182a29487b912e825;p=forks%2Fpeks-announcer.git added mute button --- diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..f8b4888 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..1c55cbb --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,7 @@ +{ + "ExpandedNodes": [ + "" + ], + "SelectedNode": "\\C:\\Users\\shane\\Source\\Repos\\peks-announcer", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/peks-announcer/FileContentIndex/3cf77d22-f694-49eb-a2a7-799f482221ec.vsidx b/.vs/peks-announcer/FileContentIndex/3cf77d22-f694-49eb-a2a7-799f482221ec.vsidx new file mode 100644 index 0000000..7cf0c7a Binary files /dev/null and b/.vs/peks-announcer/FileContentIndex/3cf77d22-f694-49eb-a2a7-799f482221ec.vsidx differ diff --git a/.vs/peks-announcer/FileContentIndex/read.lock b/.vs/peks-announcer/FileContentIndex/read.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vs/peks-announcer/v17/.wsuo b/.vs/peks-announcer/v17/.wsuo new file mode 100644 index 0000000..7de2f57 Binary files /dev/null and b/.vs/peks-announcer/v17/.wsuo differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..32e85b8 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/announcer.pyw b/announcer.pyw index 0c1bbc3..2aa0005 100644 --- a/announcer.pyw +++ b/announcer.pyw @@ -49,6 +49,10 @@ def play_event_sound(event): def update_volume(v): global volume volume = int(v) + +def mute(): + global volume_slider + volume_slider.set(0) def play_random_sound(): play_event_sound(random.choice(list(EVENT_SOUNDS.keys()))) @@ -257,6 +261,8 @@ if __name__ == '__main__': volume_slider.set(100) volume_slider.pack() Button(gui, text='Test volume', command=play_random_sound).pack() + mute_button = Button(gui, text='Mute', command=mute) + mute_button.pack() announcer_thread = threading.Thread(target=announcer_loop) announcer_thread.start() mainloop()