From 9dac6d187810915895ac9f7a6b739ff818336b35 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 5 Sep 2010 04:36:48 +0200 Subject: Initial import. --- gui/browser.cpp | 2 + gui/browser.h | 13 ++++ gui/mainwindow.cpp | 45 ++++++++++++++ gui/mainwindow.h | 29 +++++++++ gui/mainwindow.ui | 174 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 263 insertions(+) create mode 100644 gui/browser.cpp create mode 100644 gui/browser.h create mode 100644 gui/mainwindow.cpp create mode 100644 gui/mainwindow.h create mode 100644 gui/mainwindow.ui (limited to 'gui') diff --git a/gui/browser.cpp b/gui/browser.cpp new file mode 100644 index 0000000..681039d --- /dev/null +++ b/gui/browser.cpp @@ -0,0 +1,2 @@ +#include "browser.h" + diff --git a/gui/browser.h b/gui/browser.h new file mode 100644 index 0000000..72c5447 --- /dev/null +++ b/gui/browser.h @@ -0,0 +1,13 @@ +#ifndef BROWSER_H +#define BROWSER_H + +#include + +class Browser : public QWidget { + public: + Browser(QWidget* p) : QWidget(p) { + + } +}; + +#endif diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp new file mode 100644 index 0000000..28def13 --- /dev/null +++ b/gui/mainwindow.cpp @@ -0,0 +1,45 @@ +#include "mainwindow.h" + +MainWindow::MainWindow() { + //setAttribute(Qt::WA_MacBrushedMetal, true); + setupUi(this); + + connect(button_prev, SIGNAL(clicked()), SIGNAL(prev())); + connect(button_pause, SIGNAL(clicked()), SIGNAL(pause())); + connect(button_play, SIGNAL(clicked()), SIGNAL(play())); + connect(button_next, SIGNAL(clicked()), SIGNAL(next())); + + connect(slider_seek, SIGNAL(sliderReleased()), SLOT(slider_released())); + + button_pause->hide(); +} + +void MainWindow::update_track(const QUrl& track) { + +} + +void MainWindow::update_state(bool playing) { + if(playing) { + button_play->hide(); + button_pause->show(); + } else { + button_pause->hide(); + button_play->show(); + } +} + +void MainWindow::update_pos(int pos) { + label_pos->setText(QString("%1:%2").arg(pos / 60).arg(pos % 60, 2, 10, QChar('0'))); + if(!slider_seek->isSliderDown()) { + slider_seek->setValue(pos); + } +} + +void MainWindow::update_length(int length) { + label_length->setText(QString("%1:%2").arg(length / 60).arg(length % 60, 2, 10, QChar('0'))); + slider_seek->setMaximum(length); +} + +void MainWindow::slider_released() { + emit seek(slider_seek->value()); +} diff --git a/gui/mainwindow.h b/gui/mainwindow.h new file mode 100644 index 0000000..e61b405 --- /dev/null +++ b/gui/mainwindow.h @@ -0,0 +1,29 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include "ui_mainwindow.h" + +class MainWindow : public QWidget, private Ui::MainWindow { + Q_OBJECT + + public: + MainWindow(); + + public slots: + void update_track(const QUrl& track); + void update_state(bool playing); + void update_pos(int pos); + void update_length(int length); + + private slots: + void slider_released(); + + signals: + void prev(); + void pause(); + void play(); + void next(); + void seek(int pos); +}; + +#endif diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui new file mode 100644 index 0000000..2c25920 --- /dev/null +++ b/gui/mainwindow.ui @@ -0,0 +1,174 @@ + + + MainWindow + + + + 0 + 0 + 727 + 519 + + + + Hei morn + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + + + TextLabel + + + + + + + + + + Qt::Horizontal + + + + + 200 + 16777215 + + + + + 0 + + + + + QAbstractItemView::InternalMove + + + false + + + true + + + + 1 + + + + + Fisk + + + + + Playlists + + + + Kake + + + + + Brød + + + + + + + + + + + + + + + 0 + 0 + + + + + + + ... + + + + + + + ... + + + + + + + ... + + + + + + + ... + + + + + + + 0:00 + + + + + + + Qt::Horizontal + + + + + + + 0:00 + + + + + + + + + + + Browser + QWidget +
browser.h
+ 1 +
+
+ + +
-- cgit v1.2.3