当前位置: 首页>>代码示例>>C++>>正文


C++ pfc::list_base_const_t类代码示例

本文整理汇总了C++中pfc::list_base_const_t的典型用法代码示例。如果您正苦于以下问题:C++ list_base_const_t类的具体用法?C++ list_base_const_t怎么用?C++ list_base_const_t使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了list_base_const_t类的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);
	}
}
开发者ID:AICIDNN,项目名称:lastfm-desktop,代码行数:29,代码来源:metadb_handle_list.cpp

示例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);
	}
}
开发者ID:AICIDNN,项目名称:lastfm-desktop,代码行数:31,代码来源:metadb_handle_list.cpp

示例3: 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;
}
开发者ID:AICIDNN,项目名称:lastfm-desktop,代码行数:11,代码来源:metadb_handle_list.cpp

示例4:

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;
}
开发者ID:Jorgorbia,项目名称:AltaCast,代码行数:9,代码来源:metadb.cpp

示例5: 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);
	}
}
开发者ID:ttsping,项目名称:columns_ui,代码行数:10,代码来源:layout_config.cpp

示例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));
}
开发者ID:ttsping,项目名称:columns_ui,代码行数:11,代码来源:splitter_window.cpp

示例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;
}
开发者ID:Irwin1138,项目名称:foo_bestversion,代码行数:12,代码来源:menu_helpers.cpp

示例8: 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;
}
开发者ID:9060,项目名称:columns_ui,代码行数:13,代码来源:file_move_helper.cpp

示例9: 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);
	}
}
开发者ID:Irwin1138,项目名称:foo_bestversion,代码行数:51,代码来源:file_info_merge.cpp

示例10: 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;
		};
开发者ID:i7voodoo,项目名称:columns_ui,代码行数:14,代码来源:config_filter.cpp

示例11: get_sorted_playlist

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;
}
开发者ID:epsil,项目名称:foo_lastsort,代码行数:47,代码来源:foo_lastsort.cpp

示例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;
}
开发者ID:9060,项目名称:columns_ui,代码行数:17,代码来源:item_properties_config_list_view.cpp

示例13: 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;*/
	
}
开发者ID:9060,项目名称:columns_ui,代码行数:17,代码来源:file_move_helper.cpp

示例14: 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));
}
开发者ID:GreyTeardrop,项目名称:foo_playback_log,代码行数:20,代码来源:file_info_merge.cpp

示例15: 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;
		};
开发者ID:i7voodoo,项目名称:columns_ui,代码行数:20,代码来源:config_artwork.cpp


注:本文中的pfc::list_base_const_t类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。