diff options
author | Viktor Semykin <thesame.ml@gmail.com> | 2010-05-26 03:42:59 +0300 |
---|---|---|
committer | Viktor Semykin <thesame.ml@gmail.com> | 2010-05-26 03:42:59 +0300 |
commit | a6800830237690618eb454ab331ca6e4bdbd4100 (patch) | |
tree | ca1b2069f87c37f13f210bb053533fa730c2f2da /plugins/cdda | |
parent | 8c012917f5530d947c1a31adfc6aba4b0cf3853c (diff) |
New plugins' actions system
Diffstat (limited to 'plugins/cdda')
-rw-r--r-- | plugins/cdda/cdda.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/cdda/cdda.c b/plugins/cdda/cdda.c index ffe77cc7..8e01458e 100644 --- a/plugins/cdda/cdda.c +++ b/plugins/cdda/cdda.c @@ -532,6 +532,29 @@ cda_stop (void) { return 0; } +static int +cda_action_add_cd (DB_playItem_t *unused, void *data) +{ + deadbeef->pl_add_file ("all.cda", NULL, NULL); + //Wtf? + //playlist_refresh (); +} + +static DB_plugin_action_t add_cd_action = { + .title = "File/Add Audio CD", + .flags = DB_ACTION_COMMON, + .callback = cda_action_add_cd, + .next = NULL +}; + +static int +cda_get_actions (DB_plugin_action_t **actions) +{ + add_cd_action.next = *actions; + *actions = &add_cd_action; + return 1; +} + static const char *exts[] = { "cda", "nrg", NULL }; static const char *filetypes[] = { "cdda", NULL }; @@ -558,6 +581,7 @@ static DB_decoder_t plugin = { .plugin.start = cda_start, .plugin.stop = cda_stop, .plugin.configdialog = settings_dlg, + .plugin.get_actions = cda_get_actions, .open = cda_open, .init = cda_init, .free = cda_free, |