本文整理汇总了C++中paused函数的典型用法代码示例。如果您正苦于以下问题:C++ paused函数的具体用法?C++ paused怎么用?C++ paused使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了paused函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: receiveData
void BattleInput::receiveData(QByteArray inf)
{
if (inf.isEmpty()) {
if (paused()) {
delayedCommands.push_back(inf);
return;
}
/* An empty array means raw Command */
if (commands.size() > 0) {
AbstractCommand *command = *commands.begin();
commands.pop_front();
command->apply();
delete command;
return;
}
}
if (paused() && inf[0] != char(BC::BattleChat) && inf[0] != char(BC::SpectatorChat) && inf[0] != char(BC::ClockStart)
&& inf[0] != char(BC::ClockStop)
&& inf[0] != char(BC::Spectating)) {
delayedCommands.push_back(inf);
return;
}
DataStream in (&inf, QIODevice::ReadOnly);
uchar command;
qint8 player;
in >> command >> player;
dealWithCommandInfo(in, command, player);
}
示例2: Player
KSB_MediaWidget::KSB_MediaWidget(QWidget *parent):KSB_MediaWidget_skel(parent)
{
player = new Player(this);
empty();
QFont labelFont = time->font();
labelFont.setPointSize(18);
labelFont.setBold(true);
time->setFont(labelFont);
connect(Play, SIGNAL(clicked()), player, SLOT(play()));
connect(Pause, SIGNAL(clicked()), player, SLOT(pause()));
connect(Stop, SIGNAL(clicked()), player, SLOT(stop()));
connect(player, SIGNAL(timeout()), this, SLOT(playerTimeout()));
connect(player, SIGNAL(finished()), this, SLOT(playerFinished()));
connect(player, SIGNAL(playing()), this, SLOT(playing()));
connect(player, SIGNAL(paused()), this, SLOT(paused()));
connect(player, SIGNAL(stopped()), this, SLOT(stopped()));
connect(player, SIGNAL(empty()), this, SLOT(empty()));
connect(Position, SIGNAL(userChanged(int)), this, SLOT(skipToWrapper(int)));
connect(this, SIGNAL(skipTo(unsigned long)), player, SLOT(skipTo(unsigned long)));
setAcceptDrops(true);
pretty="";
needLengthUpdate=false;
QToolTip::add(Play,i18n("Play"));
QToolTip::add(Pause,i18n("Pause"));
QToolTip::add(Stop,i18n("Stop"));
}
示例3: disconnect
void
ScrobbleService::setConnection(PlayerConnection*c)
{
if( m_connection )
{
// disconnect from all the objects that we connect to below
disconnect( m_connection, 0, this, 0);
if(m_watch)
m_connection->setElapsed(m_watch->elapsed());
}
//
connect(c, SIGNAL(trackStarted(Track, Track)), SLOT(onTrackStarted(Track, Track)));
connect(c, SIGNAL(paused()), SLOT(onPaused()));
connect(c, SIGNAL(resumed()), SLOT(onResumed()));
connect(c, SIGNAL(stopped()), SLOT(onStopped()));
connect(c, SIGNAL(trackStarted(Track, Track)), SIGNAL(trackStarted(Track, Track)));
connect(c, SIGNAL(resumed()), SIGNAL(resumed()));
connect(c, SIGNAL(paused()), SIGNAL(paused()));
connect(c, SIGNAL(stopped()), SIGNAL(stopped()));
connect(c, SIGNAL(bootstrapReady(QString)), SIGNAL( bootstrapReady(QString)));
m_connection = c;
if(c->state() == Playing || c->state() == Paused)
c->forceTrackStarted(Track());
if( c->state() == Paused )
c->forcePaused();
}
示例4: OSDWidget
Amarok::OSD::OSD()
: OSDWidget( 0 )
{
s_instance = this;
EngineController* const engine = The::engineController();
if( engine->isPlaying() )
trackPlaying( engine->currentTrack() );
connect( engine, SIGNAL( trackPlaying( Meta::TrackPtr ) ),
this, SLOT( trackPlaying( Meta::TrackPtr ) ) );
connect( engine, SIGNAL( stopped( qint64, qint64 ) ),
this, SLOT( stopped() ) );
connect( engine, SIGNAL( paused() ),
this, SLOT( paused() ) );
connect( engine, SIGNAL( trackMetadataChanged( Meta::TrackPtr ) ),
this, SLOT( metadataChanged() ) );
connect( engine, SIGNAL( albumMetadataChanged( Meta::AlbumPtr ) ),
this, SLOT( metadataChanged() ) );
connect( engine, SIGNAL( volumeChanged( int ) ),
this, SLOT( volumeChanged( int ) ) );
connect( engine, SIGNAL( muteStateChanged( bool ) ),
this, SLOT( muteStateChanged( bool ) ) );
}
示例5: Q_D
void ForgettableWatcherBase::connectForwardedInterface()
{
Q_D(ForgettableWatcherBase);
connect(d, SIGNAL(started()), this, SIGNAL(started()));
connect(d, SIGNAL(finished()), this, SLOT(deleteObject()));
connect(d, SIGNAL(canceled()), this, SIGNAL(canceled()));
connect(d, SIGNAL(paused()), this, SIGNAL(paused()));
connect(d, SIGNAL(resumed()), this, SIGNAL(resumed()));
connect(d, SIGNAL(resultReadyAt(int)), this, SIGNAL(resultReadyAt(int)));
connect(d, SIGNAL(resultsReadyAt(int, int)), this, SIGNAL(resultsReadyAt(int, int)));
connect(d, SIGNAL(progressRangeChanged(int, int)), this, SIGNAL(progressRangeChanged(int, int)));
connect(d, SIGNAL(progressValueChanged(int)), this, SIGNAL(progressValueChanged(int)));
connect(d, SIGNAL(progressTextChanged(const QString&)), this, SIGNAL(progressTextChanged(const QString&)));
}
示例6: paused
void FsRadProgressDlg::OnPause()
{
paused() = !paused();
if (paused())
{
pauseButton.SetWindowText(L"Resume");
runtimeText.SetWindowText(L"Paused");
RedrawWindow();
}
else
{
pauseButton.SetWindowText(L"Pause");
}
}
示例7: timeToNextService
double AnimationBase::timeToNextService()
{
// Returns the time at which next service is required. -1 means no service is required. 0 means
// service is required now, and > 0 means service is required that many seconds in the future.
if (paused() || isNew() || m_animationState == AnimationState::FillingForwards)
return -1;
if (m_animationState == AnimationState::StartWaitTimer) {
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
if (m_animation->trigger()->isScrollAnimationTrigger()) {
if (m_object) {
float currentScrollOffset = m_object->view().frameView().scrollOffsetForFixedPosition().height().toFloat();
ScrollAnimationTrigger& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger().get());
if (currentScrollOffset >= scrollTrigger.startValue().value() && (!scrollTrigger.hasEndValue() || currentScrollOffset <= scrollTrigger.endValue().value()))
return 0;
}
return -1;
}
#endif
double timeFromNow = m_animation->delay() - (beginAnimationUpdateTime() - m_requestedStartTime);
return std::max(timeFromNow, 0.0);
}
fireAnimationEventsIfNeeded();
// In all other cases, we need service right away.
return 0;
}
示例8: paused
void Application::onResize()
{
m_resized = true;
sf::Vector2f size = static_cast<sf::Vector2f>(m_window.getSize());
// Minimum size
if(size.x < 800)
size.x = 800;
if(size.y < 600)
size.y = 600;
// Apply possible size changes
m_window.setSize(static_cast<sf::Vector2u>(size));
// Reset static (1:1) view
m_staticView = sf::View(sf::FloatRect(0.f, 0.f, size.x, size.y));
m_window.setView(m_staticView);
// Resize widgets
// The sidebar should be 180px wide
const float width = 180.f;
//m_desktop.UpdateViewRect(sf::FloatRect(0.f, 0.f, size.x, size.y));
// m_sideBar->SetAllocation(sf::FloatRect(0.f, 0.f, width, size.y));
// Resize & update the fractal
m_fractal.resize(static_cast<sf::Vector2u>(size), 4);
paused();
m_fractal.update(sf::Vector2i(0, 0), static_cast<sf::Vector2i>(size));
}
示例9: m_window
Application::Application() :
m_window(sf::VideoMode(1000, 765), "Fractal - Mandelbrot"),//, sf::Style::Titlebar | sf::Style::Close),
m_fractal(sf::Vector2u(1000, 765), 4),
m_down(-1, -1),
m_resized(true)
{
m_window.setFramerateLimit(60);
// Init select frame
m_select.setFillColor(sf::Color(0, 0, 0, 0));
m_select.setOutlineColor(sf::Color(255, 255, 255, 255));
m_select.setOutlineThickness(-2.f);
m_font.loadFromFile("DejaVuSans.ttf");
m_precision.setFont(m_font);
m_precision.setPosition(10.f, 10.f);
m_precision.setCharacterSize(20.f);
std::stringstream ss;
ss << std::fixed << static_cast<int>(m_fractal.precision());
m_precision.setString(ss.str());
// Init fractal
paused(true);
m_fractal.update(sf::Vector2i(0, 0), static_cast<sf::Vector2i>(m_window.getSize()));
}
示例10: toggle_pause
void running_machine::toggle_pause()
{
if (paused())
resume();
else
pause();
}
示例11: update
void RepeatedTask::update(){
if(this->state != CPPIE_TASKSTATE_WAITING)
return;
if(paused())
return;
if(delay == CPPIE_TASK_NEXT_LOOP){
if(startCount != system->loopCount){
this->state = CPPIE_TASKSTATE_RUNNING;
task();
run(delay);
}
}
else{
if(getTicks() - startTick >= delay){
this->state = CPPIE_TASKSTATE_RUNNING;
task();
run(delay);
}
}
}
示例12: ENABLE
double AnimationBase::getElapsedTime() const
{
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
if (m_animation->trigger() && m_animation->trigger()->isScrollAnimationTrigger()) {
ScrollAnimationTrigger& scrollTrigger = downcast<ScrollAnimationTrigger>(*m_animation->trigger().get());
if (scrollTrigger.hasEndValue() && m_object) {
float offset = m_compositeAnimation->animationController().scrollPosition();
float startValue = scrollTrigger.startValue().value();
if (offset < startValue)
return 0;
float endValue = scrollTrigger.endValue().value();
if (offset > endValue)
return m_animation->duration();
return m_animation->duration() * (offset - startValue) / (endValue - startValue);
}
}
#endif
if (paused())
return m_pauseTime - m_startTime;
if (m_startTime <= 0)
return 0;
if (postActive() || fillingForwards())
return m_totalDuration;
return beginAnimationUpdateTime() - m_startTime;
}
示例13: QObject
Scrobbler::Scrobbler( QObject* parent )
: QObject( parent )
, m_reachedScrobblePoint( false )
{
connect( AudioEngine::instance(), SIGNAL( timerSeconds( unsigned int ) ),
SLOT( engineTick( unsigned int ) ), Qt::QueuedConnection );
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
connect( AudioEngine::instance(), SIGNAL( started( const Tomahawk::result_ptr& ) ),
SLOT( trackStarted( const Tomahawk::result_ptr& ) ), Qt::QueuedConnection );
connect( AudioEngine::instance(), SIGNAL( paused() ),
SLOT( trackPaused() ), Qt::QueuedConnection );
connect( AudioEngine::instance(), SIGNAL( resumed() ),
SLOT( trackResumed() ), Qt::QueuedConnection );
connect( AudioEngine::instance(), SIGNAL( stopped() ),
SLOT( trackStopped() ), Qt::QueuedConnection );
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
}
示例14: switch
int MPlayerProcess::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QProcess::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: mediaPosition((*reinterpret_cast< int(*)>(_a[1]))); break;
case 1: volumeChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 2: durationChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 3: volumeLevelChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 4: fileNameChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 5: paused(); break;
case 6: sizeChanged(); break;
case 7: openStream((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 8: togglePlayPause(); break;
case 9: setMediaPosition((*reinterpret_cast< int(*)>(_a[1]))); break;
case 10: setVolume((*reinterpret_cast< int(*)>(_a[1]))); break;
case 11: setLoop((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 12: setSpeed((*reinterpret_cast< int(*)>(_a[1]))); break;
case 13: setAudioDelay((*reinterpret_cast< int(*)>(_a[1]))); break;
case 14: readStandardOutput(); break;
default: ;
}
_id -= 15;
}
return _id;
}
示例15: parseCommandLine
void parseCommandLine( int argc, char** argv )
{
try
{
TCLAP::CmdLine cmd("TDSmoke");
// Directory to save png movie frames too
TCLAP::ValueArg<std::string> movie("m", "movie", "Directory to save png movie too", false, "", "string", cmd);
// Frequency (in simulation time) at which to save frames
TCLAP::ValueArg<scalar> moviefreq("f", "moviefrequency", "Frequency (in simulation time) at which to save frames", false, -1.0, "scalar", cmd);
// Begin the scene paused or running
TCLAP::ValueArg<bool> paused("p", "paused", "Begin the simulation paused if 1, running if 0", false, true, "boolean", cmd);
// Run the simulation with rendering enabled or disabled
TCLAP::ValueArg<bool> display("d", "display", "Run the simulation with display enabled if 1, without if 0", false, true, "boolean", cmd);
// Xml scene file
TCLAP::ValueArg<std::string> scene("s", "scene", "Xml scene file", false, "", "string", cmd);
// // Save svgs to a movie directory
// TCLAP::ValueArg<std::string> movie("m", "moviedir", "Directory to output svg screenshot to", false, "", "string", cmd);
cmd.parse(argc, argv);
if (scene.isSet())
{
g_xml_scene_file = scene.getValue();
g_xml_scene = true;
}
g_paused = paused.getValue();
g_opengl_rendering_enabled = display.getValue();
if( movie.isSet() )
{
g_movie_dir = movie.getValue();
scalar fps = 1.0/g_dt;
if( moviefreq.isSet() )
{
fps = moviefreq.getValue();
}
assert( fps > 0.0 );
assert( fps*g_dt <= 1.0 );
if( !mathutils::approxEqual(fmod(1.0/g_dt,fps),0.0,1.0e-9) )
{
std::cerr << outputmod::startred << "TDSmoke WARNING: " << outputmod::endred << "Time between frames and timestep not integer multiple." << std::endl;
}
g_steps_per_movie_frame = mathutils::round(1.0/(fps*g_dt));
}
}
catch( TCLAP::ArgException& e )
{
std::cerr << outputmod::startred << "TDSmoke ERROR: " << outputmod::endred << " Parse error from TCLAP: " << e.what() << std::endl;
exit(1);
}
}