diff --git a/README.md b/README.md
index 4ac03de..2a74b8a 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,8 @@ A music player without the library management. Just toss in your music to the pl
![Byte Screenshot](https://github.com/alainm23/byte/raw/master/data/screenshot/screenshot-01.png)
![Byte Screenshot](https://github.com/alainm23/byte/raw/master/data/screenshot/screenshot-02.png)
![Byte Screenshot](https://github.com/alainm23/byte/raw/master/data/screenshot/screenshot-03.png)
+![Byte Screenshot](https://github.com/alainm23/byte/raw/master/data/screenshot/screenshot-04.png)
+![Byte Screenshot](https://github.com/alainm23/byte/raw/master/data/screenshot/screenshot-05.png)
## Building and Installation
diff --git a/data/com.github.alainm23.byte.appdata.xml.in b/data/com.github.alainm23.byte.appdata.xml.in
index 7506f2f..cc9d2e5 100644
--- a/data/com.github.alainm23.byte.appdata.xml.in
+++ b/data/com.github.alainm23.byte.appdata.xml.in
@@ -39,6 +39,12 @@
https://raw.githubusercontent.com/alainm23/byte/master/data/screenshot/screenshot-03.png
+
+ https://raw.githubusercontent.com/alainm23/byte/master/data/screenshot/screenshot-04.png
+
+
+ https://raw.githubusercontent.com/alainm23/byte/master/data/screenshot/screenshot-05.png
+
none
diff --git a/data/screenshot/screenshot-01.png b/data/screenshot/screenshot-01.png
index 42a70c4..8886f61 100644
Binary files a/data/screenshot/screenshot-01.png and b/data/screenshot/screenshot-01.png differ
diff --git a/data/screenshot/screenshot-02.png b/data/screenshot/screenshot-02.png
index 35e867c..a638cda 100644
Binary files a/data/screenshot/screenshot-02.png and b/data/screenshot/screenshot-02.png differ
diff --git a/data/screenshot/screenshot-03.png b/data/screenshot/screenshot-03.png
index 55112f8..06e2765 100644
Binary files a/data/screenshot/screenshot-03.png and b/data/screenshot/screenshot-03.png differ
diff --git a/data/screenshot/screenshot-04.png b/data/screenshot/screenshot-04.png
new file mode 100644
index 0000000..defe079
Binary files /dev/null and b/data/screenshot/screenshot-04.png differ
diff --git a/data/screenshot/screenshot-05.png b/data/screenshot/screenshot-05.png
new file mode 100644
index 0000000..abc1299
Binary files /dev/null and b/data/screenshot/screenshot-05.png differ
diff --git a/src/Services/Database.vala b/src/Services/Database.vala
index c2a3d0b..9628ab1 100644
--- a/src/Services/Database.vala
+++ b/src/Services/Database.vala
@@ -1351,6 +1351,31 @@ public class Services.Database : GLib.Object {
}
}
+ public bool remove_from_playlist (Objects.Track track) {
+ Sqlite.Statement stmt;
+ string sql;
+ int res;
+
+ sql = """
+ DELETE FROM playlist_tracks where track_id = ? AND playlist_id = ?;
+ """;
+
+ res = db.prepare_v2 (sql, -1, out stmt);
+ assert (res == Sqlite.OK);
+
+ res = stmt.bind_int (1, track.id);
+ assert (res == Sqlite.OK);
+
+ res = stmt.bind_int (2, track.playlist);
+ assert (res == Sqlite.OK);
+
+ if (stmt.step () == Sqlite.DONE) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
public void reset_all_library () {
File db_path = File.new_for_path (db_path);
try {
diff --git a/src/Utils.vala b/src/Utils.vala
index 4506568..d6c183a 100644
--- a/src/Utils.vala
+++ b/src/Utils.vala
@@ -14,31 +14,25 @@ public class Utils : GLib.Object {
COVER_FOLDER = GLib.Path.build_filename (MAIN_FOLDER, "covers");
}
- public void set_items (Gee.ArrayList all_items, bool shuffle_mode, Objects.Track? track) {
- /*
- print ("-------------------\n");
- foreach (var item in queue_playlist) {
- print ("Track: %s\n".printf (item.title));
- }
- print ("--------------------\n");
- */
-
- if (shuffle_mode) {
- queue_playlist = generate_shuffle (all_items);
-
- if (track != null) {
- int index = get_track_index_by_id (track.id, queue_playlist);
- queue_playlist.remove_at (index);
- queue_playlist.insert (0, track);
+ public void set_items (Gee.ArrayList all_items, bool shuffle_mode, Objects.Track? track) {
+ if (all_items.size > 0) {
+ if (shuffle_mode) {
+ queue_playlist = generate_shuffle (all_items);
+
+ if (track != null) {
+ int index = get_track_index_by_id (track.id, queue_playlist);
+ queue_playlist.remove_at (index);
+ queue_playlist.insert (0, track);
+ }
+
+ Byte.settings.set_boolean ("shuffle-mode", true);
+ } else {
+ queue_playlist = playlist_order (all_items);
+ Byte.settings.set_boolean ("shuffle-mode", false);
}
- Byte.settings.set_boolean ("shuffle-mode", true);
- } else {
- queue_playlist = playlist_order (all_items);
- Byte.settings.set_boolean ("shuffle-mode", false);
- }
-
- play_items (queue_playlist, track);
+ play_items (queue_playlist, track);
+ }
}
public void shuffle_changed (bool shuffle_mode) {
diff --git a/src/Views/Album.vala b/src/Views/Album.vala
index afee8e0..f6f1e38 100644
--- a/src/Views/Album.vala
+++ b/src/Views/Album.vala
@@ -137,8 +137,6 @@ public class Views.Album : Gtk.EventBox {
var action_grid = new Gtk.Grid ();
action_grid.margin = 6;
- action_grid.margin_start = 12;
- action_grid.margin_end = 12;
action_grid.column_spacing = 12;
action_grid.add (play_button);
action_grid.add (shuffle_button);
@@ -153,20 +151,16 @@ public class Views.Album : Gtk.EventBox {
var album_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
album_box.hexpand = true;
- album_box.margin = 12;
- album_box.margin_bottom = 6;
- album_box.margin_top = 12;
+ album_box.margin = 6;
album_box.pack_start (image_cover, false, false, 0);
album_box.pack_start (detail_box, false, false, 0);
listbox = new Gtk.ListBox ();
listbox.expand = true;
- listbox.margin_start = 9;
- listbox.margin_end = 9;
var separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL);
- separator.margin_start = 14;
- separator.margin_end = 9;
+ separator.margin_start = 6;
+ separator.margin_end = 6;
var scrolled_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
scrolled_box.expand = true;
diff --git a/src/Views/Home.vala b/src/Views/Home.vala
index 633f58f..5392d93 100644
--- a/src/Views/Home.vala
+++ b/src/Views/Home.vala
@@ -36,7 +36,10 @@ public class Views.Home : Gtk.EventBox {
var playlists_button = new Widgets.HomeButton (_("Playlists"), "playlist-symbolic");
var albums_button = new Widgets.HomeButton (_("Albums"), "byte-album-symbolic");
var songs_button = new Widgets.HomeButton (_("Songs"), "folder-music-symbolic");
+
var artists_button = new Widgets.HomeButton ("Artists", "byte-artist-symbolic");
+ artists_button.sensitive = false;
+
var radios_button = new Widgets.HomeButton ("Radios", "byte-radio-symbolic");
var favorites_button = new Widgets.HomeButton ("Favorites", "byte-favorite-symbolic");
diff --git a/src/Views/Playlist.vala b/src/Views/Playlist.vala
index da91fe9..ba21d89 100644
--- a/src/Views/Playlist.vala
+++ b/src/Views/Playlist.vala
@@ -160,8 +160,6 @@ public class Views.Playlist : Gtk.EventBox {
var action_grid = new Gtk.Grid ();
action_grid.margin = 6;
- action_grid.margin_start = 12;
- action_grid.margin_end = 12;
action_grid.column_spacing = 12;
action_grid.add (play_button);
action_grid.add (shuffle_button);
@@ -175,24 +173,20 @@ public class Views.Playlist : Gtk.EventBox {
var album_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
album_box.hexpand = true;
- album_box.margin = 12;
- album_box.margin_bottom = 6;
- album_box.margin_top = 12;
+ album_box.margin = 6;
album_box.pack_start (image_cover, false, false, 0);
album_box.pack_start (detail_box, false, false, 0);
listbox = new Gtk.ListBox ();
listbox.expand = true;
- listbox.margin_start = 9;
- listbox.margin_end = 9;
var separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL);
- separator.margin_start = 14;
- separator.margin_end = 9;
+ separator.margin_start = 6;
+ separator.margin_end = 6;
var separator_2 = new Gtk.Separator (Gtk.Orientation.HORIZONTAL);
- separator_2.margin_start = 14;
- separator_2.margin_end = 9;
+ separator_2.margin_start = 6;
+ separator_2.margin_end = 6;
var scrolled_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
scrolled_box.expand = true;
diff --git a/src/Widgets/AlertView.vala b/src/Widgets/AlertView.vala
index 2037d73..cf90263 100644
--- a/src/Widgets/AlertView.vala
+++ b/src/Widgets/AlertView.vala
@@ -45,7 +45,7 @@ public class Widgets.AlertView : Gtk.Grid {
set {
if (value != null && value != "") {
image.gicon = new ThemedIcon (value);
- image.pixel_size = 48;
+ image.pixel_size = 32;
image.no_show_all = false;
image.show ();
} else {
@@ -73,7 +73,7 @@ public class Widgets.AlertView : Gtk.Grid {
title_label = new Gtk.Label (null);
title_label.halign = Gtk.Align.CENTER;
title_label.hexpand = true;
- title_label.get_style_context ().add_class (Granite.STYLE_CLASS_H2_LABEL);
+ title_label.get_style_context ().add_class (Granite.STYLE_CLASS_H3_LABEL);
title_label.max_width_chars = 75;
title_label.wrap = true;
title_label.wrap_mode = Pango.WrapMode.WORD_CHAR;
@@ -83,7 +83,7 @@ public class Widgets.AlertView : Gtk.Grid {
description_label.hexpand = true;
description_label.max_width_chars = 75;
description_label.wrap = true;
- description_label.get_style_context ().add_class (Granite.STYLE_CLASS_H3_LABEL);
+ //description_label.get_style_context ().add_class (Granite.STYLE_CLASS_H3_LABEL);
description_label.use_markup = true;
description_label.xalign = 0;
description_label.valign = Gtk.Align.START;
@@ -91,12 +91,13 @@ public class Widgets.AlertView : Gtk.Grid {
image = new Gtk.Image ();
image.opacity = 1;
+ image.margin_bottom = 6;
image.valign = Gtk.Align.START;
var layout = new Gtk.Grid ();
//layout.get_style_context ().add_class ("label-color-primary");
layout.orientation = Gtk.Orientation.VERTICAL;
- layout.row_spacing = 6;
+ layout.row_spacing = 0;
layout.halign = Gtk.Align.CENTER;
layout.valign = Gtk.Align.START;
layout.vexpand = true;
diff --git a/src/Widgets/HeaderBar.vala b/src/Widgets/HeaderBar.vala
index 7a7863c..7c55139 100644
--- a/src/Widgets/HeaderBar.vala
+++ b/src/Widgets/HeaderBar.vala
@@ -99,6 +99,7 @@ public class Widgets.HeaderBar : Gtk.HeaderBar {
*/
var search_menuitem = new Widgets.ModelButton (_("Search"), "edit-find-symbolic", _("Search"));
+ search_menuitem.sensitive = false;
var import_menuitem = new Widgets.ModelButton (_("Import Music"), "document-import-symbolic", _("Import Music"));
var resync_menuitem = new Widgets.ModelButton (_("Resync Libray"), "emblem-synchronizing-symbolic", _("Resync Libray"));
var preferences_menuitem = new Widgets.ModelButton (_("Preferences"), "preferences-system-symbolic", _("Preferences"));
diff --git a/src/Widgets/PlaylistRow.vala b/src/Widgets/PlaylistRow.vala
index e0149f6..383f171 100644
--- a/src/Widgets/PlaylistRow.vala
+++ b/src/Widgets/PlaylistRow.vala
@@ -21,11 +21,14 @@ public class Widgets.PlaylistRow : Gtk.ListBoxRow {
title_label.halign = Gtk.Align.START;
title_label.valign = Gtk.Align.END;
+ /*
var tracks_label = new Gtk.Label ("Updated %s".printf(
Granite.DateTime.get_relative_datetime (
new GLib.DateTime.from_iso8601 (playlist.date_updated, new GLib.TimeZone.local ())
))
);
+ */
+ var tracks_label = new Gtk.Label (null);
tracks_label.get_style_context ().add_class ("h3");
tracks_label.halign = Gtk.Align.START;
tracks_label.valign = Gtk.Align.START;
diff --git a/src/Widgets/Queue.vala b/src/Widgets/Queue.vala
index a4ae82f..087c6bc 100644
--- a/src/Widgets/Queue.vala
+++ b/src/Widgets/Queue.vala
@@ -53,8 +53,8 @@ public class Widgets.Queue : Gtk.Revealer {
*/
var notification_image = new Gtk.Image ();
- notification_image.gicon = new ThemedIcon ("notification-symbolic");
- notification_image.pixel_size = 24;
+ notification_image.gicon = new ThemedIcon ("byte-favorite-symbolic");
+ notification_image.pixel_size = 16;
notification_image.margin_top = 1;
notification_image.valign = Gtk.Align.CENTER;
notification_image.halign = Gtk.Align.CENTER;
@@ -145,7 +145,7 @@ public class Widgets.Queue : Gtk.Revealer {
mode_button.margin = 3;
mode_button.append_text (_("Up Next"));
//mode_button.append_text (_("History"));
- mode_button.append_text (_("Lyrics"));
+ //mode_button.append_text (_("Lyrics"));
mode_button.selected = 0;
var title_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
diff --git a/src/Widgets/QuickFind.vala b/src/Widgets/QuickFind.vala
index 95350e0..8b6862c 100644
--- a/src/Widgets/QuickFind.vala
+++ b/src/Widgets/QuickFind.vala
@@ -60,8 +60,8 @@ public class Widgets.QuickFind : Gtk.Revealer {
radios_spinner.start ();
var alert_view = new Widgets.AlertView (
- _("No Results"),
- _("lorem"),
+ _("Discovery..."),
+ _("Search your favorite radios"),
"edit-find-symbolic"
);
diff --git a/src/Widgets/TrackAlbumRow.vala b/src/Widgets/TrackAlbumRow.vala
index 0ac3969..640fb8b 100644
--- a/src/Widgets/TrackAlbumRow.vala
+++ b/src/Widgets/TrackAlbumRow.vala
@@ -66,6 +66,7 @@ public class Widgets.TrackAlbumRow : Gtk.ListBoxRow {
var separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL);
separator.margin_start = 6;
+ separator.margin_end = 6;
var grid = new Gtk.Grid ();
grid.hexpand = true;
@@ -157,7 +158,7 @@ public class Widgets.TrackAlbumRow : Gtk.ListBoxRow {
//var new_playlist = library_manager.create_new_playlist ();
//library_manager.add_track_into_playlist (new_playlist, track.ID);
});
- playlists.add (item);
+ //playlists.add (item);
foreach (var playlist in all_items) {
item = new Gtk.MenuItem.with_label (playlist.title);
@@ -236,7 +237,7 @@ public class Widgets.TrackAlbumRow : Gtk.ListBoxRow {
menu.add (play_last_menu);
menu.add (new Gtk.SeparatorMenuItem ());
menu.add (add_playlist_menu);
- menu.add (edit_menu);
+ //menu.add (edit_menu);
menu.add (favorite_menu);
menu.add (new Gtk.SeparatorMenuItem ());
diff --git a/src/Widgets/TrackRow.vala b/src/Widgets/TrackRow.vala
index 2d674de..2a88df4 100644
--- a/src/Widgets/TrackRow.vala
+++ b/src/Widgets/TrackRow.vala
@@ -240,7 +240,7 @@ public class Widgets.TrackRow : Gtk.ListBoxRow {
//var new_playlist = library_manager.create_new_playlist ();
//library_manager.add_track_into_playlist (new_playlist, track.ID);
});
- playlists.add (item);
+ //playlists.add (item);
foreach (var playlist in all_items) {
item = new Gtk.MenuItem.with_label (playlist.title);
@@ -319,7 +319,7 @@ public class Widgets.TrackRow : Gtk.ListBoxRow {
menu.add (play_last_menu);
menu.add (new Gtk.SeparatorMenuItem ());
menu.add (add_playlist_menu);
- menu.add (edit_menu);
+ //menu.add (edit_menu);
menu.add (favorite_menu);
menu.add (new Gtk.SeparatorMenuItem ());
@@ -372,7 +372,9 @@ public class Widgets.TrackRow : Gtk.ListBoxRow {
});
remove_playlist_menu.activate.connect (() => {
- destroy ();
+ if (Byte.database.remove_from_playlist (track)) {
+ destroy ();
+ }
});
}
}