7 virtual GUID get_guid() = 0;
8 virtual GUID get_parent() = 0;
9 virtual void reset() = 0;
10 virtual double get_sort_priority() = 0;
18 template<
typename outptr>
static bool g_find_t(outptr & out,
const GUID &
id) {
20 if (!g_find(temp,
id))
return false;
21 return temp->service_query_t(out);
25 static const GUID guid_branch_tagging,guid_branch_decoding,
guid_branch_tools,guid_branch_playback,guid_branch_display;
42 virtual bool get_state() = 0;
43 virtual void set_state(
bool p_state) = 0;
44 virtual bool is_radio() = 0;
46 bool get_default_state_();
54 virtual bool get_default_state() = 0;
63 virtual void set_state(
const char * p_string,
t_size p_length = ~0) = 0;
69 flag_is_integer = 1 << 0,
70 flag_is_signed = 1 << 1,
89 advconfig_branch_impl(
const char * p_name,
const GUID & p_guid,
const GUID & p_parent,
double p_priority) : m_name(p_name), m_guid(p_guid), m_parent(p_parent), m_priority(p_priority) {}
103 template<
bool p_is_radio = false, u
int32_t prefFlags = 0>
107 : m_name(p_name), m_initialstate(p_initialstate), m_state(p_guid,p_initialstate), m_parent(p_parent), m_priority(p_priority) {}
112 void reset() {m_state = m_initialstate;}
139 template<
bool p_is_radio, u
int32_t prefFlags = 0>
145 bool get()
const {
return this->get_static_instance().
get_state_();}
146 void set(
bool val) {this->get_static_instance().set_state(val);}
147 operator bool()
const {
return get();}
161 : m_name(p_name), m_parent(p_parent), m_priority(p_priority), m_initialstate(p_initialstate), m_state(p_guid,p_initialstate), m_prefFlags(p_prefFlags) {}
188 void set(
const char * in) {get_static_instance().set_state(in);}
196 : m_name(p_name), m_parent(p_parent), m_priority(p_priority), m_initval(p_initialstate), m_min(p_min), m_max(p_max), m_state(p_guid,p_initialstate), m_prefFlags(p_prefFlags) {}
233 void set(
t_uint64 val) {get_static_instance().set_state_int(val);}
243 virtual t_size get_value_count() = 0;
245 virtual t_size get_state() = 0;
246 virtual void set_state(
t_size p_value) = 0;
258 : m_name(p_name), m_parent(p_parent), m_priority(p_priority), m_initialstate(p_initialstate), m_state(p_guid,p_initialstate), m_prefFlags(p_prefFlags) {}
264 m_state = m_initialstate;
273 m_state.set_string(p_string,p_length);
294 void set(
const char * in) {get_static_instance().set_state(in);}
t_uint32 get_preferences_flags()
void ensure_main_thread()
Triggers a bug check if the calling thread is not the main app thread.
static const GUID guid_root
advconfig_branch_factory(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority)
Standard implementation of advconfig_branch. Usage: no need to use this class directly - use advconf...
const pfc::string8 m_name
advconfig_entry_string_impl(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority, const char *p_initialstate, t_uint32 p_prefFlags)
t_uint32 get_preferences_flags()
advconfig_checkbox_factory_t(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority, bool p_initialstate)
const t_uint32 m_prefFlags
const pfc::string8 m_name
double get_sort_priority()
advconfig_checkbox_factory_t< false > advconfig_checkbox_factory
Service factory helper around standard advconfig_entry_checkbox implementation, specialized for check...
Service factory helper around standard advconfig_entry_checkbox implementation. Use this class to reg...
const bool m_initialstate
t_uint32 get_preferences_flags()
void set_state_int(t_uint64 val)
Creates a new branch in Advanced Preferences. Implementation: see advconfig_branch_impl / advconfig_...
void set_state(bool p_state)
double get_sort_priority()
advconfig_entry_checkbox_impl(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority, bool p_initialstate)
Entrypoint class for adding items to Advanced Preferences page. Implementations must derive from one...
t_uint32 get_preferences_flags()
advconfig_entry_integer_impl(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority, t_uint64 p_initialstate, t_uint64 p_min, t_uint64 p_max, t_uint32 p_prefFlags)
FB2K_MAKE_SERVICE_INTERFACE(advconfig_entry_string, advconfig_entry)
Not currently used, reserved for future use.
virtual FB2K_MAKE_SERVICE_INTERFACE(advconfig_entry_checkbox_v2, advconfig_entry_checkbox) public t_uint32 get_preferences_flags()
double get_sort_priority()
bool get_default_state_() const
static bool g_find_t(outptr &out, const GUID &id)
const pfc::string8 m_name
const t_uint32 m_prefFlags
double get_sort_priority()
static bool g_find(service_ptr_t< advconfig_entry > &out, const GUID &id)
const t_uint32 m_prefFlags
void get_default_state(pfc::string_base &out)
Standard implementation of advconfig_entry_checkbox. p_is_radio parameter controls whether we're imp...
double get_sort_priority()
advconfig_string_factory(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority, const char *p_initialstate, t_uint32 p_prefFlags=0)
Special advconfig_entry_string implementation - implements integer entries. Use advconfig_integer_fac...
FB2K_MAKE_SERVICE_INTERFACE(advconfig_entry_checkbox, advconfig_entry)
t_uint64 atoui64_ex(const char *src, t_size len)
Service factory helper around standard advconfig_entry_string implementation. Use this class to regis...
void set_state(const char *p_string, t_size p_length)
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
advconfig_integer_factory(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority, t_uint64 p_initialstate, t_uint64 p_min, t_uint64 p_max, t_uint32 p_prefFlags=0)
advconfig_checkbox_factory_t< true > advconfig_radio_factory
Service factory helper around standard advconfig_entry_checkbox implementation, specialized for radio...
void validate(pfc::string_base &val)
String config variable. Stored in the stream with int32 header containing size in bytes...
Service factory helper around integer-specialized advconfig_entry_string implementation. Use this class to register your own integer entries in Advanced Preferences. Usage: static advconfig_integer_factory myint(name, itemID, parentID, priority, initialValue, minValue, maxValue);.
t_uint64 get_state_int() const
void set_state(const char *p_string, t_size p_length=~0)
void set_state(const char *p_string, t_size p_length=~0)
Service factory helper around standard advconfig_branch implementation. Use this class to register yo...
Creates a string/integer editbox entry in Advanced Preferences. Implementation: see advconfig_entry_s...
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
void get_default_state(pfc::string_base &out)
Creates a checkbox/radiocheckbox entry in Advanced Preferences. The difference between checkboxes an...
void get_default_state(pfc::string_base &out)
void get_state(pfc::string_base &p_out)
void get_name(pfc::string_base &p_out)
cfg_int_t< t_uint64 > m_state
void get_name(pfc::string_base &p_out)
void get_name(pfc::string_base &p_out)
void get_state(pfc::string_base &p_out)
advconfig_entry_string_impl_MT(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority, const char *p_initialstate, t_uint32 p_prefFlags)
Special version if advconfig_entry_string_impl that allows the value to be retrieved from worker thre...
void get_name(pfc::string_base &p_out)
t_uint64 operator=(t_uint64 val)
virtual FB2K_MAKE_SERVICE_INTERFACE(advconfig_entry_string_v2, advconfig_entry_string) public void validate(pfc::string_base &val)
Special version if advconfig_string_factory that allows the value to be retrieved from worker threads...
advconfig_branch_impl(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority)
bool next(service_ptr_t< t_query > &p_out)
void get_state(pfc::string_base &p_out)
static const GUID guid_branch_tools
Standard advconfig_entry_string implementation. Use advconfig_string_factory to register your own str...
virtual t_uint32 get_preferences_flags()
void get_name(pfc::string_base &p_out)
advconfig_string_factory_MT(const char *p_name, const GUID &p_guid, const GUID &p_parent, double p_priority, const char *p_initialstate, t_uint32 p_prefFlags=0)