diff audio/AudioRecordTarget.cpp @ 480:1d4cb8befcfd recording

New filename for each audio recording
author Chris Cannam
date Wed, 19 Aug 2015 17:21:40 +0100
parents 411e019474e5
children 493f2af85497
line wrap: on
line diff
--- a/audio/AudioRecordTarget.cpp	Wed Aug 19 17:03:31 2015 +0100
+++ b/audio/AudioRecordTarget.cpp	Wed Aug 19 17:21:40 2015 +0100
@@ -97,9 +97,12 @@
         recordedDir = parent.filePath(subdirname);
     }
 
-    //!!! todo proper temp name as in TempDirectory
+    QDateTime now = QDateTime::currentDateTime();
 
-    QString filename = "recorded.wav"; //!!!
+    // Don't use QDateTime::toString(Qt::ISODate) as the ":" character
+    // isn't permitted in filenames on Windows
+    QString filename = QString("recorded-%1.wav")
+        .arg(now.toString("yyyyMMdd-HHmmss-zzz"));
 
     m_audioFileName = recordedDir.filePath(filename);