changeset 620:bfa9604714c9 import-audio-data

Query recorded file locations from svcore code
author Chris Cannam
date Tue, 11 Sep 2018 14:37:31 +0100
parents 0e95c30d6680
children 5e0018969003
files audio/AudioCallbackRecordTarget.cpp audio/AudioCallbackRecordTarget.h
diffstat 2 files changed, 2 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/audio/AudioCallbackRecordTarget.cpp	Fri Sep 07 16:14:19 2018 +0100
+++ b/audio/AudioCallbackRecordTarget.cpp	Tue Sep 11 14:37:31 2018 +0100
@@ -15,7 +15,7 @@
 #include "AudioCallbackRecordTarget.h"
 
 #include "base/ViewManagerBase.h"
-#include "base/TempDirectory.h"
+#include "base/RecordDirectory.h"
 
 #include "data/model/WritableWaveFileModel.h"
 
@@ -222,35 +222,6 @@
     }
 }
 
-QString
-AudioCallbackRecordTarget::getRecordContainerFolder()
-{
-    QDir parent(TempDirectory::getInstance()->getContainingPath());
-    QString subdirname("recorded");
-
-    if (!parent.mkpath(subdirname)) {
-        SVCERR << "ERROR: AudioCallbackRecordTarget::getRecordContainerFolder: Failed to create recorded dir in \"" << parent.canonicalPath() << "\"" << endl;
-        return "";
-    } else {
-        return parent.filePath(subdirname);
-    }
-}
-
-QString
-AudioCallbackRecordTarget::getRecordFolder()
-{
-    QDir parent(getRecordContainerFolder());
-    QDateTime now = QDateTime::currentDateTime();
-    QString subdirname = QString("%1").arg(now.toString("yyyyMMdd"));
-
-    if (!parent.mkpath(subdirname)) {
-        SVCERR << "ERROR: AudioCallbackRecordTarget::getRecordFolder: Failed to create recorded dir in \"" << parent.canonicalPath() << "\"" << endl;
-        return "";
-    } else {
-        return parent.filePath(subdirname);
-    }
-}
-
 WritableWaveFileModel *
 AudioCallbackRecordTarget::startRecording()
 {
@@ -262,7 +233,7 @@
     m_model = 0;
     m_frameCount = 0;
 
-    QString folder = getRecordFolder();
+    QString folder = RecordDirectory::getRecordDirectory();
     if (folder == "") return 0;
     QDir recordedDir(folder);
 
--- a/audio/AudioCallbackRecordTarget.h	Fri Sep 07 16:14:19 2018 +0100
+++ b/audio/AudioCallbackRecordTarget.h	Tue Sep 11 14:37:31 2018 +0100
@@ -56,9 +56,6 @@
     virtual void setInputLevels(float peakLeft, float peakRight) override;
 
     virtual void audioProcessingOverload() override { }
-
-    QString getRecordContainerFolder();
-    QString getRecordFolder();
     
     virtual bool isRecording() const override { return m_recording; }
     virtual sv_frame_t getRecordDuration() const override { return m_frameCount; }