summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/browser.cpp2
-rw-r--r--gui/browser.h13
-rw-r--r--gui/mainwindow.cpp45
-rw-r--r--gui/mainwindow.h29
-rw-r--r--gui/mainwindow.ui174
5 files changed, 263 insertions, 0 deletions
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 <QtGui>
+
+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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QWidget" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>727</width>
+ <height>519</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Hei morn</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QFrame" name="frame_top">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSplitter" name="splitter">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QFrame" name="frame_left">
+ <property name="maximumSize">
+ <size>
+ <width>200</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QTreeWidget" name="treeWidget">
+ <property name="dragDropMode">
+ <enum>QAbstractItemView::InternalMove</enum>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>false</bool>
+ </property>
+ <property name="headerHidden">
+ <bool>true</bool>
+ </property>
+ <column>
+ <property name="text">
+ <string>1</string>
+ </property>
+ </column>
+ <item>
+ <property name="text">
+ <string>Fisk</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Playlists</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>Kake</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Brød</string>
+ </property>
+ </item>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="Browser" name="browser" native="true"/>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="frame_bottom">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QToolButton" name="button_prev">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="button_pause">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="button_play">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="button_next">
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_pos">
+ <property name="text">
+ <string>0:00</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSlider" name="slider_seek">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_length">
+ <property name="text">
+ <string>0:00</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>Browser</class>
+ <extends>QWidget</extends>
+ <header>browser.h</header>
+ <container>1</container>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>