本文整理汇总了C++中pfc::list_base_t::get_count方法的典型用法代码示例。如果您正苦于以下问题:C++ list_base_t::get_count方法的具体用法?C++ list_base_t::get_count怎么用?C++ list_base_t::get_count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pfc::list_base_t
的用法示例。
在下文中一共展示了list_base_t::get_count方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sort_by_relative_path_partial
void metadb_handle_list_helper::sort_by_relative_path_partial(pfc::list_base_t<metadb_handle_ptr> & p_list,t_size base,t_size count)
{
assert(base+count<=p_list.get_count());
pfc::array_t<t_size> order; order.set_size(count);
sort_by_relative_path_get_order_partial(p_list,base,count,order.get_ptr());
p_list.reorder_partial(base,order.get_ptr(),count);
}
示例2: sort_by_pointer_remove_duplicates
void metadb_handle_list_helper::sort_by_pointer_remove_duplicates(pfc::list_base_t<metadb_handle_ptr> & p_list)
{
t_size count = p_list.get_count();
if (count>0)
{
sort_by_pointer(p_list);
bool b_found = false;
t_size n;
for(n=0;n<count-1;n++)
{
if (p_list.get_item(n)==p_list.get_item(n+1))
{
b_found = true;
break;
}
}
if (b_found)
{
bit_array_bittable mask(count);
t_size n;
for(n=0;n<count-1;n++)
{
if (p_list.get_item(n)==p_list.get_item(n+1))
mask.set(n+1,true);
}
p_list.remove_mask(mask);
}
}
}
示例3: g_filter_dead_files_sorted
t_size file_move_helper::g_filter_dead_files_sorted(pfc::list_base_t<metadb_handle_ptr> & p_data,const pfc::list_base_const_t<const char*> & p_dead)
{
bit_array_bittable mask(p_data.get_count());
t_size found = g_filter_dead_files_sorted_make_mask(p_data,p_dead,mask);
if (found > 0) p_data.remove_mask(mask);
return found;
}
示例4: remove_duplicates
void metadb_handle_list_helper::remove_duplicates(pfc::list_base_t<metadb_handle_ptr> & p_list)
{
t_size count = p_list.get_count();
if (count>0)
{
bit_array_bittable mask(count);
pfc::array_t<t_size> order; order.set_size(count);
order_helper::g_fill(order);
p_list.sort_get_permutation_t(pfc::compare_t<metadb_handle_ptr,metadb_handle_ptr>,order.get_ptr());
t_size n;
bool found = false;
for(n=0;n<count-1;n++)
{
if (p_list.get_item(order[n])==p_list.get_item(order[n+1]))
{
found = true;
mask.set(order[n+1],true);
}
}
if (found) p_list.remove_mask(mask);
}
}
示例5: filterTracksByCloseTitle
void filterTracksByCloseTitle(const std::string& title, pfc::list_base_t<metadb_handle_ptr>& tracks)
{
const t_size n = tracks.get_count();
bit_array_bittable deleteMask(n);
for(t_size i = 0; i < n; i++)
{
deleteMask.set(i, !doesTrackHaveSimilarTitle(title, tracks[i]));
}
tracks.remove_mask(deleteMask);
}
示例6: filterTracksByArtist
void filterTracksByArtist(const std::string& artist, pfc::list_base_t<metadb_handle_ptr>& tracks)
{
const t_size n = tracks.get_count();
bit_array_bittable deleteMask(n);
for(t_size i = 0; i < n; i++)
{
deleteMask.set(i, !isTrackByArtist(artist, tracks[i]));
}
tracks.remove_mask(deleteMask);
}
示例7: g_filter_dead_files_sorted_make_mask
t_size file_move_helper::g_filter_dead_files_sorted_make_mask(pfc::list_base_t<metadb_handle_ptr> & p_data,const pfc::list_base_const_t<const char*> & p_dead,bit_array_var & p_mask)
{
t_size n, m = p_data.get_count();
t_size found = 0;
for(n=0;n<m;n++)
{
t_size dummy;
bool dead = p_dead.bsearch_t(metadb::path_compare,p_data.get_item(n)->get_path(),dummy);
if (dead) found++;
p_mask.set(n,dead);
}
return found;
}
示例8: getBestTrackByTitle
// all tracks will be analysed; try to cut the size of the list down before calling.
metadb_handle_ptr getBestTrackByTitle(const std::string& title, const pfc::list_base_t<metadb_handle_ptr>& tracks)
{
if(tracks.get_count() == 1)
{
console::info(("Only one version of " + title + " exists in library").c_str());
return tracks[0];
}
console::info(("Finding best version of " + title + ". " + to_string(tracks.get_count()) + " candidates").c_str());
metadb_handle_ptr bestTrack = 0;
float bestTrackRating = std::numeric_limits<float>::min();
for(t_size index = 0; index < tracks.get_count(); index++)
{
const float trackRating = calculateTrackRating(title, tracks[index]);
console::info(("Rating: " + to_string(trackRating, 2) + ": " + tracks[index]->get_path()).c_str());
if(trackRating >= 0.0f && trackRating > bestTrackRating)
{
bestTrackRating = trackRating;
bestTrack = tracks[index];
}
}
if(bestTrack == 0)
{
console::info(("Couldn't find a match for " + title).c_str());
}
else
{
console::info(("Picked track with rating: " + to_string(bestTrackRating, 2) + ": " + bestTrack->get_path()).c_str());
}
return bestTrack;
}
示例9: grab_items_by_path
static bool grab_items_by_path(pfc::list_base_t<metadb_handle_ptr> & p_out,const char * p_path,abort_callback & p_abort)
{
try {
pfc::string8 path;
filesystem::g_get_canonical_path(p_path,path);
p_out.remove_all();
service_ptr_t<input_info_reader> reader;
input_entry::g_open_for_info_read(reader,0,path,p_abort);
static_api_ptr_t<metadb> l_metadb;
const t_uint32 count = reader->get_subsong_count();
for(t_uint32 n=0;n<count;n++) {
p_abort.check_e();
metadb_handle_ptr ptr;
l_metadb->handle_create(ptr,make_playable_location(path,reader->get_subsong(n)));
p_out.add_item(ptr);
}
return p_out.get_count() > 0;
} catch(std::exception const &) {return false;}
}
示例10: sort_by_path
void metadb_handle_list_helper::sort_by_path(pfc::list_base_t<metadb_handle_ptr> & p_list)
{
sort_by_format_partial(p_list,0,p_list.get_count(),"%path_sort%",0);
}