foobar2000 SDK  2015-08-03
metadb_io_hintlist.cpp
Go to the documentation of this file.
1 #include "stdafx.h"
2 
4  if (m_entries.get_count() > 0) {
5  static_api_ptr_t<metadb_io>()->hint_multi_async(
10  );
11  }
12  m_entries.remove_all();
13 }
14 
15 void metadb_io_hintlist::add(metadb_handle_ptr const & p_handle,const file_info & p_info,t_filestats const & p_stats,bool p_fresh) {
16  t_entry entry;
17  entry.m_handle = p_handle;
18  entry.m_info.new_t(p_info);
19  entry.m_stats = p_stats;
20  entry.m_fresh = p_fresh;
21  m_entries.add_item(entry);
22 }
23 
26  const t_uint32 subsongcount = p_reader->get_subsong_count();
27  t_filestats stats = p_reader->get_file_stats(p_abort);
28  for(t_uint32 subsong = 0; subsong < subsongcount; subsong++) {
29  t_uint32 subsong_id = p_reader->get_subsong(subsong);
30  metadb_handle_ptr handle;
31  api->handle_create(handle,make_playable_location(p_path,subsong_id));
32  if (handle->should_reload(stats,true)) {
33  file_info_impl temp;
34  p_reader->get_info(subsong_id,temp,p_abort);
35 
36  add(handle,temp,stats,true);
37  }
38  }
39 }
void new_t()
Definition: rcptr.h:101
Main interface class for information about some playable object.
Definition: file_info.h:73
pfc::rcptr_t< file_info_const_impl > m_info
Implements file_info.
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
Definition: service.h:533
void add(metadb_handle_ptr const &p_handle, const file_info &p_info, t_filestats const &p_stats, bool p_fresh)
pfc::list_t< t_entry, pfc::alloc_fast > m_entries
void hint_reader(service_ptr_t< input_info_reader > p_reader, const char *p_path, abort_callback &p_abort)
uint32_t t_uint32
Definition: int_types.h:5