foobar2000 SDK  2015-01-14
Public Member Functions | Static Public Member Functions
album_art_extractorabstract

#include <album_art.h>

+ Inheritance diagram for album_art_extractor:

Public Member Functions

 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (album_art_extractor)
 
virtual bool is_our_path (const char *p_path, const char *p_extension)=0
 
virtual album_art_extractor_instance_ptr open (file_ptr p_filehint, const char *p_path, abort_callback &p_abort)=0
 
- 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_get_interface (service_ptr_t< album_art_extractor > &out, const char *path)
 
static bool g_is_supported_path (const char *path)
 
static album_art_extractor_instance_ptr g_open (file_ptr p_filehint, const char *p_path, abort_callback &p_abort)
 
static album_art_extractor_instance_ptr g_open_allowempty (file_ptr p_filehint, const char *p_path, abort_callback &p_abort)
 

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 ()
 

Detailed Description

Entrypoint class for accessing album art extraction functionality. Register your own implementation to allow album art extraction from your media file format.
If you want to extract album art from a media file, it's recommended that you use album_art_manager API instead of calling album_art_extractor directly.

Definition at line 83 of file album_art.h.

Member Function Documentation

album_art_extractor::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( album_art_extractor  )
bool album_art_extractor::g_get_interface ( service_ptr_t< album_art_extractor > &  out,
const char *  path 
)
static

Definition at line 23 of file album_art.cpp.

23  {
25  pfc::string_extension ext(path);
26  while(e.next(ptr)) {
27  if (ptr->is_our_path(path,ext)) { out = ptr; return true; }
28  }
29  return false;
30 }
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
bool album_art_extractor::g_is_supported_path ( const char *  path)
static

Definition at line 32 of file album_art.cpp.

32  {
33  ptr ptr; return g_get_interface(ptr,path);
34 }
static bool g_get_interface(service_ptr_t< album_art_extractor > &out, const char *path)
Definition: album_art.cpp:23
album_art_extractor_instance_ptr album_art_extractor::g_open ( file_ptr  p_filehint,
const char *  p_path,
abort_callback p_abort 
)
static

Definition at line 35 of file album_art.cpp.

35  {
36  album_art_extractor::ptr obj;
37  if (!g_get_interface(obj, p_path)) throw exception_album_art_unsupported_format();
38  return obj->open(p_filehint, p_path, p_abort);
39 }
static bool g_get_interface(service_ptr_t< album_art_extractor > &out, const char *path)
Definition: album_art.cpp:23
album_art_extractor_instance_ptr album_art_extractor::g_open_allowempty ( file_ptr  p_filehint,
const char *  p_path,
abort_callback p_abort 
)
static

Definition at line 42 of file album_art.cpp.

42  {
43  try {
44  return g_open(p_filehint, p_path, p_abort);
45  } catch(exception_album_art_not_found) {
47  }
48 }
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
static album_art_extractor_instance_ptr g_open(file_ptr p_filehint, const char *p_path, abort_callback &p_abort)
Definition: album_art.cpp:35
virtual bool album_art_extractor::is_our_path ( const char *  p_path,
const char *  p_extension 
)
pure virtual

Returns whether the specified file is one of formats supported by our album_art_extractor implementation.

Parameters
p_pathPath to file being queried.
p_extensionExtension of file being queried (also present in p_path parameter) - provided as a separate parameter for performance reasons.

Implemented in album_art_extractor_impl_stdtags.

virtual album_art_extractor_instance_ptr album_art_extractor::open ( file_ptr  p_filehint,
const char *  p_path,
abort_callback p_abort 
)
pure virtual

Instantiates album_art_extractor_instance providing access to album art stored in a specified media file.
Throws one of I/O exceptions on failure; exception_album_art_not_found when the file has no album art record at all.

Parameters
p_filehintOptional; specifies a file interface to use for accessing the specified file; can be null - in that case, the implementation will open and close the file internally.

Implemented in album_art_extractor_impl_stdtags.


The documentation for this class was generated from the following files: