• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IsPaused函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了IsPaused函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:v4l2encrecorder.cpp


示例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,代码来源:iptvrecorder.cpp


示例3: locker

// documented in recorderbase.cpp
bool 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,代码来源:firewirerecorder.cpp


示例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,代码来源:byosnake.cpp


示例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,代码来源:dvbrecorder.cpp


示例6: locker

// documented in recorderbase.cpp
bool 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,代码来源:firewirerecorder.cpp


示例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,代码来源:PawnAction.cpp


示例8: Play

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


示例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,代码来源:Download.cpp


示例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,代码来源:MannequinAGState.cpp


示例11: GetParentTime

void
nsSMILTimeContainer::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,代码来源:nsSMILTimeContainer.cpp


示例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,代码来源:System.cpp


示例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,代码来源:PAPlayer.cpp


示例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,代码来源:movierecorder.cpp


示例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,代码来源:movierecorder.cpp


示例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,代码来源:UDPProxy.hpp


示例17: AudioQueueStart

void
Moose::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,代码来源:MooseMusicClip.cpp


示例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,代码来源:AnimationComponent.cpp


示例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,代码来源:System.cpp


示例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,代码来源:System.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IsPendingKill函数代码示例发布时间:2022-05-30
下一篇:
C++ IsPathSeparator函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap