Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/analyserqueue.h

Go to the documentation of this file.
00001 #ifndef ANALYSERQUEUE_H
00002 #define ANALYSERQUEUE_H
00003 
00004 #include <QList>
00005 #include <QThread>
00006 #include <QQueue>
00007 #include <QWaitCondition>
00008 
00009 #include "configobject.h"
00010 #include "analyser.h"
00011 #include "trackinfoobject.h"
00012 
00013 class SoundSourceProxy;
00014 
00015 class AnalyserQueue : public QThread {
00016     Q_OBJECT
00017 
00018   public:
00019     AnalyserQueue();
00020     virtual ~AnalyserQueue();
00021     void stop();
00022     int numQueuedTracks();
00023 
00024     static AnalyserQueue* createDefaultAnalyserQueue(ConfigObject<ConfigValue> *_config);
00025     static AnalyserQueue* createPrepareViewAnalyserQueue(ConfigObject<ConfigValue> *_config);
00026     static AnalyserQueue* createAnalyserQueue(QList<Analyser*> analysers);
00027 
00028   public slots:
00029     void queueAnalyseTrack(TrackPointer tio);
00030 
00031   signals:
00032     void trackProgress(TrackPointer pTrack,int progress);
00033     void trackFinished(TrackPointer pTrack);
00034     void queueEmpty();
00035 
00036   protected:
00037     void run();
00038 
00039   private:
00040     void addAnalyser(Analyser* an);
00041 
00042     QList<Analyser*> m_aq;
00043 
00044     TrackPointer dequeueNextBlocking();
00045     void doAnalysis(TrackPointer tio, SoundSourceProxy *pSoundSource);
00046 
00047     bool m_exit;
00048 
00049     // The processing queue and associated mutex
00050     QQueue<TrackPointer> m_tioq;
00051     QMutex m_qm;
00052     QWaitCondition m_qwait;
00053 };
00054 
00055 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines