예제 #1
0
	static void g_get_root_items(pfc::list_base_t<mainmenu_root_group> & p_out)
	{
		p_out.remove_all();
		mnemonic_manager mnemonics;

		service_enum_t<mainmenu_group> e;
		service_ptr_t<mainmenu_group> ptr;
		service_ptr_t<mainmenu_group_popup> ptrp;

		while(e.next(ptr))
		{
			if (ptr->get_parent() == pfc::guid_null)
			{
				if (ptr->service_query_t(ptrp))
				{
					mainmenu_root_group item;
					pfc::string8 name;
					ptrp->get_display_string(name);
					item.m_guid = ptrp->get_guid();
					item.m_sort_priority = ptrp->get_sort_priority();
					uFixAmpersandChars_v2(name, item.m_name);
					name.reset();
					mnemonics.process_string(item.m_name, name);
					pfc::stringcvt::string_os_from_utf8 os(name);
					item.m_name_with_accelerators.append_fromptr(os.get_ptr(), os.length());
					item.m_name_with_accelerators.append_single(0);
					p_out.add_item(item);
				}
			}
		}
		p_out.sort_t(g_compare);
	}
예제 #2
0
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;}
}
예제 #3
0
void playlist_manager::activeplaylist_get_items(pfc::list_base_t<metadb_handle_ptr> & out,const bit_array & p_mask)
{
	t_size playlist = get_active_playlist();
	if (playlist != pfc_infinite) playlist_get_items(playlist,out,p_mask);
	else out.remove_all();
}