foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions
dsp_chain_configabstract

#include <dsp.h>

+ Inheritance diagram for dsp_chain_config:

Public Member Functions

void add_item (const dsp_preset &p_data)
 
void contents_from_stream (stream_reader *p_stream, abort_callback &p_abort)
 
void contents_to_stream (stream_writer *p_stream, abort_callback &p_abort) const
 
void copy (const dsp_chain_config &p_source)
 
virtual t_size get_count () const =0
 
virtual const dsp_presetget_item (t_size p_index) const =0
 
void get_name_list (pfc::string_base &p_out) const
 
virtual void insert_item (const dsp_preset &p_data, t_size p_index)=0
 
void instantiate (service_list_t< dsp > &p_out)
 
bool operator!= (const dsp_chain_config &other) const
 
const dsp_chain_configoperator= (const dsp_chain_config &p_source)
 
bool operator== (const dsp_chain_config &other) const
 
void remove_all ()
 
void remove_item (t_size p_index)
 
virtual void remove_mask (const bit_array &p_mask)=0
 
virtual void replace_item (const dsp_preset &p_data, t_size p_index)=0
 

Static Public Member Functions

static bool equals (dsp_chain_config const &v1, dsp_chain_config const &v2)
 

Detailed Description

Definition at line 389 of file dsp.h.

Member Function Documentation

void dsp_chain_config::add_item ( const dsp_preset p_data)

Definition at line 166 of file dsp.cpp.

167 {
168  insert_item(p_data,get_count());
169 }
virtual t_size get_count() const =0
virtual void insert_item(const dsp_preset &p_data, t_size p_index)=0
void dsp_chain_config::contents_from_stream ( stream_reader p_stream,
abort_callback p_abort 
)

Definition at line 124 of file dsp.cpp.

124  {
125  t_uint32 n,count;
126 
127  remove_all();
128 
129  p_stream->read_lendian_t(count,p_abort);
130 
131  dsp_preset_impl temp;
132 
133  for(n=0;n<count;n++) {
134  temp.contents_from_stream(p_stream,p_abort);
135  add_item(temp);
136  }
137 }
void add_item(const dsp_preset &p_data)
Definition: dsp.cpp:166
void remove_all()
Definition: dsp.cpp:171
void contents_from_stream(stream_reader *p_stream, abort_callback &p_abort)
Definition: dsp.cpp:227
uint32_t t_uint32
Definition: int_types.h:5
void dsp_chain_config::contents_to_stream ( stream_writer p_stream,
abort_callback p_abort 
) const

Definition at line 116 of file dsp.cpp.

116  {
117  t_size n, count = get_count();
118  p_stream->write_lendian_t(count,p_abort);
119  for(n=0;n<count;n++) {
120  get_item(n).contents_to_stream(p_stream,p_abort);
121  }
122 }
virtual t_size get_count() const =0
virtual const dsp_preset & get_item(t_size p_index) const =0
size_t t_size
Definition: int_types.h:48
void contents_to_stream(stream_writer *p_stream, abort_callback &p_abort) const
Definition: dsp.cpp:218
void dsp_chain_config::copy ( const dsp_chain_config p_source)

Definition at line 251 of file dsp.cpp.

251  {
252  remove_all();
253  t_size n, m = p_source.get_count();
254  for(n=0;n<m;n++)
255  add_item(p_source.get_item(n));
256 }
void add_item(const dsp_preset &p_data)
Definition: dsp.cpp:166
virtual t_size get_count() const =0
virtual const dsp_preset & get_item(t_size p_index) const =0
void remove_all()
Definition: dsp.cpp:171
size_t t_size
Definition: int_types.h:48
bool dsp_chain_config::equals ( dsp_chain_config const &  v1,
dsp_chain_config const &  v2 
)
static

Definition at line 351 of file dsp.cpp.

351  {
352  const t_size count = v1.get_count();
353  if (count != v2.get_count()) return false;
354  for(t_size walk = 0; walk < count; ++walk) {
355  if (v1.get_item(walk) != v2.get_item(walk)) return false;
356  }
357  return true;
358 }
size_t t_size
Definition: int_types.h:48
virtual t_size dsp_chain_config::get_count ( ) const
pure virtual

Implemented in dsp_chain_config_impl.

virtual const dsp_preset& dsp_chain_config::get_item ( t_size  p_index) const
pure virtual

Implemented in dsp_chain_config_impl.

void dsp_chain_config::get_name_list ( pfc::string_base p_out) const

Definition at line 359 of file dsp.cpp.

360 {
361  const t_size count = get_count();
362  bool added = false;
363  for(unsigned n=0;n<count;n++)
364  {
366  if (dsp_entry::g_get_interface(ptr,get_item(n).get_owner()))
367  {
368  if (added) p_out += ", ";
369  added = true;
370 
371  pfc::string8 temp;
372  ptr->get_name(temp);
373  p_out += temp;
374  }
375  }
376 }
virtual t_size get_count() const =0
virtual const dsp_preset & get_item(t_size p_index) const =0
size_t t_size
Definition: int_types.h:48
static bool g_get_interface(service_ptr_t< dsp_entry > &p_out, const GUID &p_guid)
Definition: dsp.cpp:290
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
virtual void dsp_chain_config::insert_item ( const dsp_preset p_data,
t_size  p_index 
)
pure virtual

Implemented in dsp_chain_config_impl.

void dsp_chain_config::instantiate ( service_list_t< dsp > &  p_out)

Definition at line 176 of file dsp.cpp.

177 {
178  p_out.remove_all();
179  t_size n, m = get_count();
180  for(n=0;n<m;n++)
181  {
182  service_ptr_t<dsp> temp;
183  if (dsp_entry::g_instantiate(temp,get_item(n)))
184  p_out.add_item(temp);
185  }
186 }
virtual t_size get_count() const =0
virtual const dsp_preset & get_item(t_size p_index) const =0
size_t t_size
Definition: int_types.h:48
static bool g_instantiate(service_ptr_t< dsp > &p_out, const dsp_preset &p_preset)
Definition: dsp.cpp:79
bool dsp_chain_config::operator!= ( const dsp_chain_config other) const
inline

Definition at line 415 of file dsp.h.

415 {return !equals(*this, other);}
static bool equals(dsp_chain_config const &v1, dsp_chain_config const &v2)
Definition: dsp.cpp:351
const dsp_chain_config& dsp_chain_config::operator= ( const dsp_chain_config p_source)
inline

Definition at line 403 of file dsp.h.

403 {copy(p_source); return *this;}
void copy(const dsp_chain_config &p_source)
Definition: dsp.cpp:251
bool dsp_chain_config::operator== ( const dsp_chain_config other) const
inline

Definition at line 414 of file dsp.h.

414 {return equals(*this, other);}
static bool equals(dsp_chain_config const &v1, dsp_chain_config const &v2)
Definition: dsp.cpp:351
void dsp_chain_config::remove_all ( )

Definition at line 171 of file dsp.cpp.

172 {
174 }
virtual void remove_mask(const bit_array &p_mask)=0
void dsp_chain_config::remove_item ( t_size  p_index)

Definition at line 161 of file dsp.cpp.

162 {
163  remove_mask(bit_array_one(p_index));
164 }
virtual void remove_mask(const bit_array &p_mask)=0
virtual void dsp_chain_config::remove_mask ( const bit_array p_mask)
pure virtual

Implemented in dsp_chain_config_impl.

virtual void dsp_chain_config::replace_item ( const dsp_preset p_data,
t_size  p_index 
)
pure virtual

Implemented in dsp_chain_config_impl.


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