Skip to content

Commit

Permalink
Initial work on Lyrics pane
Browse files Browse the repository at this point in the history
  • Loading branch information
lainsce committed Aug 5, 2024
1 parent c6df8cd commit 1ac3221
Show file tree
Hide file tree
Showing 8 changed files with 634 additions and 110 deletions.
1 change: 0 additions & 1 deletion data/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

.side-pane .bottom-bar {
border-radius: 0 0 12px 12px;
margin: 0 1px 1px 1px;
}

.music-navrail {
Expand Down
39 changes: 33 additions & 6 deletions data/ui/window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,42 @@ template VictrolaMainWindow : He.ApplicationWindow {
show-back: bind album.folded;
show-left-title-buttons: bind album.folded;
show-right-title-buttons: true;

[titlebar-toggle]
ToggleButton lyrics_btn {
icon-name: "edit-find-symbolic";
tooltip-text: _("See Lyrics");
}
}

Box info_box {
orientation: vertical;
vexpand: true;
Stack infostack {
StackPage {
name: "info";
child:
Box info_box {
orientation: vertical;
vexpand: true;

styles [
"side-pane"
]
styles [
"side-pane"
]
}
;
}

StackPage {
name: "lyrics";
child:
Box lyrics_box {
orientation: vertical;
vexpand: true;

styles [
"side-pane"
]
}
;
}
}
}
;
Expand Down
6 changes: 6 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ dependencies = [
dependency('gtk4'),
dependency('gee-0.8'),
dependency('libhelium-1'),
dependency('libsoup-2.4'),
dependency('json-glib-1.0'),
dependency('libxml-2.0'),
dependency('libbismuth-1', fallback: [ 'libbismuth', 'libbismuth_dep' ], version: '>=1.0.0'),
libm_dep,
posix_dep,
Expand All @@ -70,7 +73,10 @@ sources = [
'src/Utils/mpris.vala',
'src/Utils/song-store.vala',
'src/Utils/tag-parser.vala',
'src/Utils/lyric.vala',
'src/Utils/lyrics-catch.vala',
'src/Widgets/info-page.vala',
'src/Widgets/lyric-page.vala',
'src/Widgets/play-bar.vala',
'src/Widgets/play-bar-mobile.vala',
'src/Widgets/song-entry.vala',
Expand Down
30 changes: 30 additions & 0 deletions src/Utils/lyric.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Gee;

namespace Victrola {
public class Lyric : Object {

/* Fields */
public string title { get; set; }
public string artist { get; set; }
public string lyric { get; set; }
public string lyric_sync { get; set; }
private string[] urls;
public string current_url { get; set; }
public string current_sync_url { get; set; }

public void add_url(string url) {
urls += url;
}

public int get_len_urls() {
return urls.length;
}

public string get_url_from_index(int index) {
if (index > get_len_urls()) {
return "";
}
return urls[index];
}
}
}
Loading

0 comments on commit 1ac3221

Please sign in to comment.