foobar2000 SDK
2015-08-03
|
#include <metadb_handle.h>
Public Member Functions | |
__declspec (deprecated) virtual void metadb_lock()=0 | |
__declspec (deprecated) virtual void metadb_unlock()=0 | |
__declspec (deprecated) virtual bool get_info_locked(const file_info *&p_info) const =0 | |
__declspec (deprecated) virtual bool get_info_async_locked(const file_info *&p_info) const =0 | |
__declspec (deprecated) virtual bool format_title_nonlocking(titleformat_hook *p_hook | |
__declspec (deprecated) virtual void format_title_from_external_info_nonlocking(const file_info &p_info | |
__declspec (deprecated) virtual bool get_browse_info_locked(const file_info *&p_info | |
FB2K_MAKE_SERVICE_INTERFACE (metadb_handle, service_base) | |
virtual bool | format_title (titleformat_hook *p_hook, pfc::string_base &p_out, const service_ptr_t< titleformat_object > &p_script, titleformat_text_filter *p_filter)=0 |
virtual void | format_title_from_external_info (const file_info &p_info, titleformat_hook *p_hook, pfc::string_base &p_out, const service_ptr_t< titleformat_object > &p_script, titleformat_text_filter *p_filter)=0 |
bool | format_title_legacy (titleformat_hook *p_hook, pfc::string_base &out, const char *p_spec, titleformat_text_filter *p_filter) |
virtual bool | get_async_info_ref (metadb_info_container::ptr &outInfo) const =0 |
virtual metadb_info_container::ptr | get_async_info_ref () const =0 |
virtual bool | get_browse_info (file_info &info, t_filetimestamp &ts) const =0 |
bool | get_browse_info_merged (file_info &infoMerged) const |
virtual void | get_browse_info_ref (metadb_info_container::ptr &outInfo, metadb_info_container::ptr &outBrowse) const =0 |
t_filesize | get_filesize () |
virtual t_filestats | get_filestats () const =0 |
t_filetimestamp | get_filetimestamp () |
metadb_info_container::ptr | get_full_info_ref (abort_callback &aborter) const |
virtual bool | get_info (file_info &p_info) const =0 |
virtual bool | get_info_async (file_info &p_info) const =0 |
virtual bool | get_info_ref (metadb_info_container::ptr &outInfo) const =0 |
virtual metadb_info_container::ptr | get_info_ref () const =0 |
double | get_length () |
virtual const playable_location & | get_location () const =0 |
const char * | get_path () const |
t_uint32 | get_subsong_index () const |
virtual bool | is_info_loaded () const =0 |
virtual bool | is_info_loaded_async () const =0 |
bool | should_reload (const t_filestats &p_new_stats, bool p_fresh) const |
Public Member Functions inherited from service_base | |
template<typename outPtr_t > | |
bool | cast (outPtr_t &outPtr) |
virtual int | service_add_ref ()=0 throw () |
virtual bool | service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid) |
template<class T > | |
bool | service_query_t (service_ptr_t< T > &p_out) |
virtual int | service_release ()=0 throw () |
Static Public Member Functions | |
static bool | g_should_reload (const t_filestats &p_old_stats, const t_filestats &p_new_stats, bool p_fresh) |
Data Fields | |
t_filetimestamp &ts | const = 0 |
pfc::string_base const service_ptr_t< titleformat_object > titleformat_text_filter * | p_filter = 0 |
titleformat_hook pfc::string_base const service_ptr_t< titleformat_object > titleformat_text_filter * | p_filter = 0 |
titleformat_hook * | p_hook |
pfc::string_base & | p_out |
titleformat_hook pfc::string_base & | p_out |
pfc::string_base const service_ptr_t< titleformat_object > & | p_script |
titleformat_hook pfc::string_base const service_ptr_t< titleformat_object > & | p_script |
Additional Inherited Members | |
Public Types inherited from service_base | |
typedef service_base | t_interface |
Protected Member Functions inherited from service_base | |
service_base () | |
~service_base () | |
A metadb_handle object represents interface to reference-counted file_info cache entry for the specified location.
To obtain a metadb_handle to specific location, use metadb::handle_create(). To obtain a list of metadb_handle objects corresponding to specific path (directory, playlist, multitrack file, etc), use relevant playlist_incoming_item_filter methods (recommended), or call playlist_loader methods directly.
A metadb_handle is also the most efficient way of passing playable object locations around because it provides fast access to both location and infos, and is reference counted so duplicating it is as fast as possible.
To retrieve a path of a file from a metadb_handle, use metadb_handle::get_path() function. Note that metadb_handle is NOT just file path, some formats support multiple subsongs per physical file, which are signaled using subsong indexes.
Definition at line 19 of file metadb_handle.h.
|
pure virtual |
OBSOLETE, DO NOT CALL.
|
pure virtual |
OBSOLETE, DO NOT CALL.
|
pure virtual |
OBSOLETE, DO NOT CALL.
|
pure virtual |
OBSOLETE, DO NOT CALL.
metadb_handle::__declspec | ( | deprecated | ) |
OBSOLETE, DO NOT CALL.
metadb_handle::__declspec | ( | deprecated | ) | const |
OBSOLETE, DO NOT CALL.
metadb_handle::__declspec | ( | deprecated | ) | const |
OBSOLETE, DO NOT CALL.
metadb_handle::FB2K_MAKE_SERVICE_INTERFACE | ( | metadb_handle | , |
service_base | |||
) |
|
pure virtual |
Renders information about item referenced by this metadb_handle object.
p_hook | Optional callback object overriding fields and functions; set to NULL if not used. |
p_out | String receiving the output on success. |
p_script | Titleformat script to use. Use titleformat_compiler service to create one. |
p_filter | Optional callback object allowing input to be filtered according to context (i.e. removal of linebreak characters present in tags when rendering playlist lines). Set to NULL when not used. |
|
pure virtual |
Renders information about item referenced by this metadb_handle object, using external file_info data.
bool metadb_handle::format_title_legacy | ( | titleformat_hook * | p_hook, |
pfc::string_base & | out, | ||
const char * | p_spec, | ||
titleformat_text_filter * | p_filter | ||
) |
Helper provided for backwards compatibility; takes formatting script as text string and calls relevant titleformat_compiler methods; returns false when the script could not be compiled.
See format_title() for descriptions of parameters.
Bottleneck warning: you should consider using precompiled titleformat script object and calling regular format_title() instead when processing large numbers of items.
Definition at line 19 of file metadb_handle.cpp.
|
static |
Definition at line 32 of file metadb_handle.cpp.
|
pure virtual |
|
pure virtual |
Simplified method, always returns non-null, dummy info if nothing to return.
|
pure virtual |
New in 1.0.
bool metadb_handle::get_browse_info_merged | ( | file_info & | infoMerged | ) | const |
Definition at line 46 of file metadb_handle.cpp.
|
pure virtual |
t_filesize metadb_handle::get_filesize | ( | ) |
Definition at line 14 of file metadb_handle.cpp.
|
pure virtual |
Returns last seen file stats, filestats_invalid if unknown.
t_filetimestamp metadb_handle::get_filetimestamp | ( | ) |
Definition at line 9 of file metadb_handle.cpp.
metadb_info_container::ptr metadb_handle::get_full_info_ref | ( | abort_callback & | aborter | ) | const |
Definition at line 85 of file metadb_handle.cpp.
|
pure virtual |
Queries cached info about item referenced by this metadb_handle object. Returns true on success, false when info is not yet known. Note that this function causes the metadb to be temporarily locked; you can not use it in context that where locking is forbidden.
Note that state of cached info changes only inside main thread, so you can safely assume that it doesn't change while some block of your code inside main thread is being executed.
|
pure virtual |
Queries cached info about item referenced by this metadb_handle object. Returns true on success, false when info is not yet known. Note that this function causes the metadb to be temporarily locked; you can not use it in context that where locking is forbidden.
This is intended for use in special cases when you need to immediately retrieve info sent by metadb_io hint from another thread; state of returned data can be altered by any thread, as opposed to non-async methods.
|
pure virtual |
|
pure virtual |
Simplified method, always returns non-null, dummy info if nothing to return.
double metadb_handle::get_length | ( | ) |
Definition at line 4 of file metadb_handle.cpp.
|
pure virtual |
Retrieves location represented by this metadb_handle object. Returned reference is valid until calling context releases metadb_handle that returned it (metadb_handle_ptr is deallocated etc).
|
inline |
Retrieves path of item described by this metadb_handle instance. Returned string is valid until calling context releases metadb_handle that returned it (metadb_handle_ptr is deallocated etc).
Definition at line 125 of file metadb_handle.h.
|
inline |
Retrieves subsong index of item described by this metadb_handle instance (used for multiple playable tracks within single physical file).
Definition at line 127 of file metadb_handle.h.
|
pure virtual |
Queries whether cached info about item referenced by this metadb_handle object is already available. Note that this function causes the metadb to be temporarily locked; you can not use it in context that where locking is forbidden.
Note that state of cached info changes only inside main thread, so you can safely assume that it doesn't change while some block of your code inside main thread is being executed.
|
pure virtual |
Queries whether cached info about item referenced by this metadb_handle object is already available.
This is intended for use in special cases when you need to immediately retrieve info sent by metadb_io hint from another thread; state of returned data can be altered by any thread, as opposed to non-async methods.
bool metadb_handle::should_reload | ( | const t_filestats & | p_new_stats, |
bool | p_fresh | ||
) | const |
Definition at line 39 of file metadb_handle.cpp.
t_filetimestamp& ts metadb_handle::const = 0 |
Definition at line 75 of file metadb_handle.h.
pfc::string_base const service_ptr_t<titleformat_object> titleformat_text_filter* metadb_handle::p_filter = 0 |
Definition at line 66 of file metadb_handle.h.
titleformat_hook pfc::string_base const service_ptr_t<titleformat_object> titleformat_text_filter* metadb_handle::p_filter = 0 |
Definition at line 68 of file metadb_handle.h.
titleformat_hook* metadb_handle::p_hook |
Definition at line 68 of file metadb_handle.h.
pfc::string_base& metadb_handle::p_out |
Definition at line 66 of file metadb_handle.h.
titleformat_hook pfc::string_base& metadb_handle::p_out |
Definition at line 68 of file metadb_handle.h.
pfc::string_base const service_ptr_t<titleformat_object>& metadb_handle::p_script |
Definition at line 66 of file metadb_handle.h.
titleformat_hook pfc::string_base const service_ptr_t<titleformat_object>& metadb_handle::p_script |
Definition at line 68 of file metadb_handle.h.