diff --git a/.directory b/.directory new file mode 100644 index 0000000..06dab1c --- /dev/null +++ b/.directory @@ -0,0 +1,2 @@ +[Desktop Entry] +Icon=./.icon.png diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..06e26c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +#---- Gambas files to ignore (v5) +*.gambas +.lock +*~ +core +core.* +vgcore +vgcore.* +.kdbg* +.*.prof +.lang/*.pot +.gambas/* +.settings +.startup +.list +.info +#---- diff --git a/.icon.png b/.icon.png new file mode 100644 index 0000000..9c4741a Binary files /dev/null and b/.icon.png differ diff --git a/.project b/.project new file mode 100644 index 0000000..2d9d131 --- /dev/null +++ b/.project @@ -0,0 +1,13 @@ +# Gambas Project File 3.0 +Title=Vimus +Startup=FMain +Icon=icon2048.png +Version=0.0.1 +Component=gb.image +Component=gb.gui.qt +Component=gb.form +Description="A simple song and album visualizer made with Gambas" +Authors="Gianmarco Gargiulo" +TabSize=2 +Language=en_US +Packager=1 diff --git a/.src/FMain.class b/.src/FMain.class new file mode 100644 index 0000000..f15a37c --- /dev/null +++ b/.src/FMain.class @@ -0,0 +1,44 @@ +' Gambas class file + + +Public Sub Timer1_Timer() + + Dim songTitle As String + Dim songArtist As String + Dim songAlbum As String + Dim songYear As String + Dim songCover As String + + '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 + songTitle = Replace$(songTitle, "\n", "") + + '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 + songArtist = Replace$(songArtist, "\n", "") + + '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" To songAlbum + songAlbum = Replace$(songAlbum, "\n", "") + + '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 + songYear = Replace$(songYear, "\n", "") + + '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 + songCover = Replace$(songCover, "\n", "") + songCover = Replace$(songCover, "file://", "") + + 'Displaying all the data on screen + TitleLabel.Text = songTitle + ArtistLabel.Text = songArtist & " · " & songAlbum & " (" & songYear & ")" + CoverPic.Picture = Picture.Load(songCover) + +End + +Public Sub Form_Open() + + Timer1.Start + +End diff --git a/.src/FMain.form b/.src/FMain.form new file mode 100644 index 0000000..77179b7 --- /dev/null +++ b/.src/FMain.form @@ -0,0 +1,31 @@ +# Gambas Form File 3.0 + +{ Form Form + MoveScaled(0,0,148,89) + Background = Color.Black + FullScreen = True + { MainPanel Panel + MoveScaled(17.5714,15.5714,112.8571,57.8571) + { ArtistLabel Label + MoveScaled(0.4286,51,112,6) + Font = Font["+2"] + Alignment = Align.Center + Text = ("No artist · No album (No year)") + } + { TitleLabel Label + MoveScaled(3.4286,40,106,10) + Font = Font["Bold,+6"] + Alignment = Align.Center + Text = ("No title") + } + { CoverPic PictureBox + MoveScaled(38.1429,0,36.5714,36.5714) + Picture = Picture.Load("icon:/256/audio") + Stretch = True + } + } + { Timer1 #Timer + #MoveScaled(139,2) + Delay = 1 + } +}