Compare commits
5 Commits
97524c201b
...
8366fed1be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8366fed1be | ||
|
|
5d61b514b5 | ||
|
|
00c9509c12 | ||
|
|
5492ad58d5 | ||
|
|
6ad141162d |
@ -139,9 +139,8 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
self.btnFade.clicked.connect(self.fade)
|
self.btnFade.clicked.connect(self.fade)
|
||||||
self.btnPlay.clicked.connect(self.play_next)
|
self.btnPlay.clicked.connect(self.play_next)
|
||||||
self.btnSetNext.clicked.connect(self.set_next_track)
|
self.btnSetNext.clicked.connect(self.set_next_track)
|
||||||
self.btnSongfacts.clicked.connect(self.songfacts_search)
|
self.btnSongInfo.clicked.connect(self.song_info_search)
|
||||||
self.btnStop.clicked.connect(self.stop)
|
self.btnStop.clicked.connect(self.stop)
|
||||||
self.btnWikipedia.clicked.connect(self.wikipedia_search)
|
|
||||||
self.spnVolume.valueChanged.connect(self.change_volume)
|
self.spnVolume.valueChanged.connect(self.change_volume)
|
||||||
self.tabPlaylist.currentChanged.connect(self.tab_change)
|
self.tabPlaylist.currentChanged.connect(self.tab_change)
|
||||||
|
|
||||||
@ -407,11 +406,28 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
QMessageBox.warning(None, title, msg, buttons=QMessageBox.Cancel)
|
QMessageBox.warning(None, title, msg, buttons=QMessageBox.Cancel)
|
||||||
|
|
||||||
def songfacts_search(self):
|
def song_info_search(self):
|
||||||
"Open a browser window in Songfacts searching for selected title"
|
"""
|
||||||
|
Open browser tabs for Wikipedia and Songfacts, searching for
|
||||||
|
the first that exists of:
|
||||||
|
- selected track
|
||||||
|
- current track
|
||||||
|
- next track
|
||||||
|
"""
|
||||||
|
|
||||||
title = self.visible_playlist().get_selected_title()
|
title = self.visible_playlist().get_selected_title()
|
||||||
|
if not title:
|
||||||
|
if self.current_track:
|
||||||
|
title = self.current_track.title
|
||||||
|
if not title:
|
||||||
|
if self.next_track:
|
||||||
|
title = self.next_track.title
|
||||||
if title:
|
if title:
|
||||||
|
# Wikipedia
|
||||||
|
str = urllib.parse.quote_plus(title)
|
||||||
|
url = f"https://www.wikipedia.org/w/index.php?search={str}"
|
||||||
|
webbrowser.open(url, new=2)
|
||||||
|
# Songfacts
|
||||||
slug = slugify(title, replacements=([["'", ""]]))
|
slug = slugify(title, replacements=([["'", ""]]))
|
||||||
url = f"https://www.songfacts.com/search/songs/{slug}"
|
url = f"https://www.songfacts.com/search/songs/{slug}"
|
||||||
webbrowser.open(url, new=2)
|
webbrowser.open(url, new=2)
|
||||||
@ -540,6 +556,8 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
self.current_track_playlist = None
|
self.current_track_playlist = None
|
||||||
self.previous_track_position = 0
|
self.previous_track_position = 0
|
||||||
self.update_headers()
|
self.update_headers()
|
||||||
|
# Release player
|
||||||
|
self.music.stop()
|
||||||
|
|
||||||
def update_headers(self):
|
def update_headers(self):
|
||||||
"Update last / current / next track headers"
|
"Update last / current / next track headers"
|
||||||
@ -568,15 +586,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.hdrNextTrack.setText("")
|
self.hdrNextTrack.setText("")
|
||||||
|
|
||||||
def wikipedia_search(self):
|
|
||||||
"Open a browser window in Wikipedia searching for selected title"
|
|
||||||
|
|
||||||
title = self.visible_playlist().get_selected_title()
|
|
||||||
if title:
|
|
||||||
str = urllib.parse.quote_plus(title)
|
|
||||||
url = f"https://www.wikipedia.org/w/index.php?search={str}"
|
|
||||||
webbrowser.open(url, new=2)
|
|
||||||
|
|
||||||
|
|
||||||
class DbDialog(QDialog):
|
class DbDialog(QDialog):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
|
|||||||
@ -242,7 +242,7 @@ class Playlist(QTableWidget):
|
|||||||
# Add empty start time for now as background
|
# Add empty start time for now as background
|
||||||
# colour won't be set for columns without items
|
# colour won't be set for columns without items
|
||||||
item = QTableWidgetItem()
|
item = QTableWidgetItem()
|
||||||
self.setItem(row, self.COL_PATH, item)
|
self.setItem(row, self.COL_START_TIME, item)
|
||||||
|
|
||||||
# Scroll to new row
|
# Scroll to new row
|
||||||
self.scrollToItem(titleitem, QAbstractItemView.PositionAtCenter)
|
self.scrollToItem(titleitem, QAbstractItemView.PositionAtCenter)
|
||||||
@ -333,6 +333,7 @@ class Playlist(QTableWidget):
|
|||||||
def play_stopped(self):
|
def play_stopped(self):
|
||||||
self._meta_clear_current()
|
self._meta_clear_current()
|
||||||
self.current_track_start_time = None
|
self.current_track_start_time = None
|
||||||
|
self._repaint(save_playlist=False)
|
||||||
|
|
||||||
def populate(self):
|
def populate(self):
|
||||||
# add them in row order. We don't mandate that an item will be
|
# add them in row order. We don't mandate that an item will be
|
||||||
|
|||||||
@ -260,6 +260,36 @@ border: 1px solid rgb(85, 87, 83);</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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="btnSongInfo">
|
||||||
|
<property name="text">
|
||||||
|
<string>Song info</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="icons.qrc">
|
||||||
|
<normaloff>:/icons/wikipedia</normaloff>:/icons/wikipedia</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>30</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnSetNext">
|
<widget class="QPushButton" name="btnSetNext">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -278,43 +308,13 @@ border: 1px solid rgb(85, 87, 83);</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<widget class="QPushButton" name="btnDatabase">
|
||||||
<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="btnWikipedia">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Wikipedia</string>
|
<string>Database</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="icons.qrc">
|
<iconset resource="icons.qrc">
|
||||||
<normaloff>:/icons/wikipedia</normaloff>:/icons/wikipedia</iconset>
|
<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="btnSongfacts">
|
|
||||||
<property name="text">
|
|
||||||
<string>Songfacts</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="icons.qrc">
|
|
||||||
<normaloff>:/icons/songsearch</normaloff>:/icons/songsearch</iconset>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
@ -368,13 +368,13 @@ border: 1px solid rgb(85, 87, 83);</string>
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnDatabase">
|
<widget class="QPushButton" name="btnAddNote">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Database</string>
|
<string>Add note</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="icons.qrc">
|
<iconset resource="icons.qrc">
|
||||||
<normaloff>:/icons/search_db</normaloff>:/icons/search_db</iconset>
|
<normaloff>:/icons/note</normaloff>:/icons/note</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
@ -401,23 +401,6 @@ border: 1px solid rgb(85, 87, 83);</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<spacer name="horizontalSpacer_3">
|
<spacer name="horizontalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@ -751,7 +734,7 @@ border: 1px solid rgb(85, 87, 83);</string>
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1164</width>
|
<width>1164</width>
|
||||||
<height>18</height>
|
<height>26</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
gdb -ex r --args /home/kae/git/musicmuster/.direnv/python-3.7.3/bin/python app/musicmuster.py
|
gdb -ex r --args /home/kae/git/musicmuster/.direnv/python-3.9.2/bin/python app/musicmuster.py
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user