本文整理汇总了C++中CAtlArray类的典型用法代码示例。如果您正苦于以下问题:C++ CAtlArray类的具体用法?C++ CAtlArray怎么用?C++ CAtlArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CAtlArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAudioFilter
void CMediaFormats::GetAudioFilter(CString& filter, CAtlArray<CString>& mask)
{
CString strTemp;
filter += _T("Audio files (all types)|");
mask.Add(_T(""));
for(size_t i = 0; i < GetCount(); i++)
{
CMediaFormatCategory& mfc = GetAt(i);
if(mfc.IsAudioOnly() != 1 || mfc.GetEngineType() != DirectShow) continue;
strTemp = GetAt(i).GetFilter() + _T(";");
mask[0] += strTemp;
filter += strTemp;
}
mask[0].TrimRight(_T(";"));
filter.TrimRight(_T(";"));
filter += _T("|");
for(size_t i = 0; i < GetCount(); i++)
{
CMediaFormatCategory& mfc = GetAt(i);
if(mfc.IsAudioOnly() != 1 || mfc.GetEngineType() != DirectShow) continue;
filter += mfc.GetLabel() + _T("|") + GetAt(i).GetFilter() + _T("|");
mask.Add(mfc.GetFilter());
}
filter += _T("All files (*.*)|(*.*)|");
mask.Add(_T("*.*"));
filter += _T("|");
}
示例2: GetFilter
void CMediaFormats::GetFilter(CString& filter, CAtlArray<CString>& mask)
{
CString strTemp;
filter += _T("Media files (all types)|");
mask.Add(_T(""));
for(size_t i = 0; i < GetCount(); i++)
{
strTemp = GetAt(i).GetFilter() + _T(";");;
mask[0] += strTemp;
filter += strTemp;
}
mask[0].TrimRight(_T(";"));
filter.TrimRight(_T(";"));
filter += _T("|");
for(size_t i = 0; i < GetCount(); i++)
{
CMediaFormatCategory& mfc = GetAt(i);
filter += mfc.GetLabel() + _T("|" + GetAt(i).GetFilter() + _T("|"));
mask.Add(mfc.GetFilter());
}
filter.Append( ResStr(IDS_FILEOPEN_DISLOG_ALL_MEDIA_TYPE) );
mask.Add(_T("*.*"));
filter += _T("|");
}
示例3: GetCount
// Calling this function with bEnable equals to true when
// shuffle is already enabled will re-shuffle the tracks.
void CPlaylist::SetShuffle(bool bEnable)
{
m_bShuffle = bEnable;
if (bEnable && !IsEmpty()) {
m_nShuffledListSize = GetCount();
CAtlArray<plsort_t> positions;
positions.SetCount(m_nShuffledListSize + 1);
srand((unsigned int)time(nullptr));
POSITION pos = GetHeadPosition();
for (size_t i = 0; pos; i++, GetNext(pos)) {
positions[i].n = rand();
positions[i].pos = pos;
}
qsort(positions.GetData(), m_nShuffledListSize, sizeof(plsort_t), compare);
positions[m_nShuffledListSize].pos = nullptr; // Termination
m_posHeadShuffle = positions[0].pos;
m_posTailShuffle = nullptr;
for (size_t i = 0; i < m_nShuffledListSize; i++) {
pos = positions[i].pos;
CPlaylistItem& pli = GetAt(pos);
pli.m_posPrevShuffle = m_posTailShuffle;
pli.m_posNextShuffle = positions[i + 1].pos;
m_posTailShuffle = pos;
}
} else {
m_posHeadShuffle = m_posTailShuffle = nullptr;
m_nShuffledListSize = 0;
}
}
示例4: strXml
UINT_PTR CBkSafeMsgBox2::ShowMutlLineMsg(LPCWSTR pszMsg,
LPCWSTR lpszCaption /* = NULL */,
UINT uType /* = NULL */,
BOOL *pbNoNotifyLater /* = NULL */,
HWND hWndParent /* = ::GetActiveWindow */)
{
CString strMsg = pszMsg, strXml(L""), strXmlPanel(L"");
CAtlArray<CString> arrMsgLine;
if ( 0 == ParseMsgLine(strMsg, arrMsgLine))
return -1;
int nWidth = 0,
nLineCount = arrMsgLine.GetCount(),
nHeight = nLineCount* 18,
nTop = 0;
CRect rcText;
for (int i = 0; i < nLineCount; i++)
{
if (1 == nLineCount)
nTop = 10;
else
nTop = i*18;
strXml.Format(L"<text pos=\"0,%d\">%s</text>", nTop, arrMsgLine[i]);
strXmlPanel += strXml;
rcText = GetTextRect(arrMsgLine[i]);
if (nWidth < rcText.Width())
nWidth = rcText.Width();
}
CRect rc(0, 0, nWidth+10, nHeight);
return ShowPanelMsg(strXmlPanel, &rc, NULL, uType, pbNoNotifyLater, hWndParent);
}
示例5: Toolbar
LRESULT CFunctionPage::OnToolbarDropDown(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
{
LPNMTOOLBAR lpnmtb = (LPNMTOOLBAR) pnmh;
CMenu Menu = m_FunctionManager.CreateSpecFunctionDropMenu();
CToolBarCtrl Toolbar(lpnmtb->hdr.hwndFrom);
CRect r = lpnmtb->rcButton;
Toolbar.ClientToScreen(r);
Toolbar.Detach();
int ID = Menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RETURNCMD, r.left, r.bottom, m_hWnd);
if (!ID)
return 0;
CAtlArray<MessageStruct*> Messages;
VSFunction* pFunc = m_FunctionManager.AddSpecFunction(ID, Messages);
if (pFunc)
{
for (size_t i = 0; i < Messages.GetCount(); i++)
{
HandlerStruct Handler;
if (m_MessageManager.InsertWindowsMessageHandler(Messages[i], Handler))
{
AddHandler(&Handler);
}
}
int k = m_Functions.AddString(pFunc->Name);
m_Functions.SetItemDataPtr(k, pFunc);
}
return 0;
}
示例6: CheckPointer
HRESULT CMpaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
{
CheckPointer(pAsyncReader, E_POINTER);
HRESULT hr = E_FAIL;
m_pFile.Free();
m_pFile.Attach(DNew CMpaSplitterFile(pAsyncReader, hr));
if (!m_pFile) {
return E_OUTOFMEMORY;
}
if (FAILED(hr)) {
m_pFile.Free();
return hr;
}
CAtlArray<CMediaType> mts;
mts.Add(m_pFile->GetMediaType());
CAutoPtr<CBaseSplitterOutputPin> pPinOut(DNew CBaseSplitterOutputPin(mts, L"Audio", this, this, &hr));
AddOutputPin(0, pPinOut);
m_rtNewStart = m_rtCurrent = 0;
m_rtNewStop = m_rtStop = m_rtDuration = m_pFile->GetDuration();
SetID3TagProperties(this, m_pFile->ID3Tag);
return m_pOutputs.GetCount() > 0 ? S_OK : E_FAIL;
}
示例7: ScanPathSync
void SlimItem::ScanPathSync()
{
DWORD dwAttributes;
CAtlArray<CString> itemPaths;
GetPaths(itemPaths);
for (size_t i = 0; i < itemPaths.GetCount(); i++)
{
dwAttributes = ::GetFileAttributes(itemPaths[i]);
if (INVALID_FILE_ATTRIBUTES == dwAttributes)
continue;
if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if (!slimhelper::ScanDirectory(itemPaths[i], this))
break;
}
else
{
slimhelper::ScanFile(itemPaths[i], 0, INVALID_FILE_ATTRIBUTES, this);
}
}
CheckEnable();
::PostMessage(m_hNotifyWnd, SLIM_WM_ITEM_SCAN_END, 0, 0);
}
示例8: CheckPointer
HRESULT CMpaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
{
CheckPointer(pAsyncReader, E_POINTER);
HRESULT hr = E_FAIL;
m_pFile.Free();
m_pFile.Attach(new CMpaSplitterFile(pAsyncReader, hr));
if(!m_pFile) return E_OUTOFMEMORY;
if(FAILED(hr)) {m_pFile.Free(); return hr;}
CAtlArray<CMediaType> mts;
mts.Add(m_pFile->GetMediaType());
CAutoPtr<CBaseSplitterOutputPin> pPinOut(new CBaseSplitterOutputPin(mts, L"Audio", this, this, &hr));
AddOutputPin(0, pPinOut);
m_rtNewStart = m_rtCurrent = 0;
m_rtNewStop = m_rtStop = m_rtDuration = m_pFile->GetDuration();
CStringW str, title;
if(m_pFile->m_tags.Lookup('TIT2', str)) title = str;
if(m_pFile->m_tags.Lookup('TYER', str) && !title.IsEmpty() && !str.IsEmpty()) title += L" (" + str + L")";
if(!title.IsEmpty()) SetProperty(L"TITL", title);
if(m_pFile->m_tags.Lookup('TPE1', str)) SetProperty(L"AUTH", str);
if(m_pFile->m_tags.Lookup('TCOP', str)) SetProperty(L"CPYR", str);
if(m_pFile->m_tags.Lookup('COMM', str)) SetProperty(L"DESC", str);
return m_pOutputs.GetCount() > 0 ? S_OK : E_FAIL;
}
示例9: Expand
bool TrackEntry::Expand(CBinary& data, UINT64 Scope)
{
if (ces.ce.IsEmpty()) {
return true;
}
CAtlArray<ContentEncoding*> cearray;
POSITION pos = ces.ce.GetHeadPosition();
while (pos) {
cearray.Add(ces.ce.GetNext(pos));
}
qsort(cearray.GetData(), cearray.GetCount(), sizeof(ContentEncoding*), cesort);
for (int i = (int)cearray.GetCount() - 1; i >= 0; i--) {
ContentEncoding* ce = cearray[i];
if (!(ce->ContentEncodingScope & Scope)) {
continue;
}
if (ce->ContentEncodingType == ContentEncoding::Compression) {
if (!data.Decompress(ce->cc)) {
return false;
}
} else if (ce->ContentEncodingType == ContentEncoding::Encryption) {
// TODO
return false;
}
}
return true;
}
示例10: GetAudioFilter
void CMediaFormats::GetAudioFilter(CString& filter, CAtlArray<CString>& mask)
{
CString strTemp;
filter += ResStr(IDS_MEDIAFORMATS_36);
mask.Add(_T(""));
for(int i = 0; i < GetCount(); i++)
{
CMediaFormatCategory& mfc = GetAt(i);
if(!mfc.IsAudioOnly() || mfc.GetEngineType() != DirectShow) continue;
strTemp = GetAt(i).GetFilter() + _T(";");
mask[0] += strTemp;
filter += strTemp;
}
mask[0].TrimRight(_T(";"));
filter.TrimRight(_T(";"));
filter += _T("|");
for(int i = 0; i < GetCount(); i++)
{
CMediaFormatCategory& mfc = GetAt(i);
if(!mfc.IsAudioOnly() || mfc.GetEngineType() != DirectShow) continue;
filter += mfc.GetLabel() + _T("|") + GetAt(i).GetFilter() + _T("|");
mask.Add(mfc.GetFilter());
}
filter += ResStr(IDS_MEDIAFORMATS_35);
mask.Add(_T("*.*"));
filter += _T("|");
}
示例11: strTmp
int CBkSafeMsgBox2::ParseMsgLine(CString strMsg, CAtlArray<CString>& arrMsg)
{
int nRet = -1;
if (TRUE == strMsg.IsEmpty())
return nRet;
arrMsg.RemoveAll();
strMsg.Replace(_T("\\n"), _T("\n"));
int nIndex = -1;
strMsg += L"\n";
CString strTmp(L""), msg = strMsg;;
nIndex = msg.Find(L"\n");
while (-1 != nIndex)
{
strTmp = msg.Left(nIndex);
if (strTmp.GetLength())
arrMsg.Add(strTmp);
msg = msg.Mid(nIndex+1);
nIndex = msg.Find(L"\n");
}
return arrMsg.GetCount();
}
示例12: GetFilter
void CMediaFormats::GetFilter(CString& filter, CAtlArray<CString>& mask)
{
CString strTemp;
filter += ResStr(IDS_MEDIAFORMATS_34);
mask.Add(_T(""));
for(int i = 0; i < GetCount(); i++)
{
strTemp = GetAt(i).GetFilter() + _T(";");
mask[0] += strTemp;
filter += strTemp;
}
mask[0].TrimRight(_T(";"));
filter.TrimRight(_T(";"));
filter += _T("|");
for(int i = 0; i < GetCount(); i++)
{
CMediaFormatCategory& mfc = GetAt(i);
filter += mfc.GetLabel() + _T("|" + GetAt(i).GetFilter() + _T("|"));
mask.Add(mfc.GetFilter());
}
filter += ResStr(IDS_MEDIAFORMATS_35);
mask.Add(_T("*.*"));
filter += _T("|");
}
示例13: OnViewBBCode
LRESULT CHistoryWindow::OnViewBBCode(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
TreeItem* item = m_treeView.selectedItem();
if(!item) return 0;
CAtlArray<CUrlListItem> items;
if(item->level()==0)
{
CHistorySession* ses = reinterpret_cast<CHistorySession*>(item->userData());
for(int i=0; i<ses->entriesCount(); i++)
{
CUrlListItem it =fromHistoryItem(ses->entry(i));
items.Add(it);
}
}
else
{
HistoryItem* hit = reinterpret_cast<HistoryItem*>(item->userData());
CUrlListItem it = fromHistoryItem(*hit);
items.Add(it);
}
CResultsWindow rp( pWizardDlg, items,false);
rp.DoModal(m_hWnd);
return 0;
}
示例14: GetAudioFilter
void CMediaFormats::GetAudioFilter(CString& filter, CAtlArray<CString>& mask)
{
CString strTemp;
filter += ResStr(IDS_AG_AUDIOFILES);
mask.Add(_T(""));
for (size_t i = 0; i < GetCount(); i++) {
CMediaFormatCategory& mfc = GetAt(i);
if (mfc.GetFileType() == TAudio/* && mfc.GetEngineType() == DirectShow*/) {
strTemp = GetAt(i).GetFilter() + _T(";");
mask[0] += strTemp;
filter += strTemp;
}
}
mask[0].TrimRight(_T(';'));
filter.TrimRight(_T(';'));
filter += _T("|");
for (size_t i = 0; i < GetCount(); i++) {
CMediaFormatCategory& mfc = GetAt(i);
if (mfc.GetFileType() == TAudio/* && mfc.GetEngineType() == DirectShow*/) {
filter += mfc.GetDescription() + _T("|") + GetAt(i).GetFilter() + _T("|");
mask.Add(mfc.GetFilter());
}
}
filter += ResStr(IDS_AG_ALLFILES);
mask.Add(_T("*.*"));
filter += _T("|");
}
示例15: GetFilter
void CMediaFormats::GetFilter(CString& filter, CAtlArray<CString>& mask) const
{
CString strTemp;
filter += ResStr(IDS_AG_MEDIAFILES);
mask.Add(_T(""));
for (size_t i = 0; i < GetCount(); i++) {
strTemp = GetAt(i).GetFilter() + _T(";");
mask[0] += strTemp;
filter += strTemp;
}
mask[0].TrimRight(_T(';'));
filter.TrimRight(_T(';'));
filter += _T("|");
for (size_t i = 0; i < GetCount(); i++) {
const CMediaFormatCategory& mfc = GetAt(i);
filter += mfc.GetDescription() + _T("|" + GetAt(i).GetFilter() + _T("|"));
mask.Add(mfc.GetFilter());
}
filter += ResStr(IDS_AG_ALLFILES);
mask.Add(_T("*.*"));
filter += _T("|");
}