changeset 480:1d4cb8befcfd recording

New filename for each audio recording
author Chris Cannam
date Wed, 19 Aug 2015 17:21:40 +0100
parents 6f475df6f833
children 52c0aff69478 493f2af85497
files audio/AudioRecordTarget.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
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);