aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--about.ui136
-rw-r--r--player.cpp20
-rw-r--r--player.h2
-rw-r--r--player.ui268
4 files changed, 267 insertions, 159 deletions
diff --git a/about.ui b/about.ui
index 41e5125..e8751e5 100644
--- a/about.ui
+++ b/about.ui
@@ -28,56 +28,83 @@
<property name="modal">
<bool>false</bool>
</property>
- <widget class="QLabel" name="label_2">
- <property name="geometry">
- <rect>
- <x>130</x>
- <y>70</y>
- <width>215</width>
- <height>30</height>
- </rect>
- </property>
- <property name="font">
- <font>
- <pointsize>16</pointsize>
- </font>
- </property>
- <property name="text">
- <string>Licensed with GPL-3.0</string>
- </property>
- </widget>
- <widget class="QLabel" name="label">
- <property name="geometry">
- <rect>
- <x>80</x>
- <y>30</y>
- <width>371</width>
- <height>30</height>
- </rect>
- </property>
- <property name="font">
- <font>
- <pointsize>16</pointsize>
- </font>
- </property>
- <property name="text">
- <string>AleePlayer 0.1 by Alee Productions</string>
- </property>
- </widget>
- <widget class="QTextEdit" name="licenseText">
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>130</y>
- <width>471</width>
- <height>241</height>
- </rect>
- </property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
- <property name="html">
- <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>8</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="font">
+ <font>
+ <pointsize>16</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>AleePlayer 0.1 by Alee Productions</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="font">
+ <font>
+ <pointsize>16</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>Licensed with GPL-3.0</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Website: https://alee-productions.xyz</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="licenseText">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="html">
+ <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
@@ -98,9 +125,14 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans';&quot;&gt; You should have received a copy of the GNU General Public License&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans';&quot;&gt; along with this program. If not, see &amp;lt;https://www.gnu.org/licenses/&amp;gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Noto Sans';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
- </property>
- </widget>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
+ <tabstops>
+ <tabstop>licenseText</tabstop>
+ </tabstops>
<resources/>
<connections/>
</ui>
diff --git a/player.cpp b/player.cpp
index dd95b23..e618afc 100644
--- a/player.cpp
+++ b/player.cpp
@@ -27,6 +27,7 @@ void Player::mFileDialog()
msgbox.setText("This audio file has been loaded.");
msgbox.setIcon(QMessageBox::Information);
msgbox.exec();
+ ui->volumeSlider->setValue(100);
return;
}
}
@@ -37,8 +38,6 @@ Player::Player(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::Player)
{
- QSlider volumeSlider;
- //connect()
ui->setupUi(this);
}
@@ -57,15 +56,16 @@ void Player::on_actionQuit_triggered()
void Player::on_playButton_pressed()
{
- QPushButton playButton;
+ ui->playbackSlider->setEnabled(true);
+ ui->volumeSlider->setEnabled(true);
if (mPlayer->state() == mPlayer->PlayingState) {
qDebug() << "Pausing music...";
mPlayer->pause();
- playButton.setText("Pause");
+ ui->playButton->setText("Pause");
} else {
qDebug() << "Playing music...";
mPlayer->play();
- playButton.setText("Play");
+ ui->playButton->setText("Play");
}
}
@@ -73,6 +73,10 @@ void Player::on_stopButton_pressed()
{
qInfo() << "Stopping music...";
mPlayer->stop();
+ ui->volumeSlider->setEnabled(false);
+ ui->volumeSlider->setValue(100);
+ ui->playbackSlider->setEnabled(false);
+ ui->playbackSlider->setValue(0);
}
void Player::on_actionAbout_triggered()
@@ -91,3 +95,9 @@ void Player::on_actionOpen_triggered()
{
mFileDialog();
}
+
+
+void Player::on_volumeSlider_sliderMoved(int position)
+{
+ mPlayer->setVolume(position);
+}
diff --git a/player.h b/player.h
index d8424f2..fae3e58 100644
--- a/player.h
+++ b/player.h
@@ -32,6 +32,8 @@ private slots:
void mFileDialog();
+ void on_volumeSlider_sliderMoved(int position);
+
private:
Ui::Player *ui;
};
diff --git a/player.ui b/player.ui
index 2128933..4df7103 100644
--- a/player.ui
+++ b/player.ui
@@ -14,108 +14,166 @@
<string>AleePlayer</string>
</property>
<widget class="QWidget" name="centralwidget">
- <widget class="QPushButton" name="mediaButton">
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>500</y>
- <width>80</width>
- <height>26</height>
- </rect>
- </property>
- <property name="text">
- <string>Set Media</string>
- </property>
- <property name="flat">
- <bool>false</bool>
- </property>
- </widget>
- <widget class="QPushButton" name="playButton">
- <property name="geometry">
- <rect>
- <x>280</x>
- <y>500</y>
- <width>80</width>
- <height>26</height>
- </rect>
- </property>
- <property name="text">
- <string>Play/Pause</string>
- </property>
- <property name="checkable">
- <bool>false</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- <property name="flat">
- <bool>false</bool>
- </property>
- </widget>
- <widget class="QSlider" name="volumeSlider">
- <property name="geometry">
- <rect>
- <x>560</x>
- <y>500</y>
- <width>211</width>
- <height>31</height>
- </rect>
- </property>
- <property name="value">
- <number>0</number>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="tickPosition">
- <enum>QSlider::NoTicks</enum>
- </property>
- <property name="tickInterval">
- <number>0</number>
- </property>
- </widget>
- <widget class="QPushButton" name="stopButton">
- <property name="geometry">
- <rect>
- <x>400</x>
- <y>500</y>
- <width>80</width>
- <height>26</height>
- </rect>
- </property>
- <property name="text">
- <string>Stop</string>
- </property>
- <property name="flat">
- <bool>false</bool>
- </property>
- </widget>
- <widget class="QLabel" name="label">
- <property name="geometry">
- <rect>
- <x>650</x>
- <y>530</y>
- <width>51</width>
- <height>18</height>
- </rect>
- </property>
- <property name="text">
- <string>Volume</string>
- </property>
- </widget>
- <widget class="QSlider" name="playbackSlider">
- <property name="geometry">
- <rect>
- <x>40</x>
- <y>445</y>
- <width>741</width>
- <height>31</height>
- </rect>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="3" column="0">
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="5" column="5" colspan="3">
+ <widget class="QSlider" name="volumeSlider">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="value">
+ <number>99</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="tickPosition">
+ <enum>QSlider::NoTicks</enum>
+ </property>
+ <property name="tickInterval">
+ <number>0</number>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="5">
+ <widget class="QLabel" name="labelVolume">
+ <property name="text">
+ <string>Volume</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" colspan="8">
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Library</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="labelComingSoon">
+ <property name="font">
+ <font>
+ <pointsize>14</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Coming soon in a later update!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Playlist</string>
+ </attribute>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="8">
+ <widget class="QSlider" name="playbackSlider">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2">
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="7">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="1">
+ <widget class="QPushButton" name="playButton">
+ <property name="text">
+ <string>Play</string>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3">
+ <widget class="QPushButton" name="stopButton">
+ <property name="text">
+ <string>Stop</string>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="4">
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="5">
+ <widget class="QPushButton" name="mediaButton">
+ <property name="text">
+ <string>Browse</string>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
@@ -142,6 +200,9 @@
<property name="text">
<string>Quit</string>
</property>
+ <property name="shortcut">
+ <string>Ctrl+W</string>
+ </property>
</action>
<action name="actionAbout">
<property name="text">
@@ -152,6 +213,9 @@
<property name="text">
<string>Open</string>
</property>
+ <property name="shortcut">
+ <string>Ctrl+O</string>
+ </property>
</action>
</widget>
<resources/>