本文整理汇总了C++中IsPaused函数的典型用法代码示例。如果您正苦于以下问题:C++ IsPaused函数的具体用法?C++ IsPaused怎么用?C++ IsPaused使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsPaused函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
示例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);
}
示例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;
}
示例8: Play
void FSoundSource::UpdatePause()
{
if (IsPaused() && !bIsPausedByGame && !bIsManuallyPaused)
{
Play();
}
else if (!IsPaused() && (bIsManuallyPaused || bIsPausedByGame))
{
Pause();
}
}
示例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();
}
示例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?
}
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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;
}