diff options
author | wm4 <wm4@nowhere> | 2014-02-15 16:49:28 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-16 03:51:02 +0100 |
commit | 801de5ac6d16ba87143ff42fe218558ebc37efd3 (patch) | |
tree | 370c7244189afeeda1d769063a0a672e22807301 /options/m_property.h | |
parent | 486658e5c75a036e1b9eea953021c46d7ecc6b85 (diff) | |
download | mpv-801de5ac6d16ba87143ff42fe218558ebc37efd3.tar.bz2 mpv-801de5ac6d16ba87143ff42fe218558ebc37efd3.tar.xz |
m_property: add a mechanism to organize a list of sub-properties
This automatically adds a "count" sub-property, and for each entry in
the range [0, count), a numbered sub-property to access the item.
Diffstat (limited to 'options/m_property.h')
-rw-r--r-- | options/m_property.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/options/m_property.h b/options/m_property.h index cb9f8b5a25..460f8a986c 100644 --- a/options/m_property.h +++ b/options/m_property.h @@ -167,4 +167,16 @@ struct m_sub_property { int m_property_read_sub(const struct m_sub_property *props, int action, void *arg); + +// Used with m_property_read_list(). +// Get an entry. item is the 0-based index of the item. This behaves like a +// top-level property request (but you must implement M_PROPERTY_GET_TYPE). +// item will be in range [0, count), for count see m_property_read_list() +// action, arg are for property access. +// ctx is userdata passed to m_property_read_list. +typedef int (*m_get_item_cb)(int item, int action, void *arg, void *ctx); + +int m_property_read_list(int action, void *arg, int count, + m_get_item_cb get_item, void *ctx); + #endif /* MPLAYER_M_PROPERTY_H */ |