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


C++ WDL_PtrList类代码示例

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


在下文中一共展示了WDL_PtrList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: toggleActionHook

// Returns:
// -1 = action does not belong to this extension, or does not toggle
//  0 = action belongs to this extension and is currently set to "off"
//  1 = action belongs to this extension and is currently set to "on"
int toggleActionHook(int iCmd)
{
	static WDL_PtrList<const char> sReentrantCmds;
	if (COMMAND_T* cmd = SWSGetCommandByID(iCmd))
	{
		if (cmd->accel.accel.cmd==iCmd && cmd->getEnabled && cmd->doCommand!=SWS_NOOP)
		{
			if (sReentrantCmds.Find(cmd->id) == -1)
			{
				sReentrantCmds.Add(cmd->id);
				int state = cmd->getEnabled(cmd);
				sReentrantCmds.Delete(sReentrantCmds.Find(cmd->id));
				return state;
			}
#ifdef ACTION_DEBUG
			else
			{
				OutputDebugString("toggleActionHook - recursive action: ");
				OutputDebugString(cmd->id);
				OutputDebugString("\n");
			}
#endif
		}
	}
	return -1;
}
开发者ID:pottootje1982,项目名称:recorded-midi-cleaner,代码行数:30,代码来源:sws_extension.cpp

示例2:

WDL_PtrList<void>* FilteredVisState::GetFilteredTracks()
{
	static WDL_PtrList<void> tracks;
	tracks.Empty(false);
	
	for (int i = 1; i <= GetNumTracks(); i++)
	{
		MediaTrack* tr = CSurf_TrackFromID(i, false);
		if (MatchesFilter(tr))
			tracks.Add(tr);
	}
	return &tracks;
}
开发者ID:Breeder,项目名称:sws,代码行数:13,代码来源:TracklistFilter.cpp

示例3: on_list_update

void MainWnd::on_list_update()
{
    WDL_PtrList<ShellAction> *actions = NULL;
    App *the_app = NULL;
    the_app = App::get();
    actions = the_app->get_tasks();

#ifdef WIN32
    HWND ctrl = GetDlgItem(m_hwnd, IDC_TASKS);
    int sel_id = -1;
    sel_id = ListView_GetCurSel(ctrl);
    ListView_DeleteAllItems(ctrl);

    if(!actions->GetSize())
        return;

    for(int i = 0; i < actions->GetSize(); i++)
    {
        LVITEM lvitem;
        WDL_String tmp;
        char buf[128];
        ShellAction *action = actions->Get(i);

        lvitem.mask = LVIF_TEXT | LVIF_PARAM;
        lvitem.iItem = i;
        lvitem.iSubItem = 0;
        lvitem.lParam = (LPARAM)action->get_id();
        lvitem.cchTextMax = strlen(action->get_title());
        lvitem.pszText = action->get_title();

        ListView_InsertItem(ctrl, &lvitem);
        ListView_SetItemText(ctrl, i, 1, action->get_path());

        tmp = "Every ";
        itoa(action->get_interval(), buf, 10);
        tmp.Append(buf);
        tmp.Append(" ");
        tmp.Append(RUN_TYPE_LABELS[action->get_interval_type()]);

        ListView_SetItemText(ctrl, i, 2, tmp.Get());
    }

    if (sel_id >= 0 && m_selected_task)
    {
        ShellAction *action = the_app->get_task_by_id(sel_id + 1);
        the_app->activate_task(action);
        ListView_SetItemState(ctrl, sel_id, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
    }
#endif // WIN32
}
开发者ID:L1quid,项目名称:Slumber,代码行数:50,代码来源:main_wnd.cpp

示例4: hookCommandProc

bool hookCommandProc(int iCmd, int flag)
{
	static WDL_PtrList<const char> sReentrantCmds;

	// for Xen extensions
	g_KeyUpUndoHandler=0;

	// "Hack" to make actions will #s less than 1000 work with SendMessage (AHK)
	// no recursion check here: handled by REAPER
	if (iCmd < 1000)
		return KBD_OnMainActionEx(iCmd, 0, 0, 0, g_hwndParent, NULL) ? true : false; // C4800

	// Special case for checking recording
	if (iCmd == 1013 && !RecordInputCheck())
		return true;

	// Ignore commands that don't have anything to do with us from this point forward
	if (COMMAND_T* cmd = SWSGetCommandByID(iCmd))
	{
		if (cmd->accel.accel.cmd==iCmd && cmd->doCommand && cmd->doCommand!=SWS_NOOP)
		{
			if (sReentrantCmds.Find(cmd->id) == -1)
			{
				sReentrantCmds.Add(cmd->id);
				cmd->fakeToggle = !cmd->fakeToggle;
#ifndef DEBUG_PERFORMANCE_TIME
				cmd->doCommand(cmd);
#else
				CommandTimer(cmd);
#endif
				sReentrantCmds.Delete(sReentrantCmds.Find(cmd->id));
				return true;
			}
#ifdef ACTION_DEBUG
			else
			{
				OutputDebugString("hookCommandProc - recursive action: ");
				OutputDebugString(cmd->id);
				OutputDebugString("\n");
			}
#endif
		}
	}
	return false;
}
开发者ID:pottootje1982,项目名称:recorded-midi-cleaner,代码行数:45,代码来源:sws_extension.cpp

示例5: TrackPopupMenu

int TrackPopupMenu(HMENU hMenu, int flags, int xpos, int ypos, int resvd, HWND hwnd, const RECT *r)
{
  if (!hMenu || m_trackingMenus.GetSize()) return 0;

  ReleaseCapture();
  m_trackingPar=hwnd;
  m_trackingFlags=flags;
  m_trackingRet=-1;
  m_trackingPt.x=xpos;
  m_trackingPt.y=ypos;
  submenuWndProc(new HWND__(NULL,0,NULL,"menu",false,submenuWndProc,NULL),WM_CREATE,0,(LPARAM)hMenu);

  printf("enter trackpopupmenu loop\n");
  while (m_trackingRet<0 && m_trackingMenus.GetSize())
  {
    void SWELL_RunMessageLoop();
    SWELL_RunMessageLoop();
    Sleep(10);
  }
  printf("leave trackpopupmenu loop\n");

  int x=m_trackingMenus.GetSize()-1;
  while (x>=0)
  {
    HWND h = m_trackingMenus.Get(x);
    m_trackingMenus.Delete(x);
    if (h) DestroyWindow(h);
    x--;
  }
  if (!(flags&TPM_NONOTIFY) && m_trackingRet>0) 
    SendMessage(hwnd,WM_COMMAND,m_trackingRet,0);
  
  return m_trackingRet>0?m_trackingRet:0;
}
开发者ID:aidush,项目名称:openmpt,代码行数:34,代码来源:swell-menu-generic.cpp

示例6: AddString

 int AddString(const WDL_FastString &s)
 {
   WDL_FastString *ns = new WDL_FastString;
   *ns = s;
   m_strings.Add(ns);
   return m_strings.GetSize()-1+STRING_INDEX_BASE;
 }
开发者ID:robksawyer,项目名称:autotalent_64bit_osx,代码行数:7,代码来源:test.cpp

示例7: RegisterToMarkerRegionUpdates

void RegisterToMarkerRegionUpdates(SNM_MarkerRegionListener* _listener)
{
#ifdef _SNM_MUTEX
	SWS_SectionLock lock(&g_mkrRgnListenersMutex);
#endif
	if (_listener && g_mkrRgnListeners.Find(_listener) < 0)
		g_mkrRgnListeners.Add(_listener);
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:8,代码来源:SnM_Marker.cpp

示例8: UnregisterToMarkerRegionUpdates

void UnregisterToMarkerRegionUpdates(SNM_MarkerRegionListener* _listener)
{
#ifdef _SNM_MUTEX
	SWS_SectionLock lock(&g_mkrRgnListenersMutex);
#endif
	int idx = _listener ? g_mkrRgnListeners.Find(_listener) : -1;
	if (idx >= 0)
		g_mkrRgnListeners.Delete(idx, false);
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:9,代码来源:SnM_Marker.cpp

示例9: delete

 ~FontStorage()
 {
   int i, n = m_fonts.GetSize();
   for (i = 0; i < n; ++i)
   {
     delete(m_fonts.Get(i)->font);
   }
   m_fonts.Empty(true);
 }
开发者ID:AdrianGin,项目名称:Pathogen,代码行数:9,代码来源:IGraphics.cpp

示例10: ContinuousActionRegister

/******************************************************************************
* Continuous actions                                                          *
******************************************************************************/
bool ContinuousActionRegister (BR_ContinuousAction* action)
{
	if (action && kbd_getTextFromCmd(action->cmd, NULL) && g_actions.FindSorted(action, &CompareActionsByCmd) == -1)
	{
		g_actions.InsertSorted(action, &CompareActionsByCmd);
		return true;
	}
	else
		return false;
}
开发者ID:wolqws,项目名称:sws,代码行数:13,代码来源:BR_ContinuousActions.cpp

示例11: Find

 LICE_IFont* Find(IText* pTxt)
 {
   WDL_MutexLock lock(&m_mutex);
   int i = 0, n = m_fonts.GetSize();
   for (i = 0; i < n; ++i)
   {
     FontKey* key = m_fonts.Get(i);
     if (key->size == pTxt->mSize && key->orientation == pTxt->mOrientation && key->style == pTxt->mStyle && !strcmp(key->face, pTxt->mFont)) return key->font;
   }
   return 0;
 }
开发者ID:AdrianGin,项目名称:Pathogen,代码行数:11,代码来源:IGraphics.cpp

示例12: AddFontResourceEx

int AddFontResourceEx(LPCTSTR str, DWORD fl, void *pdv)
{
  if (str && *str)
  {
    int x; 
    for (x=0;x<s_registered_fonts.GetSize();x++)
      if (!strcmp(str,s_registered_fonts.Get(x))) return 0;
    s_registered_fonts.Add(strdup(str));
    return 1;
  } 
  return 0;
}
开发者ID:kronihias,项目名称:reaper_ambix,代码行数:12,代码来源:swell-gdi-lice.cpp

示例13: OscInit

bool OscInit(OscHandler* osc)
{
  KillOscThread();
  if (s_osc_handlers.Find(osc) < 0)
  {
    // insert at the top, so new listeners will block existing handlers
    s_osc_handlers.Insert(0, osc);
  }

  StartOscThread();
  return true;
}
开发者ID:GeoffWaddington,项目名称:ReaperCSurf,代码行数:12,代码来源:osc.cpp

示例14: EndDialog

void EndDialog(HWND wnd, int ret)
{   
  if (!wnd) return;
  
  int x;
  for (x = 0; x < s_modalDialogs.GetSize(); x ++)
    if (s_modalDialogs.Get(x)->hwnd == wnd)  
    {
      s_modalDialogs.Get(x)->has_ret=true;
      s_modalDialogs.Get(x)->ret = ret;
    }
  DestroyWindow(wnd);
  // todo
}
开发者ID:AdrianGin,项目名称:Pathogen,代码行数:14,代码来源:swell-dlg-generic.cpp

示例15: Remove

 void Remove(LICE_IBitmap* bitmap)
 {
   WDL_MutexLock lock(&m_mutex);
   int i, n = m_bitmaps.GetSize();
   for (i = 0; i < n; ++i)
   {
     if (m_bitmaps.Get(i)->bitmap == bitmap)
     {
       m_bitmaps.Delete(i, true);
       delete(bitmap);
       break;
     }
   }
 }
开发者ID:AdrianGin,项目名称:Pathogen,代码行数:14,代码来源:IGraphics.cpp


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