1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2013 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // http://www.gnu.org/licenses/gpl-2.0.txt
20 ///////////////////////////////////////////////////////////////////////////////
24 //#include "Model_AudioFile.h"
27 #include <QStringList>
39 ////////////////////////////////////////////////////////////
41 ////////////////////////////////////////////////////////////
43 class FileAnalyzer
: public QThread
48 FileAnalyzer(const QStringList
&inputFiles
);
51 bool getSuccess(void) { return (!isRunning()) && (!m_bAborted
) && m_bSuccess
; }
53 unsigned int filesAccepted(void);
54 unsigned int filesRejected(void);
55 unsigned int filesDenied(void);
56 unsigned int filesDummyCDDA(void);
57 unsigned int filesCueSheet(void);
60 void fileSelected(const QString
&fileName
);
61 void fileAnalyzed(const AudioFileModel
&file
);
62 void progressValChanged(unsigned int);
63 void progressMaxChanged(unsigned int);
66 void abortProcess(void) { m_bAborted
= true; exit(-1); }
69 void initializeTasks(void);
70 void taskFileAnalyzed(const unsigned int taskId
, const int fileType
, const AudioFileModel
&file
);
71 void taskThreadFinish(const unsigned int);
74 bool analyzeNextFile(void);
75 void handlePlaylistFiles(void);
76 bool createTemplate(void);
79 QElapsedTimer
*m_timer
;
81 unsigned int m_tasksCounterNext
;
82 unsigned int m_tasksCounterDone
;
83 unsigned int m_completedCounter
;
85 unsigned int m_filesAccepted
;
86 unsigned int m_filesRejected
;
87 unsigned int m_filesDenied
;
88 unsigned int m_filesDummyCDDA
;
89 unsigned int m_filesCueSheet
;
91 QStringList m_inputFiles
;
92 LockedFile
*m_templateFile
;
94 QSet
<unsigned int> m_completedTaskIds
;
95 QSet
<unsigned int> m_runningTaskIds
;
96 QHash
<unsigned int, AudioFileModel
> m_completedFiles
;
98 static const char *g_tags_gen
[];
99 static const char *g_tags_aud
[];
101 volatile bool m_bAborted
;
102 volatile bool m_bSuccess
;