summaryrefslogtreecommitdiff
path: root/plugins/vorbis/vorbis.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-04-16 21:01:37 +0200
committerGravatar waker <wakeroid@gmail.com>2011-04-16 21:01:37 +0200
commit1416dfbf622b443c309e299e0b1efd01646c8b37 (patch)
tree4794b0edfff95bce654f253b586c9aaa4e970e7f /plugins/vorbis/vorbis.c
parentd804aaaad0df4a532cfe397b5190f833837257b9 (diff)
get rid of some legacy events;
update playlist grouping on metadata changes
Diffstat (limited to 'plugins/vorbis/vorbis.c')
-rw-r--r--plugins/vorbis/vorbis.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c
index 691e40f3..27275eec 100644
--- a/plugins/vorbis/vorbis.c
+++ b/plugins/vorbis/vorbis.c
@@ -94,7 +94,7 @@ static const char *metainfo[] = {
NULL
};
-// refresh_playlist == 1 means "call plug_trigger_event_playlistchanged if metadata had been changed"
+// refresh_playlist == 1 means "send playlistchanged event if metadata had been changed"
// refresh_playlist == 2 means "don't change memory, just check for changes"
static int
update_vorbis_comments (DB_playItem_t *it, vorbis_comment *vc, int refresh_playlist) {
@@ -165,8 +165,9 @@ update_vorbis_comments (DB_playItem_t *it, vorbis_comment *vc, int refresh_playl
f &= ~DDB_TAG_MASK;
f |= DDB_TAG_VORBISCOMMENTS;
deadbeef->pl_set_item_flags (it, f);
+ deadbeef->plt_modified (deadbeef->plt_get_handle (deadbeef->plt_get_curr ()));
if (refresh_playlist) {
- deadbeef->plug_trigger_event_playlistchanged ();
+ deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0);
}
return 0;
}
@@ -320,7 +321,12 @@ cvorbis_read (DB_fileinfo_t *_info, char *bytes, int size) {
info->last_comment_update = info->currentsample;
vorbis_comment *vc = ov_comment (&info->vorbis_file, -1);
update_vorbis_comments (info->ptrack, vc, 1);
- deadbeef->plug_trigger_event_trackinfochanged (info->ptrack);
+ ddb_event_track_t *ev = (ddb_event_track_t *)deadbeef->event_alloc (DB_EV_TRACKINFOCHANGED);
+ ev->track = info->ptrack;
+ if (ev->track) {
+ deadbeef->pl_item_ref (ev->track);
+ }
+ deadbeef->event_send ((ddb_event_t *)ev, 0, 0);
}
else {
info->ptrack = NULL;