您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ IsPaused函数代码示例

51自学网 2021-06-01 21:42:19
  C++
这篇教程C++ IsPaused函数代码示例写得很实用,希望能帮到您。

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

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

示例1: locker

bool V4L2encRecorder::PauseAndWait(int timeout){    QMutexLocker locker(&m_pauseLock);    if (m_request_pause)    {        if (!IsPaused(true))        {            LOG(VB_RECORD, LOG_INFO, LOC + "PauseAndWait() -- pause");            StopEncoding();            m_paused = true;            m_pauseWait.wakeAll();            if (m_tvrec)                m_tvrec->RecorderPaused();        }    }    else if (IsPaused(true))    {        LOG(VB_RECORD, LOG_INFO, LOC + "PauseAndWait() -- unpause");        StartEncoding();        if (m_stream_data)            m_stream_data->Reset(m_stream_data->DesiredProgram());        m_paused = false;    }    // Always wait a little bit, unless woken up    m_unpauseWait.wait(&m_pauseLock, timeout);    return IsPaused(true);}
开发者ID:tomhughes,项目名称:mythtv,代码行数:34,


示例2: locker

bool IPTVRecorder::PauseAndWait(int timeout){    QMutexLocker locker(&pauseLock);    if (request_pause)    {        if (!IsPaused(true))        {            _channel->GetFeeder()->Stop();            _channel->GetFeeder()->Close();            paused = true;            pauseWait.wakeAll();            if (tvrec)                tvrec->RecorderPaused();        }        unpauseWait.wait(&pauseLock, timeout);    }    if (!request_pause && IsPaused(true))    {        paused = false;        if (recording && !_channel->GetFeeder()->IsOpen())            Open();        if (_stream_data)            _stream_data->Reset(_stream_data->DesiredProgram());        unpauseWait.wakeAll();    }    return IsPaused(true);}
开发者ID:StefanRoss,项目名称:mythtv,代码行数:34,


示例3: locker

// documented in recorderbase.cppbool FirewireRecorder::PauseAndWait(int timeout){    QMutexLocker locker(&pauseLock);    if (request_pause)    {        LOG(VB_RECORD, LOG_INFO, LOC +            QString("PauseAndWait(%1) -- pause").arg(timeout));        if (!IsPaused(true))        {            StopStreaming();            paused = true;            pauseWait.wakeAll();            if (tvrec)                tvrec->RecorderPaused();        }        unpauseWait.wait(&pauseLock, timeout);    }    if (!request_pause && IsPaused(true))    {        LOG(VB_RECORD, LOG_INFO, LOC +            QString("PauseAndWait(%1) -- unpause").arg(timeout));        paused = false;        StartStreaming();        unpauseWait.wakeAll();    }    return IsPaused(true);}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:30,


示例4: SetPause

void byoSnake::OnKeyDown(wxKeyEvent& event){    if ( event.GetKeyCode() == 'p' || event.GetKeyCode() == 'P' )    {        SetPause(!IsPaused());        Refresh();    }    if ( IsPaused() ) return;    if ( event.GetKeyCode() == WXK_LEFT )    {        m_Direction = dLeft;        Move();    }    if ( event.GetKeyCode() == WXK_RIGHT )    {        m_Direction = dRight;        Move();    }    if ( event.GetKeyCode() == WXK_UP )    {        m_Direction = dUp;        Move();    }    if ( event.GetKeyCode() == WXK_DOWN )    {        m_Direction = dDown;        Move();    }}
开发者ID:stahta01,项目名称:codeAdapt_IDE,代码行数:34,


示例5: locker

bool DVBRecorder::PauseAndWait(int timeout){    QMutexLocker locker(&pauseLock);    if (request_pause)    {        if (!IsPaused(true))        {            _stream_handler->RemoveListener(_stream_data);            paused = true;            pauseWait.wakeAll();            if (tvrec)                tvrec->RecorderPaused();        }        unpauseWait.wait(&pauseLock, timeout);    }    if (!request_pause && IsPaused(true))    {        paused = false;        _stream_handler->AddListener(_stream_data, false, true);        unpauseWait.wakeAll();    }    return IsPaused(true);}
开发者ID:Olti,项目名称:mythtv,代码行数:27,


示例6: locker

// documented in recorderbase.cppbool FirewireRecorder::PauseAndWait(int timeout){    QMutexLocker locker(&pauseLock);    if (request_pause)    {        VERBOSE(VB_RECORD, LOC + "PauseAndWait("<<timeout<<") -- pause");        if (!IsPaused(true))        {            StopStreaming();            paused = true;            pauseWait.wakeAll();            if (tvrec)                tvrec->RecorderPaused();        }        unpauseWait.wait(&pauseLock, timeout);    }    if (!request_pause && IsPaused(true))    {        paused = false;        VERBOSE(VB_RECORD, LOC + "PauseAndWait("<<timeout<<") -- unpause");        StartStreaming();        unpauseWait.wakeAll();    }    return IsPaused(true);}
开发者ID:bwarden,项目名称:mythtv,代码行数:28,


示例7: UE_VLOG

bool UPawnAction::Activate(){	bool bResult = false; 	UE_VLOG(GetPawn(), LogPawnAction, Log, TEXT("%s> Activating at priority %s! First start? %s Paused? %s")		, *GetName()		, *GetPriorityName()		, HasBeenStarted() ? TEXT("NO") : TEXT("YES")		, IsPaused() ? TEXT("YES") : TEXT("NO"));	if (HasBeenStarted() && IsPaused())	{		bResult = Resume();	}	else 	{		bResult = Start();		if (bResult == false)		{			UE_VLOG(GetPawn(), LogPawnAction, Log, TEXT("%s> Failed to start.")				, *GetName());			bFailedToStart = true;			SetFinishResult(EPawnActionResult::Failed);			SendEvent(EPawnActionEventType::FailedToStart);		}	}	return bResult;}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:29,


示例8: Play

void FSoundSource::UpdatePause(){	if (IsPaused() && !bIsPausedByGame && !bIsManuallyPaused)	{		Play();	}	else if (!IsPaused() && (bIsManuallyPaused || bIsPausedByGame))	{		Pause();	}}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:11,


示例9: ASSERT

void CDownload::StartTrying(){	ASSERT( ! IsCompleted() || IsSeeding() );	ASSERT( ! IsPaused() );	if ( IsTrying() || IsPaused() || ( IsCompleted() && ! IsSeeding() ) )		return;	if ( ! Network.IsConnected() && ! Network.Connect( TRUE ) )		return;	m_tBegan = GetTickCount();}
开发者ID:GetEnvy,项目名称:Envy,代码行数:12,


示例10: IsPaused

// ----------------------------------------------------------------------------void CMannequinAGState::Pause( bool pause, EAnimationGraphPauser pauser, float fOverrideTransTime /*= -1.0f */ ){	bool bWasPaused = IsPaused();	if (pause)		m_pauseState |= (1<<pauser);	else		m_pauseState &= ~(1<<pauser);	if (bWasPaused != IsPaused())	{		// TODO: do something here?	}}
开发者ID:aronarts,项目名称:FireNET,代码行数:15,


示例11: GetParentTime

voidnsSMILTimeContainer::SetCurrentTime(nsSMILTime aSeekTo){  // SVG 1.1 doesn't specify what to do for negative times so we adopt SVGT1.2's  // behaviour of clamping negative times to 0.  aSeekTo = NS_MAX<nsSMILTime>(0, aSeekTo);  // The following behaviour is consistent with:  // http://www.w3.org/2003/01/REC-SVG11-20030114-errata  //  #getCurrentTime_setCurrentTime_undefined_before_document_timeline_begin  // which says that if SetCurrentTime is called before the document timeline  // has begun we should still adjust the offset.  nsSMILTime parentTime = GetParentTime();  mParentOffset = parentTime - aSeekTo;  mIsSeeking = PR_TRUE;  if (IsPaused()) {    mNeedsPauseSample = PR_TRUE;    mPauseStart = parentTime;  }  if (aSeekTo < mCurrentTime) {    // Backwards seek    mNeedsRewind = PR_TRUE;    ClearMilestones();  }  // Force an update to the current time in case we get a call to GetCurrentTime  // before another call to Sample().  UpdateCurrentTime();  NotifyTimeChange();}
开发者ID:harthur,项目名称:mozilla-central,代码行数:33,


示例12: Load

void Emulator::Run(){	if (!IsReady())	{		Load();		if(!IsReady()) return;	}	if (IsRunning()) Stop();	if (IsPaused())	{		Resume();		return;	}	rpcs3::on_run()();	SendDbgCommand(DID_START_EMU);	m_pause_start_time = 0;	m_pause_amend_time = 0;	m_status = Running;	idm::select<ppu_thread, SPUThread, RawSPUThread, ARMv7Thread>([](u32, cpu_thread& cpu)	{		cpu.run();	});	SendDbgCommand(DID_STARTED_EMU);}
开发者ID:4iDragon,项目名称:rpcs3,代码行数:31,


示例13: CloseFileInternal

bool PAPlayer::CloseFileInternal(bool bAudioDevice /*= true*/){  if (IsPaused())    Pause();  m_bStopPlaying = true;  m_bStop = true;  m_visBufferLength = 0;  StopThread();  // kill both our streams if we need to  for (int i = 0; i < 2; i++)  {    m_decoder[i].Destroy();    if (bAudioDevice)      FreeStream(i);  }  m_currentFile->Reset();  m_nextFile->Reset();  if(bAudioDevice)    g_audioContext.SetActiveDevice(CAudioContext::DEFAULT_DEVICE);  else    FlushStreams();  return true;}
开发者ID:mbolhuis,项目名称:xbmc,代码行数:29,


示例14: time

void csMovieRecorder::ClockAdvance (){  csTicks lastFakeClockTicks = fakeClockTicks;  realVirtualClock->Advance();  csTicks realTicksPerFrame = realVirtualClock->GetElapsedTicks();  /*    To avoid 'jumps' in time when the clock is throttled/unthrottled    we keep our own tick counter, which is either increased by the    real elapsed time (normal mode) or the required frame time (recording).   */  if (!IsRecording() || IsPaused()) {    fakeClockElapsed = realTicksPerFrame;    fakeClockTicks += realTicksPerFrame;  }  else {    ffakeClockTicks += fakeTicksPerFrame;    fakeClockTicks = (csTicks)ffakeClockTicks;    fakeClockElapsed = fakeClockTicks -       lastFakeClockTicks;    // If we're rendering slower than real time, there's nothing we can do about it.    // If we're rendering faster, put in a little delay here.    if (throttle && ((fakeClockElapsed > realTicksPerFrame)))    {      csSleep(fakeClockElapsed - realTicksPerFrame);    }  } }
开发者ID:Tank-D,项目名称:Shards,代码行数:29,


示例15: SetupPlugin

bool csMovieRecorder::EatKey (iEvent& event){  SetupPlugin();  bool down = csKeyEventHelper::GetEventType (&event) == csKeyEventTypeDown;  csKeyModifiers m;  csKeyEventHelper::GetModifiers (&event, m);  bool alt = m.modifiers[csKeyModifierTypeAlt] != 0;  bool ctrl = m.modifiers[csKeyModifierTypeCtrl] != 0;  bool shift = m.modifiers[csKeyModifierTypeShift] != 0;  utf32_char key = csKeyEventHelper::GetCookedCode (&event);  if (down && (key == keyRecord.code) && (alt == keyRecord.alt) &&       (ctrl == keyRecord.ctrl) && (shift == keyRecord.shift))   {    if (IsRecording())	Stop();    else	Start();    return true;  }  if (down && key==keyPause.code && alt==keyPause.alt &&       ctrl==keyPause.ctrl && shift==keyPause.shift)   {    if (IsPaused())	UnPause();    else	Pause();    return true;  }  return false;}
开发者ID:Tank-D,项目名称:Shards,代码行数:33,


示例16: _RecvImpl

		DWORD _RecvImpl()		{			while(!recvThread_.IsAborted())			{				try				{					common::Buffer buf(common::MakeBuffer(common::MAX_UDP_PACKAGE));					SOCKADDR_IN addr = {0};					size_t len = recvSck_.RecvFrom(iocp::Buffer(buf.first.get(), buf.second), &addr);					if( len == 0 )						continue;					char retBuf[4] = {0};					size_t sendLen = recvSck_.SendTo(iocp::Buffer(retBuf), &addr);					assert(sendLen == sizeof(retBuf));					buf.second = len;					if( !IsPaused() )						queue_.Put(buf);				}				catch(std::exception &e)				{					::InterlockedExchange(&isOK_, 0);					::OutputDebugStringA(e.what());				}			}			return 0;		}
开发者ID:lubing521,项目名称:important-files,代码行数:32,


示例17: AudioQueueStart

voidMoose::Sound::CMusicClip::Play(){     if ( IsPaused()) {     m_bPaused = false;     pthread_mutex_lock(&m_pData->mutex);      AudioQueueStart(m_pData->audioQueue, NULL);     pthread_mutex_unlock(&m_pData->mutex); } else  {     if ( IsRunning()) Stop();     if ( m_bHasThread )      {         void *status;         pthread_join(m_thread, &status);         m_bHasThread = false;     }     OSStatus err = pthread_create( &m_thread, NULL, audio_decode_play_proc, this);     if ( err ) {         g_Error << "Could not create thread for music clip, error: " << err << endl;              }    }      		        }
开发者ID:moose3d,项目名称:moose,代码行数:31,


示例18: Update

void AnimationComponent::Update(float dt){	if (IsPaused() || !IsPlaying())	{		return;	}	AnimationData thisAnim = GetCurrentAnim();	int startFrame = thisAnim.startFrame;	float dur = thisAnim.frames[currentFrame];	time += dt * playbackSpeed;	while (time > dur && currentFrame < thisAnim.frames.size())	{		time -= dur;		++currentFrame;		if (playbackFlags & Anim_Loop)		{			currentFrame %= thisAnim.frames.size();		}		else if (currentFrame >= thisAnim.frames.size())		{			state = 0;			return;		}		dur = thisAnim.frames[currentFrame];	}	unsigned int framesPerRow = (unsigned int)(1.0f / mUV.scale.x);		mUV.position.x = ( (currentFrame + startFrame) % framesPerRow) * mUV.scale.x;	mUV.position.y = ( (currentFrame + startFrame) / framesPerRow) * mUV.scale.y;}
开发者ID:Foxious,项目名称:phEngine,代码行数:33,


示例19: Load

void Emulator::Run(){	if (!IsReady())	{		Load();		if(!IsReady()) return;	}	if (IsRunning()) Stop();	if (IsPaused())	{		Resume();		return;	}		GetCallbacks().on_run();	m_pause_start_time = 0;	m_pause_amend_time = 0;	m_state = system_state::running;	auto on_select = [](u32, cpu_thread& cpu)	{		cpu.run();	};	idm::select<ppu_thread>(on_select);	idm::select<ARMv7Thread>(on_select);	idm::select<RawSPUThread>(on_select);	idm::select<SPUThread>(on_select);}
开发者ID:Pataua,项目名称:rpcs3,代码行数:33,


示例20: Load

void Emulator::Run(){	if (!IsReady())	{		Load();		if(!IsReady()) return;	}	if (IsRunning()) Stop();	if (IsPaused())	{		Resume();		return;	}	rpcs3::on_run()();	SendDbgCommand(DID_START_EMU);	m_pause_start_time = 0;	m_pause_amend_time = 0;	m_status = Running;	for (auto& thread : get_all_cpu_threads())	{		thread->state -= cpu_state::stop;		thread->safe_notify();	}	SendDbgCommand(DID_STARTED_EMU);}
开发者ID:Snake128,项目名称:rpcs3,代码行数:32,


示例21: IsPaused

void CGEGameTimer::AddToLength(float length_seconds){	// Don't do anything we are are not enabled	if (!IsEnabled())		return;	// If paused, resume the time to capture our real end time	bool was_paused = IsPaused();	if (was_paused)		Resume();	// If changing the time would result in negative time, end the round.	if (m_flEndTime - gpGlobals->curtime + length_seconds > 0) // If the time to be adjusted to is greater than 0, go ahead and offset	{		m_flEndTime += length_seconds;		m_flLength += length_seconds;	}	else // Otherwise we took off all the remaining round time and ended it.	{		m_flEndTime = gpGlobals->curtime;		m_flLength = 1;	}	// If we were paused, put as back in that state	if (was_paused)		Pause();}
开发者ID:djoslin0,项目名称:ges-legacy-code,代码行数:27,


示例22: m_time

Game::Game(const SystemPath &path, double time) :	m_time(time),	m_state(STATE_NORMAL),	m_wantHyperspace(false),	m_timeAccel(TIMEACCEL_1X),	m_requestedTimeAccel(TIMEACCEL_1X),	m_forceTimeAccel(false){	Pi::FlushCaches();	if (!Pi::GetGalaxy()->GetGenerator().IsDefault())		Pi::CreateGalaxy();	m_space.reset(new Space(this, path));	SpaceStation *station = static_cast<SpaceStation*>(m_space->FindBodyForPath(&path));	assert(station);	m_player.reset(new Player("kanara"));	m_space->AddBody(m_player.get());	m_player->SetFrame(station->GetFrame());	m_player->SetDockedWith(station, 0);	Polit::Init();	CreateViews();	EmitPauseState(IsPaused());}
开发者ID:rob-h-w,项目名称:pioneer,代码行数:29,


示例23: Run

void CPUThread::Run(){	if(IsRunning()) Stop();	if(IsPaused())	{		Resume();		return;	}	#ifndef QT_UI	wxGetApp().SendDbgCommand(DID_START_THREAD, this);#endif	m_status = Running;	SetPc(entry);	InitStack();	InitRegs();	DoRun();	Emu.CheckStatus();#ifndef QT_UI	wxGetApp().SendDbgCommand(DID_STARTED_THREAD, this);#endif}
开发者ID:BagusThanatos,项目名称:rpcs3,代码行数:25,


示例24:

void AnimatedSprite::Process(float deltaTime){	// Ex007.1: If not paused...	if (!IsPaused()) {		// Ex007.1: Count the time elapsed.		m_timeElapsed += deltaTime;		// Ex007.1: If the time elapsed is greater than the frame speed.		if (m_timeElapsed > m_frameSpeed) {			// Ex007.1: Move to the next frame.			++m_currentFrame;			// Ex007.1: Reset the time elapsed counter.			m_timeElapsed = 0;		}		// Ex007.1: If the current frame is greater than the number 		//          of frame in this animation...		if (m_currentFrame > m_frameCoords.size() - 1) {			if (IsLooping()) {				// Ex007.1: Reset to the first frame.				m_currentFrame = 0;			}			else {				// Ex007.1: Stop the animation if it is not looping...				m_animating = false;			}		}	}	}
开发者ID:D4vx,项目名称:SDL-Framework,代码行数:29,


示例25: IsPaused

voidnsSMILTimeContainer::UpdateCurrentTime(){  nsSMILTime now = IsPaused() ? mPauseStart : GetParentTime();  mCurrentTime = now - mParentOffset;  NS_ABORT_IF_FALSE(mCurrentTime >= 0, "Container has negative time");}
开发者ID:harthur,项目名称:mozilla-central,代码行数:7,


示例26: GetSpeed

float CUPnPPlayer::GetSpeed(){  if (IsPaused())    return 0;  else    return 1;}
开发者ID:totesmuhgoats,项目名称:xbmc,代码行数:7,


示例27: SetPaused

void VFmodSoundObject::MessageFunction(int iID, INT_PTR iParamA, INT_PTR iParamB){  VisObject3D_cl::MessageFunction(iID, iParamA, iParamB);  if (iID==VIS_MSG_TRIGGER)  {    // cache IDs to avoid string comparisons    if (VFMOD_TRIGGER_ID_PAUSE == -1)    {      VFMOD_TRIGGER_ID_PAUSE = IVObjectComponent::RegisterStringID(VFMOD_TRIGGER_PAUSE);      VFMOD_TRIGGER_ID_RESUME = IVObjectComponent::RegisterStringID(VFMOD_TRIGGER_RESUME);    }    // the trigger components are added by vForge and serialized if used    VisTriggerTargetComponent_cl *pTarget = (VisTriggerTargetComponent_cl *)iParamB;    if (pTarget->m_iComponentID==VFMOD_TRIGGER_ID_PAUSE)      SetPaused(true);    else if (pTarget->m_iComponentID==VFMOD_TRIGGER_ID_RESUME)    {      if (IsPaused())        SetPaused(false);      else      {        Helper_SetFlag(VFMOD_FLAG_PAUSED, false);        Play();      }    }    return;  }}
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:30,


示例28: StopSearch

void CDownloadWithSearch::RunSearch(DWORD tNow){	if ( ! CanSearch() )	{		StopSearch();		return;	}		if ( tNow > m_tSearchTime && tNow - m_tSearchTime < Settings.Downloads.SearchPeriod )	{		StartManualSearch();	}	else if ( tNow > m_tSearchCheck && tNow - m_tSearchCheck >= 1000 )	{		BOOL bFewSources = GetSourceCount( FALSE, TRUE ) < Settings.Downloads.MinSources;		BOOL bDataStarve = ( tNow > m_tReceived ? tNow - m_tReceived : 0 ) > Settings.Downloads.StarveTimeout * 1000;				m_tSearchCheck = tNow;				if ( IsPaused() == FALSE && ( bFewSources || bDataStarve ) )		{			StartAutomaticSearch();		}		else		{			StopSearch();		}	}}
开发者ID:ericfillipe1,项目名称:shareaza-code,代码行数:29,


示例29: Stop

void CGEGameTimer::SetCurrentLength(float length_seconds){	// Don't do anything we are are not enabled	if (!IsEnabled())		return;	// Stop the timer if we change to no length	if (length_seconds <= 0) {		Stop();		return;	}	// Simply start the timer if not running already	if (!IsStarted()) {		Start(length_seconds);		return;	}	// If paused, resume the time to capture our real end time	bool was_paused = IsPaused();	if (was_paused)		Resume();	// We always directly set to this time.	m_flEndTime = gpGlobals->curtime + length_seconds;	m_flLength = length_seconds;	// If we were paused, put as back in that state	if (was_paused)		Pause();}
开发者ID:djoslin0,项目名称:ges-legacy-code,代码行数:31,



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


C++ IsPendingKill函数代码示例
C++ IsPathSeparator函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。