foobar2000 SDK  2015-08-03
library_manager.h
Go to the documentation of this file.
1 
7 class NOVTABLE library_manager : public service_base {
8  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(library_manager);
9 public:
11  class NOVTABLE enum_callback {
12  public:
14  virtual bool on_item(const metadb_handle_ptr & p_item) = 0;
15  };
16 
18  virtual bool is_item_in_library(const metadb_handle_ptr & p_item) = 0;
20  virtual bool is_item_addable(const metadb_handle_ptr & p_item) = 0;
22  virtual bool is_path_addable(const char * p_path) = 0;
25  virtual bool get_relative_path(const metadb_handle_ptr & p_item,pfc::string_base & p_out) = 0;
27  virtual void enum_items(enum_callback & p_callback) = 0;
28 protected:
30  __declspec(deprecated) virtual void add_items(const pfc::list_base_const_t<metadb_handle_ptr> & p_data) = 0;
32  __declspec(deprecated) virtual void remove_items(const pfc::list_base_const_t<metadb_handle_ptr> & p_data) = 0;
34  __declspec(deprecated) virtual void add_items_async(const pfc::list_base_const_t<metadb_handle_ptr> & p_data) = 0;
35 
37  __declspec(deprecated) virtual void on_files_deleted_sorted(const pfc::list_base_const_t<const char *> & p_data) = 0;
38 public:
40  virtual void get_all_items(pfc::list_base_t<metadb_handle_ptr> & p_out) = 0;
41 
43  virtual bool is_library_enabled() = 0;
45  virtual void show_preferences() = 0;
46 
48  virtual void rescan() = 0;
49 
50 protected:
52  __declspec(deprecated) virtual void check_dead_entries(const pfc::list_base_t<metadb_handle_ptr> & p_list) = 0;
53 public:
54 
55 
56 };
57 
59 class NOVTABLE library_manager_v2 : public library_manager {
60  FB2K_MAKE_SERVICE_INTERFACE(library_manager_v2,library_manager);
61 protected:
63  __declspec(deprecated) virtual bool is_rescan_running() = 0;
64 
66  __declspec(deprecated) virtual void rescan_async(HWND p_parent,completion_notify_ptr p_notify) = 0;
67 
69  __declspec(deprecated) virtual void check_dead_entries_async(const pfc::list_base_const_t<metadb_handle_ptr> & p_list,HWND p_parent,completion_notify_ptr p_notify) = 0;
70 
71 
72 };
73 
74 
75 class NOVTABLE library_callback_dynamic {
76 public:
78  virtual void on_items_added(const pfc::list_base_const_t<metadb_handle_ptr> & p_data) = 0;
80  virtual void on_items_removed(const pfc::list_base_const_t<metadb_handle_ptr> & p_data) = 0;
82  virtual void on_items_modified(const pfc::list_base_const_t<metadb_handle_ptr> & p_data) = 0;
83 };
84 
86 class NOVTABLE library_manager_v3 : public library_manager_v2 {
87 public:
90  virtual bool get_new_file_pattern_tracks(pfc::string_base & p_directory,pfc::string_base & p_format) = 0;
93  virtual bool get_new_file_pattern_images(pfc::string_base & p_directory,pfc::string_base & p_format) = 0;
94 
95  virtual void register_callback(library_callback_dynamic * p_callback) = 0;
96  virtual void unregister_callback(library_callback_dynamic * p_callback) = 0;
97 
99 };
100 
102 public:
105 
106  //stub implementations - avoid pure virtual function call issues
110 
111  PFC_CLASS_NOT_COPYABLE_EX(library_callback_dynamic_impl_base);
112 };
113 
116 class NOVTABLE library_callback : public service_base {
117 public:
119  virtual void on_items_added(const pfc::list_base_const_t<metadb_handle_ptr> & p_data) = 0;
121  virtual void on_items_removed(const pfc::list_base_const_t<metadb_handle_ptr> & p_data) = 0;
123  virtual void on_items_modified(const pfc::list_base_const_t<metadb_handle_ptr> & p_data) = 0;
124 
125  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(library_callback);
126 };
127 
128 template<typename T>
130 
133 class NOVTABLE library_viewer : public service_base {
134 public:
136  virtual GUID get_preferences_page() = 0;
138  virtual bool have_activate() = 0;
140  virtual void activate() = 0;
142  virtual GUID get_guid() = 0;
144  virtual const char * get_name() = 0;
145 
146  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(library_viewer);
147 };
148 
149 template<typename T>
151 
152 
153 
154 
158 class NOVTABLE library_search_ui : public service_base {
159 public:
160  virtual void show(const char * query) = 0;
161 
162  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(library_search_ui)
163 };
164 
166 class NOVTABLE library_file_move_scope : public service_base {
167  FB2K_MAKE_SERVICE_INTERFACE(library_file_move_scope, service_base)
168 public:
169 };
170 
172 class NOVTABLE library_file_move_manager : public service_base {
173  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(library_file_move_manager)
174 public:
175  virtual library_file_move_scope::ptr acquire_scope() = 0;
176  virtual bool is_move_in_progress() = 0;
177 };
178 
181 public:
182  virtual void on_state_change(bool isMoving) = 0;
183 };
184 
187  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(library_file_move_notify)
188 public:
189 };
190 
191 
193 class NOVTABLE library_meta_autocomplete : public service_base {
194  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(library_meta_autocomplete)
195 public:
196  virtual bool get_value_list(const char * metaName, pfc::com_ptr_t<IUnknown> & out) = 0;
197 };
Definition: pfc.h:71
Implement this service to appear on "library viewers" list in Media Library preferences page...
Interface for use with library_manager::enum_items().
__declspec(dllexport) foobar2000_client *_cdecl foobar2000_get_interface(foobar2000_api *p_api
Callback service receiving notifications about Media Library content changes. Methods called only fro...
void on_items_modified(metadb_handle_list_cref p_data)
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Definition: service.h:333
FB2K_MAKE_SERVICE_INTERFACE(library_manager_v2, library_manager)
void on_items_added(metadb_handle_list_cref p_data)
void on_items_removed(metadb_handle_list_cref p_data)
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
Definition: service.h:533