foobar2000 SDK  2015-08-03
config_object.h
Go to the documentation of this file.
1 #ifndef _CONFIG_OBJECT_H_
2 #define _CONFIG_OBJECT_H_
3 
4 class config_object;
5 
7 {
8 public:
9  virtual void on_changed(const service_ptr_t<config_object> & p_object) = 0;
10  static void g_on_changed(const service_ptr_t<config_object> & p_object);
11 
12 
13  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(config_object_notify_manager);
14 };
15 
16 class NOVTABLE config_object : public service_base
17 {
18 public:
19  //interface
20  virtual GUID get_guid() const = 0;
21  virtual void get_data(stream_writer * p_stream,abort_callback & p_abort) const = 0;
22  virtual void set_data(stream_reader * p_stream,abort_callback & p_abort,bool p_sendnotify = true) = 0;
23 
24  //helpers
25  static bool g_find(service_ptr_t<config_object> & p_out,const GUID & p_guid);
26 
27  void set_data_raw(const void * p_data,t_size p_bytes,bool p_sendnotify = true);
28  t_size get_data_raw(void * p_out,t_size p_bytes);
29  t_size get_data_raw_length();
30 
31  template<class T> void get_data_struct_t(T& p_out);
32  template<class T> void set_data_struct_t(const T& p_in);
33  template<class T> static void g_get_data_struct_t(const GUID & p_guid,T & p_out);
34  template<class T> static void g_set_data_struct_t(const GUID & p_guid,const T & p_in);
35 
36  void set_data_string(const char * p_data,t_size p_length);
37  void get_data_string(pfc::string_base & p_out);
38 
39  void get_data_bool(bool & p_out);
40  void set_data_bool(bool p_val);
41  void get_data_int32(t_int32 & p_out);
42  void set_data_int32(t_int32 p_val);
43  bool get_data_bool_simple(bool p_default);
44  t_int32 get_data_int32_simple(t_int32 p_default);
45 
46  static void g_get_data_string(const GUID & p_guid,pfc::string_base & p_out);
47  static void g_set_data_string(const GUID & p_guid,const char * p_data,t_size p_length = ~0);
48 
49  static void g_get_data_bool(const GUID & p_guid,bool & p_out);
50  static void g_set_data_bool(const GUID & p_guid,bool p_val);
51  static void g_get_data_int32(const GUID & p_guid,t_int32 & p_out);
52  static void g_set_data_int32(const GUID & p_guid,t_int32 p_val);
53  static bool g_get_data_bool_simple(const GUID & p_guid,bool p_default);
54  static t_int32 g_get_data_int32_simple(const GUID & p_guid,t_int32 p_default);
55 
56 
57  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(config_object);
58 };
59 
61 {
62 public:
63  static const GUID bool_remember_window_positions, bool_ui_always_on_top,bool_playlist_stop_after_current;
64  static const GUID bool_playback_follows_cursor, bool_cursor_follows_playback;
66  static const GUID string_gui_last_directory_media,string_gui_last_directory_playlists;
68 
69 
72 
73 };
74 
76 {
77 public:
78  virtual t_size get_watched_object_count() = 0;
79  virtual GUID get_watched_object(t_size p_index) = 0;
80  virtual void on_watched_object_changed(const service_ptr_t<config_object> & p_object) = 0;
81 
82  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(config_object_notify);
83 };
84 
85 #endif // _CONFIG_OBJECT_H_
static const GUID int32_dynamic_bitrate_display_rate
Definition: config_object.h:67
static const GUID bool_remember_window_positions
Definition: config_object.h:63
Definition: pfc.h:71
static bool g_get_data_bool_simple(const GUID &p_guid, bool p_default)
int32_t t_int32
Definition: int_types.h:4
static const GUID bool_playback_follows_cursor
Definition: config_object.h:64
size_t t_size
Definition: int_types.h:48
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Definition: service.h:333
static bool query_remember_window_positions()
Definition: config_object.h:71
static const GUID bool_ui_always_on_top
Definition: config_object.h:63
static bool query_show_keyboard_shortcuts_in_menus()
Definition: config_object.h:70
static const GUID string_gui_last_directory_playlists
Definition: config_object.h:66
static const GUID bool_show_keyboard_shortcuts_in_menus
Definition: config_object.h:65