diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-06 19:27:21 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-06 19:27:21 +0200 |
commit | 80f7aa0cfe21fc2715af029cc5bea6e8b4e18a5f (patch) | |
tree | 9df38c9c686e3f803fdb74492f89677b2ea8704a /plugins.c | |
parent | 40522448588f63d6d72ef775e0340b7fae548a05 (diff) |
added auto-saving config/playlist files
Diffstat (limited to 'plugins.c')
-rw-r--r-- | plugins.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -147,6 +147,8 @@ static DB_functions_t deadbeef_api = { .pl_clear = pl_clear, .pl_load = pl_load, .pl_save = pl_save, + .pl_save_current = pl_save_current, + .pl_save_all = pl_save_all, .pl_select_all = pl_select_all, .pl_crop_selected = pl_crop_selected, .pl_getselcount = pl_getselcount, @@ -230,6 +232,7 @@ static DB_functions_t deadbeef_api = { .conf_set_float = conf_set_float, .conf_find = conf_find, .conf_remove_items = conf_remove_items, + .conf_save = conf_save, // plugin communication .plug_get_decoder_list = plug_get_decoder_list, .plug_get_output_list = plug_get_output_list, @@ -422,11 +425,17 @@ plug_event_call (DB_event_t *ev) { ev->time = time (NULL); // printf ("plug_event_call enter %d\n", ev->event); mutex_lock (mutex); + for (int i = 0; i < MAX_HANDLERS; i++) { if (handlers[ev->event][i].plugin && !handlers[ev->event][i].plugin->inactive) { handlers[ev->event][i].callback (ev, handlers[ev->event][i].data); } } +// if (ev->event == DB_EV_PLAYLISTSWITCH) { +// printf ("DB_EV_PLAYLISTSWITCH %d %d\n", plt_get_curr (), conf_get_int ("playlist.current", 0)); +// pl_save_current (); +// } + mutex_unlock (mutex); // printf ("plug_event_call leave %d\n", ev->event); } |