foobar2000 SDK  2015-08-03
album_art.cpp
Go to the documentation of this file.
1 #include "foobar2000.h"
2 
5  pfc::string_extension ext(path);
6  while(e.next(ptr)) {
7  if (ptr->is_our_path(path,ext)) { out = ptr; return true; }
8  }
9  return false;
10 }
11 
12 bool album_art_editor::g_is_supported_path(const char * path) {
13  ptr ptr; return g_get_interface(ptr,path);
14 }
15 
17  album_art_editor::ptr obj;
18  if (!g_get_interface(obj, p_path)) throw exception_album_art_unsupported_format();
19  return obj->open(p_filehint, p_path, p_abort);
20 }
21 
22 
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 }
31 
33  ptr ptr; return g_get_interface(ptr,path);
34 }
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 }
40 
41 
43  try {
44  return g_open(p_filehint, p_path, p_abort);
45  } catch(exception_album_art_not_found) {
47  }
48 }
static bool g_is_supported_path(const char *path)
Definition: album_art.cpp:32
service_ptr_t< file > file_ptr
Definition: filesystem.h:324
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
static album_art_editor_instance_ptr g_open(file_ptr p_filehint, const char *p_path, abort_callback &p_abort)
Definition: album_art.cpp:16
static bool g_get_interface(service_ptr_t< album_art_editor > &out, const char *path)
Helper; attempts to retrieve an album_art_editor service pointer that supports the specified file...
Definition: album_art.cpp:3
static bool g_get_interface(service_ptr_t< album_art_extractor > &out, const char *path)
Definition: album_art.cpp:23
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
static bool g_is_supported_path(const char *path)
Helper; returns whether one of registered album_art_editor implementations is capable of opening the ...
Definition: album_art.cpp:12
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
static album_art_extractor_instance_ptr g_open_allowempty(file_ptr p_filehint, const char *p_path, abort_callback &p_abort)
Definition: album_art.cpp:42