// Copyright 2004 "Gilles Degottex" // This file is part of "fmit" // "fmit" is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // "fmit" is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef _CustomInstrumentTunerForm_h_ #define _CustomInstrumentTunerForm_h_ #include "InstrumentTunerForm.h" #include "config.h" #include using namespace std; #include #include #include #include #include #include #include #include #include #include using namespace Music; #include "AutoQSettings.h" #include "CaptureThread.h" #include "ConfigForm.h" #include "LatencyMonoQuantizer.h" #include "DummyMonoQuantizer.h" #include "modules/DialView.h" #include "modules/GLGraph.h" #include "modules/GLErrorHistory.h" #include "modules/GLVolumeHistory.h" #include "modules/MicrotonalView.h" #include "modules/GLSample.h" #include "modules/GLFreqStruct.h" #include "modules/GLFT.h" #include "modules/GLStatistics.h" class CustomInstrumentTunerForm : public InstrumentTunerForm { Q_OBJECT public: ConfigForm m_config_form; CaptureThread m_capture_thread; virtual void pause(bool on); CombedFT* m_algo_combedfft; DialView* m_dialTune; GLGraph* m_glGraph; GLErrorHistory* m_glErrorHistory; GLVolumeHistory* m_glVolumeHistory; GLSample* m_glSample; GLFreqStruct* m_glFreqStruct; GLFT* m_glFT; MicrotonalView* m_microtonalView; GLStatistics* m_glStatistics; deque m_queue; double m_freq; double m_compared_freq; double m_error; QTime m_time; CustomInstrumentTunerForm(); AutoQSettings m_settings; void loadSettings(); virtual void saveSettings(); virtual void restoreFactorySettings(); virtual void resizeEvent(QResizeEvent* e); virtual void keyPressEvent(QKeyEvent * e); virtual void update_views(); virtual void configure(); virtual void configure_ok(); virtual void errorRaised(const QString& error); virtual void samplingRateChanged(int sampling_rate); virtual void noteRangeChanged(); virtual void transportChanged(const QString& name); virtual void selectTransport(const QString & name); virtual void autoDetectTransport(); virtual void tuningFreqChanged(float); virtual void ui_spinAFreq_valueChanged(int); virtual void ui_spinAOffset_valueChanged(int); void toggleFullScreen(); QTime m_time_refresh; QTime m_time_refresh_views; void refresh(); QTimer m_timer_refresh; double m_last_refresh; // Range filters RectangularHighPassRTFilter m_rect_range_filter; FIRRTFilter m_fir_range_filter; DummyRTFilter m_dummy_range_filter; RTFilter* m_range_filter; // Time quantizers LatencyMonoQuantizer m_latency_quantizer; DummyMonoQuantizer m_dummy_quantizer; MonoQuantizer* m_quantizer; virtual void noteStarted(double freq, double dt); virtual void noteFinished(double freq, double dt); virtual void refresh_views(); void refresh_data_sample(); void refresh_data_harmonics(); // the main function virtual void helpAbout(); ~CustomInstrumentTunerForm(); }; #endif // _CustomInstrumentTunerForm_h_