本文整理汇总了C++中pfc::list_t类的典型用法代码示例。如果您正苦于以下问题:C++ list_t类的具体用法?C++ list_t怎么用?C++ list_t使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了list_t类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findDspNames
void dsp_preset_switcher::findDspNames( pfc::list_t<pfc::string8> &out ) const
{
// storing menu handles may not be a good idea, since the user can change DSP preset settings without notify this component
out.remove_all();
// enumerate mainmenu items
service_enum_t<mainmenu_commands> e;
service_ptr_t<mainmenu_commands_v2> ptr;
while( e.next( ptr ) )
{
for( t_uint32 i = 0 , imax = ptr->get_command_count(); i < imax; ++i )
{
// lock-on on DSP settings
pfc::string8 group_name;
ptr->get_name( i , group_name );
const char *DSP_PARENT_STR = "DSP"; // partial match, hope to work with non-English locale
if( strstr( group_name.toString() , DSP_PARENT_STR ) == nullptr )
continue;
// should be a dynamic item
if( !ptr->is_command_dynamic( i ) )
{
console::printf( CONSOLE_HEADER "%s(): item is NOT dynamic!!" , __FUNCTION__ );
continue;
}
const mainmenu_node::ptr dsp_group_node = ptr->dynamic_instantiate( i );
// should be a group node
if( dsp_group_node->get_type() != mainmenu_node::type_group )
{
console::printf( CONSOLE_HEADER "%s(): node is NOT type_group!!" , __FUNCTION__ );
continue;
}
// enumerate dsp names
for( t_size j = 0 , jmax = dsp_group_node->get_children_count(); ( j < jmax ) && ( jmax > 1 ) ; ++j ) // jmax == 1 when there only exist "Preferences" items
{
const mainmenu_node::ptr dsp_item_node = dsp_group_node->get_child( j );
if( dsp_item_node->get_type() == mainmenu_node::type_command )
{
pfc::string8 n;
t_uint32 d;
dsp_item_node->get_display( n , d );
out.add_item( n );
//console::printf( CONSOLE_HEADER "%s" , n.toString() );
}
else if( dsp_item_node->get_type() == mainmenu_node::type_separator )
{
// stop when encountered type_separator
break;
}
}
return;
}
}
return;
}
示例2: set_fields
void set_fields(pfc::list_t<field_t> & p_source)
{
t_size i, count = p_source.get_count();
m_fields.set_count(count);
for (i=0; i<count; i++)
m_fields[i].m_name = p_source[i].m_name;
}
示例3: initEntries
void dsp_preset_switcher::initEntries( pfc::list_t<pfc::string8> &out ) const
{
// clear existing entries
addEntry( "" ); // ensure a 1-item height empty item-list is displayed
clearEntires();
// get dsp names
out.remove_all();
findDspNames( out );
// add to combo box
for( t_size i = 0 , imax = out.get_count(); i < imax ; ++i )
{
addEntry( out[i] );
}
return;
}
示例4: get_insert_items
void fields_list_view_t::get_insert_items(t_size base, t_size count, pfc::list_t<t_list_view::t_item_insert> & items)
{
t_size i;
items.set_count(count);
for (i = 0; i < count; i++)
{
items[i].m_subitems.add_item(m_fields[base + i].m_name_friendly);
items[i].m_subitems.add_item(m_fields[base + i].m_name);
}
}
示例5: get_insert_items
void get_insert_items(t_size base, t_size count, pfc::list_t<t_list_view::t_item_insert> & items)
{
t_size i;
items.set_count(count);
for (i=0; i<count; i++)
{
items[i].m_subitems.add_item(filter_panel::cfg_field_list[base+i].m_name);
items[i].m_subitems.add_item(filter_panel::cfg_field_list[base+i].m_field);
}
}
示例6: enum_mobile_devices
void enum_mobile_devices(pfc::list_t<device_instance_info_t> & p_out)
{
HDEVINFO di = SetupDiGetClassDevs(&InterfaceClassGuid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE);
if (di != INVALID_HANDLE_VALUE)
{
SP_DEVINFO_DATA did;
memset(&did, 0, sizeof(did));
did.cbSize = sizeof(did);
DWORD i;
for (i=0; SetupDiEnumDeviceInfo(di, i, &did); i++)
{
//if (did.ClassGuid == GUID_DEVCLASS_USB)
{
ULONG DevDiskLen=0;
pfc::array_t<WCHAR> DevDisk;
if (CR_SUCCESS == CM_Get_Device_ID_Size(&DevDiskLen, did.DevInst, NULL))
{
DevDisk.set_size(DevDiskLen+1);
DevDisk.fill_null();
if (CR_SUCCESS == CM_Get_Device_ID(did.DevInst, DevDisk.get_ptr(), DevDisk.get_size(), NULL))
{
if (g_check_devid_is_mobile_device(DevDisk.get_ptr()))
{
device_instance_info_t temp;
temp.m_handle = did.DevInst;
temp.m_path = DevDisk.get_ptr();
p_out.add_item(temp);
console::formatter() << "iPod manager: USB AMD enumerator: Found " << Tu(DevDisk.get_ptr());
}
}
}
}
}
SetupDiDestroyDeviceInfoList(di);
}
if (!p_out.get_count())
console::formatter() << "iPod manager: USB AMD enumerator: No devices found!";
}
示例7: Tag
FileTagMap::FileTagMap(Release &release, pfc::list_t<metadb_handle_ptr> tracks, size_t selected_medium) {
auto current_medium = 0;
auto current_track = 0;
if (tracks.get_count() < release.track_count()) {
current_medium = selected_medium;
}
for (unsigned int i = 0; i < tracks.get_count(); i++) {
auto &medium = *release.get_medium(current_medium);
auto &track = *medium.get_track(current_track);
set(tracks[i], Tag(release, medium, track));
if (++current_track < medium.track_count()) continue;
if (++current_medium < release.medium_count()) {
current_track = 0;
continue;
}
return;
}
}
示例8: get_insert_items
void playlist_switcher_t::get_insert_items (t_size base, t_size count, pfc::list_t<t_list_view::t_item_insert> & p_out)
{
p_out.set_count(count);
t_size i;
for (i=0;i<count; i++)
{
p_out[i].m_subitems.set_count(1);
pfc::string8 temp;
m_playlist_api->playlist_get_name(i+base, temp);
p_out[i].m_subitems[0].set_string( playlist_format_name_t(i+base, temp, get_playing_playlist()) );
}
}
示例9: on_message
LRESULT menu_extension::on_message(HWND wnd,UINT msg,WPARAM wp,LPARAM lp)
{
switch (msg)
{
case WM_CREATE:
{
initialised = true;
mainmenu_root_group::g_get_root_items(m_buttons);
t_size button_count = m_buttons.get_count();
pfc::array_t<TBBUTTON> tbb;
tbb.set_size(button_count);
memset(tbb.get_ptr(), 0, tbb.get_size() * sizeof(TBBUTTON));
wnd_menu = CreateWindowEx(/*TBSTYLE_EX_MIXEDBUTTONS|*/WS_EX_TOOLWINDOW, TOOLBARCLASSNAME, NULL,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TBSTYLE_FLAT | TBSTYLE_TRANSPARENT | TBSTYLE_LIST | CCS_NORESIZE | CCS_NOPARENTALIGN | CCS_NODIVIDER,
0, 0, 0, 25, wnd, (HMENU)ID_MENU, core_api::get_my_instance(), NULL);
if (wnd_menu)
{
SetWindowLongPtr(wnd_menu, GWLP_USERDATA, (LPARAM)(this));
SendMessage(wnd_menu, TB_SETBITMAPSIZE, (WPARAM)0, MAKELONG(0, 0));
SendMessage(wnd_menu, TB_SETBUTTONSIZE, (WPARAM)0, MAKELONG(0,/*GetSystemMetrics(SM_CYMENUSIZE)*/0));
SendMessage(wnd_menu, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);
unsigned n, count = tbb.get_size();
for (n = 0; n < count; n++)
{
tbb[n].iBitmap = I_IMAGECALLBACK;
tbb[n].idCommand = n + 1;
tbb[n].fsState = TBSTATE_ENABLED;
tbb[n].fsStyle = BTNS_DROPDOWN | BTNS_AUTOSIZE;
tbb[n].dwData = 0;
tbb[n].iString = (int)m_buttons[n].m_name_with_accelerators.get_ptr();
}
SendMessage(wnd_menu, TB_ADDBUTTONS, (WPARAM)tbb.get_size(), (LPARAM)(LPTBBUTTON)tbb.get_ptr());
// SendMessage(wnd_menu, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
// SendMessage(wnd_menu, TB_AUTOSIZE, 0, 0);
//if (is_win2k_or_newer())
{
BOOL a = true;
SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &a, 0);
SendMessage(wnd_menu, WM_UPDATEUISTATE, MAKEWPARAM(a ? UIS_CLEAR : UIS_SET, UISF_HIDEACCEL), 0);
}
// SendMessage(wnd_menu, TB_SETPARENT, (WPARAM) (HWND)wnd_host, 0);
menuproc = (WNDPROC)SetWindowLongPtr(wnd_menu, GWLP_WNDPROC, (LPARAM)main_hook);
}
break;
}
case WM_WINDOWPOSCHANGED:
{
LPWINDOWPOS lpwp = (LPWINDOWPOS)lp;
if (!(lpwp->flags & SWP_NOSIZE))
{
//SIZE sz = {0,0};
//SendMessage(wnd_menu, TB_GETMAXSIZE, NULL, (LPARAM)&sz);
RECT rc = { 0,0,0,0 };
t_size count = m_buttons.get_count();
int cx = lpwp->cx;
int cy = lpwp->cy;
int extra = 0;
if (count && (BOOL)SendMessage(wnd_menu, TB_GETITEMRECT, count - 1, (LPARAM)(&rc)))
{
cx = min(cx, rc.right);
cy = min(cy, rc.bottom);
extra = (lpwp->cy - rc.bottom) / 2;
}
SetWindowPos(wnd_menu, 0, 0, extra, cx, cy, SWP_NOZORDER);
RedrawWindow(wnd, 0, 0, RDW_ERASE | RDW_INVALIDATE);
}
break;
}
case WM_NOTIFY:
{
if (((LPNMHDR)lp)->idFrom == ID_MENU) {
switch (((LPNMHDR)lp)->code)
{
case TBN_HOTITEMCHANGE:
{
if (!(((LPNMTBHOTITEM)lp)->dwFlags & HICF_LEAVING) && (((LPNMTBHOTITEM)lp)->dwFlags & HICF_MOUSE || ((LPNMTBHOTITEM)lp)->dwFlags & HICF_LMOUSE))
redrop = true;
break;
}
case TBN_DROPDOWN:
{
if (redrop)
PostMessage(wnd, MSG_CREATE_MENU, ((LPNMTOOLBAR)lp)->iItem, 0);
else
//.........这里部分代码省略.........
示例10: on_init
virtual void on_init(HWND p_wnd) {
static_api_ptr_t<playlist_manager> pm;
active_playlist = pm->get_active_playlist();
pm->activeplaylist_get_all_items(all_items);
pm->activeplaylist_get_selected_items(selected_items);
playlist_length = all_items.get_count();
first_pos = all_items.find_item(selected_items[0]);
select_mask = bit_array_bittable(playlist_length);
pm->activeplaylist_get_selection_mask(select_mask);
}
示例11: add_value
void add_value (const char * p_value)
{
t_size index;
if (!m_values.bsearch_t(stricmp_utf8, p_value, index))
{
if (m_values.get_count() < max_values)
m_values.insert_item(p_value, index);
else
m_truncated = true;
}
}
示例12: g_populate_tree
void g_populate_tree ( HWND wnd_tree, cui::fcl::group_list & list, const cui::fcl::group_list_filtered & filtered, HTREEITEM ti_parent = TVI_ROOT)
{
t_size i, count = filtered.get_count();
for (i=0; i<count; i++)
{
pfc::string8 name;
filtered[i]->get_name(name);
HTREEITEM item = treeview::insert_item(wnd_tree, name, m_nodes.get_count() , ti_parent);
m_nodes.add_item(t_node(item, filtered[i]));
TreeView_SetCheckState(wnd_tree, item, TRUE);
cui::fcl::group_list_filtered filtered2(list, filtered[i]->get_guid());
list.remove_by_guid(filtered[i]->get_guid());
g_populate_tree(wnd_tree, list, filtered2, item);
}
}
示例13: have_node_checked
bool have_node_checked (const GUID & pguid)
{
t_size i, count = m_nodes.get_count();
for (i=0; i<count; i++)
{
if (m_nodes[i].group->get_guid() == pguid)
return m_nodes[i].checked;
}
return false;
}
示例14: on_entry
bool directory_callback_full_impl::on_entry(filesystem * owner, abort_callback & p_abort, const char * url, bool is_subdirectory, const t_filestats & p_stats)
{
p_abort.check_e();
m_data.add_item(pfc::rcnew_t<t_entry>(url, is_subdirectory, p_stats));
if (is_subdirectory)
{
if (m_recur)
{
try
{
owner->list_directory(url, *this, p_abort);
}
catch (exception_io const &) {}
}
}
return true;
}
示例15: get_num_items
//public:
unsigned get_num_items()
{
//return 1;
// see if we already cached all this jazz
if ( g_mm_names.get_count() > 0 )
{
return g_mm_names.get_count();
}
unsigned total = 0;
service_enum_t<mainmenu_commands> e;
service_ptr_t<mainmenu_commands> ptr;
g_mm_names.remove_all();
g_mm_guids.remove_all();
while(e.next(ptr))
{
unsigned count = ptr->get_command_count();
for ( unsigned n = 0; n < count; n++ )
{
pfc::string8 path;
pfc::string8 name;
GUID guid;
t_uint32 p_flags;
pfc::string8 str_display;
ptr->get_display( n, str_display, p_flags );
ptr->get_name( n, name );
guid = ptr->get_command( n );
find_menu_path( ptr->get_parent(), path );
g_mm_names.add_item( name );
g_mm_guids.add_item( guid );
g_mm_paths.add_item( path );
}
total += count;
}
return total;
}