hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.03k stars 172 forks source link

EVENT_PROGRESS: -1 to indicate export failure #1821

Closed theGreatWhiteShark closed 1 year ago

theGreatWhiteShark commented 1 year ago

the DiskWriterDriver thread is now able to indicate a failing export by sending the EVENT_PROGRESS with value -1.

There are a couple of places in the code and unit tests waiting for a EVENT_PROGRESS with value 100 in order to proceed. But in case the audio engine could not be locked, the sndfile format was not valid, or the audio file could not be created (e.g. read-only location), these parts of the code would wait indefinitely since the thread would never send the 100.

A second thing fixed is that the attempts for the DiskWriterDriver thread to limit the audio engine was limited to 30. Beforehand, it tried forever.

addresses #1820