diff data/model/WaveFileModel.cpp @ 271:822bd7fd526c

* Add support for reading mp3 and Ogg file title tags
author Chris Cannam
date Mon, 02 Jul 2007 13:53:38 +0000
parents fa612dc181af
children 7802b0e2b0ff
line wrap: on
line diff
--- a/data/model/WaveFileModel.cpp	Tue Jun 26 12:27:47 2007 +0000
+++ b/data/model/WaveFileModel.cpp	Mon Jul 02 13:53:38 2007 +0000
@@ -47,7 +47,8 @@
     m_exiting(false)
 {
     m_reader = AudioFileReaderFactory::createReader(path);
-    setObjectName(QFileInfo(path).fileName());
+    setObjectName(m_reader->getTitle());
+    if (objectName() == "") setObjectName(QFileInfo(path).fileName());
     if (isOK()) fillCache();
 }
 
@@ -60,7 +61,8 @@
     m_exiting(false)
 {
     m_reader = AudioFileReaderFactory::createReader(path);
-    setObjectName(QFileInfo(originalLocation).fileName());
+    setObjectName(m_reader->getTitle());
+    if (objectName() == "") setObjectName(QFileInfo(originalLocation).fileName());
     if (isOK()) fillCache();
 }
 
@@ -73,7 +75,8 @@
     m_exiting(false)
 {
     m_reader = reader;
-    setObjectName(QFileInfo(path).fileName());
+    setObjectName(m_reader->getTitle());
+    if (objectName() == "") setObjectName(QFileInfo(path).fileName());
     fillCache();
 }