~BitmapStorage() { int i, n = m_bitmaps.GetSize(); for (i = 0; i < n; ++i) { delete(m_bitmaps.Get(i)->bitmap); } m_bitmaps.Empty(true); }
~FontStorage() { int i, n = m_fonts.GetSize(); for (i = 0; i < n; ++i) { delete(m_fonts.Get(i)->font); } m_fonts.Empty(true); }
void FillHWoutDropDown(HWND _hwnd, int _idc) { char buf[128] = ""; lstrcpyn(buf, __LOCALIZE("None","sws_DLG_149"), sizeof(buf)); SendDlgItemMessage(_hwnd,_idc,CB_ADDSTRING,0,(LPARAM)buf); SendDlgItemMessage(_hwnd,_idc,CB_SETITEMDATA,0,0); // get mono outputs WDL_PtrList<WDL_FastString> monos; int monoIdx=0; while (GetOutputChannelName(monoIdx)) { monos.Add(new WDL_FastString(GetOutputChannelName(monoIdx))); monoIdx++; } // add stereo outputs WDL_PtrList<WDL_FastString> stereos; if (monoIdx) { for(int i=0; i < (monoIdx-1); i++) { WDL_FastString* hw = new WDL_FastString(); hw->SetFormatted(256, "%s / %s", monos.Get(i)->Get(), monos.Get(i+1)->Get()); stereos.Add(hw); } } // fill dropdown for(int i=0; i < stereos.GetSize(); i++) { SendDlgItemMessage(_hwnd,_idc,CB_ADDSTRING,0,(LPARAM)stereos.Get(i)->Get()); SendDlgItemMessage(_hwnd,_idc,CB_SETITEMDATA,i,i+1); // +1 for <none> } for(int i=0; i < monos.GetSize(); i++) { SendDlgItemMessage(_hwnd,_idc,CB_ADDSTRING,0,(LPARAM)monos.Get(i)->Get()); SendDlgItemMessage(_hwnd,_idc,CB_SETITEMDATA,i,i+1); // +1 for <none> } // SendDlgItemMessage(_hwnd,_idc,CB_SETCURSEL,x0,0); monos.Empty(true); stereos.Empty(true); }
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; }
void MacroDebug() { DialogBox(g_hInst,MAKEINTRESOURCE(IDD_MACRODEBUG),g_hwndParent,doDebug); if (g_selectedMacro) { char cCommandText[256]; for (int i = 0; i < g_selectedMacro->m_iNumActions; i++) { sprintf(cCommandText, "Run %s?", kbd_getTextFromCmd(g_selectedMacro->m_pActions[i], NULL)); int iRet = MessageBox(g_hwndParent, cCommandText, g_selectedMacro->m_cName, MB_YESNOCANCEL); if (iRet == IDYES) Main_OnCommand(g_selectedMacro->m_pActions[i], 0); else if (iRet == IDCANCEL) break; } g_selectedMacro = NULL; } g_macros.Empty(true); }
void OscQuit(OscHandler* osc) { if (osc) { int i=s_osc_handlers.Find(osc); if (i >= 0) { KillOscThread(); s_osc_handlers.Delete(i); if (s_osc_handlers.GetSize()) { StartOscThread(); } } } else { KillOscThread(); s_osc_handlers.Empty(); } }