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

#include <input_helpers.h>

Public Member Functions

 input_info_read_helper ()
 
void get_info (const playable_location &p_location, file_info &p_info, t_filestats &p_stats, abort_callback &p_abort)
 
void get_info_check (const playable_location &p_location, file_info &p_info, t_filestats &p_stats, bool &p_reloaded, abort_callback &p_abort)
 

Private Member Functions

void open (const char *p_path, abort_callback &p_abort)
 

Private Attributes

service_ptr_t< input_info_readerm_input
 
pfc::string8 m_path
 

Detailed Description

Definition at line 76 of file input_helpers.h.

Constructor & Destructor Documentation

input_info_read_helper::input_info_read_helper ( )
inline

Definition at line 78 of file input_helpers.h.

78 {}

Member Function Documentation

void input_info_read_helper::get_info ( const playable_location p_location,
file_info p_info,
t_filestats &  p_stats,
abort_callback p_abort 
)

Definition at line 252 of file input_helpers.cpp.

252  {
253  open(p_location.get_path(),p_abort);
254 
255  TRACK_CODE("input_info_reader::get_file_stats",p_stats = m_input->get_file_stats(p_abort));
256 
257  TRACK_CODE("input_info_reader::get_info",m_input->get_info(p_location.get_subsong_index(),p_info,p_abort));
258 }
virtual const char * get_path() const =0
service_ptr_t< input_info_reader > m_input
Definition: input_helpers.h:85
t_uint32 get_subsong_index() const
void open(const char *p_path, abort_callback &p_abort)
void input_info_read_helper::get_info_check ( const playable_location p_location,
file_info p_info,
t_filestats &  p_stats,
bool &  p_reloaded,
abort_callback p_abort 
)

Definition at line 260 of file input_helpers.cpp.

260  {
261  open(p_location.get_path(),p_abort);
262  t_filestats newstats;
263  TRACK_CODE("input_info_reader::get_file_stats",newstats = m_input->get_file_stats(p_abort));
264  if (metadb_handle::g_should_reload(p_stats,newstats,true)) {
265  p_stats = newstats;
266  TRACK_CODE("input_info_reader::get_info",m_input->get_info(p_location.get_subsong_index(),p_info,p_abort));
267  p_reloaded = true;
268  } else {
269  p_reloaded = false;
270  }
271 }
virtual const char * get_path() const =0
service_ptr_t< input_info_reader > m_input
Definition: input_helpers.h:85
static bool g_should_reload(const t_filestats &p_old_stats, const t_filestats &p_new_stats, bool p_fresh)
t_uint32 get_subsong_index() const
void open(const char *p_path, abort_callback &p_abort)
void input_info_read_helper::open ( const char *  p_path,
abort_callback p_abort 
)
private

Definition at line 243 of file input_helpers.cpp.

243  {
244  if (m_input.is_empty() || metadb::path_compare(m_path,p_path) != 0)
245  {
246  TRACK_CODE("input_entry::g_open_for_info_read",input_entry::g_open_for_info_read(m_input,0,p_path,p_abort));
247 
248  m_path = p_path;
249  }
250 }
bool is_empty() const
Definition: service.h:120
service_ptr_t< input_info_reader > m_input
Definition: input_helpers.h:85
static void g_open_for_info_read(service_ptr_t< input_info_reader > &p_instance, service_ptr_t< file > p_filehint, const char *p_path, abort_callback &p_abort, bool p_from_redirect=false)
Definition: input.cpp:175
static int path_compare(const char *p1, const char *p2)
Definition: metadb.h:245

Field Documentation

service_ptr_t<input_info_reader> input_info_read_helper::m_input
private

Definition at line 85 of file input_helpers.h.

pfc::string8 input_info_read_helper::m_path
private

Definition at line 84 of file input_helpers.h.


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