foobar2000 SDK  2015-01-14
Public Member Functions | Private Attributes
album_art_editor_impl_stdtags

#include <album_art_helpers.h>

+ Inheritance diagram for album_art_editor_impl_stdtags:

Public Member Functions

 album_art_editor_impl_stdtags (const char *exts)
 
bool is_our_path (const char *p_path, const char *p_extension)
 
album_art_editor_instance_ptr open (file_ptr p_filehint, const char *p_path, abort_callback &p_abort)
 
- Public Member Functions inherited from album_art_editor
 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (album_art_editor)
 
- 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 ()
 

Private Attributes

pfc::avltree_t< pfc::string, pfc::string::comparatorCaseInsensitiveASCIIm_extensions
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Static Public Member Functions inherited from album_art_editor
static bool g_get_interface (service_ptr_t< album_art_editor > &out, const char *path)
 
static bool g_is_supported_path (const char *path)
 
static album_art_editor_instance_ptr g_open (file_ptr p_filehint, const char *p_path, abort_callback &p_abort)
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Helper implementation of album_art_editor - edits album art from arbitrary file formats that comply with APEv2 tagging specification.

Definition at line 75 of file album_art_helpers.h.

Constructor & Destructor Documentation

album_art_editor_impl_stdtags::album_art_editor_impl_stdtags ( const char *  exts)
inline
Parameters
extsSemicolon-separated list of file format extensions to support.

Definition at line 78 of file album_art_helpers.h.

78  {
80  }
pfc::avltree_t< pfc::string, pfc::string::comparatorCaseInsensitiveASCII > m_extensions
void splitStringSimple_toList(t_list &p_output, t_split p_split, const char *p_string, t_size p_stringLen=~0)
Definition: string_base.h:968

Member Function Documentation

bool album_art_editor_impl_stdtags::is_our_path ( const char *  p_path,
const char *  p_extension 
)
inlinevirtual

Returns whether the specified file is one of formats supported by our album_art_editor 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.

Implements album_art_editor.

Definition at line 82 of file album_art_helpers.h.

82  {
83  return m_extensions.have_item(p_extension);
84  }
bool have_item(const t_param &p_item) const
Same as contains().
Definition: avltree.h:433
pfc::avltree_t< pfc::string, pfc::string::comparatorCaseInsensitiveASCII > m_extensions
album_art_editor_instance_ptr album_art_editor_impl_stdtags::open ( file_ptr  p_filehint,
const char *  p_path,
abort_callback p_abort 
)
inlinevirtual

Instantiates album_art_editor_instance providing access to album art stored in a specified media file.
.

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.

Implements album_art_editor.

Definition at line 86 of file album_art_helpers.h.

86  {
87  PFC_ASSERT( is_our_path(p_path, pfc::string_extension(p_path) ) );
88  file_ptr l_file ( p_filehint );
89  if (l_file.is_empty()) filesystem::g_open(l_file, p_path, filesystem::open_mode_write_existing, p_abort);
90  return static_api_ptr_t<tag_processor_album_art_utils>()->edit( l_file, p_abort );
91  }
service_ptr_t< file > file_ptr
Definition: filesystem.h:319
Helper template used to easily access core services. Usage: static_api_ptr_t api; api->doso...
Definition: service.h:533
bool is_our_path(const char *p_path, const char *p_extension)
Returns whether the specified file is one of formats supported by our album_art_editor implementation...

Field Documentation

pfc::avltree_t<pfc::string,pfc::string::comparatorCaseInsensitiveASCII> album_art_editor_impl_stdtags::m_extensions
private

Definition at line 93 of file album_art_helpers.h.


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