foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions | Private Attributes
album_art_data_impl

#include <album_art_helpers.h>

+ Inheritance diagram for album_art_data_impl:

Public Member Functions

void from_stream (stream_reader *p_stream, t_size p_bytes, abort_callback &p_abort)
 
const void * get_ptr () const
 
void * get_ptr ()
 
t_size get_size () const
 
void set_size (t_size p_size)
 
- Public Member Functions inherited from album_art_data
 FB2K_MAKE_SERVICE_INTERFACE (album_art_data, service_base)
 
bool operator!= (const album_art_data &other) const
 
bool operator== (const album_art_data &other) 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 album_art_data_ptr g_create (const void *p_buffer, t_size p_bytes)
 
static album_art_data_ptr g_create (stream_reader *p_stream, t_size p_bytes, abort_callback &p_abort)
 
- Static Public Member Functions inherited from album_art_data
static bool equals (album_art_data const &v1, album_art_data const &v2)
 

Private Attributes

pfc::array_t< t_uint8m_content
 

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

Implements album_art_data.

Definition at line 2 of file album_art_helpers.h.

Member Function Documentation

void album_art_data_impl::from_stream ( stream_reader p_stream,
t_size  p_bytes,
abort_callback p_abort 
)
inline

Reads picture data from the specified stream object.

Definition at line 11 of file album_art_helpers.h.

11  {
12  set_size(p_bytes); p_stream->read_object(get_ptr(),p_bytes,p_abort);
13  }
void set_size(t_size p_size)
const void * get_ptr() const
Retrieves a pointer to a memory block containing the picture.
static album_art_data_ptr album_art_data_impl::g_create ( const void *  p_buffer,
t_size  p_bytes 
)
inlinestatic

Creates an album_art_data object from picture data contained in a memory buffer.

Definition at line 16 of file album_art_helpers.h.

16  {
18  instance->set_size(p_bytes);
19  memcpy(instance->get_ptr(),p_buffer,p_bytes);
20  return instance;
21  }
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
T * get_ptr() const
Definition: service.h:117
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
static album_art_data_ptr album_art_data_impl::g_create ( stream_reader p_stream,
t_size  p_bytes,
abort_callback p_abort 
)
inlinestatic

Creates an album_art_data object from picture data contained in a stream.

Definition at line 23 of file album_art_helpers.h.

23  {
25  instance->from_stream(p_stream,p_bytes,p_abort);
26  return instance;
27  }
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
const void* album_art_data_impl::get_ptr ( ) const
inlinevirtual

Retrieves a pointer to a memory block containing the picture.

Implements album_art_data.

Definition at line 4 of file album_art_helpers.h.

4 {return m_content.get_ptr();}
const t_item * get_ptr() const
Definition: array.h:213
pfc::array_t< t_uint8 > m_content
void* album_art_data_impl::get_ptr ( )
inline

Definition at line 7 of file album_art_helpers.h.

7 {return m_content.get_ptr();}
const t_item * get_ptr() const
Definition: array.h:213
pfc::array_t< t_uint8 > m_content
t_size album_art_data_impl::get_size ( ) const
inlinevirtual

Retrieves size of the memory block containing the picture.

Implements album_art_data.

Definition at line 5 of file album_art_helpers.h.

5 {return m_content.get_size();}
t_size get_size() const
Definition: array.h:130
pfc::array_t< t_uint8 > m_content
void album_art_data_impl::set_size ( t_size  p_size)
inline

Definition at line 8 of file album_art_helpers.h.

8 {m_content.set_size(p_size);}
void set_size(t_size p_size)
Definition: array.h:104
pfc::array_t< t_uint8 > m_content

Field Documentation

pfc::array_t<t_uint8> album_art_data_impl::m_content
private

Definition at line 30 of file album_art_helpers.h.


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