![]() |
Mixxx
|
00001 00002 // bpmcontrol.h 00003 // Created 7/5/2009 by RJ Ryan (rryan@mit.edu) 00004 00005 #ifndef BPMCONTROL_H 00006 #define BPMCONTROL_H 00007 00008 #include "engine/enginecontrol.h" 00009 #include "tapfilter.h" 00010 00011 class ControlObject; 00012 class ControlPushButton; 00013 00014 class BpmControl : public EngineControl { 00015 Q_OBJECT 00016 00017 public: 00018 BpmControl(const char* _group, ConfigObject<ConfigValue>* _config); 00019 virtual ~BpmControl(); 00020 double getBpm(); 00021 00022 public slots: 00023 00024 virtual void trackLoaded(TrackPointer pTrack); 00025 virtual void trackUnloaded(TrackPointer pTrack); 00026 00027 private slots: 00028 void slotSetEngineBpm(double); 00029 void slotFileBpmChanged(double); 00030 void slotControlBeatSync(double); 00031 void slotControlBeatSyncPhase(double); 00032 void slotControlBeatSyncTempo(double); 00033 void slotTapFilter(double,int); 00034 void slotBpmTap(double); 00035 void slotRateChanged(double); 00036 void slotUpdatedTrackBeats(); 00037 void slotBeatsTranslate(double); 00038 00039 private: 00040 bool syncTempo(); 00041 bool syncPhase(); 00042 00043 // ControlObjects that come from EngineBuffer 00044 ControlObject* m_pPlayButton; 00045 ControlObject* m_pRateSlider; 00046 ControlObject* m_pRateRange; 00047 ControlObject* m_pRateDir; 00048 00050 ControlObject* m_pFileBpm; 00051 00053 ControlObject* m_pEngineBpm; 00054 00055 // Used for bpm tapping from GUI and MIDI 00056 ControlPushButton* m_pButtonTap; 00057 00059 ControlPushButton* m_pButtonSync; 00060 ControlPushButton* m_pButtonSyncPhase; 00061 ControlPushButton* m_pButtonSyncTempo; 00062 00063 // Button that translates the beats so the nearest beat is on the current 00064 // playposition. 00065 ControlPushButton* m_pTranslateBeats; 00066 00067 TapFilter m_tapFilter; 00068 00069 TrackPointer m_pTrack; 00070 BeatsPointer m_pBeats; 00071 }; 00072 00073 00074 #endif /* BPMCONTROL_H */