-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
137 lines (110 loc) · 3.33 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
Copyright (C) 2017 Philip Downer <phil@pjd.me.uk>
Copyright (C) 2010 Marco Ballesio <gibrovacco@gmail.com>
Copyright (C) 2011 Collabora Ltd.
@author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "midicontrol.h"
#include "player.h"
#include "music.h"
#include <QMainWindow>
#include <QTimer>
#include <QWidget>
#include <QStyle>
#include <QObject>
#include <QSlider>
#include <QLabel>
#include <QListWidget>
#include <QPushButton>
class QBoxLayout;
class QToolButton;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
QListWidget *songList;
QListWidget *loopList;
private Q_SLOTS:
void open();
void loadFile();
void openFile(const QString & fileName, const float pitch, const float tempo);
void onStateChanged();
void onPositionChanged();
void onSongChanged();
void onLoopChanged();
void pitchDown();
void pitchUp();
void slowDown();
void speedUp();
void keyed(int k);
void play(void);
void onDurationChanged();
void getTimeStart();
void getTimeStop();
void timestop_back();
void timestop_forward();
void timestart_back();
void timestart_forward();
void timechange(QTime *time, QLabel *lbl, bool forward);
void saveLoop();
bool loopMode();
void checkLoopStatus();
void timeDiff(float rate);
private:
Player *jam_player;
Music *MD;
QToolButton *initButton(QStyle::StandardPixmap icon, const QString & tip,
QObject *dstobj, const char *slot_method, QLayout *layout);
midicontrol* mControl;
void getTime(bool start);
void createUI(QBoxLayout *appLayout);
bool loadData();
void readJson(QJsonObject &json);
void updateList(QJsonArray ja);
void updateLoopList(QJsonArray loops);
void updatePitchLabel(float pitch);
void updateTempoLabel(float tempo);
QSlider *positionSlider;
QLabel *positionLabel;
QLabel *pitchLabel;
QLabel *tempoLabel;
QString baseDir;
QToolButton *openButton;
QToolButton *playButton;
QToolButton *pauseButton;
QToolButton *stopButton;
QToolButton *pitchUpButton;
QToolButton *pitchDownButton;
QToolButton *slowDownButton;
QToolButton *speedUpButton;
QToolButton *start_backicon;
QToolButton *start_forwardicon;
QToolButton *start_gettime;
QToolButton *stop_backicon;
QToolButton *stop_forwardicon;
QToolButton *stop_gettime;
QLabel *loopStart;
QLabel *loopStop;
QTime startTime;
QTime stopTime;
QLineEdit *loopName;
QPushButton *loopSave;
};
#endif // MAINWINDOW_H