本文整理汇总了C++中WDL_PtrList类的典型用法代码示例。如果您正苦于以下问题:C++ WDL_PtrList类的具体用法?C++ WDL_PtrList怎么用?C++ WDL_PtrList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WDL_PtrList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: GetChildTracks
// callers must unallocate the returned value, if any
WDL_PtrList<MediaTrack>* GetChildTracks(MediaTrack* _tr)
{
int depth = (_tr ? *(int*)GetSetMediaTrackInfo(_tr, "I_FOLDERDEPTH", NULL) : 0);
if (depth == 1)
{
WDL_PtrList<MediaTrack>* childTracks = new WDL_PtrList<MediaTrack>;
int trIdx = CSurf_TrackToID(_tr, false) + 1;
while (depth > 0 && trIdx <= GetNumTracks())
{
MediaTrack* tr = CSurf_TrackFromID(trIdx, false);
depth += *(int*)GetSetMediaTrackInfo(tr, "I_FOLDERDEPTH", NULL);
childTracks->Add(tr);
trIdx++;
}
if (childTracks->GetSize())
return childTracks;
else
delete childTracks;
}
return NULL;
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:23,代码来源:SnM_Track.cpp
示例6: AddLeftItem
void AddLeftItem(COMMAND_T* = NULL)
{
for (int i = 1; i <= GetNumTracks(); i++)
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
WDL_PtrList<void> selItems;
// First find selected items
for (int j = 0; j < GetTrackNumMediaItems(tr); j++)
{
MediaItem* selItem = GetTrackMediaItem(tr, j);
if (*(bool*)GetSetMediaItemInfo(selItem, "B_UISEL", NULL))
selItems.Add(selItem);
}
for (int j = 0; j < selItems.GetSize(); j++)
{
double dLeft = *(double*)GetSetMediaItemInfo((MediaItem*)selItems.Get(j), "D_POSITION", NULL);
double dRight = *(double*)GetSetMediaItemInfo((MediaItem*)selItems.Get(j), "D_LENGTH", NULL) + dLeft;
double dMaxLeft = -DBL_MAX;
MediaItem* leftItem = NULL;
for (int k = 0; k < GetTrackNumMediaItems(tr); k++)
{
MediaItem* mi;
mi = GetTrackMediaItem(tr, k);
double dLeft2 = *(double*)GetSetMediaItemInfo(mi, "D_POSITION", NULL);
double dRight2 = *(double*)GetSetMediaItemInfo(mi, "D_LENGTH", NULL) + dLeft2;
if (dLeft2 < dLeft && dRight2 < dRight && dLeft2 > dMaxLeft)
{
dMaxLeft = dLeft2;
leftItem = mi;
}
}
if (leftItem)
GetSetMediaItemInfo(leftItem, "B_UISEL", &g_i1);
}
}
UpdateTimeline();
}
开发者ID:Breeder,项目名称:sws,代码行数:38,代码来源:ItemSel.cpp
示例7: SWELL_DialogBox
int SWELL_DialogBox(SWELL_DialogResourceIndex *reshead, const char *resid, HWND parent, DLGPROC dlgproc, LPARAM param)
{
SWELL_DialogResourceIndex *p=resById(reshead,resid);
if (resid) // allow modal dialogs to be created without template
{
if (!p||(p->windowTypeFlags&SWELL_DLG_WS_CHILD)) return -1;
}
int ret=-1;
HWND hwnd = SWELL_CreateDialog(reshead,resid,parent,dlgproc,param);
// create dialog
if (hwnd)
{
ReleaseCapture(); // force end of any captures
WDL_PtrList<HWND__> enwnds;
extern HWND__ *SWELL_topwindows;
HWND a = SWELL_topwindows;
while (a)
{
if (a->m_enabled && a != hwnd) { EnableWindow(a,FALSE); enwnds.Add(a); }
a = a->m_next;
}
modalDlgRet r = { hwnd,false, -1 };
s_modalDialogs.Add(&r);
ShowWindow(hwnd,SW_SHOW);
while (s_modalDialogs.Find(&r)>=0 && !r.has_ret)
{
void SWELL_RunMessageLoop();
SWELL_RunMessageLoop();
Sleep(10);
}
ret=r.ret;
s_modalDialogs.Delete(s_modalDialogs.Find(&r));
a = SWELL_topwindows;
while (a)
{
if (!a->m_enabled && a != hwnd && enwnds.Find(a)>=0) EnableWindow(a,TRUE);
a = a->m_next;
}
}
// while in list, do something
return ret;
}
开发者ID:AdrianGin,项目名称:Pathogen,代码行数:47,代码来源:swell-dlg-generic.cpp
示例8: 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
示例9: 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
示例10: 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
示例11: 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
示例12: 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
示例13: 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
示例14: 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
示例15: 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
示例16: 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
示例17: 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
示例18: 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
示例19: UpdateMarkerRegionRun
// notify marker/region listeners?
// polled via SNM_CSurfRun()
void UpdateMarkerRegionRun()
{
if (GetTickCount() > g_mkrRgnNotifyTime)
{
g_mkrRgnNotifyTime = GetTickCount() + SNM_MKR_RGN_UPDATE_FREQ;
#ifdef _SNM_MUTEX
SWS_SectionLock lock(&g_mkrRgnListenersMutex);
#endif
if (int sz=g_mkrRgnListeners.GetSize())
if (int updateFlags = UpdateMarkerRegionCache())
for (int i=sz-1; i>=0; i--)
g_mkrRgnListeners.Get(i)->NotifyMarkerRegionUpdate(updateFlags);
}
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:17,代码来源:SnM_Marker.cpp
示例20: runcode
int sInst::runcode(const char *code, bool showerr, bool canfree)
{
if (m_vm)
{
m_pc.Set("");
eel_preprocess_strings(this,m_pc,code);
NSEEL_CODEHANDLE code = NSEEL_code_compile_ex(m_vm,m_pc.Get(),1,canfree ? 0 : NSEEL_CODE_COMPILE_FLAG_COMMONFUNCS);
char *err;
if (!code && (err=NSEEL_code_getcodeerror(m_vm)))
{
if (NSEEL_code_geterror_flag(m_vm)&1) return 1;
if (showerr) fprintf(stderr,"NSEEL_code_compile: %s\n",err);
return -1;
}
else
{
if (code)
{
NSEEL_VM_enumallvars(m_vm,varEnumProc, this);
NSEEL_code_execute(code);
if (canfree) NSEEL_code_free(code);
else m_code_freelist.Add((void*)code);
}
return 0;
}
}
return -1;
}
开发者ID:robksawyer,项目名称:autotalent_64bit_osx,代码行数:28,代码来源:test.cpp
注:本文中的WDL_PtrList类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论