本文整理汇总了C++中IsAttached函数的典型用法代码示例。如果您正苦于以下问题:C++ IsAttached函数的具体用法?C++ IsAttached怎么用?C++ IsAttached使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsAttached函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConnectOutput
/////////////////////////////////////////////////////////////////////////////////////////////
// Output means output of SSM, so this connects plugin inputs to a jack destination
void JackClient::ConnectOutput(int n, const std::string &JackPort) {
if(!IsAttached()) return;
std::cerr << "JackClient::ConnectOutput: connecting source [" << m_OutputPortMap[n]->Name << "] \
to dest [" << JackPort << "]" << std::endl;
if(m_OutputPortMap[n]->ConnectedTo != "") {
if(jack_disconnect(m_Client, jack_port_name(m_OutputPortMap[n]->Port), m_OutputPortMap[n]->ConnectedTo.c_str()))
error("JackClient::ConnectOutput: cannot disconnect output port [%s] to [%s]",
m_OutputPortMap[n]->ConnectedTo.c_str(),
m_OutputPortMap[n]->Name.c_str());
}
m_OutputPortMap[n]->ConnectedTo = JackPort;
if(jack_connect(m_Client, jack_port_name(m_OutputPortMap[n]->Port), JackPort.c_str()))
error("JackClient::ConnectOutput: cannot connect output port [%s] to [%s]",
m_OutputPortMap[n]->Name.c_str(), JackPort.c_str());
m_OutputPortMap[n]->Connected = true;
}
示例2: Refresh
wxMenu *wxMenuBar::Remove(size_t pos)
{
wxMenu *menu = wxMenuBarBase::Remove(pos);
if ( !menu )
return NULL;
if ( IsAttached() )
{
if (s_macInstalledMenuBar == this)
::DeleteMenu( menu->MacGetMenuId() /* m_menus[pos]->MacGetMenuId() */ ) ;
Refresh();
}
m_titles.RemoveAt(pos);
return menu;
}
示例3: MOZ_ASSERT
void
SourceBuffer::Abort(ErrorResult& aRv)
{
MOZ_ASSERT(NS_IsMainThread());
MSE_API("Abort()");
if (!IsAttached()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (mMediaSource->ReadyState() != MediaSourceReadyState::Open) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
AbortBufferAppend();
mContentManager->ResetParserState();
mAttributes->SetAppendWindowStart(0);
mAttributes->SetAppendWindowEnd(PositiveInfinity<double>());
}
示例4: MSE_DEBUG
void
SourceBuffer::Remove(double aStart, double aEnd, ErrorResult& aRv)
{
MSE_DEBUG("%p Remove(Start=%f End=%f)", this, aStart, aEnd);
if (!IsAttached() || mUpdating ||
mMediaSource->ReadyState() != MediaSourceReadyState::Open) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (aStart < 0 || aStart > mMediaSource->Duration() ||
aEnd <= aStart) {
aRv.Throw(NS_ERROR_DOM_INVALID_ACCESS_ERR);
return;
}
StartUpdating();
/// TODO: Run coded frame removal algorithm asynchronously (would call StopUpdating()).
StopUpdating();
}
示例5: ASSERT
BOOL COXShortkeysOrganizer::AddAccelTable(HACCEL hAccelTable,
CMultiDocTemplate* pDocTemplate)
{
ASSERT(hAccelTable!=NULL);
if(!IsAttached())
{
TRACE(_T("COXShortkeysOrganizer::AddAccelTable: there is no attached frame window. You have to attach frame window before calling this function\n"));
return FALSE;
}
COXArrAccelerators* pArrAccels=FindAcceleratorTable(pDocTemplate);
if(pArrAccels!=NULL)
{
TRACE(_T("COXShortkeysOrganizer::AddAccelTable: accelerator table for specified CMultiDocTemplate object has already been added\n"));
return FALSE;
}
OXACCELTABLE accelTable;
accelTable.m_docTemplate=pDocTemplate;
int nAccelCount=::CopyAcceleratorTable(hAccelTable,NULL,0);
if(nAccelCount!=0)
{
ACCEL* pAccel=new ACCEL[nAccelCount];
if (pAccel==NULL)
{
TRACE(_T("COXShortkeysOrganizer::AddAccelTable: failed to copy an accelerator table\n"));
return FALSE;
}
VERIFY(::CopyAcceleratorTable(hAccelTable,pAccel,nAccelCount)==nAccelCount);
for(int nIndex=0; nIndex<nAccelCount; nIndex++)
{
accelTable.m_accelerators.Add(pAccel[nIndex]);
}
delete[] pAccel;
}
m_arrAccelTables.Add(accelTable);
return TRUE;
}
示例6: OnMnuEditCopyUpdateUI
void ThreadSearch::OnMnuEditCopyUpdateUI(wxUpdateUIEvent& event)
{
if ( !IsAttached() )
{
event.Skip(); return;
}
wxWindow* pFocused = wxWindow::FindFocus();
if (not pFocused) return;
wxMenuBar* mbar = Manager::Get()->GetAppFrame()->GetMenuBar();
if (not mbar) return;
bool hasSel = false;
// if the following window have the focus, own the copy.
if ( pFocused == m_pCboSearchExpr )
{
//event.Enable(m_pCboSearchExpr->CanCopy());
hasSel = m_pCboSearchExpr->CanCopy() ;
//LOGIT( _T("OnMnuEditCopyUpdateUI m_pCboSearchExpr") );
}
else if ( pFocused == m_pThreadSearchView->m_pCboSearchExpr )
{
//event.Enable(m_pThreadSearchView->m_pCboSearchExpr->CanCopy());
hasSel = m_pThreadSearchView->m_pCboSearchExpr->CanCopy();
//LOGIT( _T("OnMnuEditCopyUpdateUI m_pThreadSearchView->m_pCboSearchExpr") );
}
else if ( pFocused == static_cast<wxWindow*>(m_pThreadSearchView->m_pSearchPreview) )
{
hasSel = m_pThreadSearchView->m_pSearchPreview->GetSelectionStart() != m_pThreadSearchView->m_pSearchPreview->GetSelectionEnd();
//LOGIT( _T("OnMnuEditCopyUpdateUI m_pSearchPreview") );
}
if ( hasSel )
{
mbar->Enable(idMenuEditCopy, hasSel);
wxToolBar* pMainToolBar = (wxToolBar*) ::wxFindWindowByName(wxT("toolbar"), NULL);
if (pMainToolBar) pMainToolBar->EnableTool(idMenuEditCopy, hasSel);
return;
}
event.Skip();
return;
}
示例7: GetMenuItems
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
{
// we need to find the item's position in the child list
size_t pos;
wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
for ( pos = 0; node; pos++ )
{
if ( node->GetData() == item )
break;
node = node->GetNext();
}
#if wxUSE_ACCEL
// remove the corresponding accel from the accel table
int n = FindAccel(item->GetId());
if ( n != wxNOT_FOUND )
{
delete m_accels[n];
m_accels.RemoveAt(n);
#if wxUSE_OWNER_DRAWN
ResetMaxAccelWidth();
#endif
}
//else: this item doesn't have an accel, nothing to do
#endif // wxUSE_ACCEL
// remove the item from the menu
if ( !::RemoveMenu(GetHmenu(), (UINT)pos, MF_BYPOSITION) )
{
wxLogLastError(wxT("RemoveMenu"));
}
if ( IsAttached() && GetMenuBar()->IsAttached() )
{
// otherwise, the change won't be visible
GetMenuBar()->Refresh();
}
// and from internal data structures
return wxMenuBase::DoRemove(item);
}
示例8: Execute
int HeaderFixup::Execute()
{
// if not attached, exit
if ( !IsAttached() )
return -1;
// if no project is opened -> inform the user and do not operate
const cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
if (!prj)
{
cbMessageBox(_("You need to open a project/workspace before using this plugin!"),
_T("Header Fixup"), wxICON_ERROR | wxOK);
return -1;
}
Execution Dlg(NULL);
Dlg.ShowModal();
return 0;
}// Execute
示例9: wxCHECK_RET
void wxMenuBar::Refresh()
{
if ( IsFrozen() )
return;
wxCHECK_RET( IsAttached(), wxT("can't refresh unattached menubar") );
#if defined(WINCE_WITHOUT_COMMANDBAR)
if (GetToolBar())
{
CommandBar_DrawMenuBar((HWND) GetToolBar()->GetHWND(), 0);
}
#elif defined(WINCE_WITH_COMMANDBAR)
if (m_commandBar)
DrawMenuBar((HWND) m_commandBar);
#else
DrawMenuBar(GetHwndOf(GetFrame()));
#endif
}
示例10: return
bool CEngineTap::Bypass(bool Enable)
{
if (Enable == m_IsBypassed) // if already in requested state
return(TRUE); // nothing to do
#ifdef ENGINE_TAP_NATTER
_tprintf(_T("CEngineTap::Bypass %d\n"), Enable);
#endif
m_IsBypassed = Enable; // update state first to fail safe
if (IsAttached()) { // if attached to plugin
if (Enable) { // if entering bypass
if (!Disconnect(*m_Plugin)) // disconnect from plugin
return(FALSE);
} else { // exiting bypass
if (!Connect(*m_Plugin)) // connect to plugin
return(FALSE);
}
}
return(TRUE);
}
示例11: AbortUpdating
void
SourceBuffer::Abort(ErrorResult& aRv)
{
if (!IsAttached()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (mMediaSource->ReadyState() != MediaSourceReadyState::Open) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (mUpdating) {
// TODO: Abort segment parser loop, buffer append, and stream append loop algorithms.
AbortUpdating();
}
// TODO: Run reset parser algorithm.
mAppendWindowStart = 0;
mAppendWindowEnd = PositiveInfinity<double>();
}
示例12: GetMenuItems
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
{
// we need to find the item's position in the child list
size_t pos;
wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
for ( pos = 0; node; pos++ )
{
if ( node->GetData() == item )
break;
node = node->GetNext();
}
#if wxUSE_ACCEL
RemoveAccel(item);
#endif // wxUSE_ACCEL
// Update indices of radio groups.
if ( m_radioData )
{
if ( m_radioData->UpdateOnRemoveItem(pos) )
{
wxASSERT_MSG( item->IsRadio(),
wxT("Removing non radio button from radio group?") );
}
//else: item being removed is not in a radio group
}
// remove the item from the menu
if ( !::RemoveMenu(GetHmenu(), (UINT)pos, MF_BYPOSITION) )
{
wxLogLastError(wxT("RemoveMenu"));
}
if ( IsAttached() && GetMenuBar()->IsAttached() )
{
// otherwise, the change won't be visible
GetMenuBar()->Refresh();
}
// and from internal data structures
return wxMenuBase::DoRemove(item);
}
示例13: DEBUGLOG
cLiveStreamer::~cLiveStreamer()
{
DEBUGLOG("Started to delete live streamer");
cTimeMs t;
DEBUGLOG("Stopping streamer thread ...");
Cancel(5);
DEBUGLOG("Done.");
cMutexLock lock(&m_FilterMutex);
DEBUGLOG("Detaching");
if(m_PatFilter != NULL && m_Device != NULL) {
m_Device->Detach(m_PatFilter);
delete m_PatFilter;
m_PatFilter = NULL;
}
if (IsAttached()) {
Detach();
}
for (std::list<cTSDemuxer*>::iterator i = m_Demuxers.begin(); i != m_Demuxers.end(); i++) {
if ((*i) != NULL) {
DEBUGLOG("Deleting stream demuxer for pid=%i and type=%i", (*i)->GetPID(), (*i)->GetType());
delete (*i);
}
}
m_Demuxers.clear();
delete m_Queue;
m_uid = 0;
{
cMutexLock lock(&m_DeviceMutex);
m_Device = NULL;
}
DEBUGLOG("Finished to delete live streamer (took %llu ms)", t.Elapsed());
}
示例14: if
bool GDocApp<OptionsFmt>::SetDirty(bool Dirty)
{
if (IsAttached() && (d->Dirty ^ Dirty))
{
// Changing...
if (Dirty)
{
// Setting dirty
d->Dirty = true;
SetCurFile(d->CurFile);
}
else
{
// Clearing dirty
int Result = LgiMsg(this,
LgiLoadString(L_DOCAPP_SAVE_CHANGE, "Do you want to save your changes?"),
d->AppName,
MB_YESNOCANCEL);
if (Result == IDYES)
{
if (!ValidStr(d->CurFile))
{
GMru::OnCommand(IDM_SAVEAS);
}
else
{
_SaveFile(d->CurFile);
}
}
else if (Result == IDCANCEL)
{
return false;
}
d->Dirty = false;
SetCurFile(d->CurFile);
}
OnDirty(d->Dirty);
}
return true;
}
示例15: Append
void
SourceBuffer::AppendData(const uint8_t* aData, uint32_t aLength, ErrorResult& aRv)
{
if (!IsAttached() || mUpdating) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (mMediaSource->ReadyState() == MediaSourceReadyState::Ended) {
mMediaSource->SetReadyState(MediaSourceReadyState::Open);
}
// TODO: Run coded frame eviction algorithm.
// TODO: Test buffer full flag.
MSE_DEBUG("%p Append(ArrayBuffer=%u)", this, aLength);
StartUpdating();
// XXX: For future reference: NDA call must run on the main thread.
mDecoder->NotifyDataArrived(reinterpret_cast<const char*>(aData),
aLength,
mDecoder->GetResource()->GetLength());
// TODO: Run buffer append algorithm asynchronously (would call StopUpdating()).
mDecoder->GetResource()->AppendData(aData, aLength);
// Eviction uses a byte threshold. If the buffer is greater than the
// number of bytes then data is evicted. The time range for this
// eviction is reported back to the media source. It will then
// evict data before that range across all SourceBuffer's it knows
// about.
const int evict_threshold = 1000000;
bool evicted = mDecoder->GetResource()->EvictData(evict_threshold);
if (evicted) {
double start = 0.0;
double end = 0.0;
GetBufferedStartEndTime(&start, &end);
// We notify that we've evicted from the time range 0 through to
// the current start point.
mMediaSource->NotifyEvicted(0.0, start);
}
StopUpdating();
// Schedule the state machine thread to ensure playback starts
// if required when data is appended.
mMediaSource->GetDecoder()->ScheduleStateMachineThread();
}