summaryrefslogtreecommitdiff
path: root/main.cpp
blob: 1c1bd630a70f2409ddf7ed03a07c15b6f0c6aba5 (plain)
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
#include <QtGui>

#include "player.h"
#include "gui/mainwindow.h"

int main(int argc, char** argv) {
	QApplication qapp(argc, argv);
	
	qapp.setApplicationName("Ongaku");
	
	qapp.setStyleSheet("file:///default.qss");
	
	Player* player = new Player();
	
	MainWindow* mainwindow = new MainWindow();
	mainwindow->show();
	
	player->connect(mainwindow, SIGNAL(prev()), SLOT(prev()));
	player->connect(mainwindow, SIGNAL(pause()), SLOT(pause()));
	player->connect(mainwindow, SIGNAL(play()), SLOT(play()));
	player->connect(mainwindow, SIGNAL(next()), SLOT(next()));
	player->connect(mainwindow, SIGNAL(seek(int)), SLOT(seek(int)));
	
	mainwindow->connect(player, SIGNAL(changed_track(const QUrl&)), SLOT(update_track(const QUrl&)));
	mainwindow->connect(player, SIGNAL(changed_state(bool)), SLOT(update_state(bool)));
	mainwindow->connect(player, SIGNAL(changed_pos(int)), SLOT(update_pos(int)));
	mainwindow->connect(player, SIGNAL(changed_length(int)), SLOT(update_length(int)));
	
	qapp.exec();
}