Start implementation of database functionality, starting with table generation.

This database will be stored in the user's XDG_DATA_HOME directory under a folder called `com.github.joshstrobl.koto`.

Refactored Koto Track Listing into a dedicated Disc View component, break apart out CDs / Discs into relevant Disc View components, sorting them by the disc and showing a label if there are more than one discs / CDs.

Started using the row-activated event for our Artist GtkListBox instead of having press events on the artist buttons. Makes switching between artists far more reliable. Added a slide left / right stack animation and set its animation to 400ms so it's in the goldilocks zone (IMO) of not being too fast or too slow.

Fix a warning related to scale factor fetching in the PlayerBar.
This commit is contained in:
Joshua Strobl 2021-02-27 17:26:24 +02:00
parent 134b4d79a8
commit eac4940c77
17 changed files with 434 additions and 61 deletions

View file

@ -16,10 +16,13 @@
*/
#include <glib/gi18n.h>
#include "db/db.h"
#include "koto-config.h"
#include "koto-window.h"
extern sqlite3 *koto_db;
static void on_activate (GtkApplication *app) {
g_assert(GTK_IS_APPLICATION (app));
@ -33,6 +36,16 @@ static void on_activate (GtkApplication *app) {
gtk_window_present(window);
}
static void on_shutdown(GtkApplication *app) {
(void) app;
if (koto_db != NULL) {
g_message("Have a db?");
}
close_db(); // Close the database
}
int main (int argc, char *argv[]) {
g_autoptr(GtkApplication) app = NULL;
int ret;
@ -43,8 +56,10 @@ int main (int argc, char *argv[]) {
textdomain (GETTEXT_PACKAGE);
gtk_init();
open_db(); // Open our database
app = gtk_application_new ("com.github.joshstrobl.koto", G_APPLICATION_FLAGS_NONE);
g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
g_signal_connect(app, "shutdown", G_CALLBACK(on_shutdown), NULL);
ret = g_application_run (G_APPLICATION (app), argc, argv);
return ret;