aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpmainwindow.hpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-06 16:54:29 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-04-06 16:54:29 +0800
commit70fd2d85c1bd6fb8732e680e8fda9d36c317c732 (patch)
tree4f048e7af294a2d40d3cabb9ea0ff266aa1fc36c /qmidiplayer-desktop/qmpmainwindow.hpp
parentcf7eafca1fbc9aae495d7b7d7e1fb4bc92e6819f (diff)
downloadQMidiPlayer-70fd2d85c1bd6fb8732e680e8fda9d36c317c732.tar.xz
Too young too simple.
Diffstat (limited to 'qmidiplayer-desktop/qmpmainwindow.hpp')
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.hpp90
1 files changed, 90 insertions, 0 deletions
diff --git a/qmidiplayer-desktop/qmpmainwindow.hpp b/qmidiplayer-desktop/qmpmainwindow.hpp
new file mode 100644
index 0000000..a409d2e
--- /dev/null
+++ b/qmidiplayer-desktop/qmpmainwindow.hpp
@@ -0,0 +1,90 @@
+#ifndef QMPMAINWINDOW_H
+#define QMPMAINWINDOW_H
+
+#include <QMainWindow>
+#include <QTimer>
+#include <QCloseEvent>
+#include <QMoveEvent>
+#include <QDropEvent>
+#include <QDragEnterEvent>
+#include <QAction>
+#include <QMenu>
+#include <thread>
+#include <chrono>
+#include "../core/qmpmidiplay.hpp"
+#include "qmpplistwindow.hpp"
+#include "qmpchannelswindow.hpp"
+#include "qmpefxwindow.hpp"
+#include "qmpinfowindow.hpp"
+#include "qmpsettingswindow.hpp"
+#include "qmphelpwindow.hpp"
+
+namespace Ui {
+ class qmpMainWindow;
+}
+
+class qmpMainWindow:public QMainWindow
+{
+ Q_OBJECT
+
+ public:
+ explicit qmpMainWindow(QWidget *parent = 0);
+ void closeEvent(QCloseEvent *event);
+ void moveEvent(QMoveEvent *event);
+ void dropEvent(QDropEvent *event);
+ void dragEnterEvent(QDragEnterEvent *event);
+ ~qmpMainWindow();
+ CMidiPlayer* getPlayer(){return player;}
+ QTimer* getTimer(){return timer;}
+ bool isFinalizing(){return fin;}
+ QString getFileName();
+ int pharseArgs(int argc,char** argv);
+
+ private slots:
+ void on_pbPlayPause_clicked();
+ void updateWidgets();
+ void on_hsTimer_sliderPressed();
+ void on_hsTimer_sliderReleased();
+ void on_vsMasterVol_valueChanged();
+ void on_pbStop_clicked();
+ void on_pbPList_clicked();
+ void on_pbPrev_clicked();
+ void on_pbNext_clicked();
+ void on_pbChannels_clicked();
+ void on_pbEfx_clicked();
+ void on_lbFileName_customContextMenuRequested(const QPoint &pos);
+ void on_pbSettings_clicked();
+ void onfnA1();
+ void onfnA2();
+
+ void on_pushButton_clicked();
+
+ public slots:
+ void dialogClosed();
+ void selectionChanged();
+
+ private:
+ Ui::qmpMainWindow *ui;
+ QTimer *timer;
+ bool playing,stopped,dragging,fin,singleFS;
+ std::thread *playerTh=NULL;
+ std::thread *renderTh=NULL;
+ std::chrono::steady_clock::time_point st;
+ double offset;
+ CMidiPlayer *player;
+ qmpPlistWindow *plistw;
+ qmpChannelsWindow *chnlw;
+ qmpEfxWindow *efxw;
+ qmpInfoWindow *infow;
+ qmpSettingsWindow *settingsw;
+ qmpHelpWindow *helpw;
+
+ QAction *fnA1,*fnA2;
+ void playerSetup();
+
+ private:
+ static qmpMainWindow* ref;
+ public: static qmpMainWindow* getInstance(){return ref;}
+};
+
+#endif // QMPMAINWINDOW_H