Commit 04e363a9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

plugin: use separate description command for lists and list callbacks

parent b8a57f96
...@@ -91,13 +91,19 @@ enum vlc_module_properties ...@@ -91,13 +91,19 @@ enum vlc_module_properties
VLC_CONFIG_DESC, VLC_CONFIG_DESC,
/* description (args=const char *, const char *, const char *) */ /* description (args=const char *, const char *, const char *) */
VLC_CONFIG_LIST, VLC_CONFIG_LIST_OBSOLETE,
/* possible values list /* unused (ignored) */
* (args=const char *, size_t, const <type> *, const char *const *) */
VLC_CONFIG_ADD_ACTION_OBSOLETE, VLC_CONFIG_ADD_ACTION_OBSOLETE,
/* unused (ignored) */ /* unused (ignored) */
VLC_CONFIG_LIST,
/* list of suggested values
* (args=size_t, const <type> *, const char *const *) */
VLC_CONFIG_LIST_CB,
/* callback for suggested values (args=size_t (*)(<type> **, char ***)) */
/* Insert new VLC_CONFIG_* here */ /* Insert new VLC_CONFIG_* here */
}; };
...@@ -473,18 +479,16 @@ VLC_METADATA_EXPORTS ...@@ -473,18 +479,16 @@ VLC_METADATA_EXPORTS
vlc_config_set (VLC_CONFIG_LIST, \ vlc_config_set (VLC_CONFIG_LIST, \
(size_t)(sizeof (list) / sizeof (char *)), \ (size_t)(sizeof (list) / sizeof (char *)), \
(const char *const *)(list), \ (const char *const *)(list), \
(const char *const *)(list_text), \ (const char *const *)(list_text));
(vlc_callback_t)NULL);
#define change_string_cb( cb ) \ #define change_string_cb( cb ) \
vlc_config_set (VLC_CONFIG_LIST, 0, NULL, NULL, (vlc_callback_t)(cb)); vlc_config_set (VLC_CONFIG_LIST_CB, (cb));
#define change_integer_list( list, list_text ) \ #define change_integer_list( list, list_text ) \
vlc_config_set (VLC_CONFIG_LIST, \ vlc_config_set (VLC_CONFIG_LIST, \
(size_t)(sizeof (list) / sizeof (int)), \ (size_t)(sizeof (list) / sizeof (int)), \
(const int *)(list), \ (const int *)(list), \
(const char *const *)(list_text), \ (const char *const *)(list_text));
(vlc_callback_t)(NULL));
#define change_integer_range( minv, maxv ) \ #define change_integer_range( minv, maxv ) \
vlc_config_set (VLC_CONFIG_RANGE, (int64_t)(minv), (int64_t)(maxv)); vlc_config_set (VLC_CONFIG_RANGE, (int64_t)(minv), (int64_t)(maxv));
......
...@@ -417,12 +417,14 @@ static int vlc_plugin_setter (void *plugin, void *tgt, int propid, ...) ...@@ -417,12 +417,14 @@ static int vlc_plugin_setter (void *plugin, void *tgt, int propid, ...)
dtext[len] = NULL; dtext[len] = NULL;
} }
item->ppsz_list_text = dtext; item->ppsz_list_text = dtext;
item->i_list = len; item->i_list = len;
item->pf_update_list = va_arg (ap, vlc_callback_t);
break; break;
} }
case VLC_CONFIG_LIST_CB:
item->pf_update_list = va_arg (ap, vlc_callback_t);
break;
default: default:
fprintf (stderr, "LibVLC: unknown module property %d\n", propid); fprintf (stderr, "LibVLC: unknown module property %d\n", propid);
fprintf (stderr, "LibVLC: too old to use this module?\n"); fprintf (stderr, "LibVLC: too old to use this module?\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment