本文整理汇总了C++中pfc::list_base_const_t::get_count方法的典型用法代码示例。如果您正苦于以下问题:C++ list_base_const_t::get_count方法的具体用法?C++ list_base_const_t::get_count怎么用?C++ list_base_const_t::get_count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pfc::list_base_const_t
的用法示例。
在下文中一共展示了list_base_const_t::get_count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sort_by_relative_path_get_order_partial
void metadb_handle_list_helper::sort_by_relative_path_get_order_partial(const pfc::list_base_const_t<metadb_handle_ptr> & p_list,t_size base,t_size count,t_size* order)
{
assert(base+count<=p_list.get_count());
t_size n;
pfc::array_t<custom_sort_data> data;
data.set_size(count);
static_api_ptr_t<library_manager> api;
pfc::string8_fastalloc temp;
temp.prealloc(512);
for(n=0;n<count;n++)
{
metadb_handle_ptr item;
p_list.get_item_ex(item,base+n);
if (!api->get_relative_path(item,temp)) temp = "";
data[n].index = n;
data[n].text = uSortStringCreate(temp);
//data[n].subsong = item->get_subsong_index();
}
pfc::sort_t(data,custom_sort_compare,count);
//qsort(data.get_ptr(),count,sizeof(custom_sort_data),(int (__cdecl *)(const void *elem1, const void *elem2 ))custom_sort_compare);
for(n=0;n<count;n++)
{
order[n]=data[n].index;
uSortStringFree(data[n].text);
}
}
示例2: sort_by_format_get_order_partial
void metadb_handle_list_helper::sort_by_format_get_order_partial(const pfc::list_base_const_t<metadb_handle_ptr> & p_list,t_size base,t_size count,t_size* order,const service_ptr_t<titleformat_object> & p_script,titleformat_hook * p_hook)
{
assert(base+count<=p_list.get_count());
t_size n;
pfc::array_t<custom_sort_data> data;
data.set_size(count);
pfc::string8_fastalloc temp;
pfc::string8_fastalloc temp2;
temp.prealloc(512);
for(n=0;n<count;n++)
{
metadb_handle_ptr item;
p_list.get_item_ex(item,base+n);
assert(item.is_valid());
item->format_title(p_hook,temp,p_script,0);
data[n].index = n;
data[n].text = uSortStringCreate(temp);
//data[n].subsong = item->get_subsong_index();
}
pfc::sort_t(data,custom_sort_compare,count);
//qsort(data.get_ptr(),count,sizeof(custom_sort_data),(int (__cdecl *)(const void *elem1, const void *elem2 ))custom_sort_compare);
for(n=0;n<count;n++)
{
order[n]=data[n].index;
uSortStringFree(data[n].text);
}
}
示例3:
file_info_update_helper::file_info_update_helper(const pfc::list_base_const_t<metadb_handle_ptr> & p_data)
{
const t_size count = p_data.get_count();
m_data.add_items(p_data);
m_infos.set_size(count);
m_mask.set_size(count);
for(t_size n=0;n<count;n++) m_mask[n] = false;
}
示例4: set_presets
void cfg_layout_t::set_presets(const pfc::list_base_const_t<preset> & presets, t_size active)
{
if (presets.get_count())
{
m_presets.remove_all();
m_active = pfc_infinite;
m_presets.add_items(presets);
set_active_preset(active);
}
}
示例5: calc_total_duration
double metadb_handle_list_helper::calc_total_duration(const pfc::list_base_const_t<metadb_handle_ptr> & p_list)
{
double ret = 0;
t_size n, m = p_list.get_count();
for(n=0;n<m;n++)
{
double temp = p_list.get_item(n)->get_length();
if (temp > 0) ret += temp;
}
return ret;
}
示例6: get_supported_panels
void splitter_window_impl::get_supported_panels(const pfc::list_base_const_t<uie::window::ptr> & p_windows, bit_array_var & p_mask_unsupported)
{
service_ptr_t<service_base> temp;
g_splitter_host_vert.instance_create(temp);
uie::window_host_ptr ptr;
if (temp->service_query_t(ptr))
(static_cast<splitter_host_impl*>(ptr.get_ptr()))->set_window_ptr(this);
t_size i, count = p_windows.get_count();
for (i = 0; i<count; i++)
p_mask_unsupported.set(i, !p_windows[i]->is_available(ptr));
}
示例7: run_context_command_internal
static bool run_context_command_internal(const GUID & p_command,const GUID & p_subcommand,const pfc::list_base_const_t<metadb_handle_ptr> & data,const GUID & caller) {
if (data.get_count() == 0) return false;
service_ptr_t<contextmenu_item> ptr; t_uint32 index;
if (!menu_item_resolver::g_resolve_context_command(p_command, ptr, index)) return false;
{
TRACK_CALL_TEXT("menu_helpers::run_command(), by GUID");
ptr->item_execute_simple(index, p_subcommand, data, caller);
}
return true;
}
示例8: merge
void file_info::merge(const pfc::list_base_const_t<const file_info*> & p_in)
{
t_size in_count = p_in.get_count();
if (in_count == 0)
{
meta_remove_all();
return;
}
else if (in_count == 1)
{
const file_info * info = p_in[0];
copy_meta(*info);
set_replaygain(replaygain_info::g_merge(get_replaygain(),info->get_replaygain()));
overwrite_info(*info);
//copy_info_single_by_name(*info,"tagtype");
return;
}
merge_meta(*this,p_in);
{
pfc::string8_fastalloc tagtype;
replaygain_info rg = get_replaygain();
t_size in_ptr;
for(in_ptr = 0; in_ptr < in_count; in_ptr++ )
{
const file_info * info = p_in[in_ptr];
rg = replaygain_info::g_merge(rg, info->get_replaygain());
t_size field_ptr, field_max = info->info_get_count();
for(field_ptr = 0; field_ptr < field_max; field_ptr++ )
{
const char * field_name = info->info_enum_name(field_ptr), * field_value = info->info_enum_value(field_ptr);
if (*field_value)
{
if (!pfc::stricmp_ascii(field_name,"tagtype"))
{
if (!tagtype.is_empty()) tagtype += "|";
tagtype += field_value;
}
}
}
}
if (!tagtype.is_empty()) info_set("tagtype",tagtype);
set_replaygain(rg);
}
}
示例9: notify_create_inline_edit
virtual bool notify_create_inline_edit(const pfc::list_base_const_t<t_size> & indices, unsigned column, pfc::string_base & p_text, t_size & p_flags, mmh::comptr_t<IUnknown> & pAutocompleteEntries)
{
t_size indices_count = indices.get_count();
if (indices_count == 1 && indices[0] < filter_panel::cfg_field_list.get_count())
{
m_edit_index = indices[0];
m_edit_column = column;
p_text = m_edit_column ? filter_panel::cfg_field_list[m_edit_index].m_field : filter_panel::cfg_field_list[m_edit_index].m_name;
return true;
}
return false;
};
示例10:
pfc::list_t<metadb_handle_ptr> get_sorted_playlist(const pfc::list_base_const_t<metadb_handle_ptr> &data, threaded_process_status &p_status, abort_callback &p_abort) {
std::multimap<int, metadb_handle_ptr, std::greater<int>> temp;
std::multimap<int, metadb_handle_ptr, std::greater<int>>::iterator it;
pfc::list_t<metadb_handle_ptr> result;
pfc::lores_timer timer;
pfc::string8 message, msg;
int size = data.get_count();
for (int i = 0; i < size; i++) {
message.reset();
message << "Track " << i + 1 << " of " << size;
p_status.set_item(message);
p_status.set_progress(i + 1, size);
timer.start();
const metadb_handle_ptr track = data[i];
int count = get_track_count(track, p_abort);
msg.reset();
msg << count;
console::print(msg);
// don't make more than 5 requests per second
// (averaged over a 5 minute period)
if (timer.query() < 0.2) {
p_abort.sleep(0.2);
}
if (i && (i % 100 == 0)) {
p_abort.sleep(10);
}
if (count > 0) {
temp.insert(std::pair<int, metadb_handle_ptr>(count, track));
} else {
temp.insert(std::pair<int, metadb_handle_ptr>(0, track));
}
}
for (it = temp.begin(); it != temp.end(); it++) {
metadb_handle_ptr track = it->second;
result.add_item(track);
}
return result;
}
示例11: on_hint
void file_move_callback_manager::on_hint(const pfc::list_base_const_t<metadb_handle_ptr> & p_list,const pfc::list_base_const_t<const file_info*> & p_infos,const pfc::list_base_const_t<t_filestats> & p_stats)
{
m_hint_handles.add_items(p_list);
m_hint_stats.add_items(p_stats);
{
t_size old_count = m_hint_infos.get_count(), delta = p_infos.get_count();
m_hint_infos.set_count(old_count + delta);
for(t_size n=0;n<delta;n++)
m_hint_infos[old_count+n] = *p_infos[n];
}
/* metadb_handle_list m_hint_handles;
list_t<file_info_impl_const> m_hint_infos;
list_t<t_filestats> m_hint_stats;*/
}
示例12: notify_create_inline_edit
bool fields_list_view_t::notify_create_inline_edit(const pfc::list_base_const_t<t_size> & indices, unsigned column, pfc::string_base & p_text, t_size & p_flags, mmh::comptr_t<IUnknown> & pAutocompleteEntries)
{
t_size indices_count = indices.get_count();
if (indices_count == 1 && indices[0] < m_fields.get_count())
{
m_edit_index = indices[0];
m_edit_column = column;
p_text = m_edit_column ? m_fields[m_edit_index].m_name : m_fields[m_edit_index].m_name_friendly;
if (m_edit_column == 1)
p_flags = inline_edit_uppercase;
return true;
}
return false;
}
示例13: merge_meta
static void merge_meta(file_info & p_out,const pfc::list_base_const_t<const file_info*> & p_in) {
pfc::map_t<const char *,meta_merge_entry,pfc::comparator_stricmp_ascii> map;
for(t_size in_walk = 0; in_walk < p_in.get_count(); in_walk++) {
const file_info & in = * p_in[in_walk];
for(t_size meta_walk = 0, meta_count = in.meta_get_count(); meta_walk < meta_count; meta_walk++ ) {
meta_merge_entry & entry = map.find_or_add(in.meta_enum_name(meta_walk));
t_size rating = merge_tags_calc_rating_by_index(in,meta_walk);
if (rating > entry.m_rating) {
entry.m_rating = rating;
const t_size value_count = in.meta_enum_value_count(meta_walk);
entry.m_data.set_size(value_count);
for(t_size value_walk = 0; value_walk < value_count; value_walk++ ) {
entry.m_data[value_walk] = in.meta_enum_value(meta_walk,value_walk);
}
}
}
}
map.enumerate(meta_merge_map_enumerator(p_out));
}
示例14: notify_create_inline_edit
virtual bool notify_create_inline_edit(const pfc::list_base_const_t<t_size> & indices, unsigned column, pfc::string_base & p_text, t_size & p_flags, mmh::comptr_t<IUnknown> & pAutocompleteEntries)
{
t_size indices_count = indices.get_count();
if (indices_count == 1)
{
t_size index, subindex;
if (get_separated_index(indices[0], index, subindex))
{
m_edit_index = index;
m_edit_subindex = subindex;
m_edit_combined_index = indices[0];
p_text = g_artwork_sources[index].m_scripts->get_item(subindex);
return true;
}
}
return false;
};
示例15: notify_create_inline_edit
bool selection_properties_t::notify_create_inline_edit(const pfc::list_base_const_t<t_size> & indices, unsigned column, pfc::string_base & p_text, t_size & p_flags, mmh::comptr_t<IUnknown> & pAutocompleteEntries)
{
t_size indices_count = indices.get_count();
if (m_handles.get_count() && column == 1 && indices_count == 1 && indices[0] < m_fields.get_count())
{
m_edit_index = indices[0];
m_edit_column = column;
m_edit_field = m_fields[m_edit_index].m_name;
m_edit_handles = m_handles;
pfc::string8_fast_aggressive text, temp;
{
in_metadb_sync sync;
const file_info * p_info = NULL;
if (m_edit_handles[0]->get_info_locked(p_info))
g_print_field(m_edit_field, *p_info, text);
t_size i, count = m_handles.get_count();
for (i = 1; i < count; i++)
{
temp.reset();
if (m_edit_handles[i]->get_info_locked(p_info))
g_print_field(m_edit_field, *p_info, temp);
if (strcmp(temp, text))
{
text = "<mixed values>";
break;
}
}
}
p_text = text;
return true;
}
return false;
}