Go to the documentation of this file.00001 #ifndef MAINWINDOW_HPP
00002 #define MAINWINDOW_HPP
00003
00007 #include <QFutureWatcher>
00008 #include "spectrogram.hpp"
00009 #include "ui_mainwindow.h"
00010
00012 class MainWindow : public QMainWindow
00013 {
00014 Q_OBJECT
00015 public:
00016 MainWindow();
00017 private:
00018 Ui::MainWindow ui;
00019 Soundfile soundfile;
00020 bool soundfileOk();
00021 QImage image;
00022 bool imageOk();
00023 Spectrogram* spectrogram;
00024 void setValues();
00025 void loadValues();
00026 void updatePalette();
00027
00028 void workingState();
00029 void idleState();
00030
00031 QFutureWatcher<QImage>* image_watcher;
00032 QFutureWatcher<real_vec>* sound_watcher;
00033 private slots:
00034 void setFilterUnits(int scale);
00035
00036 void makeSpectrogram();
00037 bool checkAnalysisValues();
00038 void makeSound();
00039 bool checkSynthesisValues();
00040
00041 void chooseImage();
00042 void loadImage();
00043 void updateImage();
00044 void resetImage();
00045 void saveImage();
00046
00047 void chooseSoundfile();
00048 void loadSoundfile();
00049 void updateSoundfile();
00050 void resetSoundfile();
00051 void saveSoundfile(const real_vec& signal);
00052
00053 void choosePalette();
00054
00055
00056 bool confirmWarnings(const QStringList& errors);
00057
00058 void newSpectrogram();
00059 void newSound();
00060 signals:
00061
00062 void makeSpectrogram(Spectrogram* spectrogram, real_vec signal,
00063 int samplerate);
00064 };
00065
00066 #endif