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

C++ paused函数代码示例

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

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



在下文中一共展示了paused函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:Mangoxylic,项目名称:pokemon-online,代码行数:34,代码来源:battleinput.cpp


示例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"));
}
开发者ID:iegor,项目名称:kdesktop,代码行数:32,代码来源:mediawidget.cpp


示例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();
}
开发者ID:Erkan-Yilmaz,项目名称:lastfm-desktop,代码行数:31,代码来源:ScrobbleService.cpp


示例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 ) ) );

}
开发者ID:ErrAza,项目名称:amarok,代码行数:29,代码来源:Osd.cpp


示例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&)));
}
开发者ID:dezelin,项目名称:maily,代码行数:14,代码来源:forgettablewatcher.cpp


示例6: paused

void FsRadProgressDlg::OnPause() 
{
	paused() = !paused();
	if (paused())
	{
		pauseButton.SetWindowText(L"Resume");
		runtimeText.SetWindowText(L"Paused");
		RedrawWindow();
	}
	else
	{
		pauseButton.SetWindowText(L"Pause");
	}
}
开发者ID:mrusinovic,项目名称:csg-ide,代码行数:14,代码来源:FsRadProgressDlg.cpp


示例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;
}
开发者ID:robvogelaar,项目名称:WebKitForWayland,代码行数:28,代码来源:AnimationBase.cpp


示例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));
}
开发者ID:KayYui,项目名称:Fractal,代码行数:32,代码来源:Application.cpp


示例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()));
}
开发者ID:KayYui,项目名称:Fractal,代码行数:25,代码来源:Application.cpp


示例10: toggle_pause

void running_machine::toggle_pause()
{
	if (paused())
		resume();
	else
		pause();
}
开发者ID:libretro,项目名称:mame2014-libretro,代码行数:7,代码来源:machine.c


示例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);
			}
		}
	}
开发者ID:pjc0247,项目名称:Cppie,代码行数:26,代码来源:RepeatedTask.cpp


示例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;
}
开发者ID:robvogelaar,项目名称:WebKitForWayland,代码行数:27,代码来源:AnimationBase.cpp


示例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 ) ) );
}
开发者ID:eartle,项目名称:tomahawk,代码行数:25,代码来源:Scrobbler.cpp


示例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;
}
开发者ID:shiroyasha,项目名称:oldPorjects,代码行数:28,代码来源:moc_MPlayerProcess.cpp


示例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);
    }
}
开发者ID:flair2005,项目名称:TDSmoke,代码行数:60,代码来源:main.cpp


示例16: getPauseInitiatorCoreId

uint32_t
getPauseInitiatorCoreId()
{
   decaf_check(paused());
   decaf_check(sPauseInitiatorCoreId < 3);
   return sPauseInitiatorCoreId;
}
开发者ID:achurch,项目名称:decaf-emu,代码行数:7,代码来源:debugger.cpp


示例17: startRetry

	void startRetry()
	{
		connect(zhttpRequest, SIGNAL(error()), SLOT(zhttpRequest_error()));
		connect(zhttpRequest, SIGNAL(paused()), SLOT(zhttpRequest_paused()));

		state = WaitingForResponse;

		bool isHttps = (requestData.uri.scheme() == "https");
		QString host = requestData.uri.host();

		QByteArray encPath = requestData.uri.path(QUrl::FullyEncoded).toUtf8();

		// look up the route
		route = domainMap->entry(DomainMap::Http, isHttps, host, encPath);
		if(route.isNull())
		{
			log_warning("requestsession: %p %s has 0 routes", q, qPrintable(host));

			state = WaitingForResponse;
			respondError(502, "Bad Gateway", QString("No route for host: %1").arg(host));
			return;
		}

		log_debug("proxysession: %p %s has %d routes", q, qPrintable(host), route.targets.count());
	}
开发者ID:mcspring,项目名称:pushpin,代码行数:25,代码来源:requestsession.cpp


示例18: libvlc_media_parse

void VPlayer::play()
{
	if(mp){
		if(state==Stop){
			libvlc_media_track_info_t *info;
			libvlc_media_parse(m);
			int i=libvlc_media_get_tracks_info(m,&info);
			for(--i;i>=0;--i){
				if(info[i].i_type==libvlc_track_video){
					srcSize.setWidth (info[i].u.video.i_width);
					srcSize.setHeight(info[i].u.video.i_height);
				}
			}
			free(info);
			dstSize=srcSize;
			avpicture_alloc(&srcFrame,PIX_FMT_RGB32,srcSize.width(),srcSize.height());
			avpicture_alloc(&dstFrame,PIX_FMT_RGB32,dstSize.width(),dstSize.height());
			valid=true;
			libvlc_video_set_format(mp,"RV32",srcSize.width(),srcSize.height(),srcSize.width()*4);
			libvlc_video_set_callbacks(mp,lock,NULL,display,this);
			Utils::delayExec(50,[this](){libvlc_media_player_play(mp);});
		}
		else{
			libvlc_media_player_pause(mp);
			if(state==Play){
				state=Pause;
				emit paused();
			}
			else{
				state=Play;
			}
		}
	}
}
开发者ID:sealist,项目名称:BiliLocal,代码行数:34,代码来源:VPlayer.cpp


示例19: stopRequested

void FsRadProgressDlg::resetStopped()
{
	stopRequested() = false;
	if (paused()) OnPause();
	stopButton.EnableWindow(TRUE);
	pauseButton.EnableWindow(TRUE);
}
开发者ID:mrusinovic,项目名称:csg-ide,代码行数:7,代码来源:FsRadProgressDlg.cpp


示例20: GenericRenderer

ClipRenderer::ClipRenderer() :
    GenericRenderer(),
    m_clipLoaded( false ),
    m_vlcMedia( NULL ),
    m_selectedClip( NULL ),
    m_begin( 0 ),
    m_end( -1 ),
    m_mediaChanged( false )
{
    connect( m_mediaPlayer,     SIGNAL( stopped() ),            this,   SLOT( __videoStopped() ) );
    connect( m_mediaPlayer,     SIGNAL( paused() ),             this,   SIGNAL( paused() ) );
    connect( m_mediaPlayer,     SIGNAL( playing() ),            this,   SIGNAL( playing() ) );
    connect( m_mediaPlayer,     SIGNAL( volumeChanged() ),      this,   SIGNAL( volumeChanged() ) );
    connect( m_mediaPlayer,     SIGNAL( timeChanged( qint64 ) ),this,   SLOT( __timeChanged( qint64 ) ) );
    connect( m_mediaPlayer,     SIGNAL( endReached() ),         this,   SLOT( __endReached() ) );
}
开发者ID:Giladx,项目名称:vlmc,代码行数:16,代码来源:ClipRenderer.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ payAmountChanged函数代码示例发布时间:2022-05-30
下一篇:
C++ pause函数代码示例发布时间: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