1 #include "mainwindow.h"
2 #include "ui_mainwindow.h"
7 #include "player/player.h"
11 using namespace SomePlayer::DataObjects;
13 MainWindow::MainWindow(QWidget *parent) :
15 ui(new Ui::MainWindow)
17 _library = new Library(_DATABASE_PATH_, _PLAYLISTS_PATH_);
19 connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(openMedia()));
20 connect(ui->actionAbout_Qt, SIGNAL(triggered()), this, SLOT(aboutQt()));
21 connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()));
22 connect(ui->actionPlayer, SIGNAL(triggered()), this, SLOT(player()));
23 connect(ui->actionLibrary, SIGNAL(triggered()), this, SLOT(library()));
25 _playerForm = new PlayerForm(_library, ui->stackedWidget);
26 _libraryForm = new LibraryForm(_library, ui->stackedWidget);
27 ui->stackedWidget->insertWidget(0, _playerForm);
28 ui->stackedWidget->insertWidget(1, _libraryForm);
29 connect(_playerForm, SIGNAL(library()), this, SLOT(library()));
30 connect(_libraryForm, SIGNAL(player()), this, SLOT(player()));
34 MainWindow::~MainWindow()
41 void MainWindow::openMedia()
43 // SomePlayer::DataObjects::Library *l = new SomePlayer::DataObjects::Library("/tmp", "/tmp");
44 // l->addDirectory("/mnt/music/Three Days Grace");
47 void MainWindow::aboutQt() {
48 QMessageBox::aboutQt(this, "About Qt");
51 void MainWindow::about() {
52 QMessageBox::about(this, "About SomePlayer", "Alternate music player for Maemo 5 "
53 "written in C++ with Qt4\n\n"
54 "Author: Nikolay Tischenko aka \"somebody\" <niktischenko@gmail.com>");
57 void MainWindow::player() {
59 ui->stackedWidget->setCurrentIndex(0);
60 setWindowTitle("SomePlayer");
63 void MainWindow::library() {
65 ui->stackedWidget->setCurrentIndex(1);
66 setWindowTitle("SomePlayer Library");