Mercurial > hg > svcore
comparison 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 |
comparison
equal
deleted
inserted
replaced
270:840dd5e6400f | 271:822bd7fd526c |
---|---|
45 m_updateTimer(0), | 45 m_updateTimer(0), |
46 m_lastFillExtent(0), | 46 m_lastFillExtent(0), |
47 m_exiting(false) | 47 m_exiting(false) |
48 { | 48 { |
49 m_reader = AudioFileReaderFactory::createReader(path); | 49 m_reader = AudioFileReaderFactory::createReader(path); |
50 setObjectName(QFileInfo(path).fileName()); | 50 setObjectName(m_reader->getTitle()); |
51 if (objectName() == "") setObjectName(QFileInfo(path).fileName()); | |
51 if (isOK()) fillCache(); | 52 if (isOK()) fillCache(); |
52 } | 53 } |
53 | 54 |
54 WaveFileModel::WaveFileModel(QString path, QString originalLocation) : | 55 WaveFileModel::WaveFileModel(QString path, QString originalLocation) : |
55 m_path(originalLocation), | 56 m_path(originalLocation), |
58 m_updateTimer(0), | 59 m_updateTimer(0), |
59 m_lastFillExtent(0), | 60 m_lastFillExtent(0), |
60 m_exiting(false) | 61 m_exiting(false) |
61 { | 62 { |
62 m_reader = AudioFileReaderFactory::createReader(path); | 63 m_reader = AudioFileReaderFactory::createReader(path); |
63 setObjectName(QFileInfo(originalLocation).fileName()); | 64 setObjectName(m_reader->getTitle()); |
65 if (objectName() == "") setObjectName(QFileInfo(originalLocation).fileName()); | |
64 if (isOK()) fillCache(); | 66 if (isOK()) fillCache(); |
65 } | 67 } |
66 | 68 |
67 WaveFileModel::WaveFileModel(QString path, AudioFileReader *reader) : | 69 WaveFileModel::WaveFileModel(QString path, AudioFileReader *reader) : |
68 m_path(path), | 70 m_path(path), |
71 m_updateTimer(0), | 73 m_updateTimer(0), |
72 m_lastFillExtent(0), | 74 m_lastFillExtent(0), |
73 m_exiting(false) | 75 m_exiting(false) |
74 { | 76 { |
75 m_reader = reader; | 77 m_reader = reader; |
76 setObjectName(QFileInfo(path).fileName()); | 78 setObjectName(m_reader->getTitle()); |
79 if (objectName() == "") setObjectName(QFileInfo(path).fileName()); | |
77 fillCache(); | 80 fillCache(); |
78 } | 81 } |
79 | 82 |
80 WaveFileModel::~WaveFileModel() | 83 WaveFileModel::~WaveFileModel() |
81 { | 84 { |