You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(132) |
Dec
(135) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(87) |
Feb
(82) |
Mar
(117) |
Apr
(108) |
May
(231) |
Jun
(265) |
Jul
(31) |
Aug
(32) |
Sep
(89) |
Oct
(50) |
Nov
(112) |
Dec
(92) |
2007 |
Jan
(136) |
Feb
(82) |
Mar
(66) |
Apr
(104) |
May
(74) |
Jun
(103) |
Jul
(50) |
Aug
(23) |
Sep
(22) |
Oct
(39) |
Nov
(56) |
Dec
(88) |
2008 |
Jan
(51) |
Feb
(6) |
Mar
(6) |
Apr
(9) |
May
(39) |
Jun
(24) |
Jul
(48) |
Aug
(40) |
Sep
(9) |
Oct
(21) |
Nov
(12) |
Dec
(31) |
2009 |
Jan
(68) |
Feb
(14) |
Mar
(29) |
Apr
(40) |
May
(27) |
Jun
(9) |
Jul
(1) |
Aug
(10) |
Sep
(3) |
Oct
(7) |
Nov
(11) |
Dec
(165) |
2010 |
Jan
(72) |
Feb
(49) |
Mar
(30) |
Apr
(41) |
May
(17) |
Jun
(13) |
Jul
(99) |
Aug
(88) |
Sep
(59) |
Oct
(23) |
Nov
(11) |
Dec
(44) |
2011 |
Jan
(50) |
Feb
(28) |
Mar
(27) |
Apr
(18) |
May
(38) |
Jun
(5) |
Jul
(59) |
Aug
(7) |
Sep
(44) |
Oct
(12) |
Nov
(7) |
Dec
(10) |
2012 |
Jan
(8) |
Feb
(11) |
Mar
(17) |
Apr
(11) |
May
(3) |
Jun
(11) |
Jul
(26) |
Aug
(3) |
Sep
|
Oct
(17) |
Nov
(9) |
Dec
(1) |
2013 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: phantomjinx <pha...@us...> - 2011-10-03 20:00:56
|
commit 8429fa4b49ea6ce1a232dbb81f46d05ac5b3b4fd Author: phantomjinx <p.g...@ph...> Date: Mon Oct 3 20:57:57 2011 +0100 Allow the multiple selection of playlists in the playlist view * Only the first selection is passed to libgtkpod and notified to other plugins. * On selection of extra playlists, a reduced context menu can be displayed, allowing for actions to be performed on the set of playlists, notably deletion. Fixes:3413192 - Not obvious how to delete a playlist without selecting from libgtkpod/context_menus.c | 24 --- libgtkpod/context_menus.h | 1 - plugins/playlist_display/display_playlists.c | 211 ++++++++++---------- plugins/playlist_display/display_playlists.h | 12 +- .../playlist_display/playlist_display_actions.c | 68 ++++--- .../playlist_display/playlist_display_actions.h | 14 +- .../playlist_display_context_menu.c | 134 ++++++++++--- plugins/playlist_display/plugin.c | 12 +- 8 files changed, 276 insertions(+), 200 deletions(-) --- diff --git a/libgtkpod/context_menus.c b/libgtkpod/context_menus.c index c781d44..1a56c90 100644 --- a/libgtkpod/context_menus.c +++ b/libgtkpod/context_menus.c @@ -110,11 +110,6 @@ GtkWidget *add_separator(GtkWidget *menu) { return sep; } -void context_menu_delete_track_head(GtkMenuItem *mi, gpointer data) { - DeleteAction deleteaction = GPOINTER_TO_INT (data); - delete_track_head(deleteaction); -} - GtkWidget *add_exec_commands(GtkWidget *menu) { GList *trkcmds = gtkpod_get_registered_track_commands(); GList *cmds = trkcmds; @@ -156,25 +151,6 @@ GtkWidget *add_update_tracks_from_file(GtkWidget *menu) { return hookup_menu_item(menu, _("Update Tracks from File"), GTK_STOCK_REFRESH, G_CALLBACK (update_tracks_from_file), NULL); } -/* - * sync_dirs_ entries - sync the directories of the selected playlist - * - * @mi - the menu item selected - * @data - Ignored, should be NULL - */ -static void sync_dirs(GtkMenuItem *mi, gpointer data) { - if (gtkpod_get_current_playlist()) { - sync_playlist(gtkpod_get_current_playlist(), NULL, KEY_SYNC_CONFIRM_DIRS, 0, KEY_SYNC_DELETE_TRACKS, 0, KEY_SYNC_CONFIRM_DELETE, 0, KEY_SYNC_SHOW_SUMMARY, 0); - } - else { - g_return_if_reached (); - } -} - -GtkWidget *add_sync_playlist_with_dirs(GtkWidget *menu) { - return hookup_menu_item(menu, _("Sync Playlist with Dir(s)"), GTK_STOCK_REFRESH, G_CALLBACK (sync_dirs), NULL); -} - static void copy_selected_tracks_to_target_itdb(GtkMenuItem *mi, gpointer *userdata) { iTunesDB *t_itdb = *userdata; g_return_if_fail (t_itdb); diff --git a/libgtkpod/context_menus.h b/libgtkpod/context_menus.h index 8024010..05a2de6 100644 --- a/libgtkpod/context_menus.h +++ b/libgtkpod/context_menus.h @@ -54,7 +54,6 @@ void context_menu_delete_track_head(GtkMenuItem *mi, gpointer data); GtkWidget *add_copy_track_to_filesystem (GtkWidget *menu); GtkWidget *add_create_playlist_file (GtkWidget *menu); GtkWidget *add_update_tracks_from_file (GtkWidget *menu); -GtkWidget *add_sync_playlist_with_dirs (GtkWidget *menu); GtkWidget *add_create_new_playlist (GtkWidget *menu); GtkWidget *add_edit_track_details (GtkWidget *menu); diff --git a/plugins/playlist_display/display_playlists.c b/plugins/playlist_display/display_playlists.c index 951b9da..208ad91 100644 --- a/plugins/playlist_display/display_playlists.c +++ b/plugins/playlist_display/display_playlists.c @@ -231,7 +231,7 @@ static gboolean pm_drag_motion(GtkWidget *widget, GdkDragContext *dc, gint x, gi return TRUE; case DND_GTKPOD_TRACKLIST: /* do not allow drop into currently selected playlist */ - if (pl_d == pm_get_selected_playlist()) { + if (pl_d == pm_get_first_selected_playlist()) { if ((pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE) || (pos == GTK_TREE_VIEW_DROP_INTO_OR_AFTER)) { gtk_tree_path_free(path); gdk_drag_status(dc, 0, time); @@ -1015,55 +1015,20 @@ void pm_add_child(Itdb_iTunesDB *itdb, PM_column_type type, gpointer item, gint gtk_tree_store_set(GTK_TREE_STORE (model), &iter, PM_COLUMN_ITDB, itdb, PM_COLUMN_TYPE, type, type, item, -1); } -/* Remove "playlist" from the display model. - "select": TRUE: a new playlist is selected - FALSE: no selection is taking place - (useful when quitting program) */ -void pm_remove_playlist(Playlist *playlist, gboolean select) { +/* Remove "playlist" from the display model */ +void pm_remove_playlist(Playlist *playlist) { GtkTreeModel *model; - gboolean have_iter = FALSE; - GtkTreeIter select_iter, delete_iter; - GtkTreeSelection *ts = NULL; + GtkTreeIter iter; g_return_if_fail (playlist); model = gtk_tree_view_get_model(playlist_treeview); g_return_if_fail (model); - ts = gtk_tree_view_get_selection(playlist_treeview); - - if (itdb_playlist_is_mpl(playlist) && (playlist->itdb == gtkpod_get_current_itdb())) { - /* We are about to remove the entire itdb (playlist is MPL) and - * a playlist of this itdb is selected --> clear display - * (pm_unselect_playlist probably works as well, but the - * unselect won't be done until later (callback)) */ - gtkpod_set_current_playlist(NULL); - } - - if (select && (gtkpod_get_current_playlist() == playlist)) { - /* We are about to delete the currently selected - * playlist. Try to select the next. */ - if (gtk_tree_selection_get_selected(ts, NULL, &select_iter)) { - GtkTreePath *path = gtk_tree_model_get_path(model, &select_iter); - if (gtk_tree_model_iter_next(model, &select_iter)) { - have_iter = TRUE; - } - else { /* no next iter -- try previous iter */ - if (gtk_tree_path_prev(path)) { /* OK -- make iter from it */ - gtk_tree_model_get_iter(model, &select_iter, path); - have_iter = TRUE; - } - } - gtk_tree_path_free(path); - } - } + gtkpod_set_current_playlist(NULL); - if (pm_get_iter_for_playlist(playlist, &delete_iter)) { - gtk_tree_store_remove(GTK_TREE_STORE (model), &delete_iter); + if (pm_get_iter_for_playlist(playlist, &iter)) { + gtk_tree_store_remove(GTK_TREE_STORE (model), &iter); } - - /* select our new iter !!! */ - if (have_iter && select) - gtk_tree_selection_select_iter(ts, &select_iter); } /* Remove all playlists from the display model */ @@ -1091,6 +1056,35 @@ void pm_remove_all_playlists(gboolean clear_sort) { } /* Select specified playlist */ +void pm_select_playlists(GList *playlists) { + GtkTreeIter iter; + GtkTreeSelection *ts; + + g_return_if_fail (playlist_treeview); + + if (!playlists) { + ts = gtk_tree_view_get_selection(playlist_treeview); + gtk_tree_selection_unselect_all(ts); + return; + } + + ts = gtk_tree_view_get_selection(playlist_treeview); + + for (gint i = 0; i < g_list_length(playlists); ++i) { + Playlist *pl = g_list_nth_data(playlists, i); + + if (pm_get_iter_for_playlist(pl, &iter)) { + gtk_tree_selection_select_iter(ts, &iter); + } + + /* Only properly select the first in the list */ + if (i == 0 && gtkpod_get_current_playlist() != pl) { + gtkpod_set_current_playlist(pl); + } + } +} + +/* Select specified playlist */ void pm_select_playlist(Playlist *playlist) { GtkTreeIter iter; GtkTreeSelection *ts; @@ -1128,10 +1122,13 @@ void pm_unselect_playlist(Playlist *playlist) { } static gboolean pm_selection_changed_cb(gpointer data) { - GtkTreeModel *model; GtkTreeIter iter; GtkTreeView *tree_view = GTK_TREE_VIEW (data); - GtkTreeSelection *selection = gtk_tree_view_get_selection(tree_view); + + g_return_val_if_fail(tree_view, FALSE); + + GtkTreeModel *model = gtk_tree_view_get_model(tree_view); + g_return_val_if_fail(model, FALSE); #if DEBUG_TIMING GTimeVal time; @@ -1140,16 +1137,20 @@ static gboolean pm_selection_changed_cb(gpointer data) { time.tv_sec % 3600, time.tv_usec); #endif - if (gtk_tree_selection_get_selected(selection, &model, &iter) == FALSE) { /* no selection -> reset sort tabs */ - // gphoto_change_to_photo_window (FALSE); + if (! pm_is_playlist_selected()) { + /* no selection */ gtkpod_set_current_playlist(NULL); } else { - Playlist *new_playlist = NULL; + Playlist *new_playlist = pm_get_first_selected_playlist(); + g_return_val_if_fail(new_playlist, FALSE); + Itdb_iTunesDB *itdb = NULL; Itdb_PhotoDB *photodb = NULL; PM_column_type type = 0; + /* handle new selection */ + pm_get_iter_for_playlist(new_playlist, &iter); gtk_tree_model_get(model, &iter, PM_COLUMN_TYPE, &type, PM_COLUMN_ITDB, &itdb, PM_COLUMN_PLAYLIST, &new_playlist, PM_COLUMN_PHOTOS, &photodb, -1); gtkpod_set_current_playlist(new_playlist); @@ -1159,8 +1160,6 @@ static gboolean pm_selection_changed_cb(gpointer data) { g_return_val_if_fail (new_playlist, FALSE); g_return_val_if_fail (itdb, FALSE); - // gphoto_change_to_photo_window (FALSE); - if (new_playlist->is_spl && new_playlist->splpref.liveupdate) itdb_spl_update(new_playlist); @@ -1169,7 +1168,6 @@ static gboolean pm_selection_changed_cb(gpointer data) { case PM_COLUMN_PHOTOS: g_return_val_if_fail (photodb, FALSE); g_return_val_if_fail (itdb, FALSE); - // gphoto_display_photo_window (itdb); break; case PM_COLUMN_ITDB: case PM_COLUMN_TYPE: @@ -1361,16 +1359,16 @@ static gint pm_get_position_for_playlist(Playlist *playlist) { /* "unsort" the playlist view without causing the sort tabs to be touched. */ static void pm_unsort() { - Playlist *cur_pl; + GList *cur_pls; pm_selection_blocked = TRUE; /* remember */ - cur_pl = pm_get_selected_playlist(); + cur_pls = pm_get_selected_playlists(); pm_remove_all_playlists(TRUE); - pm_set_selected_playlist(cur_pl); + pm_select_playlists(cur_pls); pm_selection_blocked = FALSE; /* reset sort counter */ @@ -1904,11 +1902,12 @@ static void pm_create_treeview(void) { model = gtk_tree_store_new(PM_NUM_COLUMNS, G_TYPE_POINTER, G_TYPE_INT, G_TYPE_POINTER, G_TYPE_POINTER); /* set tree model */ gtk_tree_view_set_model(playlist_treeview, GTK_TREE_MODEL (model)); - /* gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (playlist_treeview), TRUE); */ - gtk_tree_selection_set_mode(gtk_tree_view_get_selection(playlist_treeview), GTK_SELECTION_SINGLE); + + /* set selection mode */ selection = gtk_tree_view_get_selection(playlist_treeview); - g_signal_connect (G_OBJECT (selection), "changed", - G_CALLBACK (pm_selection_changed), NULL); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); + g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (pm_selection_changed), NULL); + pm_add_columns(); pm_add_all_itdbs(); @@ -2005,51 +2004,63 @@ GtkWidget *pm_create_playlist_view(GtkActionGroup *action_group) { return GTK_WIDGET(vbox); } -Playlist* pm_get_selected_playlist(void) { - GtkTreeSelection *ts; - GtkTreeIter iter; - GtkTreeModel *model; - Playlist *result = NULL; +void pm_selected_playlists_foreach(PlaylistSelectionForeachFunc func, gpointer data) { + GList *playlists = pm_get_selected_playlists(); + while(playlists) { + Playlist *pl = playlists->data; + (* func) (pl ,data); + playlists = playlists->next; + } +} - g_return_val_if_fail (playlist_treeview, NULL); - ts = gtk_tree_view_get_selection(playlist_treeview); - g_return_val_if_fail (ts, NULL); +GList *pm_get_selected_playlists() { + g_return_val_if_fail(playlist_treeview, NULL); - if (gtk_tree_selection_get_selected(ts, &model, &iter)) { - gtk_tree_model_get(model, &iter, PM_COLUMN_PLAYLIST, &result, -1); + GtkTreeSelection *selection = gtk_tree_view_get_selection(playlist_treeview); + g_return_val_if_fail(selection, NULL); + + GtkTreeModel *model = gtk_tree_view_get_model(playlist_treeview); + GList *paths = gtk_tree_selection_get_selected_rows(selection, &model); + GList *playlists = NULL; + + while (paths) { + GtkTreePath *path = paths->data; + GtkTreeIter iter; + + if (gtk_tree_model_get_iter(model, &iter, path)) { + Playlist *pl; + gtk_tree_model_get(model, &iter, PM_COLUMN_PLAYLIST, &pl, -1); + if (pl) { + playlists = g_list_append(playlists, pl); + } + } + + paths = paths->next; } - /* playlist was just changed -- wait until current_playlist is - updated. */ - if (result != gtkpod_get_current_playlist()) - result = NULL; - return result; + g_list_free(paths); + + return playlists; } -Itdb_iTunesDB* pm_get_selected_itdb(void) { - GtkTreeSelection *ts; - GtkTreeIter iter; - GtkTreeModel *model; - Itdb_iTunesDB *result = NULL; +Playlist *pm_get_first_selected_playlist(void) { - g_return_val_if_fail (playlist_treeview, NULL); - ts = gtk_tree_view_get_selection(playlist_treeview); - g_return_val_if_fail (ts, NULL); + GList *playlists = pm_get_selected_playlists(); - if (gtk_tree_selection_get_selected(ts, &model, &iter)) { - gtk_tree_model_get(model, &iter, PM_COLUMN_ITDB, &result, -1); + if (!playlists) { + return NULL; } - /* playlist was just changed -- wait until current_playlist is - updated. */ - if (result != gtkpod_get_current_itdb()) - result = NULL; - return result; + return playlists->data; +} + +gint pm_get_selected_playlist_count() { + GtkTreeSelection *selection = gtk_tree_view_get_selection(playlist_treeview); + return gtk_tree_selection_count_selected_rows(selection); } -/* use with care!! */ -void pm_set_selected_playlist(Playlist *pl) { - gtkpod_set_current_playlist(pl); +gboolean pm_is_playlist_selected() { + return pm_get_selected_playlist_count() > 0; } void pm_show_all_playlists() { @@ -2082,7 +2093,7 @@ void playlist_display_update_itdb_cb(GtkPodApp *app, gpointer olditdb, gpointer /* remove @old_itdb (all playlists are removed if the MPL is removed and add @new_itdb at its place */ - pm_remove_playlist(itdb_playlist_mpl(old_itdb), FALSE); + pm_remove_playlist(itdb_playlist_mpl(old_itdb)); /* display replacement */ pm_add_itdb(new_itdb, pos); @@ -2103,21 +2114,7 @@ void playlist_display_itdb_removed_cb(GtkPodApp *app, gpointer itdb, gpointer da return; } - pm_remove_playlist(itdb_playlist_mpl(old_itdb), FALSE); -} - -void playlist_display_select_playlist_cb(GtkPodApp *app, gpointer pl, gpointer data) { - Playlist *new_playlist = pl; - Playlist *old_playlist = pm_get_selected_playlist(); - - if (old_playlist == new_playlist) { - return; - } - - if (old_playlist) - pm_unselect_playlist(old_playlist); - - pm_select_playlist(new_playlist); + pm_remove_playlist(itdb_playlist_mpl(old_itdb)); } void playlist_display_playlist_added_cb(GtkPodApp *app, gpointer pl, gint32 pos, gpointer data) { @@ -2129,7 +2126,7 @@ void playlist_display_playlist_added_cb(GtkPodApp *app, gpointer pl, gint32 pos, void playlist_display_playlist_removed_cb(GtkPodApp *app, gpointer pl, gpointer data) { Playlist *old_playlist = pl; - pm_remove_playlist(old_playlist, TRUE); + pm_remove_playlist(old_playlist); } void playlist_display_preference_changed_cb(GtkPodApp *app, gpointer pfname, gpointer value, gpointer data) { diff --git a/plugins/playlist_display/display_playlists.h b/plugins/playlist_display/display_playlists.h index e78f68f..8957a4b 100644 --- a/plugins/playlist_display/display_playlists.h +++ b/plugins/playlist_display/display_playlists.h @@ -49,16 +49,22 @@ typedef enum { GtkWidget *pm_create_playlist_view(GtkActionGroup *action_group); void pm_destroy_playlist_view(void); void pm_select_playlist(Playlist *playlist); -void pm_set_selected_playlist(Playlist *pl); + +GList *pm_get_selected_playlists(void); +Playlist *pm_get_first_selected_playlist(void); +gint pm_get_selected_playlist_count(void); +gboolean pm_is_playlist_selected(void); + +typedef gboolean (* PlaylistSelectionForeachFunc) (Playlist *playlist, gpointer data); +void pm_selected_playlists_foreach(PlaylistSelectionForeachFunc func, gpointer data); + void pm_remove_all_playlists (gboolean clear_sort); void pm_add_all_itdbs (void); -Playlist* pm_get_selected_playlist(void); void pm_stop_editing(gboolean cancel); void playlist_display_itdb_added_cb(GtkPodApp *app, gpointer itdb, gint32 pos, gpointer data); void playlist_display_itdb_removed_cb(GtkPodApp *app, gpointer itdb, gpointer data); void playlist_display_update_itdb_cb (GtkPodApp *app, gpointer olditdb, gpointer newitdb, gpointer data); -void playlist_display_select_playlist_cb (GtkPodApp *app, gpointer pl, gpointer data); void playlist_display_playlist_added_cb(GtkPodApp *app, gpointer pl, gint32 pos, gpointer data); void playlist_display_playlist_removed_cb(GtkPodApp *app, gpointer pl, gpointer data); void playlist_display_track_removed_cb(GtkPodApp *app, gpointer tk, gpointer data); diff --git a/plugins/playlist_display/playlist_display_actions.c b/plugins/playlist_display/playlist_display_actions.c index cd612d7..f8954b9 100644 --- a/plugins/playlist_display/playlist_display_actions.c +++ b/plugins/playlist_display/playlist_display_actions.c @@ -624,59 +624,77 @@ void on_pl_for_each_rating_activate(GtkAction *action, PlaylistDisplayPlugin* pl } } -static void delete_selected_playlist(DeleteAction deleteaction) { - Playlist *pl = pm_get_selected_playlist(); +static void delete_selected_playlists(DeleteAction deleteaction) { + GList *playlists = pm_get_selected_playlists(); + + while (playlists) { + Playlist *pl = playlists->data; + if (pl) { + gtkpod_set_current_playlist(pl); + delete_playlist_head(deleteaction); + } + else { + message_sb_no_playlist_selected(); + } - if (pl) { - delete_playlist_head(deleteaction); - } - else { - message_sb_no_playlist_selected(); + playlists = playlists->next; } } -void on_delete_selected_playlist (GtkAction *action, PlaylistDisplayPlugin* plugin) +void on_delete_selected_playlists (GtkAction *action, PlaylistDisplayPlugin* plugin) { - delete_selected_playlist (DELETE_ACTION_PLAYLIST); + delete_selected_playlists (DELETE_ACTION_PLAYLIST); } -void on_delete_selected_playlist_including_tracks_from_harddisk (GtkAction *action, PlaylistDisplayPlugin* plugin) +void on_delete_selected_playlists_including_tracks_from_harddisk (GtkAction *action, PlaylistDisplayPlugin* plugin) { - delete_selected_playlist (DELETE_ACTION_LOCAL); + delete_selected_playlists (DELETE_ACTION_LOCAL); } -void on_delete_selected_playlist_including_tracks_from_ipod (GtkAction *action, PlaylistDisplayPlugin* plugin) +void on_delete_selected_playlists_including_tracks_from_ipod (GtkAction *action, PlaylistDisplayPlugin* plugin) { - delete_selected_playlist (DELETE_ACTION_IPOD); + delete_selected_playlists (DELETE_ACTION_IPOD); } -void on_delete_selected_playlist_including_tracks_from_database (GtkAction *action, PlaylistDisplayPlugin* plugin) +void on_delete_selected_playlists_including_tracks_from_database (GtkAction *action, PlaylistDisplayPlugin* plugin) { - delete_selected_playlist (DELETE_ACTION_DATABASE); + delete_selected_playlists (DELETE_ACTION_DATABASE); } -void on_delete_selected_playlist_including_tracks_from_device(GtkAction *action, PlaylistDisplayPlugin* plugin) +void on_delete_selected_playlists_including_tracks_from_device(GtkAction *action, PlaylistDisplayPlugin* plugin) { iTunesDB *itdb = gtkpod_get_current_itdb(); if (!itdb) return; if (itdb->usertype & GP_ITDB_TYPE_IPOD) { - on_delete_selected_playlist_including_tracks_from_ipod(action, plugin); + on_delete_selected_playlists_including_tracks_from_ipod(action, plugin); } else if (itdb->usertype & GP_ITDB_TYPE_LOCAL) { - on_delete_selected_playlist_including_tracks_from_harddisk(action, plugin); + on_delete_selected_playlists_including_tracks_from_harddisk(action, plugin); } } -void on_update_selected_playlist (GtkAction *action, PlaylistDisplayPlugin* plugin) { - Playlist *pl = pm_get_selected_playlist(); - if (pl) { - update_tracks(pm_get_selected_playlist()->members); +void on_update_selected_playlists (GtkAction *action, PlaylistDisplayPlugin* plugin) { + + GList *playlists = pm_get_selected_playlists(); + + while (playlists) { + Playlist *pl = playlists->data; + if (pl) { + update_tracks(pl->members); + } + playlists = playlists->next; } } -void on_sync_playlist_with_dirs(GtkAction *action, PlaylistDisplayPlugin* plugin) { - if (gtkpod_get_current_playlist()) { - sync_playlist(gtkpod_get_current_playlist(), NULL, KEY_SYNC_CONFIRM_DIRS, 0, KEY_SYNC_DELETE_TRACKS, 0, KEY_SYNC_CONFIRM_DELETE, 0, KEY_SYNC_SHOW_SUMMARY, 0); +void on_sync_playlists_with_dirs(GtkAction *action, PlaylistDisplayPlugin* plugin) { + GList *playlists = pm_get_selected_playlists(); + + while (playlists) { + Playlist *pl = playlists->data; + if (pl) { + sync_playlist(pl, NULL, KEY_SYNC_CONFIRM_DIRS, 0, KEY_SYNC_DELETE_TRACKS, 0, KEY_SYNC_CONFIRM_DELETE, 0, KEY_SYNC_SHOW_SUMMARY, 0); + } + playlists = playlists->next; } } diff --git a/plugins/playlist_display/playlist_display_actions.h b/plugins/playlist_display/playlist_display_actions.h index 20ced8c..5d7b6d2 100644 --- a/plugins/playlist_display/playlist_display_actions.h +++ b/plugins/playlist_display/playlist_display_actions.h @@ -61,13 +61,13 @@ void on_pl_for_each_composer_activate(GtkAction *action, PlaylistDisplayPlugin* void on_pl_for_each_year_activate(GtkAction *action, PlaylistDisplayPlugin* plugin); void on_pl_for_each_rating_activate(GtkAction *action, PlaylistDisplayPlugin* plugin); -void on_delete_selected_playlist (GtkAction *action, PlaylistDisplayPlugin* plugin); -void on_delete_selected_playlist_including_tracks_from_harddisk (GtkAction *action, PlaylistDisplayPlugin* plugin); -void on_delete_selected_playlist_including_tracks_from_ipod (GtkAction *action, PlaylistDisplayPlugin* plugin); -void on_delete_selected_playlist_including_tracks_from_database (GtkAction *action, PlaylistDisplayPlugin* plugin); -void on_delete_selected_playlist_including_tracks_from_device(GtkAction *action, PlaylistDisplayPlugin* plugin); +void on_delete_selected_playlists (GtkAction *action, PlaylistDisplayPlugin* plugin); +void on_delete_selected_playlists_including_tracks_from_harddisk (GtkAction *action, PlaylistDisplayPlugin* plugin); +void on_delete_selected_playlists_including_tracks_from_ipod (GtkAction *action, PlaylistDisplayPlugin* plugin); +void on_delete_selected_playlists_including_tracks_from_database (GtkAction *action, PlaylistDisplayPlugin* plugin); +void on_delete_selected_playlists_including_tracks_from_device(GtkAction *action, PlaylistDisplayPlugin* plugin); -void on_update_selected_playlist (GtkAction *action, PlaylistDisplayPlugin* plugin); -void on_sync_playlist_with_dirs(GtkAction *action, PlaylistDisplayPlugin* plugin); +void on_update_selected_playlists (GtkAction *action, PlaylistDisplayPlugin* plugin); +void on_sync_playlists_with_dirs(GtkAction *action, PlaylistDisplayPlugin* plugin); #endif diff --git a/plugins/playlist_display/playlist_display_context_menu.c b/plugins/playlist_display/playlist_display_context_menu.c index b3246c6..2e8adda 100644 --- a/plugins/playlist_display/playlist_display_context_menu.c +++ b/plugins/playlist_display/playlist_display_context_menu.c @@ -40,13 +40,21 @@ #include "libgtkpod/gp_itdb.h" #include "libgtkpod/context_menus.h" #include "libgtkpod/misc_playlist.h" +#include "libgtkpod/misc_track.h" #include "libgtkpod/misc.h" +#include "libgtkpod/prefs.h" +#include "libgtkpod/syncdir.h" static void context_menu_delete_playlist_head(GtkMenuItem *mi, gpointer data) { DeleteAction deleteaction = GPOINTER_TO_INT (data); delete_playlist_head(deleteaction); } +void context_menu_delete_track_head(GtkMenuItem *mi, gpointer data) { + DeleteAction deleteaction = GPOINTER_TO_INT (data); + delete_track_head(deleteaction); +} + static GtkWidget *add_delete_all_tracks_from_ipod(GtkWidget *menu) { GtkWidget *mi; GtkWidget *sub; @@ -99,21 +107,33 @@ static GtkWidget *add_delete_playlist_but_keep_tracks(GtkWidget *menu) { return hookup_menu_item(menu, _("Delete But Keep Tracks"), GTK_STOCK_DELETE, G_CALLBACK (context_menu_delete_playlist_head), GINT_TO_POINTER (DELETE_ACTION_PLAYLIST)); } -static void copy_selected_playlist_to_target_itdb(GtkMenuItem *mi, gpointer *userdata) { +static void copy_selected_playlists_to_target_itdb(GtkMenuItem *mi, gpointer *userdata) { iTunesDB *t_itdb = *userdata; g_return_if_fail (t_itdb); - if (gtkpod_get_current_playlist()) - copy_playlist_to_target_itdb(gtkpod_get_current_playlist(), t_itdb); + + GList *playlists = pm_get_selected_playlists(); + while(playlists) { + Playlist *pl = playlists->data; + copy_playlist_to_target_itdb(pl, t_itdb); + playlists = playlists->next; + } } -static void copy_selected_playlist_to_target_playlist(GtkMenuItem *mi, gpointer *userdata) { + + +static void copy_selected_playlists_to_target_playlist(GtkMenuItem *mi, gpointer *userdata) { Playlist *t_pl = *userdata; g_return_if_fail (t_pl); - if (gtkpod_get_current_playlist()) - copy_playlist_to_target_playlist(gtkpod_get_current_playlist(), t_pl); + + GList *playlists = pm_get_selected_playlists(); + while(playlists) { + Playlist *pl = playlists->data; + copy_playlist_to_target_playlist(pl, t_pl); + playlists = playlists->next; + } } -static GtkWidget *add_copy_selected_playlist_to_target_itdb(GtkWidget *menu, const gchar *title) { +static GtkWidget *add_copy_selected_playlists_to_target_itdb(GtkWidget *menu, const gchar *title) { GtkWidget *mi; GtkWidget *sub; GtkWidget *pl_mi; @@ -150,7 +170,7 @@ static GtkWidget *add_copy_selected_playlist_to_target_itdb(GtkWidget *menu, con pl_sub = gtk_menu_new(); gtk_widget_show(pl_sub); gtk_menu_item_set_submenu(GTK_MENU_ITEM (pl_mi), pl_sub); - hookup_menu_item(pl_sub, _(itdb_playlist_mpl(itdb)->name), stock_id, G_CALLBACK(copy_selected_playlist_to_target_itdb), &itdbs->data); + hookup_menu_item(pl_sub, _(itdb_playlist_mpl(itdb)->name), stock_id, G_CALLBACK(copy_selected_playlists_to_target_itdb), &itdbs->data); add_separator(pl_sub); for (db = itdb->playlists; db; db = db->next) { pl = db->data; @@ -159,7 +179,7 @@ static GtkWidget *add_copy_selected_playlist_to_target_itdb(GtkWidget *menu, con stock_id = GTK_STOCK_PROPERTIES; else stock_id = GTK_STOCK_JUSTIFY_LEFT; - hookup_menu_item(pl_sub, _(pl->name), stock_id, G_CALLBACK(copy_selected_playlist_to_target_playlist), &db->data); + hookup_menu_item(pl_sub, _(pl->name), stock_id, G_CALLBACK(copy_selected_playlists_to_target_playlist), &db->data); } } } @@ -195,7 +215,13 @@ static void open_photo_editor(GtkMenuItem *mi, gpointer data) { /* Save Changes */ static void save_changes(GtkMenuItem *mi, gpointer data) { g_return_if_fail (gtkpod_get_current_playlist()); - gp_save_itdb(gtkpod_get_current_playlist()->itdb); + + GList *playlists = pm_get_selected_playlists(); + while (playlists) { + Playlist *pl = playlists->data; + gp_save_itdb(pl->itdb); + playlists = playlists->next; + } } /* Load an itdb */ @@ -268,21 +294,42 @@ static GtkWidget *add_eject_ipod(GtkWidget *menu) { return hookup_menu_item(menu, _("Eject iPod"), GTK_STOCK_DISCONNECT, G_CALLBACK (eject_ipod), NULL); } -void pm_context_menu_init(void) { - GtkWidget *menu = NULL; - Playlist *pl; +/* + * sync_dirs_ entries - sync the directories of the selected playlist + * + * @mi - the menu item selected + * @data - Ignored, should be NULL + */ +static void sync_dirs(GtkMenuItem *mi, gpointer data) { + GList *playlists = pm_get_selected_playlists(); + while (playlists) { + Playlist *pl = playlists->data; + sync_playlist(pl, NULL, KEY_SYNC_CONFIRM_DIRS, 0, KEY_SYNC_DELETE_TRACKS, 0, KEY_SYNC_CONFIRM_DELETE, 0, KEY_SYNC_SHOW_SUMMARY, 0); + playlists = playlists->next; + } +} - if (widgets_blocked) - return; +static GtkWidget *add_sync_playlist_with_dirs(GtkWidget *menu) { + return hookup_menu_item(menu, _("Sync Playlist with Dir(s)"), GTK_STOCK_REFRESH, G_CALLBACK (sync_dirs), NULL); +} - pm_stop_editing(TRUE); +static void update_multi_tracks_from_file(GtkMenuItem *mi, gpointer data) { + GList *playlists = pm_get_selected_playlists(); + while (playlists) { + Playlist *pl = playlists->data; + update_tracks(pl->members); + playlists = playlists->next; + } +} - if (!pm_get_selected_playlist()) - return; +GtkWidget *add_multi_update_tracks_from_file(GtkWidget *menu) { + return hookup_menu_item(menu, _("Update Tracks from File"), GTK_STOCK_REFRESH, G_CALLBACK (update_multi_tracks_from_file), NULL); +} - pl = pm_get_selected_playlist(); - if (!pl) - return; +static void _populate_single_playlist_menu(GtkWidget *menu) { + + Playlist *pl = pm_get_first_selected_playlist(); + g_return_if_fail(pl); // Ensure that all the tracks in the playlist are the current selected tracks gtkpod_set_selected_tracks(pl->members); @@ -293,8 +340,6 @@ void pm_context_menu_init(void) { eitdb = itdb->userdata; g_return_if_fail (eitdb); - menu = gtk_menu_new(); - if (itdb->usertype & GP_ITDB_TYPE_IPOD) { if (eitdb->itdb_imported) { add_exec_commands(menu); @@ -312,7 +357,7 @@ void pm_context_menu_init(void) { add_delete_playlist_but_keep_tracks(delete_menu); } add_separator(menu); - add_copy_selected_playlist_to_target_itdb(menu, _("Copy selected playlist to...")); + add_copy_selected_playlists_to_target_itdb(menu, _("Copy selected playlist to...")); add_separator(menu); add_update_tracks_from_file(menu); @@ -340,7 +385,7 @@ void pm_context_menu_init(void) { add_load_ipod(menu); } } - if (itdb->usertype & GP_ITDB_TYPE_LOCAL) { + else if (itdb->usertype & GP_ITDB_TYPE_LOCAL) { add_exec_commands(menu); add_separator(menu); @@ -353,7 +398,7 @@ void pm_context_menu_init(void) { add_delete_playlist_including_tracks_harddisk(delete_menu); add_delete_playlist_but_keep_tracks(delete_menu); } - add_copy_selected_playlist_to_target_itdb(menu, _("Copy selected playlist to...")); + add_copy_selected_playlists_to_target_itdb(menu, _("Copy selected playlist to...")); add_separator(menu); add_update_tracks_from_file(menu); if (!pl->is_spl) { @@ -376,6 +421,43 @@ void pm_context_menu_init(void) { if (eitdb->data_changed) { add_save_changes(menu); } +} + +static void _populate_multi_playlist_menu(GtkWidget *menu) { + + GtkWidget *delete_menu = add_sub_menu(menu, "Delete", GTK_STOCK_DELETE); + add_delete_playlist_including_tracks_ipod(delete_menu); + add_delete_playlist_but_keep_tracks(delete_menu); + + add_separator(menu); + add_copy_selected_playlists_to_target_itdb(menu, _("Copy selected playlist to...")); + + add_separator(menu); + add_multi_update_tracks_from_file(menu); + + add_sync_playlist_with_dirs(menu); + + add_save_changes(menu); +} + +void pm_context_menu_init(void) { + GtkWidget *menu = NULL; + + if (widgets_blocked) + return; + + pm_stop_editing(TRUE); + + if (!pm_is_playlist_selected()) + return; + + menu = gtk_menu_new(); + + if (pm_get_selected_playlist_count() == 1) { + _populate_single_playlist_menu(menu); + } else { + _populate_multi_playlist_menu(menu); + } /* * button should be button 0 as per the docs because we're calling diff --git a/plugins/playlist_display/plugin.c b/plugins/playlist_display/plugin.c index 2368e2c..407c55c 100644 --- a/plugins/playlist_display/plugin.c +++ b/plugins/playlist_display/plugin.c @@ -116,7 +116,7 @@ static GtkActionEntry playlist_actions[] = N_("Sync Playlist with Dir(s)"), NULL, NULL, - G_CALLBACK (on_sync_playlist_with_dirs) + G_CALLBACK (on_sync_playlists_with_dirs) }, { ACTION_NEW_PLAYLIST_MENU, @@ -268,7 +268,7 @@ static GtkActionEntry playlist_actions[] = N_("Selected Playlist"), NULL, NULL, - G_CALLBACK (on_delete_selected_playlist) + G_CALLBACK (on_delete_selected_playlists) }, { "ActionDeleteSelectedPlaylistIncDb", @@ -276,7 +276,7 @@ static GtkActionEntry playlist_actions[] = N_("Selected Playlist including Tracks from Database"), NULL, NULL, - G_CALLBACK (on_delete_selected_playlist_including_tracks_from_database) + G_CALLBACK (on_delete_selected_playlists_including_tracks_from_database) }, { "ActionDeleteSelectedPlaylistIncDev", @@ -284,7 +284,7 @@ static GtkActionEntry playlist_actions[] = N_("Selected Playlist including Tracks from Device"), NULL, NULL, - G_CALLBACK (on_delete_selected_playlist_including_tracks_from_device) + G_CALLBACK (on_delete_selected_playlists_including_tracks_from_device) }, { "ActionUpdatePlaylist", @@ -292,7 +292,7 @@ static GtkActionEntry playlist_actions[] = N_("Selected Playlist"), NULL, NULL, - G_CALLBACK (on_update_selected_playlist) + G_CALLBACK (on_update_selected_playlists) } }; @@ -349,7 +349,6 @@ static gboolean activate_plugin(AnjutaPlugin *plugin) { playlist_display_plugin->playlist_view = pm_create_playlist_view(action_group); - g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_SELECTED, G_CALLBACK (playlist_display_select_playlist_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_ADDED, G_CALLBACK (playlist_display_playlist_added_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_REMOVED, G_CALLBACK (playlist_display_playlist_removed_cb), NULL); g_signal_connect (gtkpod_app, SIGNAL_ITDB_ADDED, G_CALLBACK (playlist_display_itdb_added_cb), NULL); @@ -373,7 +372,6 @@ static gboolean deactivate_plugin(AnjutaPlugin *plugin) { playlist_display_plugin = (PlaylistDisplayPlugin*) plugin; ui = anjuta_shell_get_ui(plugin->shell, NULL); - g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_select_playlist_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_playlist_added_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_playlist_removed_cb), plugin); g_signal_handlers_disconnect_by_func (plugin->shell, G_CALLBACK (playlist_display_itdb_added_cb), plugin); |
From: dforsi <df...@us...> - 2011-09-26 17:07:41
|
commit 19390515d56913dc70f95b0ea2d0f804f93efdd6 Author: Daniele Forsi <da...@fo...> Date: Mon Sep 26 19:06:19 2011 +0200 Update Italian translation po/it.po | 52 +++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 41 insertions(+), 11 deletions(-) --- diff --git a/po/it.po b/po/it.po index 7605751..e0d70c7 100644 --- a/po/it.po +++ b/po/it.po @@ -15,8 +15,8 @@ msgid "" msgstr "" "Project-Id-Version: gtkpod\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-07-28 16:28+0200\n" -"PO-Revision-Date: 2011-07-28 16:29+0100\n" +"POT-Creation-Date: 2011-09-26 01:05+0200\n" +"PO-Revision-Date: 2011-09-26 19:05+0100\n" "Last-Translator: Daniele Forsi <da...@fo...>\n" "Language-Team: Italian <tp...@li...>\n" "Language: it\n" @@ -1150,6 +1150,11 @@ msgstr "Scrittura del database «%s» in corso. Attendere prego..." msgid "Extended information file not deleted: '%s'" msgstr "Il file con le informazioni estese non è stato eliminato: «%s»" +#: ../libgtkpod/file_itunesdb.c:1723 +#, c-format +msgid "Backup database could not be found so backing up database to %s\n" +msgstr "Impossibile trovare il backup del database per cui il backup sarà fatto su %s\n" + #: ../libgtkpod/file_itunesdb.c:1811 #, c-format msgid "%s: Database saved" @@ -2171,40 +2176,40 @@ msgstr "Il file sottoposto ad hash è lungo 0 byte\n" msgid "Could not open '%s' to calculate SHA1 checksum: %s\n" msgstr "Impossibile aprire «%s» per calcolare le somme di controllo SHA1: %s\n" -#: ../libgtkpod/syncdir.c:221 +#: ../libgtkpod/syncdir.c:220 #, c-format msgid "Sync summary for %s/%s\n" msgstr "Riepilogo della sincronizzazione per %s/%s\n" -#: ../libgtkpod/syncdir.c:226 +#: ../libgtkpod/syncdir.c:225 msgid "The following track has been added or updated:\n" msgid_plural "The following tracks have been added or updated:\n" msgstr[0] "La traccia seguente è stata aggiunta o aggiornata:\n" msgstr[1] "Le %d tracce seguenti sono state aggiunte o aggiornate:\n" -#: ../libgtkpod/syncdir.c:231 +#: ../libgtkpod/syncdir.c:230 msgid "The following track has been completely removed from the iPod:\n" msgid_plural "The following tracks have been completely removed from the iPod:\n" msgstr[0] "La traccia seguente è stata completamente rimossa dall'iPod:\n" msgstr[1] "La tracce seguenti sono state completamente rimosse dall'iPod:\n" -#: ../libgtkpod/syncdir.c:236 +#: ../libgtkpod/syncdir.c:235 msgid "The following track has been removed from the repository:\n" msgid_plural "The following tracks have been removed from the repository:\n" msgstr[0] "La traccia seguente è stata completamente rimossa dall'archivio:\n" msgstr[1] "Le tracce seguenti sono state completamente rimosse dall'archivio:\n" -#: ../libgtkpod/syncdir.c:241 +#: ../libgtkpod/syncdir.c:240 msgid "The following track has been removed from the playlist:\n" msgid_plural "The following tracks have been removed from the playlist:\n" msgstr[0] "La traccia seguente è stata completamente rimossa dalla playlist:\n" msgstr[1] "Le tracce seguenti sono state completamente rimosse dalla playlist:\n" -#: ../libgtkpod/syncdir.c:246 +#: ../libgtkpod/syncdir.c:245 msgid "Nothing was changed.\n" msgstr "Nessun cambiamento.\n" -#: ../libgtkpod/syncdir.c:249 +#: ../libgtkpod/syncdir.c:248 msgid "Sync summary" msgstr "Riepilogo della sincronizzazione" @@ -3761,6 +3766,26 @@ msgstr "<b>%s</b> di %s" msgid "<b>%s</b> from %s" msgstr "<b>%s</b> da %s" +#. Translators: %s is an error message +#: ../plugins/media_player/media_player.c:278 +#, c-format +msgid "GStreamer thread creation failed: %s\n" +msgstr "Impossibile creare il thread di GStreamer: %s\n" + +#: ../plugins/media_player/media_player.c:335 +msgid "Seek failed!\n" +msgstr "Seek fallito\n" + +#. Translators: %s is an error message +#: ../plugins/media_player/media_player.c:378 +#, c-format +msgid "Failed to play track: %s" +msgstr "Impossibile riprodurre la traccia: %s" + +#: ../plugins/media_player/media_player.c:385 +msgid "Failed to play track: Cannot create a play element. Ensure that all gstreamer plugins are installed" +msgstr "Impossibile riprodurre la traccia: impossibile creare un elemento «play», assicurarsi che tutti i plugin di gstreamer siano installati" + #: ../plugins/media_player/media_player.xml.h:1 msgid "Next" msgstr "Successiva" @@ -5544,7 +5569,7 @@ msgstr "<b>Colonne visualizzate</b>" #: ../plugins/track_display/track_display.xml.h:3 msgid "<b>Ignore Frequent Words</b>" -msgstr "<b>Ignora parole frequenti</b>" +msgstr "<b>Parole frequenti da ignorare</b>" #: ../plugins/track_display/track_display.xml.h:4 msgid "<b>Preferred Track Execution Command</b>" @@ -5586,6 +5611,11 @@ msgstr "Nuova parola da ignorare" msgid "Please enter a word for sorting functions to ignore" msgstr "Inserire una parola da ignorare nelle funzioni di ordinamento" +#: ../plugins/track_display/track_display_preferences.c:254 +#, c-format +msgid "The word %s is already in the \"Ignored Frequent Word\" list" +msgstr "La parola %s è già nell'elenco «Parole frequenti da ignorare»" + #: ../src/anjuta-about.c:158 #, c-format msgid "Couldn't read license file %s: %s" @@ -5774,7 +5804,7 @@ msgstr "Conferma" msgid "Loaded Session..." msgstr "Sessione caricata." -#: ../src/main.c:57 +#: ../src/main.c:56 msgid "gtkpod" msgstr "gtkpod" |
From: dforsi <df...@us...> - 2011-09-26 17:07:34
|
commit 48971dec24c57750db0b183004ddefd9719803aa Author: Daniele Forsi <da...@fo...> Date: Mon Sep 26 01:27:46 2011 +0200 Translation fixes * Mark more strings as translatable libgtkpod/file_itunesdb.c | 2 +- plugins/media_player/media_player.c | 10 ++++++---- plugins/track_display/track_display_preferences.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) --- diff --git a/libgtkpod/file_itunesdb.c b/libgtkpod/file_itunesdb.c index d947106..d4a4e8d 100644 --- a/libgtkpod/file_itunesdb.c +++ b/libgtkpod/file_itunesdb.c @@ -1720,7 +1720,7 @@ static gboolean gp_write_itdb(iTunesDB *itdb) { g_free(ipod_model); eitdb->offline_filename = g_build_filename(cfgdir, backup_name, NULL); g_free(backup_name); - gtkpod_statusbar_message("Backup database could not be found so backing up database to %s\n", eitdb->offline_filename); + gtkpod_statusbar_message(_("Backup database could not be found so backing up database to %s\n"), eitdb->offline_filename); } if (!itdb_cp(itdb->filename, eitdb->offline_filename, &error)) { diff --git a/plugins/media_player/media_player.c b/plugins/media_player/media_player.c index 2520f33..46349b5 100644 --- a/plugins/media_player/media_player.c +++ b/plugins/media_player/media_player.c @@ -274,7 +274,8 @@ static void pause_or_play_song() { player->thread = g_thread_create ((GThreadFunc)thread_play_song, NULL, TRUE, &err1); if (!player->thread) { - gtkpod_statusbar_message("GStreamer thread creation failed: %s\n", err1->message); + /* Translators: %s is an error message */ + gtkpod_statusbar_message(_("GStreamer thread creation failed: %s\n"), err1->message); g_error_free(err1); } } else if (is_playing()) { @@ -331,7 +332,7 @@ void seek_to_time(gint64 time_seconds) { if (!gst_element_seek(player->play_element, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, time_seconds * 1000000000, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)) - gtkpod_statusbar_message("Seek failed!\n"); + gtkpod_statusbar_message(_("Seek failed!\n")); } static int pipeline_bus_watch_cb(GstBus *bus, GstMessage *msg, gpointer data) { @@ -373,14 +374,15 @@ static void thread_play_song() { uri = g_filename_to_uri (track_name, NULL, &error); g_free(track_name); if (error) { - gtkpod_statusbar_message("Failed to play track: %s", error->message); + /* Translators: %s is an error message */ + gtkpod_statusbar_message(_("Failed to play track: %s"), error->message); g_free(uri); return; } player->play_element = gst_element_factory_make("playbin2", "play"); if (!player->play_element) { - gtkpod_statusbar_message("Failed to play track: Cannot create a play element. Ensure that all gstreamer plugins are installed"); + gtkpod_statusbar_message(_("Failed to play track: Cannot create a play element. Ensure that all gstreamer plugins are installed")); return; } diff --git a/plugins/track_display/track_display_preferences.c b/plugins/track_display/track_display_preferences.c index 63abaae..9a1b760 100644 --- a/plugins/track_display/track_display_preferences.c +++ b/plugins/track_display/track_display_preferences.c @@ -251,7 +251,7 @@ G_MODULE_EXPORT void on_ign_word_add_clicked (GtkButton *sender, gpointer e) { comparison = compare_string_case_insensitive(word, curr_ign); g_free (curr_ign); if (comparison == 0) { - gtkpod_statusbar_message("The word %s is already in the \"Ignored Frequent Word\" list", word); + gtkpod_statusbar_message(_("The word %s is already in the \"Ignored Frequent Word\" list"), word); return; } |
From: phantomjinx <pha...@us...> - 2011-09-25 21:32:14
|
commit b2b5413bc989fea2eff6aa1ff54733ae4c8cf95e Author: phantomjinx <p.g...@ph...> Date: Sun Sep 25 22:31:11 2011 +0100 Fix for fail message when initialising an ipod * See bug #3411223 for details * Rather than simply setting the entry of the set_model combo boxes, find the actual model row containing the model string and set that as the active iter. Ensures that if the user goes with what has already been pre-loaded then this is in fact the active iter. * Seems that initing an ipod in libgpod does not set the model in the sysinfo file so just set it here - maybe a patch to libgpod * Initing an ipod should also attempt to create an extended info file. Ensures that the "No-extended" file error does not appear anymore. libgtkpod/file.h | 1 + libgtkpod/file_itunesdb.c | 20 +++++++++++ plugins/repository_editor/repository_init.c | 50 +++++++++++++++++++++++--- 3 files changed, 65 insertions(+), 6 deletions(-) --- diff --git a/libgtkpod/file.h b/libgtkpod/file.h index d365851..cd58bc8 100644 --- a/libgtkpod/file.h +++ b/libgtkpod/file.h @@ -76,6 +76,7 @@ void gp_load_ipods (void); iTunesDB *gp_load_ipod (iTunesDB *itdb); gboolean gp_eject_ipod(iTunesDB *itdb); gboolean gp_save_itdb (iTunesDB *itdb); +gboolean gp_create_extended_info(iTunesDB *itdb); void handle_export (void); void data_changed (iTunesDB *itdb); void data_unchanged (iTunesDB *itdb); diff --git a/libgtkpod/file_itunesdb.c b/libgtkpod/file_itunesdb.c index 7e8af65..767cf4c 100644 --- a/libgtkpod/file_itunesdb.c +++ b/libgtkpod/file_itunesdb.c @@ -1158,6 +1158,26 @@ static gboolean write_extended_info(iTunesDB *itdb) { return TRUE; } +gboolean gp_create_extended_info(iTunesDB *itdb) { + /* Ensure that the itdb has a filename allocated */ + g_return_val_if_fail(itdb, FALSE); + + const gchar *mp = itdb_get_mountpoint(itdb); + g_return_val_if_fail(mp, FALSE); + + gchar *filename = itdb_get_itunescdb_path (mp); + if (!filename) { + filename = itdb_get_itunesdb_path (mp); + } + + g_return_val_if_fail(filename, FALSE); + + itdb->filename = g_strdup(filename); + g_free(filename); + + return write_extended_info(itdb); +} + TransferData *transfer_data_new(void) { TransferData *transfer_data; transfer_data = g_new0 (TransferData, 1); diff --git a/plugins/repository_editor/repository_init.c b/plugins/repository_editor/repository_init.c index aba10f4..276f63b 100644 --- a/plugins/repository_editor/repository_init.c +++ b/plugins/repository_editor/repository_init.c @@ -85,6 +85,26 @@ void set_cell(GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *t g_free(text); } +static void _model_combo_set_active_iter(GtkComboBox *cb, const gchar* modelstr) { + GtkTreeIter iter; + GtkTreeModel *cb_model = gtk_combo_box_get_model(cb); + if (gtk_tree_model_get_iter_first(cb_model, &iter)) { + do { + GtkTreeIter iter_child; + if (gtk_tree_model_iter_children (cb_model, &iter_child, &iter)) { + do { + gchar *model; + gtk_tree_model_get(cb_model, &iter_child, COL_STRING, &model, -1); + if (g_str_equal(modelstr, model)) { + gtk_combo_box_set_active_iter(cb, &iter_child); + return; + } + } while (gtk_tree_model_iter_next(cb_model, &iter_child)); + } + } while (gtk_tree_model_iter_next(cb_model, &iter)); + } +} + /** * repository_ipod_init: * @@ -100,7 +120,6 @@ gboolean repository_ipod_init(iTunesDB *itdb) { gboolean result = FALSE; gchar *mountpoint, *new_mount, *name, *model; GError *error = NULL; - GtkEntry *entry; gchar buf[PATH_MAX]; GtkComboBox *cb; const IpodInfo *info; @@ -143,8 +162,9 @@ gboolean repository_ipod_init(iTunesDB *itdb) { g_snprintf(buf, PATH_MAX, "%s", gettext (SELECT_OR_ENTER_YOUR_MODEL)); } } - entry = GTK_ENTRY (gtk_bin_get_child(GTK_BIN (cb))); - gtk_entry_set_text(entry, buf); + + /* Try and set buf as the active selection in the combo box */ + _model_combo_set_active_iter(cb, buf); gtk_window_set_transient_for(GTK_WINDOW (ii->window), GTK_WINDOW (gtkpod_app)); response = gtk_dialog_run(GTK_DIALOG (ii->window)); @@ -152,6 +172,16 @@ gboolean repository_ipod_init(iTunesDB *itdb) { switch (response) { case GTK_RESPONSE_OK: new_mount = g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(GET_WIDGET (ii->builder, IID_MOUNTPOINT_CHOOSER)))); + if (!new_mount || (strlen(new_mount) == 0)) { + gtkpod_statusbar_message("No mount point has been selected"); + return FALSE; + } + + if (!gtk_combo_box_get_has_entry(cb)) { + gtkpod_statusbar_message("No model has been selected"); + return FALSE; + } + /* remove trailing '/' in case it's present. */ if (mountpoint && (strlen(mountpoint) > 0)) { if (G_IS_DIR_SEPARATOR(mountpoint[strlen(mountpoint) - 1])) { @@ -190,6 +220,10 @@ gboolean repository_ipod_init(iTunesDB *itdb) { name = get_itdb_prefs_string(itdb, "name"); result = itdb_init_ipod(mountpoint, model, name, &error); + + /* Set the model in the sysinfo of the itdb */ + itdb_device_set_sysinfo(itdb->device, "ModelNumStr", model); + if (!result) { if (error) { gtkpod_warning(_("Error initialising iPod: %s\n"), error->message); @@ -200,6 +234,11 @@ gboolean repository_ipod_init(iTunesDB *itdb) { gtkpod_warning(_("Error initialising iPod, unknown error\n")); } } + else { + /* Should write the extended info file */ + result = gp_create_extended_info(itdb); + } + g_free(name); g_free(model); break; @@ -231,7 +270,6 @@ void repository_ipod_init_set_model(iTunesDB *itdb, const gchar *old_model) { GtkWidget *window; gint response; gchar *model, *mountpoint; - GtkEntry *entry; gchar buf[PATH_MAX]; GtkComboBox *cb; const IpodInfo *info; @@ -274,8 +312,8 @@ void repository_ipod_init_set_model(iTunesDB *itdb, const gchar *old_model) { } } - entry = GTK_ENTRY (gtk_bin_get_child(GTK_BIN (cb))); - gtk_entry_set_text(entry, buf); + /* Try and set buf as the active selection in the combo box */ + _model_combo_set_active_iter(cb, buf); response = gtk_dialog_run(GTK_DIALOG (window)); |
From: phantomjinx <pha...@us...> - 2011-09-18 00:47:29
|
commit 6f66bf1afcc44ecb42b7611a634d35c29c392255 Author: phantomjinx <p.g...@ph...> Date: Sun Sep 18 01:46:33 2011 +0100 Conditional inclusion of DISABLE_DEPRECATED flags * Including DISABLE_DEPRECATED flags consistently can cause problems when including library includes from other projects that are still using deprecated functions. * To avoid this, use DISABLE_DEPRECATED flags in development and unstable releases but avoid using them in actual releases. * See FS#84 at http://gtkpod.org/bugs/index.php configure.ac | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) --- diff --git a/configure.ac b/configure.ac index ea3098e..7220666 100644 --- a/configure.ac +++ b/configure.ac @@ -87,8 +87,22 @@ PKG_CHECK_MODULES(LIBANJUTA, libanjuta-3.0 >= 2.91,, [AC_MSG_FAILURE([*** $LIBAN PKG_CHECK_MODULES(LIBGDL, gdl-3.0 >= 3.0.0,, [AC_MSG_FAILURE([*** $LIBGDL_PKG_ERRORS])]) PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.28.5,, [AC_MSG_FAILURE([*** $GIO_PKG_ERRORS])]) PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.7.7,, [AC_MSG_FAILURE([*** $LIBXML_PKG_ERRORS])]) - -GTK_CLEANLINESS_FLAGS="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE" + + +GTK_CLEANLINESS_FLAGS="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE" + +AC_MSG_CHECKING(for using DISABLE_DEPRECATED flags) +if expr "$LIBGTKPOD_VERSION" : '.*~' >/dev/null; then + dnl The version contains a tilde so this is not a release + dnl Thus, we can add in disable deprecated flags to avoid + dnl using deprecated functions + GTK_CLEANLINESS_FLAGS="$GTK_CLEANLINESS_FLAGS -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" + AC_MSG_RESULT(yes) +else + dnl The version is a release so do not include deprecated + dnl flags. + AC_MSG_RESULT(no) +fi dnl Force C99 mode (no implicit int declarations) CFLAGS="$CFLAGS -std=gnu99 -Werror-implicit-function-declaration" |
From: phantomjinx <pha...@us...> - 2011-09-17 12:36:16
|
commit 9b68e5d73bfb926ff8823efeb9a801ac04e172cd Author: phantomjinx <p.g...@ph...> Date: Sat Sep 17 13:17:03 2011 +0100 Update git ignore to ignore generated files .gitignore | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) --- diff --git a/.gitignore b/.gitignore index e4582c5..07bd5c1 100644 --- a/.gitignore +++ b/.gitignore @@ -69,6 +69,7 @@ version /src/gtkpod /src/itdb /src/org.gtkpod.gschema.valid +/src/org.gtkpod.gschema.xml # /plugins/ /plugins/*.plugin @@ -91,6 +92,7 @@ version /data/glade/media_player.xml /data/glade/playlist_display.xml /data/glade/mserv.xml +/data/glade/clarity.xml /data/ui/details_editor.ui /data/ui/coverweb.ui @@ -105,3 +107,4 @@ version /data/ui/photo_editor.ui /data/ui/media_player.ui /data/ui/mserv.ui +/data/ui/clarity.ui |
From: phantomjinx <pha...@us...> - 2011-09-17 12:36:09
|
commit da06ace849f537e51b5850e1d6a1c19d13cc96b3 Author: phantomjinx <p.g...@ph...> Date: Sat Sep 17 13:15:45 2011 +0100 Should not be version controlling these generated files data/glade/clarity.glade | 1 - data/glade/clarity.xml | 1 - data/ui/clarity.ui | 1 - src/org.gtkpod.gschema.xml | 37 ------------------------------------- 4 files changed, 0 insertions(+), 40 deletions(-) |
From: phantomjinx <pha...@us...> - 2011-09-12 20:21:50
|
Summary of changes: a88d5cc... Stop unrefing NULL album art (*) 0bc65d5... New coverart display plugin 'clarity' (*) 56885a2... Allow broadcasting of all types of preference (*) b69b39d... Cover display not disconnecting on deactivate (*) 37e584f... Implement clarity preferences (*) 1172a33... clarity labelling of covers (*) b8f951b... Add a reference to current playlist to clarity widget (*) b7c9145... Support for clarity detecting track additions (*) 4d91390... Ensure tracks are sorted before selecting (*) 50b3e6d... Remove extraneous logging (*) f8bf1e9... Support for track removal in Clarity (*) 1940ff5... Clarity text not being cleared (*) 89cea74... Update version to reflect for unstable builds (*) 533666a... Support for updating clarity when a track is modified (*) df84987... Implement the updating of a track in clarity (*) 329cf31... Tidy up some function and variables (*) a8ce17d... Implement drag n drop cover support for clarity (*) c0a5698... clarity plugin file should not have been committed (*) a094fd3... Modify descriptions of clarity plugin (*) 0563523... Update documentation with paragraph on clarity (*) a7cf624... Sort out clarity's options for building or not building (*) 94ece12... Better still always check for clutter (*) 75bd719... Merge branch 'gtk-3.0' into clarity (*) (*) This commit already existed in another branch; no separate mail sent |
From: phantomjinx <pha...@us...> - 2011-09-12 20:03:22
|
commit 75bd71925d82bdabff4fe6e8dcf05c4ac14fd005 Merge: 94ece12 26bf8ba Author: phantomjinx <p.g...@ph...> Date: Mon Sep 12 20:58:30 2011 +0100 Merge branch 'gtk-3.0' into clarity Conflicts: version.sh plugins/track_display/plugin.c | 6 +++--- version.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) --- |
From: phantomjinx <pha...@us...> - 2011-09-12 20:03:16
|
Summary of changes: d02573e... Mistake in track plugin default preferences (*) 61d5947... Update version to reflect for unstable builds (*) 26bf8ba... version.sh: update unstable builds separator (*) 75bd719... Merge branch 'gtk-3.0' into clarity (*) This commit already existed in another branch; no separate mail sent |
From: phantomjinx <pha...@us...> - 2011-09-12 19:01:16
|
The unsigned tag 'gtkpod-2.1.0' was created. Tagger: phantomjinx <p.g...@ph...> Date: Mon Sep 12 19:58:38 2011 +0100 version gtkpod 2.1.0 Changes since the last tag 'gtkpod-2.0.2': Daniele Forsi (14): Update Italian translation File type field is not to be edited by the user More strings need translation Update Italian translation Fix make check Fix make distcheck Fix crash when trying to open the Configure Repositories dialog Merge branch 'master' into gtk-3.0 Fix make distcheck Update Italian translation Fix compilation errors introduced by commit 09b1ef56 Update Italian translation Remove unneeded include Merge branch 'master' into gtk-3.0 phantomjinx (32): Realignment of anjuta-app in line with new version Fix warnings about variables in libgtkpod Migrate combo boxes due to changes with combo box and combo box text Gdk / cairo migration necessary for the rating stars renderer in track display Gdk to Cairo migration of coverart display Stop the sort order preference containers from filling the preference tab Merge branch 'master' into gtk-3.0 Merge branch 'master' into gtk-3.0 Merge branch 'master' into gtk-3.0 Correction of merge Update version.sh script with new version number Update to documentation Revert "Update to documentation" Update to documentation m4a plugin fails to support m4b files Merge branch 'master' into gtk-3.0 Updated translation files ready for new release Append LDFLAGS rather than replace them entirely Fixes cover art preference stretching Fix to address compilation error in macport Stop volume property warning when media player loaded Ignore eclipse autotools config file Cover art display fixes for colors and updating Track plugin fixes Media player plugin fixes Update news and translation files for gtk 3.0 release With move to gtk 3 assume gsealed gdk G_CONST_RETURN has been deprecated / removed in gtk3 Replacement of deprecated gtk_[vh]box_new Correction of desktop file Replace bugs url from sourceforge to flyspray Update NEWS and Changelog scorpion (3): Upgrade gtk/glib modules to version 3 and similar gtkdialog.has_separator property no longer supported Initial migration fixes for gdk/gtk version 3.0 |
From: phantomjinx <pha...@us...> - 2011-09-12 19:01:09
|
The unsigned tag 'gtkpod-2.0.2' was created. Tagger: phantomjinx <p.g...@ph...> Date: Mon Sep 12 20:00:26 2011 +0100 release gtkpod 2.0.2 Changes since the last tag '2.0.1': phantomjinx (12): Fix for mistake with the --as-needed flag on the linker Upgrade version number to 2.0.2 Stop illegal freeing of memory on exit Errors not being cascaded in write file info function Update to documentation Revert "Update to documentation" Update to documentation m4a plugin fails to support m4b files Fix to french translation Supply GErrors to add functions Updated translation files ready for new release Update changelong and news for release |
From: phantomjinx <pha...@us...> - 2011-09-11 18:36:25
|
commit 94ece12ee63247c02d65d735fa9332cc1aca055f Author: phantomjinx <p.g...@ph...> Date: Sun Sep 11 19:35:41 2011 +0100 Better still always check for clutter * Since more plugins will probably use clutter, check for it regardless but only allow clarity if it is installed. configure.ac | 42 +++++++++++++++++++----------------------- 1 files changed, 19 insertions(+), 23 deletions(-) --- diff --git a/configure.ac b/configure.ac index cefda19..ea3098e 100644 --- a/configure.ac +++ b/configure.ac @@ -87,7 +87,7 @@ PKG_CHECK_MODULES(LIBANJUTA, libanjuta-3.0 >= 2.91,, [AC_MSG_FAILURE([*** $LIBAN PKG_CHECK_MODULES(LIBGDL, gdl-3.0 >= 3.0.0,, [AC_MSG_FAILURE([*** $LIBGDL_PKG_ERRORS])]) PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.28.5,, [AC_MSG_FAILURE([*** $GIO_PKG_ERRORS])]) PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.7.7,, [AC_MSG_FAILURE([*** $LIBXML_PKG_ERRORS])]) - + GTK_CLEANLINESS_FLAGS="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE" dnl Force C99 mode (no implicit int declarations) @@ -127,7 +127,19 @@ dnl Check if statvfs() is available (otherwise we fall back on 'df' to determine dnl free space on the iPod AC_CHECK_FUNCS(statvfs) - +dnl Check for clutter-gtk +dnl ------------------------------------------------------------- +PKG_CHECK_MODULES(CLUTTER_GTK, [clutter-gtk-1.0 >= 1.0], [have_clutter_gtk="yes"], [have_clutter_gtk="no"]) +if test "x$have_clutter_gtk" = "xyes"; then + AC_DEFINE(HAVE_CLUTTER_GTK, 1, [Define if you have clutter gtk support]) + AC_SUBST(CLUTTER_GTK_CFLAGS) + AC_SUBST(CLUTTER_GTK_LIBS) + dnl Need to add to CFLAGS and LIBS so main can init correctly + CFLAGS="$CFLAGS $CLUTTER_GTK_CFLAGS" + LIBS="$LIBS $CLUTTER_GTK_LIBS" +fi +AM_CONDITIONAL(HAVE_CLUTTER_GTK, [test "x$have_clutter_gtk" = "xyes"]) + dnl Check for libid3tag dnl ------------------------------------------------------------- PKG_CHECK_MODULES(ID3TAG, id3tag >= 0.15, [have_id3="yes"], [AC_MSG_FAILURE([*** $ID3TAG_PKG_ERRORS])]) @@ -186,7 +198,7 @@ if test "x$have_coverweb" = "xyes"; then fi -dnl Check for clutter gtk +dnl Check for clarity dnl ------------------------------------------------------------- AC_ARG_ENABLE(plugin-clarity, AS_HELP_STRING([--disable-plugin-clarity],[Disable clarity plugin for displaying coverart in gtkpod]), @@ -200,29 +212,13 @@ if test "$user_disabled_clarity" = 1; then have_clarity="no" else AC_MSG_RESULT(no) - - PKG_CHECK_MODULES(CLUTTER_GTK, - [clutter-gtk-1.0 >= 1.0], - [have_clutter_gtk="yes"], - [have_clutter_gtk="no"]) - - dnl we have clutter installed - AM_CONDITIONAL(HAVE_CLUTTER_GTK, [test "x$have_clutter_gtk" = "xyes"]) - - dnl we can go ahead and build clarity - - if test "x$have_clutter_gtk" = "xyes"; then + if test "x$have_clutter_gtk" = "xyes"; then have_clarity="yes" - AM_CONDITIONAL(HAVE_PLUGIN_CLARITY, [test "x$have_clarity" = "xyes"]) - - AC_DEFINE(HAVE_CLUTTER_GTK, 1, [Define if you have clutter gtk support]) - AC_SUBST(CLUTTER_GTK_CFLAGS) - AC_SUBST(CLUTTER_GTK_LIBS) - dnl Need to add to CFLAGS and LIBS so main can init correctly - CFLAGS="$CFLAGS $CLUTTER_GTK_CFLAGS" - LIBS="$LIBS $CLUTTER_GTK_LIBS" + else + have_clarity="no" fi fi +AM_CONDITIONAL(HAVE_PLUGIN_CLARITY, [test "x$have_clarity" = "xyes"]) dnl Check for gstreamer dnl ------------------------------------------------------------- |
From: phantomjinx <pha...@us...> - 2011-09-11 17:59:43
|
commit a7cf6246dbac6bd14a8c6036c11b629ab77e89cb Author: phantomjinx <p.g...@ph...> Date: Sun Sep 11 18:58:41 2011 +0100 Sort out clarity's options for building or not building * Seems that currently even without clutter, configure claims it will build clarity when in fact it doesn't configure.ac | 29 +++++++++++++++++------------ 1 files changed, 17 insertions(+), 12 deletions(-) --- diff --git a/configure.ac b/configure.ac index f945310..cefda19 100644 --- a/configure.ac +++ b/configure.ac @@ -205,19 +205,24 @@ else [clutter-gtk-1.0 >= 1.0], [have_clutter_gtk="yes"], [have_clutter_gtk="no"]) - have_clarity="yes" -fi -AM_CONDITIONAL(HAVE_CLUTTER_GTK, [test "x$have_clutter_gtk" = "xyes"]) -AM_CONDITIONAL(HAVE_PLUGIN_CLARITY, [test "x$have_clutter_gtk" = "xyes"]) -if test "x$have_clutter_gtk" = "xyes"; then - AC_DEFINE(HAVE_CLUTTER_GTK, 1, [Define if you have clutter gtk support]) - AC_SUBST(CLUTTER_GTK_CFLAGS) - AC_SUBST(CLUTTER_GTK_LIBS) - dnl Need to add to CFLAGS and LIBS so main can init correctly - CFLAGS="$CFLAGS $CLUTTER_GTK_CFLAGS" - LIBS="$LIBS $CLUTTER_GTK_LIBS" -fi + + dnl we have clutter installed + AM_CONDITIONAL(HAVE_CLUTTER_GTK, [test "x$have_clutter_gtk" = "xyes"]) + dnl we can go ahead and build clarity + + if test "x$have_clutter_gtk" = "xyes"; then + have_clarity="yes" + AM_CONDITIONAL(HAVE_PLUGIN_CLARITY, [test "x$have_clarity" = "xyes"]) + + AC_DEFINE(HAVE_CLUTTER_GTK, 1, [Define if you have clutter gtk support]) + AC_SUBST(CLUTTER_GTK_CFLAGS) + AC_SUBST(CLUTTER_GTK_LIBS) + dnl Need to add to CFLAGS and LIBS so main can init correctly + CFLAGS="$CFLAGS $CLUTTER_GTK_CFLAGS" + LIBS="$LIBS $CLUTTER_GTK_LIBS" + fi +fi dnl Check for gstreamer dnl ------------------------------------------------------------- |
From: phantomjinx <pha...@us...> - 2011-09-11 13:23:46
|
commit 0563523401d6e5d9479aa74a532602a7f953abae Author: phantomjinx <p.g...@ph...> Date: Sun Sep 11 14:22:46 2011 +0100 Update documentation with paragraph on clarity * Updates the coverart section of the documentation with a mention of the clarity plugin doc/adding-cover-art-from-a-browser.html | 80 +++++++---------------- doc/adding-files-and-folders.html | 78 +++++++--------------- doc/advanced-features.html | 78 +++++++--------------- doc/copying-content-to-the-ipod.html | 78 +++++++--------------- doc/cover-art.html | 106 +++++++++++------------------ doc/exporting-files-from-the-ipod.html | 84 +++++++---------------- doc/getting-started.html | 84 +++++++---------------- doc/gtkpod-info.html | 78 +++++++--------------- doc/gtkpod.html | 78 +++++++--------------- doc/gtkpod.xml | 5 ++ doc/hooking-up-the-ipod.html | 96 +++++++++------------------ doc/ipod-and-content.html | 78 +++++++--------------- doc/ipod-file-recovery.html | 78 +++++++--------------- doc/layout-of-gtkpod.html | 84 +++++++---------------- doc/managing-playlists.html | 78 +++++++--------------- doc/playcounts-and-ratings.html | 80 +++++++---------------- doc/playlists-podcasts-and-photos.html | 84 +++++++---------------- doc/setting-ipod-properties.html | 90 ++++++++----------------- doc/the-sysinfo-file.html | 107 +++++++++++------------------- doc/troubleshooting-faq.html | 94 +++++++++----------------- doc/view-and-edit-track-details.html | 78 +++++++--------------- 21 files changed, 535 insertions(+), 1161 deletions(-) --- diff --git a/doc/adding-cover-art-from-a-browser.html b/doc/adding-cover-art-from-a-browser.html index 8e5e006..a6aab4d 100644 --- a/doc/adding-cover-art-from-a-browser.html +++ b/doc/adding-cover-art-from-a-browser.html @@ -1,4 +1,5 @@ -<html xmlns:set="http://exslt.org/sets"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Adding cover art from a browser</title> @@ -39,7 +40,6 @@ div.body { border: solid 1px #e0e0df; } div.body-sidebar { - margin-right: 13em; } div.division div.division { margin-top: 1.72em; } @@ -60,10 +60,8 @@ h4.title, h5.title, h6.title, h7.title { font-size: 1em; } .block { margin-top: 1em; } .block .block-first { margin-top: 0; } .block-indent { - - margin-left: 1.72em; - - margin-right: 1em; + margin-left left: 1.72em; + margin-: 1em; } .block-indent .block-indent { margin-left: 0em; margin-right: 0em; } td .block-indent { margin-left: 0em; margin-right: 0em; } @@ -85,16 +83,13 @@ a:visited { color: #9f1f6f; } ul, ol, dl { margin: 0; padding: 0; } li { margin-top: 1em; - margin-left: 2.4em; - padding: 0; } li.li-first { margin-top: 0; } dt { margin: 1em 0 0 0; } dt.dt-first { margin: 0; } dd { - margin-left: 1.72em; margin-top: 0.5em; } @@ -105,7 +100,6 @@ dl.dl-compact dd { margin-top: 0; margin-bottom: 0; } ul.linktrail { display: block; margin: 0.2em 0 0 0; - text-align: right; } li.linktrail { display: inline; margin: 0; padding: 0; } @@ -130,7 +124,6 @@ div.navbar img { border: 0; vertical-align: -0.4em; } table.navbar { width: 100%; margin: 0; border: none; } table.navbar td { padding: 0; border: none; } td.navbar-next { - text-align: right; } a.navbar-prev::before { @@ -146,7 +139,6 @@ a.navbar-next::after { div.sidebar { - float: right; padding: 0; margin: 0; width: 12em; } @@ -162,7 +154,6 @@ div.sidenav div.autotoc { div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; } div.sidenav div.autotoc li { margin-bottom: 0.5em; } div.sidenav div.autotoc div.autotoc div.autotoc { - margin-left: 1em; margin-top: 0; } @@ -173,7 +164,6 @@ div.autotoc { display: table; margin-top: 1em; - margin-left: 1.72em; padding: 0.5em 1em 0.5em 1em; background-color: #f0f9ff; @@ -192,42 +182,28 @@ span.bibliolabel { div.admonition { - padding: 0.5em 1em 0.5em 1em; - - padding-left: 60px; - min-height: 48px; + padding: 0.5em 6px 0.5em 6px; border: solid 1px #e0e0df; background-color: #fffff0; - - background-position: 6px 0.5em; - background-repeat: no-repeat; -} -div.caution { - background-image: url("admon-caution.png"); -} -div.important { - background-image: url("admon-important.png"); -} -div.note { - background-image: url("admon-note.png"); -} -div.note-bug { - background-image: url("admon-bug.png"); -} -div.tip { - background-image: url("admon-tip.png"); } -div.warning { - background-image: url("admon-warning.png"); +div.caution-inner, div.important-inner, div.note-inner, div.tip-inner, div.warning-inner { + padding-left: 60px; + background-position: left top; + background-repeat: no-repeat; + min-height: 48px; } +div.caution-inner { background-image: url("admon-caution.png"); } +div.important-inner { background-image: url("admon-important.png"); } +div.note-inner { background-image: url("admon-note.png"); } +div.note-bug div.note-inner { background-image: url("admon-bug.png"); } +div.tip-inner { background-image: url("admon-tip.png"); } +div.warning-inner { background-image: url("admon-warning.png"); } div.blockquote { - background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png'); + background-image: url('watermark-blockquote-201C.png'); background-repeat: no-repeat; - background-position: top left; padding: 0.5em; - padding-left: 4em; } div.attribution { @@ -239,11 +215,8 @@ div.attribution::before { content: '― '; } div.epigraph { - text-align: right; - margin-left: 20%; - margin-right: 0; color: #3f3f3f; } @@ -279,14 +252,15 @@ div.screen .userinput { font-weight: bold; color: #3f3f3f; } +div.programlisting .userinput { + font-weight: bold; + color: #3f3f3f; +} pre.linenumbering { color: #3f3f3f; margin: 0; - padding-right: 1em; - float: left; - text-align: right; } @@ -302,7 +276,6 @@ div.list div.title-formal span.title { border-bottom: solid 1px #e0e0df; } div.simplelist { - margin-left: 1.72em; } div.simplelist table { margin-left: 0; border: none; } @@ -311,9 +284,7 @@ div.simplelist td { border-left: solid 1px #e0e0df; } div.simplelist td.td-first { - padding-left: 0; - border-left: 0; } div.synopsis { @@ -329,7 +300,7 @@ div.synopsis div.synopsis { } div.synopsis div.block { margin-top: 0.2em; } div.synopsis div.block-first { margin-top: 0; } - +div.cmdsynopsis { font-family: monospace; } span.accel { text-decoration: underline; } span.acronym { font-family: sans-serif; } @@ -338,7 +309,6 @@ span.classname, span.exceptionname, span.interfacename { font-family: monospace; span.code { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -346,7 +316,6 @@ pre span.code { border: none; padding: 0; } span.command { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -385,6 +354,7 @@ span.medialabel { font-style: italic; } span.methodname { font-family: monospace; } span.ooclass, span.ooexception, span.oointerface { font-family: monospace; } span.option { font-family: monospace; } +span.package { font-family: monospace; } span.parameter { font-family: monospace; } span.paramdef span.parameter { font-style: italic; } span.prompt { font-family: monospace; } @@ -428,8 +398,6 @@ span.co:hover { span.co a { text-decoration: none; } span.co a:hover { text-decoration: none; } -div.cmdsynopsis { font-family: monospace; } - dt.question { margin-left: 0em; } dt.question div.label { float: left; } dd + dt.question { margin-top: 1em; } @@ -491,7 +459,7 @@ dd.answer div.label { float: left; } <div class="division sect2"> <a name="setting-image-on-existing-album"></a><div class="header"><h2 class="sect2 title"><span class="title"><a name="setting-image-on-existing-album-title"></a><span class="label">2.5.2. </span>Setting Image on Existing Album</span></h2></div> <p class="para block block-first"> - The use of the popup menu to select a cover art file from the filesystem has been documented <span class="filename">Cover Art|here</span>. It is also possible to download a cover art image file from the internet and drag n drop it into gtkpod. + The use of the popup menu to select a cover art file from the filesystem has been documented <span class="filename" dir="ltr">Cover Art|here</span>. It is also possible to download a cover art image file from the internet and drag n drop it into gtkpod. </p> <div class="autotoc"><ul> <li> diff --git a/doc/adding-files-and-folders.html b/doc/adding-files-and-folders.html index abc56b8..419f668 100644 --- a/doc/adding-files-and-folders.html +++ b/doc/adding-files-and-folders.html @@ -1,4 +1,5 @@ -<html xmlns:set="http://exslt.org/sets"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Adding files and folders</title> @@ -39,7 +40,6 @@ div.body { border: solid 1px #e0e0df; } div.body-sidebar { - margin-right: 13em; } div.division div.division { margin-top: 1.72em; } @@ -60,10 +60,8 @@ h4.title, h5.title, h6.title, h7.title { font-size: 1em; } .block { margin-top: 1em; } .block .block-first { margin-top: 0; } .block-indent { - - margin-left: 1.72em; - - margin-right: 1em; + margin-left left: 1.72em; + margin-: 1em; } .block-indent .block-indent { margin-left: 0em; margin-right: 0em; } td .block-indent { margin-left: 0em; margin-right: 0em; } @@ -85,16 +83,13 @@ a:visited { color: #9f1f6f; } ul, ol, dl { margin: 0; padding: 0; } li { margin-top: 1em; - margin-left: 2.4em; - padding: 0; } li.li-first { margin-top: 0; } dt { margin: 1em 0 0 0; } dt.dt-first { margin: 0; } dd { - margin-left: 1.72em; margin-top: 0.5em; } @@ -105,7 +100,6 @@ dl.dl-compact dd { margin-top: 0; margin-bottom: 0; } ul.linktrail { display: block; margin: 0.2em 0 0 0; - text-align: right; } li.linktrail { display: inline; margin: 0; padding: 0; } @@ -130,7 +124,6 @@ div.navbar img { border: 0; vertical-align: -0.4em; } table.navbar { width: 100%; margin: 0; border: none; } table.navbar td { padding: 0; border: none; } td.navbar-next { - text-align: right; } a.navbar-prev::before { @@ -146,7 +139,6 @@ a.navbar-next::after { div.sidebar { - float: right; padding: 0; margin: 0; width: 12em; } @@ -162,7 +154,6 @@ div.sidenav div.autotoc { div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; } div.sidenav div.autotoc li { margin-bottom: 0.5em; } div.sidenav div.autotoc div.autotoc div.autotoc { - margin-left: 1em; margin-top: 0; } @@ -173,7 +164,6 @@ div.autotoc { display: table; margin-top: 1em; - margin-left: 1.72em; padding: 0.5em 1em 0.5em 1em; background-color: #f0f9ff; @@ -192,42 +182,28 @@ span.bibliolabel { div.admonition { - padding: 0.5em 1em 0.5em 1em; - - padding-left: 60px; - min-height: 48px; + padding: 0.5em 6px 0.5em 6px; border: solid 1px #e0e0df; background-color: #fffff0; - - background-position: 6px 0.5em; - background-repeat: no-repeat; -} -div.caution { - background-image: url("admon-caution.png"); -} -div.important { - background-image: url("admon-important.png"); -} -div.note { - background-image: url("admon-note.png"); -} -div.note-bug { - background-image: url("admon-bug.png"); -} -div.tip { - background-image: url("admon-tip.png"); } -div.warning { - background-image: url("admon-warning.png"); +div.caution-inner, div.important-inner, div.note-inner, div.tip-inner, div.warning-inner { + padding-left: 60px; + background-position: left top; + background-repeat: no-repeat; + min-height: 48px; } +div.caution-inner { background-image: url("admon-caution.png"); } +div.important-inner { background-image: url("admon-important.png"); } +div.note-inner { background-image: url("admon-note.png"); } +div.note-bug div.note-inner { background-image: url("admon-bug.png"); } +div.tip-inner { background-image: url("admon-tip.png"); } +div.warning-inner { background-image: url("admon-warning.png"); } div.blockquote { - background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png'); + background-image: url('watermark-blockquote-201C.png'); background-repeat: no-repeat; - background-position: top left; padding: 0.5em; - padding-left: 4em; } div.attribution { @@ -239,11 +215,8 @@ div.attribution::before { content: '― '; } div.epigraph { - text-align: right; - margin-left: 20%; - margin-right: 0; color: #3f3f3f; } @@ -279,14 +252,15 @@ div.screen .userinput { font-weight: bold; color: #3f3f3f; } +div.programlisting .userinput { + font-weight: bold; + color: #3f3f3f; +} pre.linenumbering { color: #3f3f3f; margin: 0; - padding-right: 1em; - float: left; - text-align: right; } @@ -302,7 +276,6 @@ div.list div.title-formal span.title { border-bottom: solid 1px #e0e0df; } div.simplelist { - margin-left: 1.72em; } div.simplelist table { margin-left: 0; border: none; } @@ -311,9 +284,7 @@ div.simplelist td { border-left: solid 1px #e0e0df; } div.simplelist td.td-first { - padding-left: 0; - border-left: 0; } div.synopsis { @@ -329,7 +300,7 @@ div.synopsis div.synopsis { } div.synopsis div.block { margin-top: 0.2em; } div.synopsis div.block-first { margin-top: 0; } - +div.cmdsynopsis { font-family: monospace; } span.accel { text-decoration: underline; } span.acronym { font-family: sans-serif; } @@ -338,7 +309,6 @@ span.classname, span.exceptionname, span.interfacename { font-family: monospace; span.code { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -346,7 +316,6 @@ pre span.code { border: none; padding: 0; } span.command { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -385,6 +354,7 @@ span.medialabel { font-style: italic; } span.methodname { font-family: monospace; } span.ooclass, span.ooexception, span.oointerface { font-family: monospace; } span.option { font-family: monospace; } +span.package { font-family: monospace; } span.parameter { font-family: monospace; } span.paramdef span.parameter { font-style: italic; } span.prompt { font-family: monospace; } @@ -428,8 +398,6 @@ span.co:hover { span.co a { text-decoration: none; } span.co a:hover { text-decoration: none; } -div.cmdsynopsis { font-family: monospace; } - dt.question { margin-left: 0em; } dt.question div.label { float: left; } dd + dt.question { margin-top: 1em; } diff --git a/doc/advanced-features.html b/doc/advanced-features.html index 9caf87b..a51b90d 100644 --- a/doc/advanced-features.html +++ b/doc/advanced-features.html @@ -1,4 +1,5 @@ -<html xmlns:set="http://exslt.org/sets"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Advanced features</title> @@ -39,7 +40,6 @@ div.body { border: solid 1px #e0e0df; } div.body-sidebar { - margin-right: 13em; } div.division div.division { margin-top: 1.72em; } @@ -60,10 +60,8 @@ h4.title, h5.title, h6.title, h7.title { font-size: 1em; } .block { margin-top: 1em; } .block .block-first { margin-top: 0; } .block-indent { - - margin-left: 1.72em; - - margin-right: 1em; + margin-left left: 1.72em; + margin-: 1em; } .block-indent .block-indent { margin-left: 0em; margin-right: 0em; } td .block-indent { margin-left: 0em; margin-right: 0em; } @@ -85,16 +83,13 @@ a:visited { color: #9f1f6f; } ul, ol, dl { margin: 0; padding: 0; } li { margin-top: 1em; - margin-left: 2.4em; - padding: 0; } li.li-first { margin-top: 0; } dt { margin: 1em 0 0 0; } dt.dt-first { margin: 0; } dd { - margin-left: 1.72em; margin-top: 0.5em; } @@ -105,7 +100,6 @@ dl.dl-compact dd { margin-top: 0; margin-bottom: 0; } ul.linktrail { display: block; margin: 0.2em 0 0 0; - text-align: right; } li.linktrail { display: inline; margin: 0; padding: 0; } @@ -130,7 +124,6 @@ div.navbar img { border: 0; vertical-align: -0.4em; } table.navbar { width: 100%; margin: 0; border: none; } table.navbar td { padding: 0; border: none; } td.navbar-next { - text-align: right; } a.navbar-prev::before { @@ -146,7 +139,6 @@ a.navbar-next::after { div.sidebar { - float: right; padding: 0; margin: 0; width: 12em; } @@ -162,7 +154,6 @@ div.sidenav div.autotoc { div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; } div.sidenav div.autotoc li { margin-bottom: 0.5em; } div.sidenav div.autotoc div.autotoc div.autotoc { - margin-left: 1em; margin-top: 0; } @@ -173,7 +164,6 @@ div.autotoc { display: table; margin-top: 1em; - margin-left: 1.72em; padding: 0.5em 1em 0.5em 1em; background-color: #f0f9ff; @@ -192,42 +182,28 @@ span.bibliolabel { div.admonition { - padding: 0.5em 1em 0.5em 1em; - - padding-left: 60px; - min-height: 48px; + padding: 0.5em 6px 0.5em 6px; border: solid 1px #e0e0df; background-color: #fffff0; - - background-position: 6px 0.5em; - background-repeat: no-repeat; -} -div.caution { - background-image: url("admon-caution.png"); -} -div.important { - background-image: url("admon-important.png"); -} -div.note { - background-image: url("admon-note.png"); -} -div.note-bug { - background-image: url("admon-bug.png"); -} -div.tip { - background-image: url("admon-tip.png"); } -div.warning { - background-image: url("admon-warning.png"); +div.caution-inner, div.important-inner, div.note-inner, div.tip-inner, div.warning-inner { + padding-left: 60px; + background-position: left top; + background-repeat: no-repeat; + min-height: 48px; } +div.caution-inner { background-image: url("admon-caution.png"); } +div.important-inner { background-image: url("admon-important.png"); } +div.note-inner { background-image: url("admon-note.png"); } +div.note-bug div.note-inner { background-image: url("admon-bug.png"); } +div.tip-inner { background-image: url("admon-tip.png"); } +div.warning-inner { background-image: url("admon-warning.png"); } div.blockquote { - background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png'); + background-image: url('watermark-blockquote-201C.png'); background-repeat: no-repeat; - background-position: top left; padding: 0.5em; - padding-left: 4em; } div.attribution { @@ -239,11 +215,8 @@ div.attribution::before { content: '― '; } div.epigraph { - text-align: right; - margin-left: 20%; - margin-right: 0; color: #3f3f3f; } @@ -279,14 +252,15 @@ div.screen .userinput { font-weight: bold; color: #3f3f3f; } +div.programlisting .userinput { + font-weight: bold; + color: #3f3f3f; +} pre.linenumbering { color: #3f3f3f; margin: 0; - padding-right: 1em; - float: left; - text-align: right; } @@ -302,7 +276,6 @@ div.list div.title-formal span.title { border-bottom: solid 1px #e0e0df; } div.simplelist { - margin-left: 1.72em; } div.simplelist table { margin-left: 0; border: none; } @@ -311,9 +284,7 @@ div.simplelist td { border-left: solid 1px #e0e0df; } div.simplelist td.td-first { - padding-left: 0; - border-left: 0; } div.synopsis { @@ -329,7 +300,7 @@ div.synopsis div.synopsis { } div.synopsis div.block { margin-top: 0.2em; } div.synopsis div.block-first { margin-top: 0; } - +div.cmdsynopsis { font-family: monospace; } span.accel { text-decoration: underline; } span.acronym { font-family: sans-serif; } @@ -338,7 +309,6 @@ span.classname, span.exceptionname, span.interfacename { font-family: monospace; span.code { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -346,7 +316,6 @@ pre span.code { border: none; padding: 0; } span.command { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -385,6 +354,7 @@ span.medialabel { font-style: italic; } span.methodname { font-family: monospace; } span.ooclass, span.ooexception, span.oointerface { font-family: monospace; } span.option { font-family: monospace; } +span.package { font-family: monospace; } span.parameter { font-family: monospace; } span.paramdef span.parameter { font-style: italic; } span.prompt { font-family: monospace; } @@ -428,8 +398,6 @@ span.co:hover { span.co a { text-decoration: none; } span.co a:hover { text-decoration: none; } -div.cmdsynopsis { font-family: monospace; } - dt.question { margin-left: 0em; } dt.question div.label { float: left; } dd + dt.question { margin-top: 1em; } diff --git a/doc/copying-content-to-the-ipod.html b/doc/copying-content-to-the-ipod.html index fe595d1..910e994 100644 --- a/doc/copying-content-to-the-ipod.html +++ b/doc/copying-content-to-the-ipod.html @@ -1,4 +1,5 @@ -<html xmlns:set="http://exslt.org/sets"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Copying content to the iPod</title> @@ -39,7 +40,6 @@ div.body { border: solid 1px #e0e0df; } div.body-sidebar { - margin-right: 13em; } div.division div.division { margin-top: 1.72em; } @@ -60,10 +60,8 @@ h4.title, h5.title, h6.title, h7.title { font-size: 1em; } .block { margin-top: 1em; } .block .block-first { margin-top: 0; } .block-indent { - - margin-left: 1.72em; - - margin-right: 1em; + margin-left left: 1.72em; + margin-: 1em; } .block-indent .block-indent { margin-left: 0em; margin-right: 0em; } td .block-indent { margin-left: 0em; margin-right: 0em; } @@ -85,16 +83,13 @@ a:visited { color: #9f1f6f; } ul, ol, dl { margin: 0; padding: 0; } li { margin-top: 1em; - margin-left: 2.4em; - padding: 0; } li.li-first { margin-top: 0; } dt { margin: 1em 0 0 0; } dt.dt-first { margin: 0; } dd { - margin-left: 1.72em; margin-top: 0.5em; } @@ -105,7 +100,6 @@ dl.dl-compact dd { margin-top: 0; margin-bottom: 0; } ul.linktrail { display: block; margin: 0.2em 0 0 0; - text-align: right; } li.linktrail { display: inline; margin: 0; padding: 0; } @@ -130,7 +124,6 @@ div.navbar img { border: 0; vertical-align: -0.4em; } table.navbar { width: 100%; margin: 0; border: none; } table.navbar td { padding: 0; border: none; } td.navbar-next { - text-align: right; } a.navbar-prev::before { @@ -146,7 +139,6 @@ a.navbar-next::after { div.sidebar { - float: right; padding: 0; margin: 0; width: 12em; } @@ -162,7 +154,6 @@ div.sidenav div.autotoc { div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; } div.sidenav div.autotoc li { margin-bottom: 0.5em; } div.sidenav div.autotoc div.autotoc div.autotoc { - margin-left: 1em; margin-top: 0; } @@ -173,7 +164,6 @@ div.autotoc { display: table; margin-top: 1em; - margin-left: 1.72em; padding: 0.5em 1em 0.5em 1em; background-color: #f0f9ff; @@ -192,42 +182,28 @@ span.bibliolabel { div.admonition { - padding: 0.5em 1em 0.5em 1em; - - padding-left: 60px; - min-height: 48px; + padding: 0.5em 6px 0.5em 6px; border: solid 1px #e0e0df; background-color: #fffff0; - - background-position: 6px 0.5em; - background-repeat: no-repeat; -} -div.caution { - background-image: url("admon-caution.png"); -} -div.important { - background-image: url("admon-important.png"); -} -div.note { - background-image: url("admon-note.png"); -} -div.note-bug { - background-image: url("admon-bug.png"); -} -div.tip { - background-image: url("admon-tip.png"); } -div.warning { - background-image: url("admon-warning.png"); +div.caution-inner, div.important-inner, div.note-inner, div.tip-inner, div.warning-inner { + padding-left: 60px; + background-position: left top; + background-repeat: no-repeat; + min-height: 48px; } +div.caution-inner { background-image: url("admon-caution.png"); } +div.important-inner { background-image: url("admon-important.png"); } +div.note-inner { background-image: url("admon-note.png"); } +div.note-bug div.note-inner { background-image: url("admon-bug.png"); } +div.tip-inner { background-image: url("admon-tip.png"); } +div.warning-inner { background-image: url("admon-warning.png"); } div.blockquote { - background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png'); + background-image: url('watermark-blockquote-201C.png'); background-repeat: no-repeat; - background-position: top left; padding: 0.5em; - padding-left: 4em; } div.attribution { @@ -239,11 +215,8 @@ div.attribution::before { content: '― '; } div.epigraph { - text-align: right; - margin-left: 20%; - margin-right: 0; color: #3f3f3f; } @@ -279,14 +252,15 @@ div.screen .userinput { font-weight: bold; color: #3f3f3f; } +div.programlisting .userinput { + font-weight: bold; + color: #3f3f3f; +} pre.linenumbering { color: #3f3f3f; margin: 0; - padding-right: 1em; - float: left; - text-align: right; } @@ -302,7 +276,6 @@ div.list div.title-formal span.title { border-bottom: solid 1px #e0e0df; } div.simplelist { - margin-left: 1.72em; } div.simplelist table { margin-left: 0; border: none; } @@ -311,9 +284,7 @@ div.simplelist td { border-left: solid 1px #e0e0df; } div.simplelist td.td-first { - padding-left: 0; - border-left: 0; } div.synopsis { @@ -329,7 +300,7 @@ div.synopsis div.synopsis { } div.synopsis div.block { margin-top: 0.2em; } div.synopsis div.block-first { margin-top: 0; } - +div.cmdsynopsis { font-family: monospace; } span.accel { text-decoration: underline; } span.acronym { font-family: sans-serif; } @@ -338,7 +309,6 @@ span.classname, span.exceptionname, span.interfacename { font-family: monospace; span.code { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -346,7 +316,6 @@ pre span.code { border: none; padding: 0; } span.command { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -385,6 +354,7 @@ span.medialabel { font-style: italic; } span.methodname { font-family: monospace; } span.ooclass, span.ooexception, span.oointerface { font-family: monospace; } span.option { font-family: monospace; } +span.package { font-family: monospace; } span.parameter { font-family: monospace; } span.paramdef span.parameter { font-style: italic; } span.prompt { font-family: monospace; } @@ -428,8 +398,6 @@ span.co:hover { span.co a { text-decoration: none; } span.co a:hover { text-decoration: none; } -div.cmdsynopsis { font-family: monospace; } - dt.question { margin-left: 0em; } dt.question div.label { float: left; } dd + dt.question { margin-top: 1em; } diff --git a/doc/cover-art.html b/doc/cover-art.html index 0afad13..cdc6151 100644 --- a/doc/cover-art.html +++ b/doc/cover-art.html @@ -1,4 +1,5 @@ -<html xmlns:set="http://exslt.org/sets"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Cover art</title> @@ -39,7 +40,6 @@ div.body { border: solid 1px #e0e0df; } div.body-sidebar { - margin-right: 13em; } div.division div.division { margin-top: 1.72em; } @@ -60,10 +60,8 @@ h4.title, h5.title, h6.title, h7.title { font-size: 1em; } .block { margin-top: 1em; } .block .block-first { margin-top: 0; } .block-indent { - - margin-left: 1.72em; - - margin-right: 1em; + margin-left left: 1.72em; + margin-: 1em; } .block-indent .block-indent { margin-left: 0em; margin-right: 0em; } td .block-indent { margin-left: 0em; margin-right: 0em; } @@ -85,16 +83,13 @@ a:visited { color: #9f1f6f; } ul, ol, dl { margin: 0; padding: 0; } li { margin-top: 1em; - margin-left: 2.4em; - padding: 0; } li.li-first { margin-top: 0; } dt { margin: 1em 0 0 0; } dt.dt-first { margin: 0; } dd { - margin-left: 1.72em; margin-top: 0.5em; } @@ -105,7 +100,6 @@ dl.dl-compact dd { margin-top: 0; margin-bottom: 0; } ul.linktrail { display: block; margin: 0.2em 0 0 0; - text-align: right; } li.linktrail { display: inline; margin: 0; padding: 0; } @@ -130,7 +124,6 @@ div.navbar img { border: 0; vertical-align: -0.4em; } table.navbar { width: 100%; margin: 0; border: none; } table.navbar td { padding: 0; border: none; } td.navbar-next { - text-align: right; } a.navbar-prev::before { @@ -146,7 +139,6 @@ a.navbar-next::after { div.sidebar { - float: right; padding: 0; margin: 0; width: 12em; } @@ -162,7 +154,6 @@ div.sidenav div.autotoc { div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; } div.sidenav div.autotoc li { margin-bottom: 0.5em; } div.sidenav div.autotoc div.autotoc div.autotoc { - margin-left: 1em; margin-top: 0; } @@ -173,7 +164,6 @@ div.autotoc { display: table; margin-top: 1em; - margin-left: 1.72em; padding: 0.5em 1em 0.5em 1em; background-color: #f0f9ff; @@ -192,42 +182,28 @@ span.bibliolabel { div.admonition { - padding: 0.5em 1em 0.5em 1em; - - padding-left: 60px; - min-height: 48px; + padding: 0.5em 6px 0.5em 6px; border: solid 1px #e0e0df; background-color: #fffff0; - - background-position: 6px 0.5em; - background-repeat: no-repeat; -} -div.caution { - background-image: url("admon-caution.png"); } -div.important { - background-image: url("admon-important.png"); -} -div.note { - background-image: url("admon-note.png"); -} -div.note-bug { - background-image: url("admon-bug.png"); -} -div.tip { - background-image: url("admon-tip.png"); -} -div.warning { - background-image: url("admon-warning.png"); +div.caution-inner, div.important-inner, div.note-inner, div.tip-inner, div.warning-inner { + padding-left: 60px; + background-position: left top; + background-repeat: no-repeat; + min-height: 48px; } +div.caution-inner { background-image: url("admon-caution.png"); } +div.important-inner { background-image: url("admon-important.png"); } +div.note-inner { background-image: url("admon-note.png"); } +div.note-bug div.note-inner { background-image: url("admon-bug.png"); } +div.tip-inner { background-image: url("admon-tip.png"); } +div.warning-inner { background-image: url("admon-warning.png"); } div.blockquote { - background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png'); + background-image: url('watermark-blockquote-201C.png'); background-repeat: no-repeat; - background-position: top left; padding: 0.5em; - padding-left: 4em; } div.attribution { @@ -239,11 +215,8 @@ div.attribution::before { content: '― '; } div.epigraph { - text-align: right; - margin-left: 20%; - margin-right: 0; color: #3f3f3f; } @@ -279,14 +252,15 @@ div.screen .userinput { font-weight: bold; color: #3f3f3f; } +div.programlisting .userinput { + font-weight: bold; + color: #3f3f3f; +} pre.linenumbering { color: #3f3f3f; margin: 0; - padding-right: 1em; - float: left; - text-align: right; } @@ -302,7 +276,6 @@ div.list div.title-formal span.title { border-bottom: solid 1px #e0e0df; } div.simplelist { - margin-left: 1.72em; } div.simplelist table { margin-left: 0; border: none; } @@ -311,9 +284,7 @@ div.simplelist td { border-left: solid 1px #e0e0df; } div.simplelist td.td-first { - padding-left: 0; - border-left: 0; } div.synopsis { @@ -329,7 +300,7 @@ div.synopsis div.synopsis { } div.synopsis div.block { margin-top: 0.2em; } div.synopsis div.block-first { margin-top: 0; } - +div.cmdsynopsis { font-family: monospace; } span.accel { text-decoration: underline; } span.acronym { font-family: sans-serif; } @@ -338,7 +309,6 @@ span.classname, span.exceptionname, span.interfacename { font-family: monospace; span.code { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -346,7 +316,6 @@ pre span.code { border: none; padding: 0; } span.command { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -385,6 +354,7 @@ span.medialabel { font-style: italic; } span.methodname { font-family: monospace; } span.ooclass, span.ooexception, span.oointerface { font-family: monospace; } span.option { font-family: monospace; } +span.package { font-family: monospace; } span.parameter { font-family: monospace; } span.paramdef span.parameter { font-style: italic; } span.prompt { font-family: monospace; } @@ -428,8 +398,6 @@ span.co:hover { span.co a { text-decoration: none; } span.co a:hover { text-decoration: none; } -div.cmdsynopsis { font-family: monospace; } - dt.question { margin-left: 0em; } dt.question div.label { float: left; } dd + dt.question { margin-top: 1em; } @@ -477,14 +445,22 @@ dd.answer div.label { float: left; } </p> <div class="autotoc"><ul> <li> -<span class="label">2.4.1. </span><a class="xref" href="cover-art.html#coverart-display" title="CoverArt Display">CoverArt Display</a> +<span class="label">2.4.1. </span><a class="xref" href="cover-art.html#clarity" title="The Clarity Display Plugin">The Clarity Display Plugin</a> +</li> +<li> +<span class="label">2.4.2. </span><a class="xref" href="cover-art.html#coverart-display" title="CoverArt Display">CoverArt Display</a> </li> <li> -<span class="label">2.4.2. </span><a class="xref" href="cover-art.html#coverart-popup-menu" title="CoverArt Popup Menu">CoverArt Popup Menu</a> +<span class="label">2.4.3. </span><a class="xref" href="cover-art.html#coverart-popup-menu" title="CoverArt Popup Menu">CoverArt Popup Menu</a> </li> </ul></div> <div class="division sect2"> -<a name="coverart-display"></a><div class="header"><h2 class="sect2 title"><span class="title"><a name="coverart-display-title"></a><span class="label">2.4.1. </span>CoverArt Display</span></h2></div> +<a name="clarity"></a><div class="header"><h2 class="sect2 title"><span class="title"><a name="clarity-title"></a><span class="label">2.4.1. </span>The Clarity Display Plugin</span></h2></div> +<p class="para block block-first">Should you have the capability of an opengl rendering graphics card and drivers then the clarity plugin provides a more stylish cover art display than the original coverart display plugin described here. + </p> +</div> +<div class="division sect2"> +<a name="coverart-display"></a><div class="header"><h2 class="sect2 title"><span class="title"><a name="coverart-display-title"></a><span class="label">2.4.2. </span>CoverArt Display</span></h2></div> <p class="para block block-first">The display consists of 9 covers displayed at any one time. The entire album collection can be cycled through from one end to another. The main image is slighly larger and lacking in "shine" for viewing clarity. </p> <p class="para block"> @@ -512,7 +488,7 @@ dd.answer div.label { float: left; } </ul></div> </div> <div class="division sect2"> -<a name="coverart-popup-menu"></a><div class="header"><h2 class="sect2 title"><span class="title"><a name="coverart-popup-menu-title"></a><span class="label">2.4.2. </span>CoverArt Popup Menu</span></h2></div> +<a name="coverart-popup-menu"></a><div class="header"><h2 class="sect2 title"><span class="title"><a name="coverart-popup-menu-title"></a><span class="label">2.4.3. </span>CoverArt Popup Menu</span></h2></div> <p class="para block block-first"> <div class=" block figure block-first block-indent"> <div class="block block-first title title-formal"><span class="title"><span class="label"><span style="font-style: italic; ">Figure 2-5</span> </span>Cover art popup menu</span></div> @@ -541,17 +517,17 @@ dd.answer div.label { float: left; } </li></ul></div> <div class="autotoc"><ul> <li> -<span class="label">2.4.2.1. </span><a class="xref" href="cover-art.html#select-cover-from-file" title="Select Cover From File">Select Cover From File</a> +<span class="label">2.4.3.1. </span><a class="xref" href="cover-art.html#select-cover-from-file" title="Select Cover From File">Select Cover From File</a> </li> <li> -<span class="label">2.4.2.2. </span><a class="xref" href="cover-art.html#view-full-size-artwork" title="View Full Size Artwork">View Full Size Artwork</a> +<span class="label">2.4.3.2. </span><a class="xref" href="cover-art.html#view-full-size-artwork" title="View Full Size Artwork">View Full Size Artwork</a> </li> <li> -<span class="label">2.4.2.3. </span><a class="xref" href="cover-art.html#edit-track-details-coverart" title="Edit Track Details">Edit Track Details</a> +<span class="label">2.4.3.3. </span><a class="xref" href="cover-art.html#edit-track-details-coverart" title="Edit Track Details">Edit Track Details</a> </li> </ul></div> <div class="division sect3"> -<a name="select-cover-from-file"></a><div class="header"><h3 class="sect3 title"><span class="title"><a name="select-cover-from-file-title"></a><span class="label">2.4.2.1. </span>Select Cover From File</span></h3></div> +<a name="select-cover-from-file"></a><div class="header"><h3 class="sect3 title"><span class="title"><a name="select-cover-from-file-title"></a><span class="label">2.4.3.1. </span>Select Cover From File</span></h3></div> <p class="para block block-first"> <div class=" block figure block-first block-indent"> <div class="block block-first title title-formal"><span class="title"><span class="label"><span style="font-style: italic; ">Figure 2-6</span> </span>Select cover from file</span></div> @@ -567,7 +543,7 @@ dd.answer div.label { float: left; } </li></ul></div> </div> <div class="division sect3"> -<a name="view-full-size-artwork"></a><div class="header"><h3 class="sect3 title"><span class="title"><a name="view-full-size-artwork-title"></a><span class="label">2.4.2.2. </span>View Full Size Artwork</span></h3></div> +<a name="view-full-size-artwork"></a><div class="header"><h3 class="sect3 title"><span class="title"><a name="view-full-size-artwork-title"></a><span class="label">2.4.3.2. </span>View Full Size Artwork</span></h3></div> <p class="para block block-first"> <div class=" block figure block-first block-indent"> <div class="block block-first title title-formal"><span class="title"><span class="label"><span style="font-style: italic; ">Figure 2-7</span> </span>View full size artwork</span></div> @@ -589,7 +565,7 @@ dd.answer div.label { float: left; } </ul></div> </div> <div class="division sect3"> -<a name="edit-track-details-coverart"></a><div class="header"><h3 class="sect3 title"><span class="title"><span class="label">2.4.2.3. </span>Edit Track Details</span></h3></div> +<a name="edit-track-details-coverart"></a><div class="header"><h3 class="sect3 title"><span class="title"><span class="label">2.4.3.3. </span>Edit Track Details</span></h3></div> <div class="block list itemizedlist"><ul class="itemizedlist"><li class="li-first"> <span class="para">This provides a shortcut to the "Edit Track Details" dialog for editing the ID3 tag information for all tracks belonging to the album displayed. </span> diff --git a/doc/exporting-files-from-the-ipod.html b/doc/exporting-files-from-the-ipod.html index 0b9e4f4..9d39a8b 100644 --- a/doc/exporting-files-from-the-ipod.html +++ b/doc/exporting-files-from-the-ipod.html @@ -1,8 +1,9 @@ -<html xmlns:set="http://exslt.org/sets"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Exporting files from the iPod</title> -<link rel="previous" href="advanced-features.html" title="Advanced features"> +<link rel="previous" href="exporting-files-from-the-ipod.html" title="Exporting files from the iPod"> <link rel="top" href="gtkpod.html" title="The gtkpod Manual"> <style type="text/css"> @@ -38,7 +39,6 @@ div.body { border: solid 1px #e0e0df; } div.body-sidebar { - margin-right: 13em; } div.division div.division { margin-top: 1.72em; } @@ -59,10 +59,8 @@ h4.title, h5.title, h6.title, h7.title { font-size: 1em; } .block { margin-top: 1em; } .block .block-first { margin-top: 0; } .block-indent { - - margin-left: 1.72em; - - margin-right: 1em; + margin-left left: 1.72em; + margin-: 1em; } .block-indent .block-indent { margin-left: 0em; margin-right: 0em; } td .block-indent { margin-left: 0em; margin-right: 0em; } @@ -84,16 +82,13 @@ a:visited { color: #9f1f6f; } ul, ol, dl { margin: 0; padding: 0; } li { margin-top: 1em; - margin-left: 2.4em; - padding: 0; } li.li-first { margin-top: 0; } dt { margin: 1em 0 0 0; } dt.dt-first { margin: 0; } dd { - margin-left: 1.72em; margin-top: 0.5em; } @@ -104,7 +99,6 @@ dl.dl-compact dd { margin-top: 0; margin-bottom: 0; } ul.linktrail { display: block; margin: 0.2em 0 0 0; - text-align: right; } li.linktrail { display: inline; margin: 0; padding: 0; } @@ -129,7 +123,6 @@ div.navbar img { border: 0; vertical-align: -0.4em; } table.navbar { width: 100%; margin: 0; border: none; } table.navbar td { padding: 0; border: none; } td.navbar-next { - text-align: right; } a.navbar-prev::before { @@ -145,7 +138,6 @@ a.navbar-next::after { div.sidebar { - float: right; padding: 0; margin: 0; width: 12em; } @@ -161,7 +153,6 @@ div.sidenav div.autotoc { div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; } div.sidenav div.autotoc li { margin-bottom: 0.5em; } div.sidenav div.autotoc div.autotoc div.autotoc { - margin-left: 1em; margin-top: 0; } @@ -172,7 +163,6 @@ div.autotoc { display: table; margin-top: 1em; - margin-left: 1.72em; padding: 0.5em 1em 0.5em 1em; background-color: #f0f9ff; @@ -191,42 +181,28 @@ span.bibliolabel { div.admonition { - padding: 0.5em 1em 0.5em 1em; - - padding-left: 60px; - min-height: 48px; + padding: 0.5em 6px 0.5em 6px; border: solid 1px #e0e0df; background-color: #fffff0; - - background-position: 6px 0.5em; - background-repeat: no-repeat; -} -div.caution { - background-image: url("admon-caution.png"); -} -div.important { - background-image: url("admon-important.png"); -} -div.note { - background-image: url("admon-note.png"); -} -div.note-bug { - background-image: url("admon-bug.png"); -} -div.tip { - background-image: url("admon-tip.png"); } -div.warning { - background-image: url("admon-warning.png"); +div.caution-inner, div.important-inner, div.note-inner, div.tip-inner, div.warning-inner { + padding-left: 60px; + background-position: left top; + background-repeat: no-repeat; + min-height: 48px; } +div.caution-inner { background-image: url("admon-caution.png"); } +div.important-inner { background-image: url("admon-important.png"); } +div.note-inner { background-image: url("admon-note.png"); } +div.note-bug div.note-inner { background-image: url("admon-bug.png"); } +div.tip-inner { background-image: url("admon-tip.png"); } +div.warning-inner { background-image: url("admon-warning.png"); } div.blockquote { - background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png'); + background-image: url('watermark-blockquote-201C.png'); background-repeat: no-repeat; - background-position: top left; padding: 0.5em; - padding-left: 4em; } div.attribution { @@ -238,11 +214,8 @@ div.attribution::before { content: '― '; } div.epigraph { - text-align: right; - margin-left: 20%; - margin-right: 0; color: #3f3f3f; } @@ -278,14 +251,15 @@ div.screen .userinput { font-weight: bold; color: #3f3f3f; } +div.programlisting .userinput { + font-weight: bold; + color: #3f3f3f; +} pre.linenumbering { color: #3f3f3f; margin: 0; - padding-right: 1em; - float: left; - text-align: right; } @@ -301,7 +275,6 @@ div.list div.title-formal span.title { border-bottom: solid 1px #e0e0df; } div.simplelist { - margin-left: 1.72em; } div.simplelist table { margin-left: 0; border: none; } @@ -310,9 +283,7 @@ div.simplelist td { border-left: solid 1px #e0e0df; } div.simplelist td.td-first { - padding-left: 0; - border-left: 0; } div.synopsis { @@ -328,7 +299,7 @@ div.synopsis div.synopsis { } div.synopsis div.block { margin-top: 0.2em; } div.synopsis div.block-first { margin-top: 0; } - +div.cmdsynopsis { font-family: monospace; } span.accel { text-decoration: underline; } span.acronym { font-family: sans-serif; } @@ -337,7 +308,6 @@ span.classname, span.exceptionname, span.interfacename { font-family: monospace; span.code { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -345,7 +315,6 @@ pre span.code { border: none; padding: 0; } span.command { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -384,6 +353,7 @@ span.medialabel { font-style: italic; } span.methodname { font-family: monospace; } span.ooclass, span.ooexception, span.oointerface { font-family: monospace; } span.option { font-family: monospace; } +span.package { font-family: monospace; } span.parameter { font-family: monospace; } span.paramdef span.parameter { font-style: italic; } span.prompt { font-family: monospace; } @@ -427,8 +397,6 @@ span.co:hover { span.co a { text-decoration: none; } span.co a:hover { text-decoration: none; } -div.cmdsynopsis { font-family: monospace; } - dt.question { margin-left: 0em; } dt.question div.label { float: left; } dd + dt.question { margin-top: 1em; } @@ -442,7 +410,7 @@ dd.answer div.label { float: left; } </head> <body> <div class="navbar navbar-top"><table class="navbar"><tr> -<td class="navbar-prev"><a class="navbar-prev" href="advanced-features.html" title="Advanced features">Advanced features</a></td> +<td class="navbar-prev"><a class="navbar-prev" href="exporting-files-from-the-ipod.html" title="Exporting files from the iPod">Exporting files from the iPod</a></td> <td class="navbar-next"></td> </tr></table></div> <div class="sidebar"><div class="sidenav"><div class="autotoc"><ul> @@ -488,7 +456,7 @@ dd.answer div.label { float: left; } </div> </div></div> <div class="navbar navbar-bottom"><table class="navbar"><tr> -<td class="navbar-prev"><a class="navbar-prev" href="advanced-features.html" title="Advanced features">Advanced features</a></td> +<td class="navbar-prev"><a class="navbar-prev" href="exporting-files-from-the-ipod.html" title="Exporting files from the iPod">Exporting files from the iPod</a></td> <td class="navbar-next"></td> </tr></table></div> </body> diff --git a/doc/getting-started.html b/doc/getting-started.html index 8670c88..e64a72b 100644 --- a/doc/getting-started.html +++ b/doc/getting-started.html @@ -1,8 +1,9 @@ -<html xmlns:set="http://exslt.org/sets"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Getting started</title> -<link rel="previous" href="gtkpod.html" title="The gtkpod Manual"> +<link rel="previous" href="getting-started.html" title="Getting started"> <link rel="next" href="hooking-up-the-ipod.html" title="Hooking up the iPod"> <link rel="top" href="gtkpod.html" title="The gtkpod Manual"> <style type="text/css"> @@ -39,7 +40,6 @@ div.body { border: solid 1px #e0e0df; } div.body-sidebar { - margin-right: 13em; } div.division div.division { margin-top: 1.72em; } @@ -60,10 +60,8 @@ h4.title, h5.title, h6.title, h7.title { font-size: 1em; } .block { margin-top: 1em; } .block .block-first { margin-top: 0; } .block-indent { - - margin-left: 1.72em; - - margin-right: 1em; + margin-left left: 1.72em; + margin-: 1em; } .block-indent .block-indent { margin-left: 0em; margin-right: 0em; } td .block-indent { margin-left: 0em; margin-right: 0em; } @@ -85,16 +83,13 @@ a:visited { color: #9f1f6f; } ul, ol, dl { margin: 0; padding: 0; } li { margin-top: 1em; - margin-left: 2.4em; - padding: 0; } li.li-first { margin-top: 0; } dt { margin: 1em 0 0 0; } dt.dt-first { margin: 0; } dd { - margin-left: 1.72em; margin-top: 0.5em; } @@ -105,7 +100,6 @@ dl.dl-compact dd { margin-top: 0; margin-bottom: 0; } ul.linktrail { display: block; margin: 0.2em 0 0 0; - text-align: right; } li.linktrail { display: inline; margin: 0; padding: 0; } @@ -130,7 +124,6 @@ div.navbar img { border: 0; vertical-align: -0.4em; } table.navbar { width: 100%; margin: 0; border: none; } table.navbar td { padding: 0; border: none; } td.navbar-next { - text-align: right; } a.navbar-prev::before { @@ -146,7 +139,6 @@ a.navbar-next::after { div.sidebar { - float: right; padding: 0; margin: 0; width: 12em; } @@ -162,7 +154,6 @@ div.sidenav div.autotoc { div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; } div.sidenav div.autotoc li { margin-bottom: 0.5em; } div.sidenav div.autotoc div.autotoc div.autotoc { - margin-left: 1em; margin-top: 0; } @@ -173,7 +164,6 @@ div.autotoc { display: table; margin-top: 1em; - margin-left: 1.72em; padding: 0.5em 1em 0.5em 1em; background-color: #f0f9ff; @@ -192,42 +182,28 @@ span.bibliolabel { div.admonition { - padding: 0.5em 1em 0.5em 1em; - - padding-left: 60px; - min-height: 48px; + padding: 0.5em 6px 0.5em 6px; border: solid 1px #e0e0df; background-color: #fffff0; - - background-position: 6px 0.5em; - background-repeat: no-repeat; -} -div.caution { - background-image: url("admon-caution.png"); -} -div.important { - background-image: url("admon-important.png"); -} -div.note { - background-image: url("admon-note.png"); -} -div.note-bug { - background-image: url("admon-bug.png"); -} -div.tip { - background-image: url("admon-tip.png"); } -div.warning { - background-image: url("admon-warning.png"); +div.caution-inner, div.important-inner, div.note-inner, div.tip-inner, div.warning-inner { + padding-left: 60px; + background-position: left top; + background-repeat: no-repeat; + min-height: 48px; } +div.caution-inner { background-image: url("admon-caution.png"); } +div.important-inner { background-image: url("admon-important.png"); } +div.note-inner { background-image: url("admon-note.png"); } +div.note-bug div.note-inner { background-image: url("admon-bug.png"); } +div.tip-inner { background-image: url("admon-tip.png"); } +div.warning-inner { background-image: url("admon-warning.png"); } div.blockquote { - background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png'); + background-image: url('watermark-blockquote-201C.png'); background-repeat: no-repeat; - background-position: top left; padding: 0.5em; - padding-left: 4em; } div.attribution { @@ -239,11 +215,8 @@ div.attribution::before { content: '― '; } div.epigraph { - text-align: right; - margin-left: 20%; - margin-right: 0; color: #3f3f3f; } @@ -279,14 +252,15 @@ div.screen .userinput { font-weight: bold; color: #3f3f3f; } +div.programlisting .userinput { + font-weight: bold; + color: #3f3f3f; +} pre.linenumbering { color: #3f3f3f; margin: 0; - padding-right: 1em; - float: left; - text-align: right; } @@ -302,7 +276,6 @@ div.list div.title-formal span.title { border-bottom: solid 1px #e0e0df; } div.simplelist { - margin-left: 1.72em; } div.simplelist table { margin-left: 0; border: none; } @@ -311,9 +284,7 @@ div.simplelist td { border-left: solid 1px #e0e0df; } div.simplelist td.td-first { - padding-left: 0; - border-left: 0; } div.synopsis { @@ -329,7 +300,7 @@ div.synopsis div.synopsis { } div.synopsis div.block { margin-top: 0.2em; } div.synopsis div.block-first { margin-top: 0; } - +div.cmdsynopsis { font-family: monospace; } span.accel { text-decoration: underline; } span.acronym { font-family: sans-serif; } @@ -338,7 +309,6 @@ span.classname, span.exceptionname, span.interfacename { font-family: monospace; span.code { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -346,7 +316,6 @@ pre span.code { border: none; padding: 0; } span.command { font-family: monospace; border: solid 1px #e0e0df; - padding-left: 0.2em; padding-right: 0.2em; } @@ -385,6 +354,7 @@ span.medialabel { font-style: italic; } span.methodname { font-family: monospace; } span.ooclass, span.ooexception, span.oointerface { font-family: monospace; } span.option { font-family: monospace; } +span.package { font-family: monospace; } span.parameter { font-family: monospace; } span.paramdef span.parameter { font-style: italic; } span.prompt { font-family: monospace; } @@ -428,8 +398,6 @@ span.co:hover { span.co a { text-decoration: none; } span.co a:hover { text-decoration: none; } -div.cmdsynopsis { font-family: monospace; } - dt.question { margin-left: 0em; } dt.question div.label { float: left; } dd + dt.question { margin-top: 1em; } @@ -443,7 +411,7 @@ dd.answer div.label { float: left; } </head> <body> <div class="navbar navbar-top"><table class="navbar"><tr> -<td class="navbar-prev"><a class="navbar-prev" href="gtkpod.html" title="The gtkpod Manual">The gtkpod Manual</a></td> +<td class="navbar-prev"><a class="navbar-prev" href="getting-started.html" title="Getting started">Getting started</a></td> <td class="navbar-next"><a class="navbar-next" href="hooking-up-the-ipod.html" title="Hooking up the iPod">Hooking up the iPod</a></td> </tr></table></div> <div class="sidebar"><div class="sidenav"><div class="autotoc"><ul> @@ -486,7 +454,7 @@ dd.answer div.label { float: left; } </ul></div> </div></div> <div class="navbar navbar-bottom"><table class="navbar"><tr> -<td class="navbar-prev"><a class="navbar-prev" href="gtkpod.html" title="The gtkpod Manual">The gtkpod Manual</a></td> +<td class="navbar-prev"><a class="navbar-prev" href="getting-started.html" title="Getting started">Getting started</a></td> <td class="navbar-next"><a class="navbar-next" href="hooking-up-the-ipod.html" title="Hooking up the iPod">Hooking up the iPod</a></td> </tr></table></div> </body> diff --git a/doc/gtkpod-info.html b/doc/gtkpod-info.html index 830e257..88fbdac 100644 --- a/doc/gtkpod-info.html +++ b/doc/gtkpod-info.html @@ -1,4 +1,5 @@ -<html xmlns:set="http://exslt.org/sets"> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>The gtkpod Manual</title> @@ -37,7 +38,6 @@ div.body { border: solid 1px #e0e0df; } div.body-sidebar { - margin-right: 13em; } div.division div.division { margin-top: 1.72em; } @@ -58,10 +58,8 @@ h4.title, h5.title, h6.title, h7.title { font-size: 1em; } .block { margin-top: 1em; } .block .block-first { margin-top: 0; } .block-indent { - - margin-left: 1.72em; - - margin-right: 1em; + margin-left left: 1.72em; + margin-: 1em; } .block-indent .block-indent { margin-left: 0em; margin-right: 0em; } td .block-indent { margin-left: 0em; margin-right: 0em; } @@ -83,16 +81,13 @@ a:visited { color: #9f1f6f; } ul, ol, dl { margin: 0; padding: 0; } li { margin-top: 1em; - margin-left: 2.4em; - padding: 0; } li.li-first { margin-top: 0; } dt { margin: 1em 0 0 0; } dt.dt-first { margin: 0; } dd { - margin-left: 1.72em; margin-top: 0.5em; } @@ -103,7 +98,6 @@ dl.dl-compact dd { margin-top: 0; margin-bottom: 0; } ul.linktrail { display: block; margin: 0.2em 0 0 0; - text-align: right; } li.linktrail { display: inline; margin: 0; padding: 0; } @@ -128,7 +122,6 @@ div.navbar img { border: 0; vertical-align: -0.4em; } table.navbar { width: 100%; margin: 0; border: none; } table.navbar td { padding: 0; border: none; } td.navbar-next { - text-align: right; } a.navbar-prev::before { @@ -144,7 +137,6 @@ a.navbar-next::after { div.sidebar { - float: right; padding: 0; margin: 0; width: 12em; } @@ -160,7 +152,6 @@ div.sidenav div.autotoc { div.sidenav div.autotoc div.autotoc { margin-top: 0.5em; } div.sidenav div.autotoc li { margin-bottom: 0.5em; } div.sidenav div.autotoc div.autotoc div.autotoc { - margin-left: 1em; margin-top: 0; } @@ -171,7 +162,6 @@ div.autotoc { display: table; margin-top: 1em; - margin-left: 1.72em; padding: 0.5em 1em 0.5em 1em; background-color: #f0f9ff; @@ -190,42 +180,28 @@ span.bibliolabel { div.admonition { - padding: 0.5em 1em 0.5em 1em; - - padding-left: 60px; - min-height: 48px; + padding: 0.5em 6px 0.5em 6px; border: solid 1px #e0e0df; background-color: #fffff0; - - background-position: 6px 0.5em; - background-repeat: no-repeat; -} -div.caution { - background-image: url("admon-caution.png"); -} -div.important { - background-image: url("admon-important.png"); -} -div.note { - background-image: url("admon-note.png"); -} -div.note-bug { - background-image: url("admon-bug.png"); -} -div.tip { - background-image: url("admon-tip.png"); } -div.warning { - background-image: url("admon-warning.png"); +div.caution-inner, div.important-inner, div.note-inner, div.tip-inner, div.warning-inner { + padding-left: 60px; + background-position: left top; + background-repeat: no-repeat; + min-height: 48px; } +div.caution-inner { background-image: url("admon-caution.png"); } +div.important-inner { background-image: url("admon-important.png"); } +div.note-inner { background-image: url("admon-note.png"); } +div.note-bug div.note-inner { background-image: url("admon-bug.png"); } +div.tip-inner { background-image: url("admon-tip.png"); } +div.warning-inner { background-image: url("admon-warning.png"); } div.blockquote { - background-image: url('../../../data/icons/yelp-watermark-blockquote-201C.png'); + background-image: url('watermark-blockquote-201C.png'); background-repeat: no-repeat; - background-position: top left; padding: 0.5em; - padding-left: 4em; } div.attribution { @@ -237,11 +213,8 @@ div.attribution::before { content: '― '; } div.epigraph { - text-align: right; - margin-left: 20%; - margin-right: 0; color: #3f3f3f; } @@ -277,14 +250,15 @@ div.screen .userinput { font-weight: bold; color: #3f3f3f; } +div.programlisting .userinput { + font-weight: bold; + color: #3f3f3f; +} pre.linenumbering { color: #3f3f3f; margin: 0; - padding-right: 1em; - float: left; - text-align: right; } @@ -300,7 +274,6 @@ div.list div.title-formal span.title { border-bottom: solid 1px #e0e0df; } div.simplelist { - margin-left: 1.72em; } div.simplelist table { margin-left: 0; border: none; } @@ -309,9 +282,7 @@ div.simplelist td { border-left: solid 1px #e0e0df; } div.simplelist td.td-first { - padding-left: 0; - border-left: 0; } div.synopsis { @@ -327,7 +298,7 @@ div.synopsis div.synopsis { } div.synopsis div.block { margin-top: 0.2em; } div.synopsis div.block-first { margin-top: 0; } - +div.cmdsynopsis { font-family: monospace; } span.accel { text-decoration: underline; } span.acronym { font-family: sans-serif; } @@ -336,7 +307,6 @@ span.classname, span.exceptionname, span.interfacename { font-family: monospace; span.code { font-family: monospace; border: solid 1px #e0e0df; - padding-le... [truncated message content] |
From: phantomjinx <pha...@us...> - 2011-09-11 11:31:15
|
commit a094fd3e109685ae34e7e46b12efbd44566f0e1f Author: phantomjinx <p.g...@ph...> Date: Sun Sep 11 12:28:52 2011 +0100 Modify descriptions of clarity plugin * Make them distinguishable from the original coverart display plugins/clarity/clarity.plugin.in | 2 +- plugins/clarity/plugin.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- diff --git a/plugins/clarity/clarity.plugin.in b/plugins/clarity/clarity.plugin.in index 0d3469f..7fb16ac 100644 --- a/plugins/clarity/clarity.plugin.in +++ b/plugins/clarity/clarity.plugin.in @@ -1,4 +1,4 @@ [Anjuta Plugin] Location=clarity:ClarityPlugin _Name=Clarity Plugin -_Description=Display Cover Artwork of Tracks +_Description=Stylish cover art display (requires opengl rendering support) diff --git a/plugins/clarity/plugin.c b/plugins/clarity/plugin.c index 030df02..ba0436b 100644 --- a/plugins/clarity/plugin.c +++ b/plugins/clarity/plugin.c @@ -91,7 +91,7 @@ static gboolean activate_plugin(AnjutaPlugin *plugin) { clarity_plugin->clarity_widget = CLARITY_WIDGET(clarity_widget_new ()); gtk_scrolled_window_add_with_viewport(clarity_plugin->cover_window, GTK_WIDGET(clarity_plugin->clarity_widget)); gtk_widget_show_all(GTK_WIDGET(clarity_plugin->cover_window)); - anjuta_shell_add_widget(plugin->shell, GTK_WIDGET(clarity_plugin->cover_window), "ClarityPlugin", "Cover Artwork", NULL, ANJUTA_SHELL_PLACEMENT_CENTER, NULL); + anjuta_shell_add_widget(plugin->shell, GTK_WIDGET(clarity_plugin->cover_window), "ClarityPlugin", "Clarity Cover Display", NULL, ANJUTA_SHELL_PLACEMENT_CENTER, NULL); g_signal_connect (gtkpod_app, SIGNAL_PREFERENCE_CHANGE, G_CALLBACK (clarity_widget_preference_changed_cb), clarity_plugin->clarity_widget); g_signal_connect (gtkpod_app, SIGNAL_PLAYLIST_SELECTED, G_CALLBACK (clarity_widget_playlist_selected_cb), clarity_plugin->clarity_widget); |
From: phantomjinx <pha...@us...> - 2011-09-11 11:31:08
|
commit c0a5698361562d94f3bc7befa61ba9e447488d0c Author: phantomjinx <p.g...@ph...> Date: Sun Sep 11 12:28:17 2011 +0100 clarity plugin file should not have been committed plugins/clarity/clarity.plugin | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) |
From: phantomjinx <pha...@us...> - 2011-09-10 23:45:43
|
commit a8ce17de0f28f80d5ea2bf0f4acd7f8bf707f072 Author: phantomjinx <p.g...@ph...> Date: Sun Sep 11 00:44:09 2011 +0100 Implement drag n drop cover support for clarity * In the same way as the coverart display, using fetchcover, a jpg can be dragged from the browser and replace the main cover in the index. * The dnd sends a track update signal and the tracks are all updated accordingly. plugins/clarity/Makefile.am | 1 + plugins/clarity/clarity_dnd_support.c | 246 +++++++++++++++++++++++++++++++++ plugins/clarity/clarity_dnd_support.h | 77 ++++++++++ plugins/clarity/clarity_widget.c | 25 +++- 4 files changed, 341 insertions(+), 8 deletions(-) --- diff --git a/plugins/clarity/Makefile.am b/plugins/clarity/Makefile.am index c623eda..441b33d 100644 --- a/plugins/clarity/Makefile.am +++ b/plugins/clarity/Makefile.am @@ -37,6 +37,7 @@ libclarity_la_SOURCES = plugin.c plugin.h \ clarity_utils.c clarity_utils.h \ clarity_preferences.c clarity_preferences.h \ clarity_context_menu.c clarity_context_menu.h \ + clarity_dnd_support.c clarity_dnd_support.h \ fetchcover.c fetchcover.h libclarity_la_CFLAGS = $(CLUTTER_GTK_CFLAGS) libclarity_la_LDFLAGS = $(GTKPOD_PLUGIN_LDFLAGS) diff --git a/plugins/clarity/clarity_dnd_support.c b/plugins/clarity/clarity_dnd_support.c new file mode 100644 index 0000000..d2cf79b --- /dev/null +++ b/plugins/clarity/clarity_dnd_support.c @@ -0,0 +1,246 @@ +/* + | Copyright (C) 2002-2011 Jorg Schuler <jcsjcs at users sourceforge net> + | Paul Richardson <phantom_sf at users.sourceforge.net> + | Part of the gtkpod project. + | + | URL: http://www.gtkpod.org/ + | URL: http://gtkpod.sourceforge.net/ + | + | This program is free software; you can redistribute it and/or modify + | it under the terms of the GNU General Public License as published by + | the Free Software Foundation; either version 2 of the License, or + | (at your option) any later version. + | + | This program is distributed in the hope that it will be useful, + | but WITHOUT ANY WARRANTY; without even the implied warranty of + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + | GNU General Public License for more details. + | + | You should have received a copy of the GNU General Public License + | along with this program; if not, write to the Free Software + | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + | + | iTunes and iPod are trademarks of Apple + | + | This product is not supported/written/published by Apple! + | + */ + +#ifndef CLARITY_DND_SUPPORT_C_ +#define CLARITY_DND_SUPPORT_C_ + +#include "libgtkpod/gtkpod_app_iface.h" +#include "clarity_dnd_support.h" +#include "fetchcover.h" +#include "clarity_canvas.h" +#include "clarity_utils.h" + +/** + * dnd_clarity_drag_drop: + * + * Used by the drag and drop of a jpg. When a drop is + * made, this determines whether the drop is valid + * then requests the data from the source widget. + * + */ +gboolean dnd_clarity_drag_drop(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time, gpointer user_data) { + GdkAtom target; + target = gtk_drag_dest_find_target(widget, drag_context, NULL); + + if (target != GDK_NONE) { + gtk_drag_get_data(widget, drag_context, target, time); + return TRUE; + } + + return FALSE; +} + +/** + * dnd_clarity_drag_motion: + * + * Used by the drag and drop of a jpg. While the jpg is being + * dragged, this reports to the source widget whether it is an + * acceptable location to allow a drop. + * + */ +gboolean dnd_clarity_drag_motion(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, guint time, gpointer user_data) { + GdkAtom target; + iTunesDB *itdb; + ExtraiTunesDBData *eitdb; + + itdb = gp_get_selected_itdb(); + /* no drop is possible if no playlist/repository is selected */ + if (itdb == NULL) { + gdk_drag_status(dc, 0, time); + return FALSE; + } + + eitdb = itdb->userdata; + g_return_val_if_fail (eitdb, FALSE); + /* no drop is possible if no repository is loaded */ + if (!eitdb->itdb_imported) { + gdk_drag_status(dc, 0, time); + return FALSE; + } + + target = gtk_drag_dest_find_target(widget, dc, NULL); + /* no drop possible if no valid target can be found */ + if (target == GDK_NONE) { + gdk_drag_status(dc, 0, time); + return FALSE; + } + + gdk_drag_status(dc, gdk_drag_context_get_suggested_action(dc), time); + + return TRUE; +} + +/** + * dnd_clarity_drag_data_received: + * + * Used by the drag and drop of a jpg. When the drop is performed, this + * acts on the receipt of the data from the source widget and applies + * the jpg to the track. + * + */ +void dnd_clarity_drag_data_received(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, GtkSelectionData *data, guint info, guint time, gpointer user_data) { + g_return_if_fail(CLARITY_IS_CANVAS(widget)); + g_return_if_fail (dc); + g_return_if_fail (data); + g_return_if_fail (gtk_selection_data_get_data(data)); + g_return_if_fail (gtk_selection_data_get_length(data) > 0); + + /* mozilla bug 402394 */ + +#if DEBUG + printf ("data length = %d\n", gtk_selection_data_get_length(data->length)); + printf ("data->data = %s\n", gtk_selection_data_get_data(data)); +#endif + + AlbumItem *item; + GList *tracks; + gchar *url = NULL; + Fetch_Cover *fcover; + gchar *filename = NULL; + gboolean image_status = FALSE; + gchar *image_error = NULL; + /* For use with DND_IMAGE_JPEG */ + GdkPixbuf *pixbuf; + GError *error = NULL; + + ClarityCanvas *ccanvas = CLARITY_CANVAS(widget); + + /* Find the display cover item in the cover display */ + item = clarity_canvas_get_current_album_item(ccanvas); + if (!item) { + /* looks like there are no covers yet something got dragged into it */ + gtk_drag_finish(dc, FALSE, FALSE, time); + return; + } + + tracks = item->tracks; + + switch (info) { + case DND_IMAGE_JPEG: +#if DEBUG + printf ("Using DND_IMAGE_JPEG\n"); +#endif + pixbuf = gtk_selection_data_get_pixbuf(data); + if (pixbuf != NULL) { + /* initialise the url string with a safe value as not used if already have image */ + url = "local image"; + /* Initialise a fetchcover object */ + fcover = fetchcover_new(url, tracks); + clarity_canvas_block_change(ccanvas, TRUE); + + /* find the filename with which to save the pixbuf to */ + if (fetchcover_select_filename(fcover)) { + filename = g_build_filename(fcover->dir, fcover->filename, NULL); + if (!gdk_pixbuf_save(pixbuf, filename, "jpeg", &error, NULL)) { + /* Save failed for some reason */ + if (error->message) + fcover->err_msg = g_strdup(error->message); + else + fcover->err_msg = "Saving image to file failed. No internal error message was returned."; + + g_error_free(error); + } + else { + /* Image successfully saved */ + image_status = TRUE; + } + } + /* record any errors and free the fetchcover */ + if (fcover->err_msg != NULL) + image_error = g_strdup(fcover->err_msg); + + free_fetchcover(fcover); + g_object_unref(pixbuf); + clarity_canvas_block_change(ccanvas, FALSE); + } + else { + /* despite the data being of type image/jpeg, the pixbuf is NULL */ + image_error = "jpeg data flavour was used but the data did not contain a GdkPixbuf object"; + } + break; + case DND_TEXT_PLAIN: +#if DEBUG + printf ("Defaulting to using DND_TEXT_PLAIN\n"); +#endif + +#ifdef HAVE_CURL + /* initialise the url string with the data from the dnd */ + url = g_strdup ((gchar *) gtk_selection_data_get_data(data)); + /* Initialise a fetchcover object */ + fcover = fetchcover_new (url, tracks); + clarity_canvas_block_change(ccanvas, TRUE); + + if (fetchcover_net_retrieve_image (fcover)) + { +#if DEBUG + printf ("Successfully retrieved\n"); + printf ("Url of fetch cover: %s\n", fcover->url->str); + printf ("filename of fetch cover: %s\n", fcover->filename); +#endif + + filename = g_build_filename(fcover->dir, fcover->filename, NULL); + image_status = TRUE; + } + + /* record any errors and free the fetchcover */ + if (fcover->err_msg != NULL) + image_error = g_strdup(fcover->err_msg); + + free_fetchcover (fcover); + clarity_canvas_block_change(ccanvas, FALSE); +#else + image_error = g_strdup(_("Item had to be downloaded but gtkpod was not compiled with curl.")); + image_status = FALSE; +#endif + } + + if (!image_status || filename == NULL) { + gtkpod_warning(_("Error occurred dropping an image onto the clarity display: %s\n"), image_error); + + if (image_error) + g_free(image_error); + if (filename) + g_free(filename); + + gtk_drag_finish(dc, FALSE, FALSE, time); + return; + } + + clarity_util_update_coverart(tracks, filename); + + if (image_error) + g_free(image_error); + + g_free(filename); + + gtkpod_statusbar_message(_("Successfully set new cover art for selected tracks")); + gtk_drag_finish(dc, FALSE, FALSE, time); + return; +} + +#endif /* CLARITY_DND_SUPPORT_C_ */ diff --git a/plugins/clarity/clarity_dnd_support.h b/plugins/clarity/clarity_dnd_support.h new file mode 100644 index 0000000..42572b7 --- /dev/null +++ b/plugins/clarity/clarity_dnd_support.h @@ -0,0 +1,77 @@ +/* + | Copyright (C) 2002-2011 Jorg Schuler <jcsjcs at users sourceforge net> + | Paul Richardson <phantom_sf at users.sourceforge.net> + | Part of the gtkpod project. + | + | URL: http://www.gtkpod.org/ + | URL: http://gtkpod.sourceforge.net/ + | + | This program is free software; you can redistribute it and/or modify + | it under the terms of the GNU General Public License as published by + | the Free Software Foundation; either version 2 of the License, or + | (at your option) any later version. + | + | This program is distributed in the hope that it will be useful, + | but WITHOUT ANY WARRANTY; without even the implied warranty of + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + | GNU General Public License for more details. + | + | You should have received a copy of the GNU General Public License + | along with this program; if not, write to the Free Software + | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + | + | iTunes and iPod are trademarks of Apple + | + | This product is not supported/written/published by Apple! + | + */ + +#ifndef CLARITY_DND_SUPPORT_H_ +#define CLARITY_DND_SUPPORT_H_ + +#include <gtk/gtk.h> +#include <libgtkpod/gp_itdb.h> +#include <libgtkpod/gp_private.h> +#include "plugin.h" + +static GtkTargetEntry clarity_drop_types[] = + { + /* Konqueror supported flavours */ + { "image/jpeg", 0, DND_IMAGE_JPEG }, + + /* Fallback flavours */ + { "text/plain", 0, DND_TEXT_PLAIN }, + { "STRING", 0, DND_TEXT_PLAIN } + }; + +/** + * dnd_clarity_drag_drop: + * + * Used by the drag and drop of a jpg. When a drop is + * made, this determines whether the drop is valid + * then requests the data from the source widget. + * + */ +gboolean dnd_clarity_drag_drop(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time, gpointer user_data); + +/** + * dnd_clarity_drag_motion: + * + * Used by the drag and drop of a jpg. While the jpg is being + * dragged, this reports to the source widget whether it is an + * acceptable location to allow a drop. + * + */ +gboolean dnd_clarity_drag_motion(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, guint time, gpointer user_data); + +/** + * dnd_clarity_drag_data_received: + * + * Used by the drag and drop of a jpg. When the drop is performed, this + * acts on the receipt of the data from the source widget and applies + * the jpg to the track. + * + */ +void dnd_clarity_drag_data_received(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, GtkSelectionData *data, guint info, guint time, gpointer user_data); + +#endif /* CLARITY_DND_SUPPORT_H_ */ diff --git a/plugins/clarity/clarity_widget.c b/plugins/clarity/clarity_widget.c index c044d40..df3fa29 100644 --- a/plugins/clarity/clarity_widget.c +++ b/plugins/clarity/clarity_widget.c @@ -31,6 +31,7 @@ #include "clarity_canvas.h" #include "clarity_widget.h" #include "album_model.h" +#include "clarity_dnd_support.h" G_DEFINE_TYPE( ClarityWidget, clarity_widget, GTK_TYPE_BOX); @@ -62,14 +63,6 @@ enum { PROP_0 }; -/* - * TODO - * - * popup menu - * drag n drop - * set cover from file - */ - static void clarity_widget_dispose(GObject *gobject) { ClarityWidget *cw = CLARITY_WIDGET(gobject); cw->current_playlist = NULL; @@ -289,6 +282,22 @@ static void clarity_widget_init (ClarityWidget *self) { g_signal_connect (G_OBJECT(priv->rightbutton), "clicked", G_CALLBACK(_on_clarity_button_clicked), priv); + /* Dnd destinaton for foreign image files */ + gtk_drag_dest_set(priv->draw_area, 0, clarity_drop_types, TGNR(clarity_drop_types), GDK_ACTION_COPY + | GDK_ACTION_MOVE); + + g_signal_connect ((gpointer) priv->draw_area, "drag-drop", + G_CALLBACK (dnd_clarity_drag_drop), + NULL); + + g_signal_connect ((gpointer) priv->draw_area, "drag-data-received", + G_CALLBACK (dnd_clarity_drag_data_received), + NULL); + + g_signal_connect ((gpointer) priv->draw_area, "drag-motion", + G_CALLBACK (dnd_clarity_drag_motion), + NULL); + _init_slider_range(priv); priv->controlbox = gtk_hbox_new(FALSE, 2); |
From: phantomjinx <pha...@us...> - 2011-09-10 23:45:37
|
commit 329cf31c79f177c51739d55ca820fa7d99dbbc82 Author: phantomjinx <p.g...@ph...> Date: Sun Sep 11 00:42:23 2011 +0100 Tidy up some function and variables * clarity_utils.* * Since these functions are being called externally then rename them to the full namespace. * Refactor the process of signalling a track update to a single function so it can be reused. * clarity_canvas.c * Change the _set_loading_complete function to the clearer clarity_canvas_block_change * Rename all references of ccanvas / cc to self since this is the file we are in. plugins/clarity/album_model.c | 2 +- plugins/clarity/clarity_canvas.c | 101 ++++++++++++++++-------------------- plugins/clarity/clarity_canvas.h | 6 ++- plugins/clarity/clarity_preview.c | 11 +---- plugins/clarity/clarity_utils.c | 32 +++++++++++- plugins/clarity/clarity_utils.h | 17 +++++-- plugins/clarity/clarity_widget.c | 8 ++-- 7 files changed, 98 insertions(+), 79 deletions(-) --- diff --git a/plugins/clarity/album_model.c b/plugins/clarity/album_model.c index 507cd0e..41675fb 100644 --- a/plugins/clarity/album_model.c +++ b/plugins/clarity/album_model.c @@ -333,7 +333,7 @@ void album_model_init_coverart(AlbumModel *model, AlbumItem *item) { item->albumart = NULL; } - item->albumart = _get_track_image(track); + item->albumart = clarity_util_get_track_image(track); } AlbumItem *album_model_get_item_with_index(AlbumModel *model, gint index) { diff --git a/plugins/clarity/clarity_canvas.c b/plugins/clarity/clarity_canvas.c index 865a114..ba71c9c 100644 --- a/plugins/clarity/clarity_canvas.c +++ b/plugins/clarity/clarity_canvas.c @@ -67,7 +67,7 @@ struct _ClarityCanvasPrivate { gulong preview_signal; - gboolean loading_complete; + gboolean blocked; }; enum DIRECTION { @@ -132,14 +132,23 @@ static void _update_text(ClarityCanvasPrivate *priv) { clutter_actor_set_position(priv->title_text, titlex, titley); } -static void _set_loading_complete(ClarityCanvasPrivate *priv, gboolean value) { - priv->loading_complete = value; +void clarity_canvas_block_change(ClarityCanvas *self, gboolean value) { + g_return_if_fail(self); + + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); + priv->blocked = value; - if (value) { + if (!value) { _update_text(priv); } } +gboolean clarity_canvas_is_blocked(ClarityCanvas *self) { + g_return_val_if_fail(self, TRUE); + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); + return priv->blocked; +} + static void _preview_cover(ClarityCanvasPrivate *priv) { if (!priv->model) return; @@ -164,8 +173,8 @@ static void _preview_cover(ClarityCanvasPrivate *priv) { * */ static gint _on_main_cover_image_clicked_cb(GtkWidget *widget, GdkEvent *event, gpointer data) { - ClarityCanvas *ccanvas = CLARITY_CANVAS(widget); - ClarityCanvasPrivate *priv = ccanvas->priv; + ClarityCanvas *self = CLARITY_CANVAS(widget); + ClarityCanvasPrivate *priv = self->priv; guint mbutton; if (event->type != GDK_BUTTON_PRESS) @@ -174,14 +183,14 @@ static gint _on_main_cover_image_clicked_cb(GtkWidget *widget, GdkEvent *event, mbutton = event->button.button; if ((mbutton == 1) && (event->button.state & GDK_SHIFT_MASK)) { - _set_loading_complete(priv, FALSE); + clarity_canvas_block_change(self, TRUE); AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); if (item) { gtkpod_set_displayed_tracks(item->tracks); } - _set_loading_complete(priv, TRUE); + clarity_canvas_block_change(self, FALSE); } else if (mbutton == 1) { _preview_cover(priv); @@ -198,7 +207,7 @@ static gint _on_main_cover_image_clicked_cb(GtkWidget *widget, GdkEvent *event, /* Right mouse button clicked on its own so display * popup menu */ - clarity_context_menu_init(ccanvas); + clarity_context_menu_init(self); } return FALSE; @@ -270,7 +279,7 @@ static void clarity_canvas_init(ClarityCanvas *self) { priv->timeline = clutter_timeline_new(1600); priv->alpha = clutter_alpha_new_full(priv->timeline, CLUTTER_EASE_OUT_EXPO); priv->curr_index = 0; - priv->loading_complete = FALSE; + priv->blocked = FALSE; } @@ -453,8 +462,6 @@ static void _set_cover_position(ClarityCover *ccover, gint index) { static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *album_item, gint index) { g_return_val_if_fail(priv, FALSE); - _set_loading_complete(priv, FALSE); - ClarityCover *ccover = clarity_cover_new(); clutter_actor_set_opacity(CLUTTER_ACTOR(ccover), 0); priv->covers = g_list_insert(priv->covers, ccover, index); @@ -469,7 +476,6 @@ static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *albu if((priv->curr_index + VISIBLE_ITEMS < index) || (priv->curr_index - VISIBLE_ITEMS > index)) { - _set_loading_complete(priv, TRUE); return FALSE; } @@ -497,19 +503,19 @@ static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *albu _display_clarity_cover(ccover, index); - _set_loading_complete(priv, TRUE); - return FALSE; } void _init_album_item(gpointer value, gint index, gpointer user_data) { AlbumItem *item = (AlbumItem *) value; - ClarityCanvas *cc = CLARITY_CANVAS(user_data); - ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(cc); + ClarityCanvas *self = CLARITY_CANVAS(user_data); + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); album_model_init_coverart(priv->model, item); + clarity_canvas_block_change(self, TRUE); _create_cover_actors(priv, item, index); + clarity_canvas_block_change(self, FALSE); } void _destroy_cover(ClarityCanvas *cc, gint index) { @@ -632,8 +638,6 @@ static void _restore_z_order(ClarityCanvasPrivate *priv) { static void _move(ClarityCanvasPrivate *priv, enum DIRECTION direction, gint increment) { - _set_loading_complete(priv, FALSE); - /* Stop any animation */ clutter_timeline_stop(priv->timeline); @@ -649,8 +653,6 @@ static void _move(ClarityCanvasPrivate *priv, enum DIRECTION direction, gint inc priv->curr_index += ((direction * -1) * increment); _restore_z_order(priv); - - _set_loading_complete(priv, TRUE); } void clarity_canvas_move_left(ClarityCanvas *self, gint increment) { @@ -660,7 +662,9 @@ void clarity_canvas_move_left(ClarityCanvas *self, gint increment) { if(priv->curr_index == g_list_length(priv->covers) - 1) return; + clarity_canvas_block_change(self, TRUE); _move(priv, MOVE_LEFT, increment); + clarity_canvas_block_change(self, FALSE); } void clarity_canvas_move_right(ClarityCanvas *self, gint increment) { @@ -670,7 +674,9 @@ void clarity_canvas_move_right(ClarityCanvas *self, gint increment) { if(priv->curr_index == 0) return; + clarity_canvas_block_change(self, TRUE); _move(priv, MOVE_RIGHT, increment); + clarity_canvas_block_change(self, FALSE); } gint clarity_canvas_get_current_index(ClarityCanvas *self) { @@ -680,10 +686,14 @@ gint clarity_canvas_get_current_index(ClarityCanvas *self) { return priv->curr_index; } -gboolean clarity_canvas_is_loading(ClarityCanvas *self) { - g_return_val_if_fail(self, FALSE); +AlbumItem *clarity_canvas_get_current_album_item(ClarityCanvas *self) { + g_return_val_if_fail(self, NULL); ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); - return !priv->loading_complete; + + if (!priv->model) + return NULL; + + return album_model_get_item_with_index(priv->model, priv->curr_index); } void clarity_canvas_add_album_item(ClarityCanvas *self, AlbumItem *item) { @@ -693,13 +703,13 @@ void clarity_canvas_add_album_item(ClarityCanvas *self, AlbumItem *item) { ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); gint index = album_model_get_index_with_album_item(priv->model, item); - _set_loading_complete(priv, FALSE); + clarity_canvas_block_change(self, TRUE); _init_album_item(item, index, self); _animate_indices(priv, 0, 0); - _set_loading_complete(priv, TRUE); + clarity_canvas_block_change(self, FALSE); } void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item) { @@ -709,23 +719,23 @@ void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item) { ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); gint index = album_model_get_index_with_album_item(priv->model, item); - _set_loading_complete(priv, FALSE); + clarity_canvas_block_change(self, TRUE); _destroy_cover(self, index); _animate_indices(priv, 0, 0); - _set_loading_complete(priv, TRUE); + clarity_canvas_block_change(self, FALSE); } -void clarity_canvas_update(ClarityCanvas *cc, AlbumItem *item) { - g_return_if_fail(cc); +void clarity_canvas_update(ClarityCanvas *self, AlbumItem *item) { + g_return_if_fail(self); - ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(cc); + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); gint index = album_model_get_index_with_album_item(priv->model, item); - _set_loading_complete(priv, FALSE); + clarity_canvas_block_change(self, TRUE); album_model_init_coverart(priv->model, item); @@ -739,7 +749,7 @@ void clarity_canvas_update(ClarityCanvas *cc, AlbumItem *item) { _animate_indices(priv, 0, 0); - _set_loading_complete(priv, TRUE); + clarity_canvas_block_change(self, FALSE); } static void _set_cover_from_file(ClarityCanvas *self) { @@ -747,32 +757,11 @@ static void _set_cover_from_file(ClarityCanvas *self) { ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); - gchar *filename; - Track *track; - GList *tracks; - - filename = fileselection_get_cover_filename(); + gchar *filename = fileselection_get_cover_filename(); if (filename) { AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); - tracks = g_list_copy(item->tracks); - - while (tracks) { - track = tracks->data; - - if (gp_track_set_thumbnails(track, filename)) { - ExtraTrackData *etd; - etd = track->userdata; - etd->tartwork_changed = TRUE; - - gtkpod_track_updated(track); - data_changed(track->itdb); - - etd->tartwork_changed = FALSE; - } - - tracks = tracks->next; - } + clarity_util_update_coverart(item->tracks, filename); } g_free(filename); diff --git a/plugins/clarity/clarity_canvas.h b/plugins/clarity/clarity_canvas.h index e5bc41b..60ae2b9 100644 --- a/plugins/clarity/clarity_canvas.h +++ b/plugins/clarity/clarity_canvas.h @@ -86,7 +86,11 @@ void clarity_canvas_move_right(ClarityCanvas *self, gint increment); gint clarity_canvas_get_current_index(ClarityCanvas *self); -gboolean clarity_canvas_is_loading(ClarityCanvas *self); +AlbumItem *clarity_canvas_get_current_album_item(ClarityCanvas *self); + +void clarity_canvas_block_change(ClarityCanvas *self, gboolean value); + +gboolean clarity_canvas_is_blocked(ClarityCanvas *self); void clarity_canvas_add_album_item(ClarityCanvas *self, AlbumItem *item); diff --git a/plugins/clarity/clarity_preview.c b/plugins/clarity/clarity_preview.c index 8c18c80..f61b3b1 100644 --- a/plugins/clarity/clarity_preview.c +++ b/plugins/clarity/clarity_preview.c @@ -46,19 +46,10 @@ struct _ClarityPreviewPrivate { }; -static void clarity_preview_finalize(GObject *gobject) { - ClarityPreviewPrivate *priv = CLARITY_PREVIEW(gobject)->priv; - - - /* call the parent class' finalize() method */ - G_OBJECT_CLASS(clarity_preview_parent_class)->finalize(gobject); -} - static void clarity_preview_class_init(ClarityPreviewClass *klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); - gobject_class->finalize = clarity_preview_finalize; g_type_class_add_private(klass, sizeof(ClarityPreviewPrivate)); } @@ -129,7 +120,7 @@ static GdkPixbuf *_get_album_artwork(AlbumItem *item) { */ if (!imgbuf) { /* Could not get a viable thumbnail so get default pixbuf */ - imgbuf = get_default_track_image(400); + imgbuf = clarity_util_get_default_track_image(400); } return imgbuf; diff --git a/plugins/clarity/clarity_utils.c b/plugins/clarity/clarity_utils.c index fc17187..c974bf5 100644 --- a/plugins/clarity/clarity_utils.c +++ b/plugins/clarity/clarity_utils.c @@ -30,6 +30,7 @@ #define CLARITY_UTILS_C_ #include "clarity_utils.h" +#include "libgtkpod/file.h" /** * _get_default_track_image: @@ -39,7 +40,7 @@ * Returns: * pixbuf of the default file for tracks with no cover art. */ -GdkPixbuf *get_default_track_image(gint default_img_size) { +GdkPixbuf *clarity_util_get_default_track_image(gint default_img_size) { GdkPixbuf *pixbuf = NULL; GdkPixbuf *scaled = NULL; GError *error = NULL; @@ -56,7 +57,7 @@ GdkPixbuf *get_default_track_image(gint default_img_size) { return scaled; } -GdkPixbuf *_get_track_image(Track *track) { +GdkPixbuf *clarity_util_get_track_image(Track *track) { GdkPixbuf *pixbuf = NULL; ExtraTrackData *etd; @@ -69,10 +70,35 @@ GdkPixbuf *_get_track_image(Track *track) { if (!pixbuf) { /* Could not get a viable thumbnail so get default pixbuf */ - pixbuf = get_default_track_image(DEFAULT_IMG_SIZE); + pixbuf = clarity_util_get_default_track_image(DEFAULT_IMG_SIZE); } return pixbuf; } +void clarity_util_update_coverart(GList *tracks, const gchar *filename) { + g_return_if_fail(filename); + + if (!tracks) + return; + + GList *tks = g_list_copy(tracks); + + while (tks) { + Track *track = tks->data; + + if (gp_track_set_thumbnails(track, filename)) { + ExtraTrackData *etd = track->userdata; + etd->tartwork_changed = TRUE; + + gtkpod_track_updated(track); + data_changed(track->itdb); + + etd->tartwork_changed = FALSE; + } + + tks = tks->next; + } +} + #endif /* CLARITY_UTILS_C_ */ diff --git a/plugins/clarity/clarity_utils.h b/plugins/clarity/clarity_utils.h index 8217c19..ddbd901 100644 --- a/plugins/clarity/clarity_utils.h +++ b/plugins/clarity/clarity_utils.h @@ -37,23 +37,32 @@ #define DEFAULT_IMG_SIZE 140 /** - * _get_default_track_image: + * clarity_util_get_default_track_image: * * Retrieve the artwork pixbuf from the default image file. * * Returns: * pixbuf of the default file for tracks with no cover art. */ -GdkPixbuf *get_default_track_image(gint default_img_size); +GdkPixbuf *clarity_util_get_default_track_image(gint default_img_size); /** - * _get_track_image: + * clarity_util_get_track_image: * * Retrieve the artwork pixbuf from the given track. * * Returns: * pixbuf of the artwork of the track. */ -GdkPixbuf *_get_track_image(Track *track); +GdkPixbuf *clarity_util_get_track_image(Track *track); + +/** + * clarity_util_update_coverart + * + * Update each track with the given filename of the + * proposed artwork then notify all parties of the change. + * + */ +void clarity_util_update_coverart(GList *tracks, const gchar *filename); #endif /* CLARITY_UTILS_H_ */ diff --git a/plugins/clarity/clarity_widget.c b/plugins/clarity/clarity_widget.c index b379f23..c044d40 100644 --- a/plugins/clarity/clarity_widget.c +++ b/plugins/clarity/clarity_widget.c @@ -448,7 +448,7 @@ void clarity_widget_tracks_selected_cb(GtkPodApp *app, gpointer tks, gpointer da tracks = _sort_track_list(tracks); ClarityCanvas *ccanvas = CLARITY_CANVAS(priv->draw_area); - if (clarity_canvas_is_loading(ccanvas)) + if (clarity_canvas_is_blocked(ccanvas)) return; gint album_index = album_model_get_index_with_track(priv->album_model, tracks->data); @@ -458,7 +458,7 @@ void clarity_widget_tracks_selected_cb(GtkPodApp *app, gpointer tks, gpointer da static void _add_track(ClarityWidgetPrivate *priv, Track *track) { ClarityCanvas *ccanvas = CLARITY_CANVAS(priv->draw_area); - if (clarity_canvas_is_loading(ccanvas)) + if (clarity_canvas_is_blocked(ccanvas)) return; if (album_model_add_track(priv->album_model, track)) { @@ -493,7 +493,7 @@ static void _remove_track(ClarityWidgetPrivate *priv, AlbumItem *item, Track *tr ClarityCanvas *ccanvas = CLARITY_CANVAS(priv->draw_area); - if (clarity_canvas_is_loading(ccanvas)) + if (clarity_canvas_is_blocked(ccanvas)) return; if(!item) @@ -538,7 +538,7 @@ void clarity_widget_track_updated_cb(GtkPodApp *app, gpointer tk, gpointer data) ClarityCanvas *ccanvas = CLARITY_CANVAS(priv->draw_area); - if (clarity_canvas_is_loading(ccanvas)) + if (clarity_canvas_is_blocked(ccanvas)) return; AlbumItem *item = NULL; |
From: phantomjinx <pha...@us...> - 2011-09-10 22:10:51
|
commit df84987b4881ada967e69637637a515e395faa7f Author: phantomjinx <p.g...@ph...> Date: Sat Sep 10 23:07:18 2011 +0100 Implement the updating of a track in clarity * If a track has been changed, clarity should react and if necessary update the artwork cover accordingly. This may mean changing the artwork, text or moving the track completely to a new album item. * AlbumItem * data reference no longer necessary * clarity_canvas * Formally defines the FLOOR constant better to understand the location set or each cover * Support for shift + mouse-button-1 to select the tracks referenced by the cover art. plugins/clarity/album_model.c | 15 ++- plugins/clarity/album_model.h | 4 +- plugins/clarity/clarity_canvas.c | 240 ++++++++++++++++++++++-------- plugins/clarity/clarity_canvas.h | 4 + plugins/clarity/clarity_context_menu.c | 72 ++++------ plugins/clarity/clarity_context_menu.h | 12 +- plugins/clarity/clarity_cover.c | 45 +++++-- plugins/clarity/clarity_cover.h | 4 + plugins/clarity/clarity_widget.c | 84 +++++------ plugins/cover_display/display_coverart.c | 3 +- plugins/details_editor/details.c | 1 + 11 files changed, 318 insertions(+), 166 deletions(-) --- diff --git a/plugins/clarity/album_model.c b/plugins/clarity/album_model.c index 2779f6a..507cd0e 100644 --- a/plugins/clarity/album_model.c +++ b/plugins/clarity/album_model.c @@ -30,6 +30,7 @@ #define ALBUM_MODEL_C_ #include "album_model.h" +#include "clarity_utils.h" #include "libgtkpod/prefs.h" #include "libgtkpod/misc.h" #include "libgtkpod/gp_private.h" @@ -181,7 +182,6 @@ static void album_model_free_album_item(AlbumItem *item) { if (item->albumart) g_object_unref(item->albumart); - item->data = NULL; } } @@ -323,6 +323,19 @@ void album_model_foreach (AlbumModel *model, AMFunc func, gpointer user_data) { } } +void album_model_init_coverart(AlbumModel *model, AlbumItem *item) { + g_return_if_fail(item); + + Track *track = g_list_nth_data(item->tracks, 0); + + if (item->albumart) { + g_object_unref(item->albumart); + item->albumart = NULL; + } + + item->albumart = _get_track_image(track); +} + AlbumItem *album_model_get_item_with_index(AlbumModel *model, gint index) { g_return_val_if_fail(model, NULL); diff --git a/plugins/clarity/album_model.h b/plugins/clarity/album_model.h index 00acc8b..617a6cb 100644 --- a/plugins/clarity/album_model.h +++ b/plugins/clarity/album_model.h @@ -41,8 +41,6 @@ typedef struct { gchar *artist; GdkPixbuf *albumart; - gpointer data; - } AlbumItem; typedef void (*AMFunc) (gpointer value, gint index, gpointer user_data); @@ -107,6 +105,8 @@ gboolean album_model_add_track(AlbumModel *model, Track *track); */ gboolean album_model_remove_track(AlbumModel *model, AlbumItem *item, Track *track); +void album_model_init_coverart(AlbumModel *model, AlbumItem *item); + AlbumItem *album_model_get_item_with_index(AlbumModel *model, gint index); AlbumItem *album_model_get_item_with_track(AlbumModel *model, Track *track); diff --git a/plugins/clarity/clarity_canvas.c b/plugins/clarity/clarity_canvas.c index 26b86fe..865a114 100644 --- a/plugins/clarity/clarity_canvas.c +++ b/plugins/clarity/clarity_canvas.c @@ -27,11 +27,14 @@ */ #include <clutter-gtk/clutter-gtk.h> #include "libgtkpod/gp_itdb.h" +#include "libgtkpod/fileselection.h" +#include "libgtkpod/misc.h" #include "plugin.h" #include "clarity_cover.h" #include "clarity_canvas.h" #include "clarity_preview.h" #include "clarity_utils.h" +#include "clarity_context_menu.h" G_DEFINE_TYPE( ClarityCanvas, clarity_canvas, GTK_TYPE_BOX); @@ -43,6 +46,7 @@ G_DEFINE_TYPE( ClarityCanvas, clarity_canvas, GTK_TYPE_BOX); #define FRONT_COVER_SPACE 150 #define MAX_SCALE 1.4 #define VISIBLE_ITEMS 8 +#define FLOOR 110 struct _ClarityCanvasPrivate { @@ -99,12 +103,46 @@ static void clarity_canvas_class_init(ClarityCanvasClass *klass) { g_type_class_add_private(klass, sizeof(ClarityCanvasPrivate)); } -static gboolean _preview_cover_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) { - ClarityCanvas *ccanvas = CLARITY_CANVAS(widget); - ClarityCanvasPrivate *priv = ccanvas->priv; +static void _update_text(ClarityCanvasPrivate *priv) { + g_return_if_fail(priv); + + if (g_list_length(priv->covers) == 0) + return; + + ClarityCover *ccover = g_list_nth_data(priv->covers, priv->curr_index); + + gchar *title = clarity_cover_get_title(ccover); + gchar *artist = clarity_cover_get_artist(ccover); + + clutter_text_set_text(CLUTTER_TEXT(priv->title_text), title); + clutter_text_set_text(CLUTTER_TEXT(priv->artist_text), artist); + + g_free(title); + g_free(artist); + clutter_actor_raise_top(priv->title_text); + clutter_actor_raise_top(priv->artist_text); + + gfloat artistx = (clutter_actor_get_width(priv->artist_text) / 2) * -1; + gfloat artisty = FLOOR - (clarity_cover_get_artwork_height(ccover) * MAX_SCALE); + clutter_actor_set_position(priv->artist_text, artistx, artisty); + + gfloat titlex = (clutter_actor_get_width(priv->title_text) / 2) * -1; + gfloat titley = artisty - clutter_actor_get_height(priv->artist_text) - 2; + clutter_actor_set_position(priv->title_text, titlex, titley); +} + +static void _set_loading_complete(ClarityCanvasPrivate *priv, gboolean value) { + priv->loading_complete = value; + + if (value) { + _update_text(priv); + } +} + +static void _preview_cover(ClarityCanvasPrivate *priv) { if (!priv->model) - return TRUE; + return; AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); @@ -112,8 +150,58 @@ static gboolean _preview_cover_cb(GtkWidget *widget, GdkEvent *event, gpointer u /* Display the dialog */ gtk_widget_show_all(dialog); +} + +/** + * on_main_cover_image_clicked_cb: + * + * Call handler used for displaying the tracks associated with + * the main displayed album cover. + * + * @ClarityCanvas + * @event: event object used to determine the event type + * @data: any data needed by the function (not required) + * + */ +static gint _on_main_cover_image_clicked_cb(GtkWidget *widget, GdkEvent *event, gpointer data) { + ClarityCanvas *ccanvas = CLARITY_CANVAS(widget); + ClarityCanvasPrivate *priv = ccanvas->priv; + guint mbutton; + + if (event->type != GDK_BUTTON_PRESS) + return FALSE; + + mbutton = event->button.button; + + if ((mbutton == 1) && (event->button.state & GDK_SHIFT_MASK)) { + _set_loading_complete(priv, FALSE); + + AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); + if (item) { + gtkpod_set_displayed_tracks(item->tracks); + } - return TRUE; + _set_loading_complete(priv, TRUE); + } + else if (mbutton == 1) { + _preview_cover(priv); + } + else if ((mbutton == 3) && (event->button.state & GDK_SHIFT_MASK)) { + /* Right mouse button clicked and shift pressed. + * Go straight to edit details window + */ + AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); + GList *tracks = item->tracks; + gtkpod_edit_details(tracks); + } + else if (mbutton == 3) { + /* Right mouse button clicked on its own so display + * popup menu + */ + clarity_context_menu_init(ccanvas); + } + + return FALSE; } /** @@ -154,7 +242,7 @@ static void clarity_canvas_init(ClarityCanvas *self) { clutter_actor_set_reactive(priv->container, TRUE); priv->preview_signal = g_signal_connect (self, "button-press-event", - G_CALLBACK (_preview_cover_cb), + G_CALLBACK (_on_main_cover_image_clicked_cb), priv); clutter_container_add(CLUTTER_CONTAINER(priv->container), priv->title_text, priv->artist_text, NULL); @@ -345,35 +433,6 @@ static gint _calculate_index_opacity (gint dist_from_front) { return CLAMP ( 255 * (VISIBLE_ITEMS - ABS(dist_from_front)) / VISIBLE_ITEMS, 0, 255); } -static void _update_text(ClarityCanvasPrivate *priv) { - g_return_if_fail(priv); - - if (g_list_length(priv->covers) == 0) - return; - - ClarityCover *ccover = g_list_nth_data(priv->covers, priv->curr_index); - - gchar *title = clarity_cover_get_title(ccover); - gchar *artist = clarity_cover_get_artist(ccover); - - clutter_text_set_text(CLUTTER_TEXT(priv->title_text), title); - clutter_text_set_text(CLUTTER_TEXT(priv->artist_text), artist); - - g_free(title); - g_free(artist); - - clutter_actor_raise_top(priv->title_text); - clutter_actor_raise_top(priv->artist_text); - - gfloat artistx = (clutter_actor_get_width(priv->artist_text) / 2) * -1; - gfloat artisty = ((clutter_actor_get_height(CLUTTER_ACTOR(ccover)) / 2) - 25) * -1; - clutter_actor_set_position(priv->artist_text, artistx, artisty); - - gfloat titlex = (clutter_actor_get_width(priv->title_text) / 2) * -1; - gfloat titley = artisty - clutter_actor_get_height(priv->artist_text) - 2; - clutter_actor_set_position(priv->title_text, titlex, titley); -} - static void _display_clarity_cover(ClarityCover *ccover, gint index) { ClutterTimeline *timeline = clutter_timeline_new(1600 * 5); ClutterAlpha *alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_OUT_EXPO); @@ -383,12 +442,12 @@ static void _display_clarity_cover(ClarityCover *ccover, gint index) { clutter_timeline_start (timeline); } -static void _set_loading_complete(ClarityCanvasPrivate *priv, gboolean value) { - priv->loading_complete = value; - - if (value) { - _update_text(priv); - } +static void _set_cover_position(ClarityCover *ccover, gint index) { + gint pos = _calculate_index_distance(index); + clutter_actor_set_position( + CLUTTER_ACTOR(ccover), + pos - clarity_cover_get_artwork_width(ccover) / 2, + FLOOR - clarity_cover_get_artwork_height(ccover)); } static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *album_item, gint index) { @@ -406,11 +465,7 @@ static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *albu clarity_cover_set_album_item(ccover, album_item); - gint pos = _calculate_index_distance(index); - clutter_actor_set_position( - CLUTTER_ACTOR(ccover), - pos - clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, - 110 - clutter_actor_get_height(CLUTTER_ACTOR(ccover))); + _set_cover_position(ccover, index); if((priv->curr_index + VISIBLE_ITEMS < index) || (priv->curr_index - VISIBLE_ITEMS > index)) { @@ -435,8 +490,8 @@ static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *albu CLUTTER_ACTOR(ccover), scale, scale, - clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, - clutter_actor_get_height(CLUTTER_ACTOR(ccover)) / 2); + clarity_cover_get_artwork_width(ccover) / 2, + clarity_cover_get_artwork_height(ccover) / 2); clutter_actor_lower_bottom(CLUTTER_ACTOR(ccover)); @@ -452,9 +507,7 @@ void _init_album_item(gpointer value, gint index, gpointer user_data) { ClarityCanvas *cc = CLARITY_CANVAS(user_data); ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(cc); - Track *track = g_list_nth_data(item->tracks, 0); - item->albumart = _get_track_image(track); - item->data = cc; + album_model_init_coverart(priv->model, item); _create_cover_actors(priv, item, index); } @@ -516,18 +569,17 @@ static void _clear_rotation_behaviours(GList *covers) { static void _animate_indices(ClarityCanvasPrivate *priv, gint direction, gint increment) { for (gint i = 0; i < g_list_length(priv->covers); ++i) { - ClarityCover *ccover = g_list_nth_data(priv->covers, i); gint dist = i - priv->curr_index + (direction * increment); - gfloat depth = 1; + gfloat scale = 1; gint pos = 0; gint opacity = 0; gint angle = 0; ClutterRotateDirection rotation_dir; opacity = _calculate_index_opacity(dist); - depth = _calculate_index_scale(dist); + scale = _calculate_index_scale(dist); pos = _calculate_index_distance(dist); _calculate_index_angle_and_dir(dist, direction, &angle, &rotation_dir); @@ -539,13 +591,17 @@ static void _animate_indices(ClarityCanvasPrivate *priv, gint direction, gint in "opacity", opacity, NULL); + gfloat w = clarity_cover_get_artwork_width(ccover); + gfloat h = clarity_cover_get_artwork_height(ccover); + /* Position and scale */ clutter_actor_animate_with_alpha (CLUTTER_ACTOR(ccover), priv->alpha, - "scale-x", depth, - "scale-y", depth, - "scale-center-x" , clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, - "scale-center-y" , clutter_actor_get_height(CLUTTER_ACTOR(ccover)) / 2, - "x", pos - clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, + "scale-x", scale, + "scale-y", scale, + "scale-center-x" , w / 2, + "scale-center-y", h / 2, + "x", pos - (w / 2), + "y", FLOOR - h, NULL); } } @@ -661,3 +717,69 @@ void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item) { _set_loading_complete(priv, TRUE); } + +void clarity_canvas_update(ClarityCanvas *cc, AlbumItem *item) { + g_return_if_fail(cc); + + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(cc); + + gint index = album_model_get_index_with_album_item(priv->model, item); + + _set_loading_complete(priv, FALSE); + + album_model_init_coverart(priv->model, item); + + ClarityCover *ccover = (ClarityCover *) g_list_nth_data(priv->covers, index); + if (!ccover) + return; + + clarity_cover_set_album_item(ccover, item); + + _set_cover_position(ccover, index); + + _animate_indices(priv, 0, 0); + + _set_loading_complete(priv, TRUE); +} + +static void _set_cover_from_file(ClarityCanvas *self) { + g_return_if_fail(self); + + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); + + gchar *filename; + Track *track; + GList *tracks; + + filename = fileselection_get_cover_filename(); + + if (filename) { + AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); + tracks = g_list_copy(item->tracks); + + while (tracks) { + track = tracks->data; + + if (gp_track_set_thumbnails(track, filename)) { + ExtraTrackData *etd; + etd = track->userdata; + etd->tartwork_changed = TRUE; + + gtkpod_track_updated(track); + data_changed(track->itdb); + + etd->tartwork_changed = FALSE; + } + + tracks = tracks->next; + } + } + + g_free(filename); +} + +void on_clarity_set_cover_menuitem_activate(GtkMenuItem *mi, gpointer data) { + g_return_if_fail(CLARITY_IS_CANVAS(data)); + + _set_cover_from_file(CLARITY_CANVAS(data)); +} diff --git a/plugins/clarity/clarity_canvas.h b/plugins/clarity/clarity_canvas.h index 3a1a691..e5bc41b 100644 --- a/plugins/clarity/clarity_canvas.h +++ b/plugins/clarity/clarity_canvas.h @@ -92,6 +92,10 @@ void clarity_canvas_add_album_item(ClarityCanvas *self, AlbumItem *item); void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item); +void clarity_canvas_update(ClarityCanvas *cc, AlbumItem *item); + +void on_clarity_set_cover_menuitem_activate(GtkMenuItem *mi, gpointer data); + G_END_DECLS #endif /* CLARITY_CANVAS_H_ */ diff --git a/plugins/clarity/clarity_context_menu.c b/plugins/clarity/clarity_context_menu.c index aeea9ea..a863d9d 100644 --- a/plugins/clarity/clarity_context_menu.c +++ b/plugins/clarity/clarity_context_menu.c @@ -34,47 +34,33 @@ #include "libgtkpod/context_menus.h" #include "libgtkpod/misc.h" #include "clarity_context_menu.h" +#include "clarity_canvas.h" -//static GtkWidget *add_get_cover_from_file(GtkWidget *menu) { -// return hookup_menu_item(menu, _("Select Cover From File"), GTK_STOCK_FLOPPY, G_CALLBACK (clarity_set_cover_from_file), NULL); -//} -// -///* -// * display the dialog with the full size cd artwork cover -// * @mi - the menu item selected -// * @data - Ignored, should be NULL -// */ -//static void display_track_artwork(GtkMenuItem *mi, gpointer data) { -// if (gtkpod_get_selected_tracks()) -// clarity_display_big_artwork(gtkpod_get_selected_tracks()); -//} -// -//static GtkWidget *add_display_big_coverart(GtkWidget *menu) { -// return hookup_menu_item(menu, _("View Full Size Artwork"), GTK_STOCK_FULLSCREEN, G_CALLBACK (display_track_artwork), NULL); -//} -// -///** -// * cad_context_menu_init - initialize the right click menu for coverart display -// */ -//void cad_context_menu_init(void) { -// if (widgets_blocked) -// return; -// -// GtkWidget *menu = NULL; -// -// if (gtkpod_get_selected_tracks()) { -// menu = gtk_menu_new(); -// -// add_get_cover_from_file(menu); -// add_display_big_coverart(menu); -// add_edit_track_details(menu); -// -// /* -// * button should be button 0 as per the docs because we're calling -// * from a button release event -// */ -// if (menu) { -// gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); -// } -// } -//} +static GtkWidget *add_get_cover_from_file(GtkWidget *menu, ClarityCanvas *ccanvas) { + return hookup_menu_item(menu, _("Select Cover From File"), GTK_STOCK_FLOPPY, G_CALLBACK (on_clarity_set_cover_menuitem_activate), ccanvas); +} + +/** + * clarity_context_menu_init - initialize the right click menu for clarity + */ +void clarity_context_menu_init(ClarityCanvas *ccanvas) { + if (widgets_blocked) + return; + + GtkWidget *menu = NULL; + + if (gtkpod_get_selected_tracks()) { + menu = gtk_menu_new(); + + add_get_cover_from_file(menu, ccanvas); + add_edit_track_details(menu); + + /* + * button should be button 0 as per the docs because we're calling + * from a button release event + */ + if (menu) { + gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); + } + } +} diff --git a/plugins/clarity/clarity_context_menu.h b/plugins/clarity/clarity_context_menu.h index a2b4606..ce38587 100644 --- a/plugins/clarity/clarity_context_menu.h +++ b/plugins/clarity/clarity_context_menu.h @@ -26,12 +26,14 @@ | */ -#ifndef COVER_DISPLAY_CONTEXT_MENU_H_ -#define COVER_DISPLAY_CONTEXT_MENU_H_ +#ifndef CLARITY_CONTEXT_MENU_H_ +#define CLARTIY_CONTEXT_MENU_H_ + +#include "clarity_canvas.h" /** - * cad_context_menu_init - initialize the right click menu for coverart display + * clarity_context_menu_init - initialize the right click menu for clarity */ -void cad_context_menu_init(void); +void clarity_context_menu_init(ClarityCanvas *ccanvas); -#endif /* COVER_DISPLAY_CONTEXT_MENU_H_ */ +#endif /* CLARITY_CONTEXT_MENU_H_ */ diff --git a/plugins/clarity/clarity_cover.c b/plugins/clarity/clarity_cover.c index d5d44e6..32e3943 100644 --- a/plugins/clarity/clarity_cover.c +++ b/plugins/clarity/clarity_cover.c @@ -233,9 +233,13 @@ void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) { GError *error = NULL; gint y_offset; - priv->texture = gtk_clutter_texture_new(); - gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE(priv->texture), item->albumart, &error); + if (!priv->texture) { + priv->texture = gtk_clutter_texture_new(); + clutter_container_add_actor(CLUTTER_CONTAINER(self), priv->texture); + } + // Set cover artwork + gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE(priv->texture), item->albumart, &error); if (error) { g_warning(error->message); g_error_free(error); @@ -243,19 +247,21 @@ void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) { } // Add reflection - y_offset = clutter_actor_get_height (priv->texture) + V_PADDING; - - priv->reflection = clutter_clone_new (priv->texture); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_X, 0.0)); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_Y, y_offset)); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_WIDTH, 0.0)); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_HEIGHT, 0.0)); - g_signal_connect (priv->reflection, + if (! priv->reflection) { + y_offset = clutter_actor_get_height (priv->texture) + V_PADDING; + + priv->reflection = clutter_clone_new (priv->texture); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_X, 0.0)); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_Y, y_offset)); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_WIDTH, 0.0)); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_HEIGHT, 0.0)); + g_signal_connect (priv->reflection, "paint", G_CALLBACK (_clone_paint_cb), NULL); - clutter_container_add(CLUTTER_CONTAINER(self), priv->texture, priv->reflection, NULL); + clutter_container_add_actor(CLUTTER_CONTAINER(self), priv->reflection); + } ClutterActorBox box; gfloat w, h; @@ -268,7 +274,14 @@ void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) { } // Add title / artist data + if (priv->title) + g_free(priv->title); + priv->title = g_strdup(item->albumname); + + if (priv->artist) + g_free(priv->artist); + priv->artist = g_strdup(item->artist); } @@ -320,6 +333,16 @@ gchar *clarity_cover_get_artist(ClarityCover *self) { return g_strdup(priv->artist); } +gfloat clarity_cover_get_artwork_height(ClarityCover *self) { + ClarityCoverPrivate *priv = self->priv; + return clutter_actor_get_height(priv->texture); +} + +gfloat clarity_cover_get_artwork_width(ClarityCover *self) { + ClarityCoverPrivate *priv = self->priv; + return clutter_actor_get_width(priv->texture); +} + /** * clarity_cover_new: * diff --git a/plugins/clarity/clarity_cover.h b/plugins/clarity/clarity_cover.h index 8b8f18b..3f52dfa 100644 --- a/plugins/clarity/clarity_cover.h +++ b/plugins/clarity/clarity_cover.h @@ -105,6 +105,10 @@ gchar *clarity_cover_get_title(ClarityCover *self); gchar *clarity_cover_get_artist(ClarityCover *self); +gfloat clarity_cover_get_artwork_height(ClarityCover *self); + +gfloat clarity_cover_get_artwork_width(ClarityCover *self); + /* constructor - note this returns a ClutterActor instance */ ClarityCover *clarity_cover_new (void); diff --git a/plugins/clarity/clarity_widget.c b/plugins/clarity/clarity_widget.c index ca50d74..b379f23 100644 --- a/plugins/clarity/clarity_widget.c +++ b/plugins/clarity/clarity_widget.c @@ -541,72 +541,70 @@ void clarity_widget_track_updated_cb(GtkPodApp *app, gpointer tk, gpointer data) if (clarity_canvas_is_loading(ccanvas)) return; - AlbumItem *item; - gboolean findremove = FALSE; + AlbumItem *item = NULL; gint index = album_model_get_index_with_track(priv->album_model, track); - if (index == -1) { - /* The track's key could not be found according to the track! - * The ONLY way this could happen is if the user changed the - * components of the track's key. Well it should be rare but the only - * way to remove it from its "old" album item is to search each one - */ - findremove = TRUE; - } - else { - /* Track has a valid key so can get the album back. + if (index > -1) { + /* + * Track has a valid key so can get the album back. * Either has happened: * a) Artist/Album key has been changed so the track is being moved * to another existing album - * b) Some other change has occurred that is irrelevant to this code. + * b) Artwork has been updated + * c) Some other change has occurred that is irrelevant to this code. * * To determine if a) is the case need to determine whether track exists - * in the album items track list. If it does then b) is true and nothing - * more is required. + * in the album items track list. If it does then b) or c) is true. */ item = album_model_get_item_with_track(priv->album_model, track); g_return_if_fail (item); index = g_list_index(item->tracks, track); if (index != -1) { - /* Track exists in the album list so ignore the change and return */ + /* + * Track exists in the album list so determine whether + * its artwork is up to date + */ ExtraTrackData *etd; etd = track->userdata; - if (etd->tartwork_changed == TRUE) { - etd->tartwork_changed = FALSE; + if (etd->tartwork_changed) { + clarity_canvas_update(ccanvas, item); + return; + } + else { + /* + * Artwork is up to date so nothing changed relevant + * to the display. + */ + return; } - - return; } else { - /* Track does not exist in the album list so the artist/album - * key has definitely changed */ - findremove = TRUE; - } - } - - if (findremove) { - /* It has been determined that the track has had its key changed - * and thus a search must be performed to find the "original" album - * that the track belonged to, remove it then add the track to the - * new album. - */ - item = album_model_search_for_track(priv->album_model, track); - /* item represents the album item containing the track */ - if (item) { - g_warning("Item %s %s", item->albumname, item->artist); - - /* The track is in this album so remove it in preparation for - * readding under the new album key + /* + * Track does not exist in the album list so the artist/album + * key has definitely changed so find the old album item the long + * way. */ - _remove_track(priv, item, track); + item = album_model_search_for_track(priv->album_model, track); } + } - /* Create a new album item or find existing album to house the - * "brand new" track + /* item represents the old album item containing the track */ + if (item) { + /* + * The track is in this album so remove it in preparation for + * readding it back either under the same album item but with + * a different cover or under a different album item due to a + * different album key. */ - _add_track(priv, track); + _remove_track(priv, item, track); } + + /* + * Create a new album item or find existing album to house the + * "brand new" track + */ + _add_track(priv, track); } diff --git a/plugins/cover_display/display_coverart.c b/plugins/cover_display/display_coverart.c index c797dff..ad62e06 100644 --- a/plugins/cover_display/display_coverart.c +++ b/plugins/cover_display/display_coverart.c @@ -949,8 +949,7 @@ void coverart_track_changed(Track *track, gint signal) { /* Track exists in the album list so ignore the change and return */ ExtraTrackData *etd; etd = track->userdata; - if (etd->tartwork_changed == TRUE) { - etd->tartwork_changed = FALSE; + if (etd->tartwork_changed) { redraw(TRUE); } diff --git a/plugins/details_editor/details.c b/plugins/details_editor/details.c index 4e0b48c..91087ef 100644 --- a/plugins/details_editor/details.c +++ b/plugins/details_editor/details.c @@ -354,6 +354,7 @@ static void details_button_apply_clicked(GtkButton *button) { changed |= tr_changed; etr->tchanged = FALSE; + etr->tartwork_changed = FALSE; } } |
From: phantomjinx <pha...@us...> - 2011-09-10 22:10:44
|
The branch 'clarity' was changed in a way that was not a fast-forward update. NOTE: This may cause problems for people pulling from the branch. For more information, please see: http://live.gnome.org/Git/Help/NonFastForward Commits removed from the branch: bec268f... Implement the updating of a track in clarity Commits added to the branch: df84987... Implement the updating of a track in clarity |
From: phantomjinx <pha...@us...> - 2011-09-10 21:15:48
|
commit bec268fa95093b8ca5e87b8e86721f7b237382c5 Author: phantomjinx <p.g...@ph...> Date: Thu Sep 8 21:04:36 2011 +0100 Implement the updating of a track in clarity * If a track has been changed, clarity should react and if necessary update the artwork cover accordingly. This may mean changing the artwork, text or moving the track completely to a new album item. * AlbumItem * data reference no longer necessary * clarity_canvas * Formally defines the FLOOR constant better to understand the location set or each cover * Support for shift + mouse-button-1 to select the tracks referenced by the cover art. plugins/clarity/album_model.c | 19 +++- plugins/clarity/album_model.h | 4 +- plugins/clarity/clarity_canvas.c | 240 ++++++++++++++++++++++-------- plugins/clarity/clarity_canvas.h | 4 + plugins/clarity/clarity_context_menu.c | 72 ++++------ plugins/clarity/clarity_context_menu.h | 12 +- plugins/clarity/clarity_cover.c | 45 +++++-- plugins/clarity/clarity_cover.h | 4 + plugins/clarity/clarity_widget.c | 84 +++++------ plugins/cover_display/display_coverart.c | 3 +- plugins/details_editor/details.c | 1 + 11 files changed, 322 insertions(+), 166 deletions(-) --- diff --git a/plugins/clarity/album_model.c b/plugins/clarity/album_model.c index 2779f6a..7c4b5b2 100644 --- a/plugins/clarity/album_model.c +++ b/plugins/clarity/album_model.c @@ -30,6 +30,7 @@ #define ALBUM_MODEL_C_ #include "album_model.h" +#include "clarity_utils.h" #include "libgtkpod/prefs.h" #include "libgtkpod/misc.h" #include "libgtkpod/gp_private.h" @@ -142,6 +143,10 @@ static gboolean _insert_track(AlbumModelPrivate *priv, Track *track) { AlbumItem *item; gchar *album_key; + Updating tracks by removing then adding is not working as the item + is never removed so the album item image is never updated! + + album_key = _create_key_from_track(track); /* Check whether an album item has already been created in connection * with the track's artist and album @@ -181,7 +186,6 @@ static void album_model_free_album_item(AlbumItem *item) { if (item->albumart) g_object_unref(item->albumart); - item->data = NULL; } } @@ -323,6 +327,19 @@ void album_model_foreach (AlbumModel *model, AMFunc func, gpointer user_data) { } } +void album_model_init_coverart(AlbumModel *model, AlbumItem *item) { + g_return_if_fail(item); + + Track *track = g_list_nth_data(item->tracks, 0); + + if (item->albumart) { + g_object_unref(item->albumart); + item->albumart = NULL; + } + + item->albumart = _get_track_image(track); +} + AlbumItem *album_model_get_item_with_index(AlbumModel *model, gint index) { g_return_val_if_fail(model, NULL); diff --git a/plugins/clarity/album_model.h b/plugins/clarity/album_model.h index 00acc8b..617a6cb 100644 --- a/plugins/clarity/album_model.h +++ b/plugins/clarity/album_model.h @@ -41,8 +41,6 @@ typedef struct { gchar *artist; GdkPixbuf *albumart; - gpointer data; - } AlbumItem; typedef void (*AMFunc) (gpointer value, gint index, gpointer user_data); @@ -107,6 +105,8 @@ gboolean album_model_add_track(AlbumModel *model, Track *track); */ gboolean album_model_remove_track(AlbumModel *model, AlbumItem *item, Track *track); +void album_model_init_coverart(AlbumModel *model, AlbumItem *item); + AlbumItem *album_model_get_item_with_index(AlbumModel *model, gint index); AlbumItem *album_model_get_item_with_track(AlbumModel *model, Track *track); diff --git a/plugins/clarity/clarity_canvas.c b/plugins/clarity/clarity_canvas.c index 26b86fe..865a114 100644 --- a/plugins/clarity/clarity_canvas.c +++ b/plugins/clarity/clarity_canvas.c @@ -27,11 +27,14 @@ */ #include <clutter-gtk/clutter-gtk.h> #include "libgtkpod/gp_itdb.h" +#include "libgtkpod/fileselection.h" +#include "libgtkpod/misc.h" #include "plugin.h" #include "clarity_cover.h" #include "clarity_canvas.h" #include "clarity_preview.h" #include "clarity_utils.h" +#include "clarity_context_menu.h" G_DEFINE_TYPE( ClarityCanvas, clarity_canvas, GTK_TYPE_BOX); @@ -43,6 +46,7 @@ G_DEFINE_TYPE( ClarityCanvas, clarity_canvas, GTK_TYPE_BOX); #define FRONT_COVER_SPACE 150 #define MAX_SCALE 1.4 #define VISIBLE_ITEMS 8 +#define FLOOR 110 struct _ClarityCanvasPrivate { @@ -99,12 +103,46 @@ static void clarity_canvas_class_init(ClarityCanvasClass *klass) { g_type_class_add_private(klass, sizeof(ClarityCanvasPrivate)); } -static gboolean _preview_cover_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) { - ClarityCanvas *ccanvas = CLARITY_CANVAS(widget); - ClarityCanvasPrivate *priv = ccanvas->priv; +static void _update_text(ClarityCanvasPrivate *priv) { + g_return_if_fail(priv); + + if (g_list_length(priv->covers) == 0) + return; + + ClarityCover *ccover = g_list_nth_data(priv->covers, priv->curr_index); + + gchar *title = clarity_cover_get_title(ccover); + gchar *artist = clarity_cover_get_artist(ccover); + + clutter_text_set_text(CLUTTER_TEXT(priv->title_text), title); + clutter_text_set_text(CLUTTER_TEXT(priv->artist_text), artist); + + g_free(title); + g_free(artist); + clutter_actor_raise_top(priv->title_text); + clutter_actor_raise_top(priv->artist_text); + + gfloat artistx = (clutter_actor_get_width(priv->artist_text) / 2) * -1; + gfloat artisty = FLOOR - (clarity_cover_get_artwork_height(ccover) * MAX_SCALE); + clutter_actor_set_position(priv->artist_text, artistx, artisty); + + gfloat titlex = (clutter_actor_get_width(priv->title_text) / 2) * -1; + gfloat titley = artisty - clutter_actor_get_height(priv->artist_text) - 2; + clutter_actor_set_position(priv->title_text, titlex, titley); +} + +static void _set_loading_complete(ClarityCanvasPrivate *priv, gboolean value) { + priv->loading_complete = value; + + if (value) { + _update_text(priv); + } +} + +static void _preview_cover(ClarityCanvasPrivate *priv) { if (!priv->model) - return TRUE; + return; AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); @@ -112,8 +150,58 @@ static gboolean _preview_cover_cb(GtkWidget *widget, GdkEvent *event, gpointer u /* Display the dialog */ gtk_widget_show_all(dialog); +} + +/** + * on_main_cover_image_clicked_cb: + * + * Call handler used for displaying the tracks associated with + * the main displayed album cover. + * + * @ClarityCanvas + * @event: event object used to determine the event type + * @data: any data needed by the function (not required) + * + */ +static gint _on_main_cover_image_clicked_cb(GtkWidget *widget, GdkEvent *event, gpointer data) { + ClarityCanvas *ccanvas = CLARITY_CANVAS(widget); + ClarityCanvasPrivate *priv = ccanvas->priv; + guint mbutton; + + if (event->type != GDK_BUTTON_PRESS) + return FALSE; + + mbutton = event->button.button; + + if ((mbutton == 1) && (event->button.state & GDK_SHIFT_MASK)) { + _set_loading_complete(priv, FALSE); + + AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); + if (item) { + gtkpod_set_displayed_tracks(item->tracks); + } - return TRUE; + _set_loading_complete(priv, TRUE); + } + else if (mbutton == 1) { + _preview_cover(priv); + } + else if ((mbutton == 3) && (event->button.state & GDK_SHIFT_MASK)) { + /* Right mouse button clicked and shift pressed. + * Go straight to edit details window + */ + AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); + GList *tracks = item->tracks; + gtkpod_edit_details(tracks); + } + else if (mbutton == 3) { + /* Right mouse button clicked on its own so display + * popup menu + */ + clarity_context_menu_init(ccanvas); + } + + return FALSE; } /** @@ -154,7 +242,7 @@ static void clarity_canvas_init(ClarityCanvas *self) { clutter_actor_set_reactive(priv->container, TRUE); priv->preview_signal = g_signal_connect (self, "button-press-event", - G_CALLBACK (_preview_cover_cb), + G_CALLBACK (_on_main_cover_image_clicked_cb), priv); clutter_container_add(CLUTTER_CONTAINER(priv->container), priv->title_text, priv->artist_text, NULL); @@ -345,35 +433,6 @@ static gint _calculate_index_opacity (gint dist_from_front) { return CLAMP ( 255 * (VISIBLE_ITEMS - ABS(dist_from_front)) / VISIBLE_ITEMS, 0, 255); } -static void _update_text(ClarityCanvasPrivate *priv) { - g_return_if_fail(priv); - - if (g_list_length(priv->covers) == 0) - return; - - ClarityCover *ccover = g_list_nth_data(priv->covers, priv->curr_index); - - gchar *title = clarity_cover_get_title(ccover); - gchar *artist = clarity_cover_get_artist(ccover); - - clutter_text_set_text(CLUTTER_TEXT(priv->title_text), title); - clutter_text_set_text(CLUTTER_TEXT(priv->artist_text), artist); - - g_free(title); - g_free(artist); - - clutter_actor_raise_top(priv->title_text); - clutter_actor_raise_top(priv->artist_text); - - gfloat artistx = (clutter_actor_get_width(priv->artist_text) / 2) * -1; - gfloat artisty = ((clutter_actor_get_height(CLUTTER_ACTOR(ccover)) / 2) - 25) * -1; - clutter_actor_set_position(priv->artist_text, artistx, artisty); - - gfloat titlex = (clutter_actor_get_width(priv->title_text) / 2) * -1; - gfloat titley = artisty - clutter_actor_get_height(priv->artist_text) - 2; - clutter_actor_set_position(priv->title_text, titlex, titley); -} - static void _display_clarity_cover(ClarityCover *ccover, gint index) { ClutterTimeline *timeline = clutter_timeline_new(1600 * 5); ClutterAlpha *alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_OUT_EXPO); @@ -383,12 +442,12 @@ static void _display_clarity_cover(ClarityCover *ccover, gint index) { clutter_timeline_start (timeline); } -static void _set_loading_complete(ClarityCanvasPrivate *priv, gboolean value) { - priv->loading_complete = value; - - if (value) { - _update_text(priv); - } +static void _set_cover_position(ClarityCover *ccover, gint index) { + gint pos = _calculate_index_distance(index); + clutter_actor_set_position( + CLUTTER_ACTOR(ccover), + pos - clarity_cover_get_artwork_width(ccover) / 2, + FLOOR - clarity_cover_get_artwork_height(ccover)); } static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *album_item, gint index) { @@ -406,11 +465,7 @@ static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *albu clarity_cover_set_album_item(ccover, album_item); - gint pos = _calculate_index_distance(index); - clutter_actor_set_position( - CLUTTER_ACTOR(ccover), - pos - clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, - 110 - clutter_actor_get_height(CLUTTER_ACTOR(ccover))); + _set_cover_position(ccover, index); if((priv->curr_index + VISIBLE_ITEMS < index) || (priv->curr_index - VISIBLE_ITEMS > index)) { @@ -435,8 +490,8 @@ static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *albu CLUTTER_ACTOR(ccover), scale, scale, - clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, - clutter_actor_get_height(CLUTTER_ACTOR(ccover)) / 2); + clarity_cover_get_artwork_width(ccover) / 2, + clarity_cover_get_artwork_height(ccover) / 2); clutter_actor_lower_bottom(CLUTTER_ACTOR(ccover)); @@ -452,9 +507,7 @@ void _init_album_item(gpointer value, gint index, gpointer user_data) { ClarityCanvas *cc = CLARITY_CANVAS(user_data); ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(cc); - Track *track = g_list_nth_data(item->tracks, 0); - item->albumart = _get_track_image(track); - item->data = cc; + album_model_init_coverart(priv->model, item); _create_cover_actors(priv, item, index); } @@ -516,18 +569,17 @@ static void _clear_rotation_behaviours(GList *covers) { static void _animate_indices(ClarityCanvasPrivate *priv, gint direction, gint increment) { for (gint i = 0; i < g_list_length(priv->covers); ++i) { - ClarityCover *ccover = g_list_nth_data(priv->covers, i); gint dist = i - priv->curr_index + (direction * increment); - gfloat depth = 1; + gfloat scale = 1; gint pos = 0; gint opacity = 0; gint angle = 0; ClutterRotateDirection rotation_dir; opacity = _calculate_index_opacity(dist); - depth = _calculate_index_scale(dist); + scale = _calculate_index_scale(dist); pos = _calculate_index_distance(dist); _calculate_index_angle_and_dir(dist, direction, &angle, &rotation_dir); @@ -539,13 +591,17 @@ static void _animate_indices(ClarityCanvasPrivate *priv, gint direction, gint in "opacity", opacity, NULL); + gfloat w = clarity_cover_get_artwork_width(ccover); + gfloat h = clarity_cover_get_artwork_height(ccover); + /* Position and scale */ clutter_actor_animate_with_alpha (CLUTTER_ACTOR(ccover), priv->alpha, - "scale-x", depth, - "scale-y", depth, - "scale-center-x" , clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, - "scale-center-y" , clutter_actor_get_height(CLUTTER_ACTOR(ccover)) / 2, - "x", pos - clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, + "scale-x", scale, + "scale-y", scale, + "scale-center-x" , w / 2, + "scale-center-y", h / 2, + "x", pos - (w / 2), + "y", FLOOR - h, NULL); } } @@ -661,3 +717,69 @@ void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item) { _set_loading_complete(priv, TRUE); } + +void clarity_canvas_update(ClarityCanvas *cc, AlbumItem *item) { + g_return_if_fail(cc); + + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(cc); + + gint index = album_model_get_index_with_album_item(priv->model, item); + + _set_loading_complete(priv, FALSE); + + album_model_init_coverart(priv->model, item); + + ClarityCover *ccover = (ClarityCover *) g_list_nth_data(priv->covers, index); + if (!ccover) + return; + + clarity_cover_set_album_item(ccover, item); + + _set_cover_position(ccover, index); + + _animate_indices(priv, 0, 0); + + _set_loading_complete(priv, TRUE); +} + +static void _set_cover_from_file(ClarityCanvas *self) { + g_return_if_fail(self); + + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); + + gchar *filename; + Track *track; + GList *tracks; + + filename = fileselection_get_cover_filename(); + + if (filename) { + AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); + tracks = g_list_copy(item->tracks); + + while (tracks) { + track = tracks->data; + + if (gp_track_set_thumbnails(track, filename)) { + ExtraTrackData *etd; + etd = track->userdata; + etd->tartwork_changed = TRUE; + + gtkpod_track_updated(track); + data_changed(track->itdb); + + etd->tartwork_changed = FALSE; + } + + tracks = tracks->next; + } + } + + g_free(filename); +} + +void on_clarity_set_cover_menuitem_activate(GtkMenuItem *mi, gpointer data) { + g_return_if_fail(CLARITY_IS_CANVAS(data)); + + _set_cover_from_file(CLARITY_CANVAS(data)); +} diff --git a/plugins/clarity/clarity_canvas.h b/plugins/clarity/clarity_canvas.h index 3a1a691..e5bc41b 100644 --- a/plugins/clarity/clarity_canvas.h +++ b/plugins/clarity/clarity_canvas.h @@ -92,6 +92,10 @@ void clarity_canvas_add_album_item(ClarityCanvas *self, AlbumItem *item); void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item); +void clarity_canvas_update(ClarityCanvas *cc, AlbumItem *item); + +void on_clarity_set_cover_menuitem_activate(GtkMenuItem *mi, gpointer data); + G_END_DECLS #endif /* CLARITY_CANVAS_H_ */ diff --git a/plugins/clarity/clarity_context_menu.c b/plugins/clarity/clarity_context_menu.c index aeea9ea..a863d9d 100644 --- a/plugins/clarity/clarity_context_menu.c +++ b/plugins/clarity/clarity_context_menu.c @@ -34,47 +34,33 @@ #include "libgtkpod/context_menus.h" #include "libgtkpod/misc.h" #include "clarity_context_menu.h" +#include "clarity_canvas.h" -//static GtkWidget *add_get_cover_from_file(GtkWidget *menu) { -// return hookup_menu_item(menu, _("Select Cover From File"), GTK_STOCK_FLOPPY, G_CALLBACK (clarity_set_cover_from_file), NULL); -//} -// -///* -// * display the dialog with the full size cd artwork cover -// * @mi - the menu item selected -// * @data - Ignored, should be NULL -// */ -//static void display_track_artwork(GtkMenuItem *mi, gpointer data) { -// if (gtkpod_get_selected_tracks()) -// clarity_display_big_artwork(gtkpod_get_selected_tracks()); -//} -// -//static GtkWidget *add_display_big_coverart(GtkWidget *menu) { -// return hookup_menu_item(menu, _("View Full Size Artwork"), GTK_STOCK_FULLSCREEN, G_CALLBACK (display_track_artwork), NULL); -//} -// -///** -// * cad_context_menu_init - initialize the right click menu for coverart display -// */ -//void cad_context_menu_init(void) { -// if (widgets_blocked) -// return; -// -// GtkWidget *menu = NULL; -// -// if (gtkpod_get_selected_tracks()) { -// menu = gtk_menu_new(); -// -// add_get_cover_from_file(menu); -// add_display_big_coverart(menu); -// add_edit_track_details(menu); -// -// /* -// * button should be button 0 as per the docs because we're calling -// * from a button release event -// */ -// if (menu) { -// gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); -// } -// } -//} +static GtkWidget *add_get_cover_from_file(GtkWidget *menu, ClarityCanvas *ccanvas) { + return hookup_menu_item(menu, _("Select Cover From File"), GTK_STOCK_FLOPPY, G_CALLBACK (on_clarity_set_cover_menuitem_activate), ccanvas); +} + +/** + * clarity_context_menu_init - initialize the right click menu for clarity + */ +void clarity_context_menu_init(ClarityCanvas *ccanvas) { + if (widgets_blocked) + return; + + GtkWidget *menu = NULL; + + if (gtkpod_get_selected_tracks()) { + menu = gtk_menu_new(); + + add_get_cover_from_file(menu, ccanvas); + add_edit_track_details(menu); + + /* + * button should be button 0 as per the docs because we're calling + * from a button release event + */ + if (menu) { + gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); + } + } +} diff --git a/plugins/clarity/clarity_context_menu.h b/plugins/clarity/clarity_context_menu.h index a2b4606..ce38587 100644 --- a/plugins/clarity/clarity_context_menu.h +++ b/plugins/clarity/clarity_context_menu.h @@ -26,12 +26,14 @@ | */ -#ifndef COVER_DISPLAY_CONTEXT_MENU_H_ -#define COVER_DISPLAY_CONTEXT_MENU_H_ +#ifndef CLARITY_CONTEXT_MENU_H_ +#define CLARTIY_CONTEXT_MENU_H_ + +#include "clarity_canvas.h" /** - * cad_context_menu_init - initialize the right click menu for coverart display + * clarity_context_menu_init - initialize the right click menu for clarity */ -void cad_context_menu_init(void); +void clarity_context_menu_init(ClarityCanvas *ccanvas); -#endif /* COVER_DISPLAY_CONTEXT_MENU_H_ */ +#endif /* CLARITY_CONTEXT_MENU_H_ */ diff --git a/plugins/clarity/clarity_cover.c b/plugins/clarity/clarity_cover.c index d5d44e6..32e3943 100644 --- a/plugins/clarity/clarity_cover.c +++ b/plugins/clarity/clarity_cover.c @@ -233,9 +233,13 @@ void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) { GError *error = NULL; gint y_offset; - priv->texture = gtk_clutter_texture_new(); - gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE(priv->texture), item->albumart, &error); + if (!priv->texture) { + priv->texture = gtk_clutter_texture_new(); + clutter_container_add_actor(CLUTTER_CONTAINER(self), priv->texture); + } + // Set cover artwork + gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE(priv->texture), item->albumart, &error); if (error) { g_warning(error->message); g_error_free(error); @@ -243,19 +247,21 @@ void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) { } // Add reflection - y_offset = clutter_actor_get_height (priv->texture) + V_PADDING; - - priv->reflection = clutter_clone_new (priv->texture); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_X, 0.0)); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_Y, y_offset)); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_WIDTH, 0.0)); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_HEIGHT, 0.0)); - g_signal_connect (priv->reflection, + if (! priv->reflection) { + y_offset = clutter_actor_get_height (priv->texture) + V_PADDING; + + priv->reflection = clutter_clone_new (priv->texture); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_X, 0.0)); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_Y, y_offset)); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_WIDTH, 0.0)); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_HEIGHT, 0.0)); + g_signal_connect (priv->reflection, "paint", G_CALLBACK (_clone_paint_cb), NULL); - clutter_container_add(CLUTTER_CONTAINER(self), priv->texture, priv->reflection, NULL); + clutter_container_add_actor(CLUTTER_CONTAINER(self), priv->reflection); + } ClutterActorBox box; gfloat w, h; @@ -268,7 +274,14 @@ void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) { } // Add title / artist data + if (priv->title) + g_free(priv->title); + priv->title = g_strdup(item->albumname); + + if (priv->artist) + g_free(priv->artist); + priv->artist = g_strdup(item->artist); } @@ -320,6 +333,16 @@ gchar *clarity_cover_get_artist(ClarityCover *self) { return g_strdup(priv->artist); } +gfloat clarity_cover_get_artwork_height(ClarityCover *self) { + ClarityCoverPrivate *priv = self->priv; + return clutter_actor_get_height(priv->texture); +} + +gfloat clarity_cover_get_artwork_width(ClarityCover *self) { + ClarityCoverPrivate *priv = self->priv; + return clutter_actor_get_width(priv->texture); +} + /** * clarity_cover_new: * diff --git a/plugins/clarity/clarity_cover.h b/plugins/clarity/clarity_cover.h index 8b8f18b..3f52dfa 100644 --- a/plugins/clarity/clarity_cover.h +++ b/plugins/clarity/clarity_cover.h @@ -105,6 +105,10 @@ gchar *clarity_cover_get_title(ClarityCover *self); gchar *clarity_cover_get_artist(ClarityCover *self); +gfloat clarity_cover_get_artwork_height(ClarityCover *self); + +gfloat clarity_cover_get_artwork_width(ClarityCover *self); + /* constructor - note this returns a ClutterActor instance */ ClarityCover *clarity_cover_new (void); diff --git a/plugins/clarity/clarity_widget.c b/plugins/clarity/clarity_widget.c index ca50d74..b379f23 100644 --- a/plugins/clarity/clarity_widget.c +++ b/plugins/clarity/clarity_widget.c @@ -541,72 +541,70 @@ void clarity_widget_track_updated_cb(GtkPodApp *app, gpointer tk, gpointer data) if (clarity_canvas_is_loading(ccanvas)) return; - AlbumItem *item; - gboolean findremove = FALSE; + AlbumItem *item = NULL; gint index = album_model_get_index_with_track(priv->album_model, track); - if (index == -1) { - /* The track's key could not be found according to the track! - * The ONLY way this could happen is if the user changed the - * components of the track's key. Well it should be rare but the only - * way to remove it from its "old" album item is to search each one - */ - findremove = TRUE; - } - else { - /* Track has a valid key so can get the album back. + if (index > -1) { + /* + * Track has a valid key so can get the album back. * Either has happened: * a) Artist/Album key has been changed so the track is being moved * to another existing album - * b) Some other change has occurred that is irrelevant to this code. + * b) Artwork has been updated + * c) Some other change has occurred that is irrelevant to this code. * * To determine if a) is the case need to determine whether track exists - * in the album items track list. If it does then b) is true and nothing - * more is required. + * in the album items track list. If it does then b) or c) is true. */ item = album_model_get_item_with_track(priv->album_model, track); g_return_if_fail (item); index = g_list_index(item->tracks, track); if (index != -1) { - /* Track exists in the album list so ignore the change and return */ + /* + * Track exists in the album list so determine whether + * its artwork is up to date + */ ExtraTrackData *etd; etd = track->userdata; - if (etd->tartwork_changed == TRUE) { - etd->tartwork_changed = FALSE; + if (etd->tartwork_changed) { + clarity_canvas_update(ccanvas, item); + return; + } + else { + /* + * Artwork is up to date so nothing changed relevant + * to the display. + */ + return; } - - return; } else { - /* Track does not exist in the album list so the artist/album - * key has definitely changed */ - findremove = TRUE; - } - } - - if (findremove) { - /* It has been determined that the track has had its key changed - * and thus a search must be performed to find the "original" album - * that the track belonged to, remove it then add the track to the - * new album. - */ - item = album_model_search_for_track(priv->album_model, track); - /* item represents the album item containing the track */ - if (item) { - g_warning("Item %s %s", item->albumname, item->artist); - - /* The track is in this album so remove it in preparation for - * readding under the new album key + /* + * Track does not exist in the album list so the artist/album + * key has definitely changed so find the old album item the long + * way. */ - _remove_track(priv, item, track); + item = album_model_search_for_track(priv->album_model, track); } + } - /* Create a new album item or find existing album to house the - * "brand new" track + /* item represents the old album item containing the track */ + if (item) { + /* + * The track is in this album so remove it in preparation for + * readding it back either under the same album item but with + * a different cover or under a different album item due to a + * different album key. */ - _add_track(priv, track); + _remove_track(priv, item, track); } + + /* + * Create a new album item or find existing album to house the + * "brand new" track + */ + _add_track(priv, track); } diff --git a/plugins/cover_display/display_coverart.c b/plugins/cover_display/display_coverart.c index c797dff..ad62e06 100644 --- a/plugins/cover_display/display_coverart.c +++ b/plugins/cover_display/display_coverart.c @@ -949,8 +949,7 @@ void coverart_track_changed(Track *track, gint signal) { /* Track exists in the album list so ignore the change and return */ ExtraTrackData *etd; etd = track->userdata; - if (etd->tartwork_changed == TRUE) { - etd->tartwork_changed = FALSE; + if (etd->tartwork_changed) { redraw(TRUE); } diff --git a/plugins/details_editor/details.c b/plugins/details_editor/details.c index 4e0b48c..91087ef 100644 --- a/plugins/details_editor/details.c +++ b/plugins/details_editor/details.c @@ -354,6 +354,7 @@ static void details_button_apply_clicked(GtkButton *button) { changed |= tr_changed; etr->tchanged = FALSE; + etr->tartwork_changed = FALSE; } } |
From: phantomjinx <pha...@us...> - 2011-09-10 21:15:41
|
The branch 'clarity' was changed in a way that was not a fast-forward update. NOTE: This may cause problems for people pulling from the branch. For more information, please see: http://live.gnome.org/Git/Help/NonFastForward Commits removed from the branch: 563aeaf... blah ddef6ad... Implement the updating of a track in clarity Commits added to the branch: bec268f... Implement the updating of a track in clarity |
From: phantomjinx <pha...@us...> - 2011-09-10 12:39:41
|
commit ddef6ad02ab592877d82cd36c5def70f3a1228f0 Author: phantomjinx <p.g...@ph...> Date: Sat Sep 10 13:38:30 2011 +0100 Implement the updating of a track in clarity * If a track has been changed, clarity should react and if necessary update the artwork cover accordingly. This may mean changing the artwork, text or moving the track completely to a new album item. * AlbumItem * data reference no longer necessary * clarity_canvas * Formally defines the FLOOR constant better to understand the location set or each cover * Support for shift + mouse-button-1 to select the tracks referenced by the cover art. plugins/clarity/album_model.c | 15 ++++- plugins/clarity/album_model.h | 4 +- plugins/clarity/clarity_canvas.c | 159 +++++++++++++++++++++++--------------- plugins/clarity/clarity_canvas.h | 9 +-- plugins/clarity/clarity_cover.c | 45 ++++++++--- plugins/clarity/clarity_cover.h | 4 + plugins/clarity/clarity_widget.c | 6 +- 7 files changed, 156 insertions(+), 86 deletions(-) --- diff --git a/plugins/clarity/album_model.c b/plugins/clarity/album_model.c index 5db9fb3..7c4b5b2 100644 --- a/plugins/clarity/album_model.c +++ b/plugins/clarity/album_model.c @@ -30,6 +30,7 @@ #define ALBUM_MODEL_C_ #include "album_model.h" +#include "clarity_utils.h" #include "libgtkpod/prefs.h" #include "libgtkpod/misc.h" #include "libgtkpod/gp_private.h" @@ -185,7 +186,6 @@ static void album_model_free_album_item(AlbumItem *item) { if (item->albumart) g_object_unref(item->albumart); - item->data = NULL; } } @@ -327,6 +327,19 @@ void album_model_foreach (AlbumModel *model, AMFunc func, gpointer user_data) { } } +void album_model_init_coverart(AlbumModel *model, AlbumItem *item) { + g_return_if_fail(item); + + Track *track = g_list_nth_data(item->tracks, 0); + + if (item->albumart) { + g_object_unref(item->albumart); + item->albumart = NULL; + } + + item->albumart = _get_track_image(track); +} + AlbumItem *album_model_get_item_with_index(AlbumModel *model, gint index) { g_return_val_if_fail(model, NULL); diff --git a/plugins/clarity/album_model.h b/plugins/clarity/album_model.h index 00acc8b..617a6cb 100644 --- a/plugins/clarity/album_model.h +++ b/plugins/clarity/album_model.h @@ -41,8 +41,6 @@ typedef struct { gchar *artist; GdkPixbuf *albumart; - gpointer data; - } AlbumItem; typedef void (*AMFunc) (gpointer value, gint index, gpointer user_data); @@ -107,6 +105,8 @@ gboolean album_model_add_track(AlbumModel *model, Track *track); */ gboolean album_model_remove_track(AlbumModel *model, AlbumItem *item, Track *track); +void album_model_init_coverart(AlbumModel *model, AlbumItem *item); + AlbumItem *album_model_get_item_with_index(AlbumModel *model, gint index); AlbumItem *album_model_get_item_with_track(AlbumModel *model, Track *track); diff --git a/plugins/clarity/clarity_canvas.c b/plugins/clarity/clarity_canvas.c index be04b23..865a114 100644 --- a/plugins/clarity/clarity_canvas.c +++ b/plugins/clarity/clarity_canvas.c @@ -46,6 +46,7 @@ G_DEFINE_TYPE( ClarityCanvas, clarity_canvas, GTK_TYPE_BOX); #define FRONT_COVER_SPACE 150 #define MAX_SCALE 1.4 #define VISIBLE_ITEMS 8 +#define FLOOR 110 struct _ClarityCanvasPrivate { @@ -102,6 +103,43 @@ static void clarity_canvas_class_init(ClarityCanvasClass *klass) { g_type_class_add_private(klass, sizeof(ClarityCanvasPrivate)); } +static void _update_text(ClarityCanvasPrivate *priv) { + g_return_if_fail(priv); + + if (g_list_length(priv->covers) == 0) + return; + + ClarityCover *ccover = g_list_nth_data(priv->covers, priv->curr_index); + + gchar *title = clarity_cover_get_title(ccover); + gchar *artist = clarity_cover_get_artist(ccover); + + clutter_text_set_text(CLUTTER_TEXT(priv->title_text), title); + clutter_text_set_text(CLUTTER_TEXT(priv->artist_text), artist); + + g_free(title); + g_free(artist); + + clutter_actor_raise_top(priv->title_text); + clutter_actor_raise_top(priv->artist_text); + + gfloat artistx = (clutter_actor_get_width(priv->artist_text) / 2) * -1; + gfloat artisty = FLOOR - (clarity_cover_get_artwork_height(ccover) * MAX_SCALE); + clutter_actor_set_position(priv->artist_text, artistx, artisty); + + gfloat titlex = (clutter_actor_get_width(priv->title_text) / 2) * -1; + gfloat titley = artisty - clutter_actor_get_height(priv->artist_text) - 2; + clutter_actor_set_position(priv->title_text, titlex, titley); +} + +static void _set_loading_complete(ClarityCanvasPrivate *priv, gboolean value) { + priv->loading_complete = value; + + if (value) { + _update_text(priv); + } +} + static void _preview_cover(ClarityCanvasPrivate *priv) { if (!priv->model) return; @@ -135,7 +173,17 @@ static gint _on_main_cover_image_clicked_cb(GtkWidget *widget, GdkEvent *event, mbutton = event->button.button; - if (mbutton == 1) { + if ((mbutton == 1) && (event->button.state & GDK_SHIFT_MASK)) { + _set_loading_complete(priv, FALSE); + + AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); + if (item) { + gtkpod_set_displayed_tracks(item->tracks); + } + + _set_loading_complete(priv, TRUE); + } + else if (mbutton == 1) { _preview_cover(priv); } else if ((mbutton == 3) && (event->button.state & GDK_SHIFT_MASK)) { @@ -385,35 +433,6 @@ static gint _calculate_index_opacity (gint dist_from_front) { return CLAMP ( 255 * (VISIBLE_ITEMS - ABS(dist_from_front)) / VISIBLE_ITEMS, 0, 255); } -static void _update_text(ClarityCanvasPrivate *priv) { - g_return_if_fail(priv); - - if (g_list_length(priv->covers) == 0) - return; - - ClarityCover *ccover = g_list_nth_data(priv->covers, priv->curr_index); - - gchar *title = clarity_cover_get_title(ccover); - gchar *artist = clarity_cover_get_artist(ccover); - - clutter_text_set_text(CLUTTER_TEXT(priv->title_text), title); - clutter_text_set_text(CLUTTER_TEXT(priv->artist_text), artist); - - g_free(title); - g_free(artist); - - clutter_actor_raise_top(priv->title_text); - clutter_actor_raise_top(priv->artist_text); - - gfloat artistx = (clutter_actor_get_width(priv->artist_text) / 2) * -1; - gfloat artisty = ((clutter_actor_get_height(CLUTTER_ACTOR(ccover)) / 2) - 25) * -1; - clutter_actor_set_position(priv->artist_text, artistx, artisty); - - gfloat titlex = (clutter_actor_get_width(priv->title_text) / 2) * -1; - gfloat titley = artisty - clutter_actor_get_height(priv->artist_text) - 2; - clutter_actor_set_position(priv->title_text, titlex, titley); -} - static void _display_clarity_cover(ClarityCover *ccover, gint index) { ClutterTimeline *timeline = clutter_timeline_new(1600 * 5); ClutterAlpha *alpha = clutter_alpha_new_full (timeline, CLUTTER_EASE_OUT_EXPO); @@ -423,12 +442,12 @@ static void _display_clarity_cover(ClarityCover *ccover, gint index) { clutter_timeline_start (timeline); } -static void _set_loading_complete(ClarityCanvasPrivate *priv, gboolean value) { - priv->loading_complete = value; - - if (value) { - _update_text(priv); - } +static void _set_cover_position(ClarityCover *ccover, gint index) { + gint pos = _calculate_index_distance(index); + clutter_actor_set_position( + CLUTTER_ACTOR(ccover), + pos - clarity_cover_get_artwork_width(ccover) / 2, + FLOOR - clarity_cover_get_artwork_height(ccover)); } static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *album_item, gint index) { @@ -446,11 +465,7 @@ static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *albu clarity_cover_set_album_item(ccover, album_item); - gint pos = _calculate_index_distance(index); - clutter_actor_set_position( - CLUTTER_ACTOR(ccover), - pos - clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, - 110 - clutter_actor_get_height(CLUTTER_ACTOR(ccover))); + _set_cover_position(ccover, index); if((priv->curr_index + VISIBLE_ITEMS < index) || (priv->curr_index - VISIBLE_ITEMS > index)) { @@ -475,8 +490,8 @@ static gboolean _create_cover_actors(ClarityCanvasPrivate *priv, AlbumItem *albu CLUTTER_ACTOR(ccover), scale, scale, - clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, - clutter_actor_get_height(CLUTTER_ACTOR(ccover)) / 2); + clarity_cover_get_artwork_width(ccover) / 2, + clarity_cover_get_artwork_height(ccover) / 2); clutter_actor_lower_bottom(CLUTTER_ACTOR(ccover)); @@ -492,9 +507,7 @@ void _init_album_item(gpointer value, gint index, gpointer user_data) { ClarityCanvas *cc = CLARITY_CANVAS(user_data); ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(cc); - Track *track = g_list_nth_data(item->tracks, 0); - item->albumart = _get_track_image(track); - item->data = cc; + album_model_init_coverart(priv->model, item); _create_cover_actors(priv, item, index); } @@ -556,18 +569,17 @@ static void _clear_rotation_behaviours(GList *covers) { static void _animate_indices(ClarityCanvasPrivate *priv, gint direction, gint increment) { for (gint i = 0; i < g_list_length(priv->covers); ++i) { - ClarityCover *ccover = g_list_nth_data(priv->covers, i); gint dist = i - priv->curr_index + (direction * increment); - gfloat depth = 1; + gfloat scale = 1; gint pos = 0; gint opacity = 0; gint angle = 0; ClutterRotateDirection rotation_dir; opacity = _calculate_index_opacity(dist); - depth = _calculate_index_scale(dist); + scale = _calculate_index_scale(dist); pos = _calculate_index_distance(dist); _calculate_index_angle_and_dir(dist, direction, &angle, &rotation_dir); @@ -579,13 +591,17 @@ static void _animate_indices(ClarityCanvasPrivate *priv, gint direction, gint in "opacity", opacity, NULL); + gfloat w = clarity_cover_get_artwork_width(ccover); + gfloat h = clarity_cover_get_artwork_height(ccover); + /* Position and scale */ clutter_actor_animate_with_alpha (CLUTTER_ACTOR(ccover), priv->alpha, - "scale-x", depth, - "scale-y", depth, - "scale-center-x" , clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, - "scale-center-y" , clutter_actor_get_height(CLUTTER_ACTOR(ccover)) / 2, - "x", pos - clutter_actor_get_width(CLUTTER_ACTOR(ccover)) / 2, + "scale-x", scale, + "scale-y", scale, + "scale-center-x" , w / 2, + "scale-center-y", h / 2, + "x", pos - (w / 2), + "y", FLOOR - h, NULL); } } @@ -702,14 +718,31 @@ void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item) { _set_loading_complete(priv, TRUE); } -/** - * clarity_canvas_set_cover_from_file: - * - * Add a cover to the displayed track by setting it from a - * picture file. - * - */ -void clarity_canvas_set_cover_from_file(ClarityCanvas *self) { +void clarity_canvas_update(ClarityCanvas *cc, AlbumItem *item) { + g_return_if_fail(cc); + + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(cc); + + gint index = album_model_get_index_with_album_item(priv->model, item); + + _set_loading_complete(priv, FALSE); + + album_model_init_coverart(priv->model, item); + + ClarityCover *ccover = (ClarityCover *) g_list_nth_data(priv->covers, index); + if (!ccover) + return; + + clarity_cover_set_album_item(ccover, item); + + _set_cover_position(ccover, index); + + _animate_indices(priv, 0, 0); + + _set_loading_complete(priv, TRUE); +} + +static void _set_cover_from_file(ClarityCanvas *self) { g_return_if_fail(self); ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); @@ -748,5 +781,5 @@ void clarity_canvas_set_cover_from_file(ClarityCanvas *self) { void on_clarity_set_cover_menuitem_activate(GtkMenuItem *mi, gpointer data) { g_return_if_fail(CLARITY_IS_CANVAS(data)); - clarity_canvas_set_cover_from_file(CLARITY_CANVAS(data)); + _set_cover_from_file(CLARITY_CANVAS(data)); } diff --git a/plugins/clarity/clarity_canvas.h b/plugins/clarity/clarity_canvas.h index 23561fa..e5bc41b 100644 --- a/plugins/clarity/clarity_canvas.h +++ b/plugins/clarity/clarity_canvas.h @@ -92,14 +92,7 @@ void clarity_canvas_add_album_item(ClarityCanvas *self, AlbumItem *item); void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item); -/** - * clarity_canvas_set_cover_from_file: - * - * Add a cover to the displayed track by setting it from a - * picture file. - * - */ -void clarity_canvas_set_cover_from_file(ClarityCanvas *self); +void clarity_canvas_update(ClarityCanvas *cc, AlbumItem *item); void on_clarity_set_cover_menuitem_activate(GtkMenuItem *mi, gpointer data); diff --git a/plugins/clarity/clarity_cover.c b/plugins/clarity/clarity_cover.c index d5d44e6..32e3943 100644 --- a/plugins/clarity/clarity_cover.c +++ b/plugins/clarity/clarity_cover.c @@ -233,9 +233,13 @@ void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) { GError *error = NULL; gint y_offset; - priv->texture = gtk_clutter_texture_new(); - gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE(priv->texture), item->albumart, &error); + if (!priv->texture) { + priv->texture = gtk_clutter_texture_new(); + clutter_container_add_actor(CLUTTER_CONTAINER(self), priv->texture); + } + // Set cover artwork + gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE(priv->texture), item->albumart, &error); if (error) { g_warning(error->message); g_error_free(error); @@ -243,19 +247,21 @@ void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) { } // Add reflection - y_offset = clutter_actor_get_height (priv->texture) + V_PADDING; - - priv->reflection = clutter_clone_new (priv->texture); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_X, 0.0)); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_Y, y_offset)); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_WIDTH, 0.0)); - clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_HEIGHT, 0.0)); - g_signal_connect (priv->reflection, + if (! priv->reflection) { + y_offset = clutter_actor_get_height (priv->texture) + V_PADDING; + + priv->reflection = clutter_clone_new (priv->texture); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_X, 0.0)); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_Y, y_offset)); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_WIDTH, 0.0)); + clutter_actor_add_constraint (priv->reflection, clutter_bind_constraint_new (priv->texture, CLUTTER_BIND_HEIGHT, 0.0)); + g_signal_connect (priv->reflection, "paint", G_CALLBACK (_clone_paint_cb), NULL); - clutter_container_add(CLUTTER_CONTAINER(self), priv->texture, priv->reflection, NULL); + clutter_container_add_actor(CLUTTER_CONTAINER(self), priv->reflection); + } ClutterActorBox box; gfloat w, h; @@ -268,7 +274,14 @@ void clarity_cover_set_album_item (ClarityCover *self, AlbumItem *item) { } // Add title / artist data + if (priv->title) + g_free(priv->title); + priv->title = g_strdup(item->albumname); + + if (priv->artist) + g_free(priv->artist); + priv->artist = g_strdup(item->artist); } @@ -320,6 +333,16 @@ gchar *clarity_cover_get_artist(ClarityCover *self) { return g_strdup(priv->artist); } +gfloat clarity_cover_get_artwork_height(ClarityCover *self) { + ClarityCoverPrivate *priv = self->priv; + return clutter_actor_get_height(priv->texture); +} + +gfloat clarity_cover_get_artwork_width(ClarityCover *self) { + ClarityCoverPrivate *priv = self->priv; + return clutter_actor_get_width(priv->texture); +} + /** * clarity_cover_new: * diff --git a/plugins/clarity/clarity_cover.h b/plugins/clarity/clarity_cover.h index 8b8f18b..3f52dfa 100644 --- a/plugins/clarity/clarity_cover.h +++ b/plugins/clarity/clarity_cover.h @@ -105,6 +105,10 @@ gchar *clarity_cover_get_title(ClarityCover *self); gchar *clarity_cover_get_artist(ClarityCover *self); +gfloat clarity_cover_get_artwork_height(ClarityCover *self); + +gfloat clarity_cover_get_artwork_width(ClarityCover *self); + /* constructor - note this returns a ClutterActor instance */ ClarityCover *clarity_cover_new (void); diff --git a/plugins/clarity/clarity_widget.c b/plugins/clarity/clarity_widget.c index 2bccbaf..b379f23 100644 --- a/plugins/clarity/clarity_widget.c +++ b/plugins/clarity/clarity_widget.c @@ -567,7 +567,11 @@ void clarity_widget_track_updated_cb(GtkPodApp *app, gpointer tk, gpointer data) */ ExtraTrackData *etd; etd = track->userdata; - if (! etd->tartwork_changed) { + if (etd->tartwork_changed) { + clarity_canvas_update(ccanvas, item); + return; + } + else { /* * Artwork is up to date so nothing changed relevant * to the display. |
From: phantomjinx <pha...@us...> - 2011-09-10 12:39:34
|
commit 563aeaf7904bd236ec5ec656613d8f4c312e0046 Author: phantomjinx <p.g...@ph...> Date: Thu Sep 8 21:04:36 2011 +0100 blah plugins/clarity/album_model.c | 4 + plugins/clarity/clarity_canvas.c | 103 ++++++++++++++++++++++++++++-- plugins/clarity/clarity_canvas.h | 11 +++ plugins/clarity/clarity_context_menu.c | 72 ++++++++------------ plugins/clarity/clarity_context_menu.h | 12 ++-- plugins/clarity/clarity_widget.c | 80 +++++++++++------------ plugins/cover_display/display_coverart.c | 3 +- plugins/details_editor/details.c | 1 + 8 files changed, 186 insertions(+), 100 deletions(-) --- diff --git a/plugins/clarity/album_model.c b/plugins/clarity/album_model.c index 2779f6a..5db9fb3 100644 --- a/plugins/clarity/album_model.c +++ b/plugins/clarity/album_model.c @@ -142,6 +142,10 @@ static gboolean _insert_track(AlbumModelPrivate *priv, Track *track) { AlbumItem *item; gchar *album_key; + Updating tracks by removing then adding is not working as the item + is never removed so the album item image is never updated! + + album_key = _create_key_from_track(track); /* Check whether an album item has already been created in connection * with the track's artist and album diff --git a/plugins/clarity/clarity_canvas.c b/plugins/clarity/clarity_canvas.c index 26b86fe..be04b23 100644 --- a/plugins/clarity/clarity_canvas.c +++ b/plugins/clarity/clarity_canvas.c @@ -27,11 +27,14 @@ */ #include <clutter-gtk/clutter-gtk.h> #include "libgtkpod/gp_itdb.h" +#include "libgtkpod/fileselection.h" +#include "libgtkpod/misc.h" #include "plugin.h" #include "clarity_cover.h" #include "clarity_canvas.h" #include "clarity_preview.h" #include "clarity_utils.h" +#include "clarity_context_menu.h" G_DEFINE_TYPE( ClarityCanvas, clarity_canvas, GTK_TYPE_BOX); @@ -99,12 +102,9 @@ static void clarity_canvas_class_init(ClarityCanvasClass *klass) { g_type_class_add_private(klass, sizeof(ClarityCanvasPrivate)); } -static gboolean _preview_cover_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data) { - ClarityCanvas *ccanvas = CLARITY_CANVAS(widget); - ClarityCanvasPrivate *priv = ccanvas->priv; - +static void _preview_cover(ClarityCanvasPrivate *priv) { if (!priv->model) - return TRUE; + return; AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); @@ -112,8 +112,48 @@ static gboolean _preview_cover_cb(GtkWidget *widget, GdkEvent *event, gpointer u /* Display the dialog */ gtk_widget_show_all(dialog); +} + +/** + * on_main_cover_image_clicked_cb: + * + * Call handler used for displaying the tracks associated with + * the main displayed album cover. + * + * @ClarityCanvas + * @event: event object used to determine the event type + * @data: any data needed by the function (not required) + * + */ +static gint _on_main_cover_image_clicked_cb(GtkWidget *widget, GdkEvent *event, gpointer data) { + ClarityCanvas *ccanvas = CLARITY_CANVAS(widget); + ClarityCanvasPrivate *priv = ccanvas->priv; + guint mbutton; + + if (event->type != GDK_BUTTON_PRESS) + return FALSE; - return TRUE; + mbutton = event->button.button; + + if (mbutton == 1) { + _preview_cover(priv); + } + else if ((mbutton == 3) && (event->button.state & GDK_SHIFT_MASK)) { + /* Right mouse button clicked and shift pressed. + * Go straight to edit details window + */ + AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); + GList *tracks = item->tracks; + gtkpod_edit_details(tracks); + } + else if (mbutton == 3) { + /* Right mouse button clicked on its own so display + * popup menu + */ + clarity_context_menu_init(ccanvas); + } + + return FALSE; } /** @@ -154,7 +194,7 @@ static void clarity_canvas_init(ClarityCanvas *self) { clutter_actor_set_reactive(priv->container, TRUE); priv->preview_signal = g_signal_connect (self, "button-press-event", - G_CALLBACK (_preview_cover_cb), + G_CALLBACK (_on_main_cover_image_clicked_cb), priv); clutter_container_add(CLUTTER_CONTAINER(priv->container), priv->title_text, priv->artist_text, NULL); @@ -661,3 +701,52 @@ void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item) { _set_loading_complete(priv, TRUE); } + +/** + * clarity_canvas_set_cover_from_file: + * + * Add a cover to the displayed track by setting it from a + * picture file. + * + */ +void clarity_canvas_set_cover_from_file(ClarityCanvas *self) { + g_return_if_fail(self); + + ClarityCanvasPrivate *priv = CLARITY_CANVAS_GET_PRIVATE(self); + + gchar *filename; + Track *track; + GList *tracks; + + filename = fileselection_get_cover_filename(); + + if (filename) { + AlbumItem *item = album_model_get_item_with_index(priv->model, priv->curr_index); + tracks = g_list_copy(item->tracks); + + while (tracks) { + track = tracks->data; + + if (gp_track_set_thumbnails(track, filename)) { + ExtraTrackData *etd; + etd = track->userdata; + etd->tartwork_changed = TRUE; + + gtkpod_track_updated(track); + data_changed(track->itdb); + + etd->tartwork_changed = FALSE; + } + + tracks = tracks->next; + } + } + + g_free(filename); +} + +void on_clarity_set_cover_menuitem_activate(GtkMenuItem *mi, gpointer data) { + g_return_if_fail(CLARITY_IS_CANVAS(data)); + + clarity_canvas_set_cover_from_file(CLARITY_CANVAS(data)); +} diff --git a/plugins/clarity/clarity_canvas.h b/plugins/clarity/clarity_canvas.h index 3a1a691..23561fa 100644 --- a/plugins/clarity/clarity_canvas.h +++ b/plugins/clarity/clarity_canvas.h @@ -92,6 +92,17 @@ void clarity_canvas_add_album_item(ClarityCanvas *self, AlbumItem *item); void clarity_canvas_remove_album_item(ClarityCanvas *self, AlbumItem *item); +/** + * clarity_canvas_set_cover_from_file: + * + * Add a cover to the displayed track by setting it from a + * picture file. + * + */ +void clarity_canvas_set_cover_from_file(ClarityCanvas *self); + +void on_clarity_set_cover_menuitem_activate(GtkMenuItem *mi, gpointer data); + G_END_DECLS #endif /* CLARITY_CANVAS_H_ */ diff --git a/plugins/clarity/clarity_context_menu.c b/plugins/clarity/clarity_context_menu.c index aeea9ea..a863d9d 100644 --- a/plugins/clarity/clarity_context_menu.c +++ b/plugins/clarity/clarity_context_menu.c @@ -34,47 +34,33 @@ #include "libgtkpod/context_menus.h" #include "libgtkpod/misc.h" #include "clarity_context_menu.h" +#include "clarity_canvas.h" -//static GtkWidget *add_get_cover_from_file(GtkWidget *menu) { -// return hookup_menu_item(menu, _("Select Cover From File"), GTK_STOCK_FLOPPY, G_CALLBACK (clarity_set_cover_from_file), NULL); -//} -// -///* -// * display the dialog with the full size cd artwork cover -// * @mi - the menu item selected -// * @data - Ignored, should be NULL -// */ -//static void display_track_artwork(GtkMenuItem *mi, gpointer data) { -// if (gtkpod_get_selected_tracks()) -// clarity_display_big_artwork(gtkpod_get_selected_tracks()); -//} -// -//static GtkWidget *add_display_big_coverart(GtkWidget *menu) { -// return hookup_menu_item(menu, _("View Full Size Artwork"), GTK_STOCK_FULLSCREEN, G_CALLBACK (display_track_artwork), NULL); -//} -// -///** -// * cad_context_menu_init - initialize the right click menu for coverart display -// */ -//void cad_context_menu_init(void) { -// if (widgets_blocked) -// return; -// -// GtkWidget *menu = NULL; -// -// if (gtkpod_get_selected_tracks()) { -// menu = gtk_menu_new(); -// -// add_get_cover_from_file(menu); -// add_display_big_coverart(menu); -// add_edit_track_details(menu); -// -// /* -// * button should be button 0 as per the docs because we're calling -// * from a button release event -// */ -// if (menu) { -// gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); -// } -// } -//} +static GtkWidget *add_get_cover_from_file(GtkWidget *menu, ClarityCanvas *ccanvas) { + return hookup_menu_item(menu, _("Select Cover From File"), GTK_STOCK_FLOPPY, G_CALLBACK (on_clarity_set_cover_menuitem_activate), ccanvas); +} + +/** + * clarity_context_menu_init - initialize the right click menu for clarity + */ +void clarity_context_menu_init(ClarityCanvas *ccanvas) { + if (widgets_blocked) + return; + + GtkWidget *menu = NULL; + + if (gtkpod_get_selected_tracks()) { + menu = gtk_menu_new(); + + add_get_cover_from_file(menu, ccanvas); + add_edit_track_details(menu); + + /* + * button should be button 0 as per the docs because we're calling + * from a button release event + */ + if (menu) { + gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time()); + } + } +} diff --git a/plugins/clarity/clarity_context_menu.h b/plugins/clarity/clarity_context_menu.h index a2b4606..ce38587 100644 --- a/plugins/clarity/clarity_context_menu.h +++ b/plugins/clarity/clarity_context_menu.h @@ -26,12 +26,14 @@ | */ -#ifndef COVER_DISPLAY_CONTEXT_MENU_H_ -#define COVER_DISPLAY_CONTEXT_MENU_H_ +#ifndef CLARITY_CONTEXT_MENU_H_ +#define CLARTIY_CONTEXT_MENU_H_ + +#include "clarity_canvas.h" /** - * cad_context_menu_init - initialize the right click menu for coverart display + * clarity_context_menu_init - initialize the right click menu for clarity */ -void cad_context_menu_init(void); +void clarity_context_menu_init(ClarityCanvas *ccanvas); -#endif /* COVER_DISPLAY_CONTEXT_MENU_H_ */ +#endif /* CLARITY_CONTEXT_MENU_H_ */ diff --git a/plugins/clarity/clarity_widget.c b/plugins/clarity/clarity_widget.c index ca50d74..2bccbaf 100644 --- a/plugins/clarity/clarity_widget.c +++ b/plugins/clarity/clarity_widget.c @@ -541,72 +541,66 @@ void clarity_widget_track_updated_cb(GtkPodApp *app, gpointer tk, gpointer data) if (clarity_canvas_is_loading(ccanvas)) return; - AlbumItem *item; - gboolean findremove = FALSE; + AlbumItem *item = NULL; gint index = album_model_get_index_with_track(priv->album_model, track); - if (index == -1) { - /* The track's key could not be found according to the track! - * The ONLY way this could happen is if the user changed the - * components of the track's key. Well it should be rare but the only - * way to remove it from its "old" album item is to search each one - */ - findremove = TRUE; - } - else { - /* Track has a valid key so can get the album back. + if (index > -1) { + /* + * Track has a valid key so can get the album back. * Either has happened: * a) Artist/Album key has been changed so the track is being moved * to another existing album - * b) Some other change has occurred that is irrelevant to this code. + * b) Artwork has been updated + * c) Some other change has occurred that is irrelevant to this code. * * To determine if a) is the case need to determine whether track exists - * in the album items track list. If it does then b) is true and nothing - * more is required. + * in the album items track list. If it does then b) or c) is true. */ item = album_model_get_item_with_track(priv->album_model, track); g_return_if_fail (item); index = g_list_index(item->tracks, track); if (index != -1) { - /* Track exists in the album list so ignore the change and return */ + /* + * Track exists in the album list so determine whether + * its artwork is up to date + */ ExtraTrackData *etd; etd = track->userdata; - if (etd->tartwork_changed == TRUE) { - etd->tartwork_changed = FALSE; + if (! etd->tartwork_changed) { + /* + * Artwork is up to date so nothing changed relevant + * to the display. + */ + return; } - - return; } else { - /* Track does not exist in the album list so the artist/album - * key has definitely changed */ - findremove = TRUE; - } - } - - if (findremove) { - /* It has been determined that the track has had its key changed - * and thus a search must be performed to find the "original" album - * that the track belonged to, remove it then add the track to the - * new album. - */ - item = album_model_search_for_track(priv->album_model, track); - /* item represents the album item containing the track */ - if (item) { - g_warning("Item %s %s", item->albumname, item->artist); - - /* The track is in this album so remove it in preparation for - * readding under the new album key + /* + * Track does not exist in the album list so the artist/album + * key has definitely changed so find the old album item the long + * way. */ - _remove_track(priv, item, track); + item = album_model_search_for_track(priv->album_model, track); } + } - /* Create a new album item or find existing album to house the - * "brand new" track + /* item represents the old album item containing the track */ + if (item) { + /* + * The track is in this album so remove it in preparation for + * readding it back either under the same album item but with + * a different cover or under a different album item due to a + * different album key. */ - _add_track(priv, track); + _remove_track(priv, item, track); } + + /* + * Create a new album item or find existing album to house the + * "brand new" track + */ + _add_track(priv, track); } diff --git a/plugins/cover_display/display_coverart.c b/plugins/cover_display/display_coverart.c index c797dff..ad62e06 100644 --- a/plugins/cover_display/display_coverart.c +++ b/plugins/cover_display/display_coverart.c @@ -949,8 +949,7 @@ void coverart_track_changed(Track *track, gint signal) { /* Track exists in the album list so ignore the change and return */ ExtraTrackData *etd; etd = track->userdata; - if (etd->tartwork_changed == TRUE) { - etd->tartwork_changed = FALSE; + if (etd->tartwork_changed) { redraw(TRUE); } diff --git a/plugins/details_editor/details.c b/plugins/details_editor/details.c index 4e0b48c..91087ef 100644 --- a/plugins/details_editor/details.c +++ b/plugins/details_editor/details.c @@ -354,6 +354,7 @@ static void details_button_apply_clicked(GtkButton *button) { changed |= tr_changed; etr->tchanged = FALSE; + etr->tartwork_changed = FALSE; } } |