foobar2000 SDK  2015-08-03
track_property.h
Go to the documentation of this file.
1 class NOVTABLE track_property_callback {
3 public:
9  virtual void set_property(const char * p_group,double p_sortpriority,const char * p_name,const char * p_value) = 0;
10 protected:
13 };
14 
16 public:
17  virtual bool is_group_wanted(const char * p_group) = 0;
18 protected:
20 };
21 
23 class NOVTABLE track_property_provider : public service_base {
24 public:
28  virtual void enumerate_properties(metadb_handle_list_cref p_tracks, track_property_callback & p_out) = 0;
32  virtual bool is_our_tech_info(const char * p_name) = 0;
33 
34  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(track_property_provider);
35 };
36 
38  FB2K_MAKE_SERVICE_INTERFACE(track_property_provider_v2,track_property_provider)
39 public:
40  virtual void enumerate_properties_v2(metadb_handle_list_cref p_tracks, track_property_callback_v2 & p_out) = 0;
41 };
42 
44 public:
45  virtual metadb_info_container::ptr get_info(size_t index) = 0;
46 };
47 
49 public:
51  metadb_info_container::ptr get_info(size_t index) {return m_items[index]->get_info_ref();}
52 private:
54 };
55 
57 public:
58  track_property_callback_v2_proxy(track_property_callback & callback) : m_callback(callback) {}
59  void set_property(const char * p_group,double p_sortpriority,const char * p_name,const char * p_value) {m_callback.set_property(p_group, p_sortpriority, p_name, p_value);}
60  bool is_group_wanted(const char*) {return true;}
61 
62 private:
64 };
65 
68  FB2K_MAKE_SERVICE_INTERFACE(track_property_provider_v3,track_property_provider_v2)
69 public:
70  virtual void enumerate_properties_v3(metadb_handle_list_cref items, track_property_provider_v3_info_source & info, track_property_callback_v2 & callback) = 0;
71 
72  void enumerate_properties(metadb_handle_list_cref p_tracks, track_property_callback & p_out) {track_property_provider_v3_info_source_impl src(p_tracks); track_property_callback_v2_proxy cb(p_out); enumerate_properties_v3(p_tracks, src, cb);}
73  void enumerate_properties_v2(metadb_handle_list_cref p_tracks, track_property_callback_v2 & p_out) {track_property_provider_v3_info_source_impl src(p_tracks); enumerate_properties_v3(p_tracks, src, p_out);}
74 };
75 
76 template<typename T>
track_property_callback & m_callback
Callback interface for track_property_provider::enumerate_properties().
Definition: track_property.h:2
void info(const char *p_message)
Definition: console.cpp:4
void enumerate_properties_v2(metadb_handle_list_cref p_tracks, track_property_callback_v2 &p_out)
track_property_callback_v2_proxy(track_property_callback &callback)
metadb_info_container::ptr get_info(size_t index)
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Definition: service.h:333
track_property_callback const & operator=(track_property_callback const &)
track_property_provider_v3_info_source_impl(metadb_handle_list_cref items)
Service for adding custom entries in "Properties" tab of the properties dialog.
FB2K_MAKE_SERVICE_INTERFACE(track_property_provider_v3, track_property_provider_v2) public void enumerate_properties(metadb_handle_list_cref p_tracks, track_property_callback &p_out)
Enumerates properties of specified track list.
bool is_group_wanted(const char *)
void set_property(const char *p_group, double p_sortpriority, const char *p_name, const char *p_value)
Sets a property list entry to display. Called by track_property_provider::enumerate_properties() impl...