Skip to content

Commit

Permalink
WAVExporter: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tedfelix committed Oct 15, 2024
1 parent b58cdd6 commit eca1ae7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/gui/seqmanager/SequenceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ SequenceManager::setExportWavFile(const QString& fileName)
}
m_wavExporter = new WAVExporter(fileName);
// If creation of the WAVExporter has failed, bail.
if (m_wavExporter->isComplete())
if (!m_wavExporter->isOK())
return;

// and install in the driver
Expand Down
11 changes: 5 additions & 6 deletions src/sound/WAVExporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class WAVExporter
{
public:
explicit WAVExporter(const QString& fileName);
/*
* Call this after the ctor to determine whether the file was
* successfully created.
*/
bool isOK() const { return static_cast<bool>(m_audioWriteStream); }

/// called by the audio thread on start playback
void start();
Expand All @@ -54,12 +59,6 @@ class WAVExporter
/// Export is complete, or this object is not OK.
/**
* Called by the gui thread to request completion status.
*
* ??? update() could return a bool and then this could be changed to
* an isOK() that checks m_audioWriteStream.
*
* Call this after the ctor to determine whether the file was
* successfully created. true means failure.
*/
bool isComplete() const;

Expand Down

0 comments on commit eca1ae7

Please sign in to comment.