Backend changed from DBus to playerctl, small UI tweaks and small change in the README
parent
6f4e13de85
commit
b647177662
|
@ -1,3 +1,6 @@
|
||||||
|
* Thu Sep 01 2022 Gianmarco Gargiulo <me@gianmarco.ga> 0.0.2
|
||||||
|
- Backend changed from DBus to playerctl and small UI tweaks.
|
||||||
|
|
||||||
* Sun Aug 14 2022 Gianmarco Gargiulo <me@gianmarco.ga> 0.0.1
|
* Sun Aug 14 2022 Gianmarco Gargiulo <me@gianmarco.ga> 0.0.1
|
||||||
- Versione iniziale
|
- Versione iniziale
|
||||||
|
|
||||||
|
|
BIN
.icon.png
BIN
.icon.png
Binary file not shown.
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
22
.project
22
.project
|
@ -2,7 +2,7 @@
|
||||||
Title=Vimus
|
Title=Vimus
|
||||||
Startup=FMain
|
Startup=FMain
|
||||||
Icon=icon2048.png
|
Icon=icon2048.png
|
||||||
Version=0.0.1
|
Version=0.0.2
|
||||||
Component=gb.image
|
Component=gb.image
|
||||||
Component=gb.gui.qt
|
Component=gb.gui.qt
|
||||||
Component=gb.form
|
Component=gb.form
|
||||||
|
@ -10,4 +10,24 @@ Description="A simple song and album visualizer made with Gambas"
|
||||||
Authors="Gianmarco Gargiulo"
|
Authors="Gianmarco Gargiulo"
|
||||||
TabSize=2
|
TabSize=2
|
||||||
Language=en_US
|
Language=en_US
|
||||||
|
Maintainer=Gianmarco Gargiulo
|
||||||
|
Vendor=gianmarcogg03
|
||||||
|
Address=me@gianmarco.ga
|
||||||
|
Url=https://gianmarco.ga
|
||||||
|
License=General Public License
|
||||||
|
PackageName=vimus-0.0.2
|
||||||
|
CreateEachDirectory=1
|
||||||
Packager=1
|
Packager=1
|
||||||
|
Systems=archlinux,debian,fedora,suse,ubuntu
|
||||||
|
Menus=archlinux:"Applications/Sound"
|
||||||
|
Groups=archlinux:"sound"
|
||||||
|
Menus=debian:"Applications/Sound"
|
||||||
|
Groups=debian:"sound"
|
||||||
|
Menus=fedora:"Audio Video/Music"
|
||||||
|
Categories=fedora:"AudioVideo;Music"
|
||||||
|
Groups=fedora:"Applications/Multimedia"
|
||||||
|
Menus=suse:"Audio Video/Music"
|
||||||
|
Categories=suse:"AudioVideo;Music"
|
||||||
|
Groups=suse:"Productivity/Multimedia/Sound/Visualization"
|
||||||
|
Menus=ubuntu:"Applications/Sound"
|
||||||
|
Groups=ubuntu:"sound"
|
||||||
|
|
|
@ -10,23 +10,26 @@ Public Sub Timer1_Timer()
|
||||||
Dim songCover As String
|
Dim songCover As String
|
||||||
|
|
||||||
'Getting the title
|
'Getting the title
|
||||||
Shell "dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | sed -n '/title/{n;p}' | cut -d '\"' -f 2" To songTitle
|
Shell "playerctl metadata xesam:title" To songTitle
|
||||||
songTitle = Replace$(songTitle, "\n", "")
|
songTitle = Replace$(songTitle, "\n", "")
|
||||||
|
|
||||||
'Getting the artist name
|
'Getting the artist name
|
||||||
Shell "dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | sed -n '/artist/{n;n;p}' | cut -d '\"' -f 2" To songArtist
|
Shell "playerctl metadata xesam:artist" To songArtist
|
||||||
songArtist = Replace$(songArtist, "\n", "")
|
songArtist = Replace$(songArtist, "\n", "")
|
||||||
|
|
||||||
'Getting the album name
|
'Getting the album name
|
||||||
Shell "dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | sed -n '/album/{n;p}' | cut -d '\"' -f 2 | sed '2d'" To songAlbum
|
Shell "playerctl metadata xesam:album" To songAlbum
|
||||||
songAlbum = Replace$(songAlbum, "\n", "")
|
songAlbum = Replace$(songAlbum, "\n", "")
|
||||||
|
|
||||||
'Getting the year
|
'Getting the year
|
||||||
Shell "dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | sed -n '/year/{n;p}' | cut -d '\"' -f 2 | awk '{ print $3 }'" To songYear
|
Shell "playerctl metadata year" To songYear
|
||||||
|
If songYear = "" Then
|
||||||
|
Shell "playerctl metadata xesam:contentCreated | awk '{print substr ($0, 0, 4)}'" To songYear
|
||||||
|
Endif
|
||||||
songYear = Replace$(songYear, "\n", "")
|
songYear = Replace$(songYear, "\n", "")
|
||||||
|
|
||||||
'Getting the cover art
|
'Getting the cover art
|
||||||
Shell "dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata' | sed -n '/artUrl/{n;p}' | cut -d '\"' -f 2" To songCover
|
Shell "playerctl metadata mpris:artUrl" To songCover
|
||||||
songCover = Replace$(songCover, "\n", "")
|
songCover = Replace$(songCover, "\n", "")
|
||||||
songCover = Replace$(songCover, "file://", "")
|
songCover = Replace$(songCover, "file://", "")
|
||||||
|
|
||||||
|
|
|
@ -9,20 +9,20 @@
|
||||||
Arrangement = Arrange.Fill
|
Arrangement = Arrange.Fill
|
||||||
Centered = True
|
Centered = True
|
||||||
{ MainPanel Panel
|
{ MainPanel Panel
|
||||||
MoveScaled(0,16,177,58)
|
MoveScaled(0,8,177,73)
|
||||||
{ CoverPic PictureBox
|
{ CoverPic PictureBox
|
||||||
MoveScaled(70.7143,0,36.5714,36.5714)
|
MoveScaled(60.4286,0,56,56)
|
||||||
Picture = Picture.Load("icon:/256/audio")
|
Picture = Picture.Load("icon:/256/audio")
|
||||||
Stretch = True
|
Stretch = True
|
||||||
}
|
}
|
||||||
{ TitleLabel Label
|
{ TitleLabel Label
|
||||||
MoveScaled(0,40,178,10)
|
MoveScaled(0,58,177,9)
|
||||||
Font = Font["Bold,+6"]
|
Font = Font["Bold,+6"]
|
||||||
Alignment = Align.Center
|
Alignment = Align.Center
|
||||||
Text = ("No title")
|
Text = ("No title")
|
||||||
}
|
}
|
||||||
{ ArtistLabel Label
|
{ ArtistLabel Label
|
||||||
MoveScaled(-3,51,184,6)
|
MoveScaled(0,67,177,6)
|
||||||
Font = Font["+2"]
|
Font = Font["+2"]
|
||||||
Alignment = Align.Center
|
Alignment = Align.Center
|
||||||
Text = ("No artist · No album (No year)")
|
Text = ("No artist · No album (No year)")
|
||||||
|
|
|
@ -13,5 +13,3 @@ It's really really simple: when you play a song in Clementine (for now it's hard
|
||||||
![Daft Punk's Robot Rock](https://gianmarco.ga/software/img/robotrock.png)
|
![Daft Punk's Robot Rock](https://gianmarco.ga/software/img/robotrock.png)
|
||||||
|
|
||||||
![Thomas Bangalter's Colossus](https://gianmarco.ga/software/img/colossus.png)
|
![Thomas Bangalter's Colossus](https://gianmarco.ga/software/img/colossus.png)
|
||||||
|
|
||||||
The code itself is very bad and hacky and was done in just a few days, just a bunch of shell commands directing to DBus to get the data Vimus needs to display. Feel free to suggest any changes or to make a pull request to make it simpler and more efficient.
|
|
||||||
|
|
Loading…
Reference in New Issue