-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmidix_player.h
92 lines (74 loc) · 1.98 KB
/
xmidix_player.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
#ifndef ARP__XMIDI_PLAYER_H_
#define ARP__XMIDI_PLAYER_H_
#include "ui_xmidix.h"
#include "xmidix_vu.h"
#include "xmidix_seq.h"
#include "xmidix_file.h"
#include "xmidix_piano.h"
#include "xmidix_config.h"
#include "xmidix_playlist.h"
#include <QUrl>
#include <QList>
#include <QTimer>
#include <QObject>
#include <QAction>
#include <QSettings>
#include <QMainWindow>
#include <QSystemTrayIcon>
#define WINDOW_TITLE "XMIDIX"
#define SETTINGS_CLIENT "client"
#define SETTINGS_PORT "port"
#define SETTINGS_CWD "cwd"
#define SETTINGS_SYSTRAY "systray"
#define SETTINGS_CHANBAR "chanbar"
enum class play_status {
STOPPED, PLAYING, PAUSED
};
class xmidix_player : public QMainWindow {
Q_OBJECT
public:
explicit xmidix_player(QWidget *parent = nullptr, QList<QUrl> files = {});
~xmidix_player() override;
public slots:
void play(const QUrl &url);
void config_client_update();
void config_updated();
void playlist_activated(const QModelIndex &index);
void load_button_click();
void play_button_click();
void stop_button_click();
void config_button_click();
void status_updated(play_status status);
void song_complete();
void tick_update();
void slider_seek();
signals:
void song_change(const QUrl &url);
void clients_updated(const std::vector<xmidix_client_info> &c);
void status_update(play_status s);
protected:
bool eventFilter(QObject *watched, QEvent *event) override;
private:
void load_settings();
void setup_connections();
void setup_actions();
void setup_action(QAction *a, const QKeySequence &s);
play_status status;
unsigned int last_tick;
Ui::MainWindow ui;
xmidix_config config_window;
xmidix_seq seq;
xmidix_playlist model;
xmidix_piano_array pianos;
QTimer progress_timer;
QSettings settings;
QSystemTrayIcon tray_icon;
QAction play_action;
QAction load_action;
QAction stop_action;
QAction conf_action;
QAction back_action;
QAction forw_action;
QAction shuf_action;
};
#endif //ARP__XMIDI_PLAYER_H_