Rework buttons for main window

This commit is contained in:
Keith Edmunds 2021-04-19 07:53:39 +01:00
parent 7e22471dc4
commit bb4d1d466c
8 changed files with 13542 additions and 295 deletions

26
analyse_tracks.py Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env python
import os
from pydub import AudioSegment
DIR = "/home/kae/git/musicmuster/archive"
# Iterate through flac files
def process(path):
audio = AudioSegment.from_file(path, "flac")
print(path)
print(f"{audio.dBFS=}")
print("-----------------")
for f in os.scandir(DIR):
if f.name.endswith(".flac"):
process(f.path)

View File

@ -111,11 +111,11 @@ class Window(QMainWindow, Ui_MainWindow):
self.actionSkipToEnd.triggered.connect(self.test_skip_to_end)
self.actionSkipToFade.triggered.connect(self.test_skip_to_fade)
self.actionTestFunction.triggered.connect(self.test_function)
self.cmdAddFile.clicked.connect(self.add_file)
self.cmdAddNote.clicked.connect(self.insert_note)
self.btnAddFile.clicked.connect(self.add_file)
self.btnAddNote.clicked.connect(self.insert_note)
self.btnPrevious.clicked.connect(self.play_previous)
self.cmdDatabase.clicked.connect(self.search_database)
self.cmdSetNext.clicked.connect(self.set_next_track)
self.btnDatabase.clicked.connect(self.search_database)
self.btnSetNext.clicked.connect(self.set_next_track)
self.btnSkipNext.clicked.connect(self.play_next)
self.btnStop.clicked.connect(self.fade)

View File

@ -490,7 +490,7 @@ class Playlist(QTableWidget):
def meta_set(self, row, metadata):
"Set row metadata"
DEBUG(f"meta_set({row=}, {metadata=})")
DEBUG(f"meta_set(row={row}, metadata={metadata})")
self.item(row, self.COL_INDEX).setData(Qt.UserRole, metadata)
def play_next(self):

View File

@ -1,5 +1,8 @@
<RCC>
<qresource prefix="icons">
<file alias="stopsign">stopsign.png</file>
<file alias="fade">icon-fade.png</file>
<file alias="play">play_icon-64.jpeg</file>
<file alias="search_db">icon_search_database.png</file>
<file alias="open_file">icon_open_file.png</file>
<file alias="set_next">btn_next.png</file>

File diff suppressed because it is too large Load Diff

View File

@ -17,9 +17,9 @@
<string notr="true"/>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout_3">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
@ -175,8 +175,6 @@ border: 1px solid rgb(85, 87, 83);</string>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="lblTOD">
<property name="font">
@ -192,64 +190,179 @@ border: 1px solid rgb(85, 87, 83);</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QFrame" name="frame_5">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="btnPrevious">
<property name="maximumSize">
<widget class="QPushButton" name="btnPlay">
<property name="text">
<string> Play</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/play</normaloff>:/icons/play</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnSetNext">
<property name="text">
<string/>
<string>Set next</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/set_next</normaloff>:/icons/set_next</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>68</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnFade">
<property name="text">
<string>Fade</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/fade</normaloff>:/icons/fade</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>68</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnDatabase">
<property name="text">
<string>Database</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/search_db</normaloff>:/icons/search_db</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnAddFile">
<property name="text">
<string>Add file</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/open_file</normaloff>:/icons/open_file</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnAddNote">
<property name="text">
<string>Add note</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/note</normaloff>:/icons/note</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>68</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnPrevious">
<property name="text">
<string>Previous</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/previous</normaloff>:/icons/previous</iconset>
</property>
<property name="iconSize">
<size>
<width>41</width>
<height>41</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnStop">
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/stop</normaloff>:/icons/stop</iconset>
</property>
<property name="iconSize">
<size>
<width>41</width>
<height>41</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnSkipNext">
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="text">
<string/>
<string>Skip next</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
@ -257,19 +370,33 @@ border: 1px solid rgb(85, 87, 83);</string>
</property>
<property name="iconSize">
<size>
<width>41</width>
<height>41</height>
<width>30</width>
<height>30</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnStop">
<property name="text">
<string>Stop</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/stopsign</normaloff>:/icons/stopsign</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="Playlist" name="playlist">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
@ -332,8 +459,8 @@ border: 1px solid rgb(85, 87, 83);</string>
</column>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
@ -596,110 +723,6 @@ border: 1px solid rgb(85, 87, 83);</string>
</layout>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCommandLinkButton" name="cmdSetNext">
<property name="maximumSize">
<size>
<width>150</width>
<height>60</height>
</size>
</property>
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background: rgb(255, 243, 205)</string>
</property>
<property name="text">
<string>Set &amp;next</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/set_next</normaloff>:/icons/set_next</iconset>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCommandLinkButton" name="cmdDatabase">
<property name="maximumSize">
<size>
<width>150</width>
<height>60</height>
</size>
</property>
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background: rgb(255, 243, 205)</string>
</property>
<property name="text">
<string>&amp;Database</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/search_db</normaloff>:/icons/search_db</iconset>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCommandLinkButton" name="cmdAddNote">
<property name="maximumSize">
<size>
<width>150</width>
<height>60</height>
</size>
</property>
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background: rgb(255, 243, 205)</string>
</property>
<property name="text">
<string>Add no&amp;te</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/note</normaloff>:/icons/note</iconset>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCommandLinkButton" name="cmdAddFile">
<property name="maximumSize">
<size>
<width>150</width>
<height>60</height>
</size>
</property>
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background: rgb(255, 243, 205)</string>
</property>
<property name="text">
<string>Add &amp;file</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/open_file</normaloff>:/icons/open_file</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>

BIN
app/ui/stopsign.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

View File

@ -1,17 +1,31 @@
alembic==1.5.7
backcall==0.2.0
decorator==5.0.7
greenlet==1.0.0
importlib-metadata==3.7.3
ipython==7.22.0
ipython-genutils==0.2.0
jedi==0.18.0
Mako==1.1.4
MarkupSafe==1.1.1
mysqlclient==2.0.3
PyQt6==6.0.3
PyQt6-Qt6==6.0.2
PyQt6-sip==13.0.1
parso==0.8.2
pexpect==4.8.0
pickleshare==0.7.5
prompt-toolkit==3.0.18
ptyprocess==0.7.0
pydub==0.25.1
Pygments==2.8.1
PyQt5==5.15.4
PyQt5-Qt5==5.15.2
PyQt5-sip==12.8.1
python-dateutil==2.8.1
python-editor==1.0.4
python-vlc==3.0.11115
six==1.15.0
SQLAlchemy==1.4.2
tinytag==1.5.0
traitlets==5.0.5
typing-extensions==3.7.4.3
wcwidth==0.2.5
zipp==3.4.1