Skip to content

Commit

Permalink
Join after Stop to ensure starting again works (#165).
Browse files Browse the repository at this point in the history
  • Loading branch information
gogins committed Jul 22, 2021
1 parent 7f79715 commit c3c3669
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions playpen/playpen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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...")
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit c3c3669

Please sign in to comment.