From c3c36692b07663e022b197e3f7670cac0bf3a773 Mon Sep 17 00:00:00 2001 From: Michael Gogins Date: Thu, 22 Jul 2021 07:34:54 -0400 Subject: [PATCH] Join after Stop to ensure starting again works (#165). --- playpen/playpen.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/playpen/playpen.py b/playpen/playpen.py index 1b083d9c2..91f16babd 100755 --- a/playpen/playpen.py +++ b/playpen/playpen.py @@ -359,12 +359,24 @@ def on_render_soundfile_button_clicked(button): while csound.PerformBuffer() == 0: Gtk.main_iteration_do(False) csound.Stop() + csound.Join() csound.Cleanup() csound.Reset() post_process() except: print(traceback.format_exc()) +def on_stop_button_clicked(button): + try: + print("Stopping csound...") + csound.Stop() + csound.Join() + csound.Cleanup() + csound.Reset() + print("Csound has been stopped and reset.") + except: + print(traceback.format_exc()) + def post_process(): try: print("Post-processing...") @@ -517,19 +529,10 @@ def on_edit_gui_button_clicked(button): future_.add_done_callback(glade_exit_callback) except: print(traceback.format_exc()) - -def on_stop_button_clicked(button): - try: - print("Stopping csound...") - csound.Stop() - csound.Cleanup() - csound.Reset() - print("Csound has been stopped and reset.") - except: - print(traceback.format_exc()) - + def on_destroy(source): csound.Stop() + csound.Join() csound.Cleanup() csound.Reset() Gtk.main_quit()