diff options
author | waker <wakeroid@gmail.com> | 2011-05-19 21:20:56 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-05-19 21:20:56 +0200 |
commit | c8dbc585400905a78a94834facfa283ce1ee4708 (patch) | |
tree | 5b44d50c9579820d4b7981dbfc85039c59feb8b5 | |
parent | 619bad2797e4a12aa9eef60373124a63c000968f (diff) |
send trackinfochanged after changing track metadata
-rw-r--r-- | plugins/gtkui/gtkui.c | 14 | ||||
-rw-r--r-- | plugins/gtkui/gtkui.h | 3 | ||||
-rw-r--r-- | plugins/gtkui/trkproperties.c | 7 |
3 files changed, 19 insertions, 5 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 62c0b8fd..1f85e38d 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -413,9 +413,8 @@ trackinfochanged_wrapper (DdbListview *playlist, DB_playItem_t *track, int iter) } } -static gboolean -trackinfochanged_cb (gpointer data) { - DB_playItem_t *track = (DB_playItem_t *)data; +void +gtkui_trackinfochanged (DB_playItem_t *track) { GtkWidget *playlist = lookup_widget (mainwin, "playlist"); trackinfochanged_wrapper (DDB_LISTVIEW (playlist), track, PL_MAIN); @@ -431,8 +430,13 @@ trackinfochanged_cb (gpointer data) { if (curr) { deadbeef->pl_item_unref (curr); } - if (track) { - deadbeef->pl_item_unref (track); +} + +static gboolean +trackinfochanged_cb (gpointer data) { + gtkui_trackinfochanged (data); + if (data) { + deadbeef->pl_item_unref ((DB_playItem_t *)data); } return FALSE; } diff --git a/plugins/gtkui/gtkui.h b/plugins/gtkui/gtkui.h index 073262c5..e2ed8dbf 100644 --- a/plugins/gtkui/gtkui.h +++ b/plugins/gtkui/gtkui.h @@ -169,4 +169,7 @@ gtkui_setup_gui_refresh (); int gtkui_get_curr_playlist_mod (void); +void +gtkui_trackinfochanged (DB_playItem_t *it); + #endif diff --git a/plugins/gtkui/trkproperties.c b/plugins/gtkui/trkproperties.c index 9e9ffb2a..8dc5302d 100644 --- a/plugins/gtkui/trkproperties.c +++ b/plugins/gtkui/trkproperties.c @@ -582,6 +582,13 @@ on_write_tags_clicked (GtkButton *button, gtk_tree_model_foreach (model, set_metadata_cb, NULL); deadbeef->pl_unlock (); + for (int i = 0; i < numtracks; i++) { + ddb_event_track_t *ev = (ddb_event_track_t *)deadbeef->event_alloc (DB_EV_TRACKINFOCHANGED); + ev->track = tracks[i]; + deadbeef->pl_item_ref (ev->track); + deadbeef->event_send ((ddb_event_t*)ev, 0, 0); + } + progress_aborted = 0; progressdlg = create_progressdlg (); gtk_window_set_title (GTK_WINDOW (progressdlg), _("Writing tags...")); |