Browse Source

fix error when attempting to bounce track while transport is playing

libpanel_detach
Alexandros Theodotou 2 months ago
parent
commit
a26bf9b28a
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 3
      inc/audio/engine.h
  2. 3
      src/audio/exporter.c
  3. 6
      src/audio/transport.c

3
inc/audio/engine.h

@ -504,6 +504,9 @@ typedef struct AudioEngine @@ -504,6 +504,9 @@ typedef struct AudioEngine
/** Ok to process or not. */
volatile gint run;
/** To be set to true when preparing to export. */
bool preparing_to_export;
/** 1 if currently exporting. */
gint exporting;

3
src/audio/exporter.c

@ -893,6 +893,8 @@ exporter_export (ExportSettings * info) @@ -893,6 +893,8 @@ exporter_export (ExportSettings * info)
export_settings_print (info);
AUDIO_ENGINE->preparing_to_export = true;
/* pause engine */
EngineState state;
engine_wait_for_pause (AUDIO_ENGINE, &state, Z_F_NO_FORCE);
@ -902,6 +904,7 @@ exporter_export (ExportSettings * info) @@ -902,6 +904,7 @@ exporter_export (ExportSettings * info)
TRANSPORT->play_state = PLAYSTATE_ROLLING;
AUDIO_ENGINE->exporting = true;
AUDIO_ENGINE->preparing_to_export = false;
TRANSPORT->loop = false;
g_message ("deactivating and reactivating plugins");

6
src/audio/transport.c

@ -464,9 +464,11 @@ transport_update_caches ( @@ -464,9 +464,11 @@ transport_update_caches (
void
transport_request_pause (Transport * self, bool with_wait)
{
/* can only be called from the gtk thread */
/* can only be called from the gtk thread or when preparing
* to export */
g_return_if_fail (
!AUDIO_ENGINE->run || ZRYTHM_APP_IS_GTK_THREAD);
!AUDIO_ENGINE->run || ZRYTHM_APP_IS_GTK_THREAD
|| AUDIO_ENGINE->preparing_to_export);
if (with_wait)
{

Loading…
Cancel
Save