Rename all KotoIndexed* to Koto*, KOTO_INDEXED_ to KOTO_, etc. Fixes #9.

This commit is contained in:
Joshua Strobl 2021-05-11 20:08:39 +03:00
parent 62de9c2032
commit 9f0e8dfbc8
28 changed files with 490 additions and 490 deletions

View file

@ -29,7 +29,7 @@ extern KotoCartographer * koto_maps;
struct _KotoAlbumView {
GObject parent_instance;
KotoIndexedAlbum * album;
KotoAlbum * album;
GtkWidget * main;
GtkWidget * album_tracks_box;
GtkWidget * discs;
@ -81,7 +81,7 @@ static void koto_album_view_class_init(KotoAlbumViewClass * c) {
"album",
"Album",
"Album",
KOTO_TYPE_INDEXED_ALBUM,
KOTO_TYPE_ALBUM,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_READWRITE
);
@ -172,7 +172,7 @@ static void koto_album_view_set_property(
switch (prop_id) {
case PROP_ALBUM:
koto_album_view_set_album(self, (KotoIndexedAlbum*) g_value_get_object(val));
koto_album_view_set_album(self, (KotoAlbum*) g_value_get_object(val));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop_id, spec);
@ -181,8 +181,8 @@ static void koto_album_view_set_property(
}
void koto_album_view_add_track_to_listbox(
KotoIndexedAlbum * self,
KotoIndexedTrack * track
KotoAlbum * self,
KotoTrack * track
) {
(void) self;
(void) track;
@ -201,7 +201,7 @@ void koto_album_view_hide_overlay_controls(
void koto_album_view_set_album(
KotoAlbumView * self,
KotoIndexedAlbum * album
KotoAlbum * album
) {
if (album == NULL) {
return;
@ -209,7 +209,7 @@ void koto_album_view_set_album(
self->album = album;
gchar * album_art = koto_indexed_album_get_album_art(self->album); // Get the art for the album
gchar * album_art = koto_album_get_album_art(self->album); // Get the art for the album
gtk_image_set_from_file(GTK_IMAGE(self->album_overlay_art), album_art);
@ -224,11 +224,11 @@ void koto_album_view_set_album(
gtk_box_prepend(GTK_BOX(self->album_tracks_box), self->album_label); // Prepend our new label to the album + tracks box
GHashTable * discs = g_hash_table_new(g_str_hash, g_str_equal);
GList * tracks = koto_indexed_album_get_tracks(album); // Get the tracks for this album
GList * tracks = koto_album_get_tracks(album); // Get the tracks for this album
for (guint i = 0; i < g_list_length(tracks); i++) {
KotoIndexedTrack * track = koto_cartographer_get_track_by_uuid(koto_maps, (gchar*) g_list_nth_data(tracks, i)); // Get the track by its UUID
KotoTrack * track = koto_cartographer_get_track_by_uuid(koto_maps, (gchar*) g_list_nth_data(tracks, i)); // Get the track by its UUID
if (track == NULL) { // Track doesn't exist
continue;
@ -309,9 +309,9 @@ void koto_album_view_toggle_album_playback(
koto_button_show_image(KOTO_BUTTON(self->play_pause_button), TRUE);
koto_indexed_album_set_as_current_playlist(self->album); // Set as the current playlist
koto_album_set_as_current_playlist(self->album); // Set as the current playlist
}
KotoAlbumView * koto_album_view_new(KotoIndexedAlbum * album) {
KotoAlbumView * koto_album_view_new(KotoAlbum * album) {
return g_object_new(KOTO_TYPE_ALBUM_VIEW, "album", album, NULL);
}

View file

@ -27,12 +27,12 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE(KotoAlbumView, koto_album_view, KOTO, ALBUM_VIEW, GObject)
KotoAlbumView* koto_album_view_new(KotoIndexedAlbum * album);
KotoAlbumView* koto_album_view_new(KotoAlbum * album);
GtkWidget * koto_album_view_get_main(KotoAlbumView * self);
void koto_album_view_add_track_to_listbox(
KotoIndexedAlbum * self,
KotoIndexedTrack * track
KotoAlbum * self,
KotoTrack * track
);
void koto_album_view_hide_overlay_controls(
@ -42,7 +42,7 @@ void koto_album_view_hide_overlay_controls(
void koto_album_view_set_album(
KotoAlbumView * self,
KotoIndexedAlbum * album
KotoAlbum * album
);
void koto_album_view_show_overlay_controls(

View file

@ -28,7 +28,7 @@ extern KotoCartographer * koto_maps;
struct _KotoArtistView {
GObject parent_instance;
KotoIndexedArtist * artist;
KotoArtist * artist;
GtkWidget * scrolled_window;
GtkWidget * content;
GtkWidget * favorites_list;
@ -79,7 +79,7 @@ static void koto_artist_view_class_init(KotoArtistViewClass * c) {
"artist",
"Artist",
"Artist",
KOTO_TYPE_INDEXED_ARTIST,
KOTO_TYPE_ARTIST,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_READWRITE
);
@ -116,7 +116,7 @@ static void koto_artist_view_set_property(
switch (prop_id) {
case PROP_ARTIST:
koto_artist_view_add_artist(self, (KotoIndexedArtist*) g_value_get_object(val));
koto_artist_view_add_artist(self, (KotoArtist*) g_value_get_object(val));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop_id, spec);
@ -168,9 +168,9 @@ static void koto_artist_view_constructed(GObject * obj) {
void koto_artist_view_add_album(
KotoArtistView * self,
KotoIndexedAlbum * album
KotoAlbum * album
) {
gchar * album_art = koto_indexed_album_get_album_art(album); // Get the art for the album
gchar * album_art = koto_album_get_album_art(album); // Get the art for the album
GtkWidget * art_image = koto_utils_create_image_from_filepath(album_art, "audio-x-generic-symbolic", 220, 220);
@ -187,7 +187,7 @@ void koto_artist_view_add_album(
void koto_artist_view_add_artist(
KotoArtistView * self,
KotoIndexedArtist * artist
KotoArtist * artist
) {
if (artist == NULL) {
return;
@ -199,13 +199,13 @@ void koto_artist_view_add_artist(
return;
}
GList * albums = koto_indexed_artist_get_albums(self->artist); // Get the albums
GList * albums = koto_artist_get_albums(self->artist); // Get the albums
GList * a;
for (a = albums; a != NULL; a = a->next) {
KotoIndexedAlbum * album = koto_cartographer_get_album_by_uuid(koto_maps, (gchar*) a->data);
KotoAlbum * album = koto_cartographer_get_album_by_uuid(koto_maps, (gchar*) a->data);
if (album != NULL) {
koto_artist_view_add_album(self, album); // Add the album

View file

@ -30,12 +30,12 @@ G_DECLARE_FINAL_TYPE(KotoArtistView, koto_artist_view, KOTO, ARTIST_VIEW, GObjec
KotoArtistView* koto_artist_view_new();
void koto_artist_view_add_album(
KotoArtistView * self,
KotoIndexedAlbum * album
KotoAlbum * album
);
void koto_artist_view_add_artist(
KotoArtistView * self,
KotoIndexedArtist * artist
KotoArtist * artist
);
GtkWidget * koto_artist_view_get_main(KotoArtistView * self);

View file

@ -28,7 +28,7 @@ extern KotoCartographer * koto_maps;
struct _KotoDiscView {
GtkBox parent_instance;
KotoIndexedAlbum * album;
KotoAlbum * album;
GtkWidget * header;
GtkWidget * label;
GtkWidget * list;
@ -84,7 +84,7 @@ static void koto_disc_view_class_init(KotoDiscViewClass * c) {
"album",
"Album",
"Album",
KOTO_TYPE_INDEXED_ALBUM,
KOTO_TYPE_ALBUM,
G_PARAM_CONSTRUCT | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_READWRITE
);
@ -127,7 +127,7 @@ static void koto_disc_view_set_property(
koto_disc_view_set_disc_number(self, g_value_get_uint(val));
break;
case PROP_ALBUM:
koto_disc_view_set_album(self, (KotoIndexedAlbum*) g_value_get_object(val));
koto_disc_view_set_album(self, (KotoAlbum*) g_value_get_object(val));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop_id, spec);
@ -171,7 +171,7 @@ void koto_disc_view_list_tracks(
gpointer selfptr
) {
KotoDiscView * self = (KotoDiscView*) selfptr;
KotoIndexedTrack * track = koto_cartographer_get_track_by_uuid(koto_maps, (gchar*) data); // Get the track by its UUID
KotoTrack * track = koto_cartographer_get_track_by_uuid(koto_maps, (gchar*) data); // Get the track by its UUID
guint * disc_number;
@ -194,7 +194,7 @@ void koto_disc_view_handle_selected_rows_changed(
) {
KotoDiscView * self = user_data;
gchar * album_uuid = koto_indexed_album_get_album_uuid(self->album); // Get the UUID
gchar * album_uuid = koto_album_get_album_uuid(self->album); // Get the UUID
if (!koto_utils_is_string_valid(album_uuid)) { // Not set
@ -209,13 +209,13 @@ void koto_disc_view_handle_selected_rows_changed(
return;
}
GList * selected_tracks = NULL; // Create our list of KotoIndexedTracks
GList * selected_tracks = NULL; // Create our list of KotoTracks
GList * cur_selected_rows;
for (cur_selected_rows = selected_rows; cur_selected_rows != NULL; cur_selected_rows = cur_selected_rows->next) { // Iterate over the rows
KotoTrackItem * track_item = (KotoTrackItem*) gtk_list_box_row_get_child(cur_selected_rows->data);
selected_tracks = g_list_append(selected_tracks, koto_track_item_get_track(track_item)); // Add the KotoIndexedTrack to our list
selected_tracks = g_list_append(selected_tracks, koto_track_item_get_track(track_item)); // Add the KotoTrack to our list
}
g_list_free(cur_selected_rows);
@ -226,7 +226,7 @@ void koto_disc_view_handle_selected_rows_changed(
void koto_disc_view_set_album(
KotoDiscView * self,
KotoIndexedAlbum * album
KotoAlbum * album
) {
if (album == NULL) {
return;
@ -238,7 +238,7 @@ void koto_disc_view_set_album(
self->album = album;
g_list_foreach(koto_indexed_album_get_tracks(self->album), koto_disc_view_list_tracks, self);
g_list_foreach(koto_album_get_tracks(self->album), koto_disc_view_list_tracks, self);
}
void koto_disc_view_set_disc_number(
@ -267,7 +267,7 @@ void koto_disc_view_set_disc_label_visible(
}
KotoDiscView * koto_disc_view_new(
KotoIndexedAlbum * album,
KotoAlbum * album,
guint * disc_number
) {
return g_object_new(

View file

@ -27,7 +27,7 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE(KotoDiscView, koto_disc_view, KOTO, DISC_VIEW, GtkBox)
KotoDiscView* koto_disc_view_new(KotoIndexedAlbum * album, guint * disc);
KotoDiscView* koto_disc_view_new(KotoAlbum * album, guint * disc);
void koto_disc_view_handle_selected_rows_changed(
GtkListBox * box,
gpointer user_data
@ -40,7 +40,7 @@ void koto_disc_view_list_tracks(
void koto_disc_view_set_album(
KotoDiscView * self,
KotoIndexedAlbum * album
KotoAlbum * album
);
void koto_disc_view_set_disc_label_visible(

View file

@ -42,7 +42,7 @@ struct _KotoPageMusicLocal {
GtkWidget * artist_list;
GtkWidget * stack;
KotoIndexedLibrary * lib;
KotoLibrary * lib;
gboolean constructed;
};
@ -83,7 +83,7 @@ static void koto_page_music_local_class_init(KotoPageMusicLocalClass * c) {
"lib",
"Library",
"Library",
KOTO_TYPE_INDEXED_LIBRARY,
KOTO_TYPE_LIBRARY,
G_PARAM_CONSTRUCT | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_READWRITE
);
@ -120,7 +120,7 @@ static void koto_page_music_local_set_property(
switch (prop_id) {
case PROP_LIB:
koto_page_music_local_set_library(self, (KotoIndexedLibrary*) g_value_get_object(val));
koto_page_music_local_set_library(self, (KotoLibrary*) g_value_get_object(val));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, prop_id, spec);
@ -168,7 +168,7 @@ static void koto_page_music_local_constructed(GObject * obj) {
void koto_page_music_local_add_artist(
KotoPageMusicLocal * self,
KotoIndexedArtist * artist
KotoArtist * artist
) {
gchar * artist_name;
@ -197,10 +197,10 @@ void koto_page_music_local_go_to_artist_by_uuid(
KotoPageMusicLocal * self,
gchar * artist_uuid
) {
KotoIndexedArtist * artist = koto_cartographer_get_artist_by_uuid(koto_maps, artist_uuid); // Get the artist
KotoArtist * artist = koto_cartographer_get_artist_by_uuid(koto_maps, artist_uuid); // Get the artist
if (!KOTO_IS_INDEXED_ARTIST(artist)) { // No artist for this UUID
if (!KOTO_IS_ARTIST(artist)) { // No artist for this UUID
return;
}
@ -239,7 +239,7 @@ void koto_page_music_local_handle_artist_click(
void koto_page_music_local_set_library(
KotoPageMusicLocal * self,
KotoIndexedLibrary * lib
KotoLibrary * lib
) {
if (lib == NULL) {
return;
@ -259,12 +259,12 @@ void koto_page_music_local_set_library(
gpointer artist_key;
gpointer artist_data;
GHashTable * artists = koto_indexed_library_get_artists(self->lib); // Get the artists
GHashTable * artists = koto_library_get_artists(self->lib); // Get the artists
g_hash_table_iter_init(&artist_list_iter, artists);
while (g_hash_table_iter_next(&artist_list_iter, &artist_key, &artist_data)) { // For each of the music artists
KotoIndexedArtist * artist = koto_cartographer_get_artist_by_uuid(koto_maps, (gchar*) artist_data); // Cast our data as a KotoIndexedArtist
KotoArtist * artist = koto_cartographer_get_artist_by_uuid(koto_maps, (gchar*) artist_data); // Cast our data as a KotoArtist
if (artist != NULL) {
koto_page_music_local_add_artist(self, artist);

View file

@ -31,7 +31,7 @@ G_DECLARE_FINAL_TYPE(KotoPageMusicLocal, koto_page_music_local, KOTO, PAGE_MUSIC
KotoPageMusicLocal* koto_page_music_local_new();
void koto_page_music_local_add_artist(
KotoPageMusicLocal * self,
KotoIndexedArtist * artist
KotoArtist * artist
);
void koto_page_music_local_handle_artist_click(
@ -52,7 +52,7 @@ void koto_page_music_local_go_to_artist_by_uuid(
void koto_page_music_local_set_library(
KotoPageMusicLocal * self,
KotoIndexedLibrary * lib
KotoLibrary * lib
);
int koto_page_music_local_sort_artists(

View file

@ -245,10 +245,10 @@ void koto_playlist_page_bind_track_item(
GtkWidget * track_album_label = gtk_widget_get_next_sibling(track_name_label);
GtkWidget * track_artist_label = gtk_widget_get_next_sibling(track_album_label);
KotoIndexedTrack * track = gtk_list_item_get_item(item); // Get the track UUID from our model
KotoTrack * track = gtk_list_item_get_item(item); // Get the track UUID from our model
if (!KOTO_IS_INDEXED_TRACK(track)) {
if (!KOTO_IS_TRACK(track)) {
return;
}
@ -274,18 +274,18 @@ void koto_playlist_page_bind_track_item(
gtk_label_set_label(GTK_LABEL(track_position_label), g_strdup_printf("%u", track_position)); // Set the track position
gtk_label_set_label(GTK_LABEL(track_name_label), track_name); // Set our track name
KotoIndexedAlbum * album = koto_cartographer_get_album_by_uuid(koto_maps, album_uuid);
KotoAlbum * album = koto_cartographer_get_album_by_uuid(koto_maps, album_uuid);
if (KOTO_IS_INDEXED_ALBUM(album)) {
gtk_label_set_label(GTK_LABEL(track_album_label), koto_indexed_album_get_album_name(album)); // Get the name of the album and set it to the label
if (KOTO_IS_ALBUM(album)) {
gtk_label_set_label(GTK_LABEL(track_album_label), koto_album_get_album_name(album)); // Get the name of the album and set it to the label
}
KotoIndexedArtist * artist = koto_cartographer_get_artist_by_uuid(koto_maps, artist_uuid);
KotoArtist * artist = koto_cartographer_get_artist_by_uuid(koto_maps, artist_uuid);
if (KOTO_IS_INDEXED_ARTIST(artist)) {
gtk_label_set_label(GTK_LABEL(track_artist_label), koto_indexed_artist_get_name(artist)); // Get the name of the artist and set it to the label
if (KOTO_IS_ARTIST(artist)) {
gtk_label_set_label(GTK_LABEL(track_artist_label), koto_artist_get_name(artist)); // Get the name of the artist and set it to the label
}
}
@ -532,7 +532,7 @@ void koto_playlist_page_handle_tracks_selected(
for (cur_pos_list = selected_tracks_pos; cur_pos_list != NULL; cur_pos_list = cur_pos_list->next) { // Iterate over every position that we accumulated
KotoIndexedTrack * selected_track = g_list_model_get_item(self->model, GPOINTER_TO_UINT(cur_pos_list->data)); // Get the KotoIndexedTrack in the GListModel for this current position
KotoTrack * selected_track = g_list_model_get_item(self->model, GPOINTER_TO_UINT(cur_pos_list->data)); // Get the KotoTrack in the GListModel for this current position
selected_tracks = g_list_append(selected_tracks, selected_track); // Add to selected tracks
}