From 98f491a29d62a08672d4d267218dad5c4334b7c9 Mon Sep 17 00:00:00 2001 From: CrSjimo Date: Wed, 18 Sep 2024 22:49:36 +0800 Subject: [PATCH] update DspxProjectAudioExporter --- src/dspx/DspxProjectAudioExporter.cpp | 14 ++++++++------ src/dspx/DspxProjectAudioExporter.h | 2 -- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dspx/DspxProjectAudioExporter.cpp b/src/dspx/DspxProjectAudioExporter.cpp index 22c2d8a..6414939 100644 --- a/src/dspx/DspxProjectAudioExporter.cpp +++ b/src/dspx/DspxProjectAudioExporter.cpp @@ -125,7 +125,7 @@ namespace talcs { mixerSourceData.source->setSilentFlags(mixerSourceData.actualSilentFlags); } savedMixerSourceDataIt++; - projectContext->transport()->setPosition(projectContext->timeConverter()(startTick)); + masterTrack->setNextReadPosition(projectContext->timeConverter()(startTick)); return {mixerSourceData.trackContext, taskSources.value(mixerSourceData.source)}; } return {nullptr, nullptr}; @@ -133,6 +133,7 @@ namespace talcs { DspxProjectAudioExporter::DspxProjectAudioExporter(DspxProjectContext *context, QObject *parent) : QObject(parent), d_ptr(new DspxProjectAudioExporterPrivate) { Q_D(DspxProjectAudioExporter); + d->q_ptr = this; d->projectContext = context; } @@ -231,6 +232,7 @@ namespace talcs { DspxProjectAudioExporter::Result ret = DspxProjectAudioExporter::OK; + savedMixerSourceDataIt = savedMixerSourceDataList.cbegin(); while (true) { auto [trackContext, io] = makeNextSeparatedThruMasterTaskMixerLayoutAndGetCorrespondingData(); if (!trackContext) @@ -260,10 +262,10 @@ namespace talcs { writer.moveToThread(&exportThread); QObject::connect(&exportThread, &QThread::started, &writer, &AudioSourceProcessorBase::start); - int clippingFlag = 0; + bool clippingFlag = false; QObject::connect(&writer, &DspxProjectAudioExporterSourceWriter::clippingDetected, q, [&] { if (!clippingFlag) { - clippingFlag = DspxProjectAudioExporter::ClippingDetected; + clippingFlag = true; emit q->clippingDetected(trackContext); } }); @@ -272,11 +274,11 @@ namespace talcs { }); QObject::connect(&writer, &AudioSourceProcessorBase::finished, q, [&] { if (writer.status() == AudioSourceProcessorBase::Completed) { - eventLoop.exit(DspxProjectAudioExporter::OK | clippingFlag); + eventLoop.exit(DspxProjectAudioExporter::OK); } else if (writer.status() == AudioSourceProcessorBase::Failed) { - eventLoop.exit(DspxProjectAudioExporter::Fail | clippingFlag); + eventLoop.exit(DspxProjectAudioExporter::Fail); } else if (writer.status() == AudioSourceProcessorBase::Interrupted) { - eventLoop.exit((interruptionFlagIsFail ? DspxProjectAudioExporter::Fail : DspxProjectAudioExporter::Interrupted) | clippingFlag); + eventLoop.exit(interruptionFlagIsFail ? DspxProjectAudioExporter::Fail : DspxProjectAudioExporter::Interrupted); } }); exportThread.start(); diff --git a/src/dspx/DspxProjectAudioExporter.h b/src/dspx/DspxProjectAudioExporter.h index 3b2ee4f..510aabf 100644 --- a/src/dspx/DspxProjectAudioExporter.h +++ b/src/dspx/DspxProjectAudioExporter.h @@ -64,8 +64,6 @@ namespace talcs { OK = 0x0000, Fail = 0x0001, Interrupted = 0x0002, - - ClippingDetected = 0x0010, }; Q_DECLARE_FLAGS(Result, ResultFlag) Result exec();