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

C++ playing函数代码示例

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

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



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

示例1: QWidget

    MediaController::MediaController(kt::MediaPlayer* player, KActionCollection* ac, QWidget* parent) : QWidget(parent)
    {
        setupUi(this);

        info_label->setText(i18n("Ready to play"));
        seek_slider->setMediaObject(player->media0bject());
        volume->setAudioOutput(player->output());
        volume->setOrientation(Qt::Horizontal);


        connect(player, SIGNAL(stopped()), this, SLOT(stopped()));
        connect(player, SIGNAL(playing(MediaFileRef)), this, SLOT(playing(MediaFileRef)));

        play->setDefaultAction(ac->action("media_play"));
        play->setAutoRaise(true);
        pause->setDefaultAction(ac->action("media_pause"));
        pause->setAutoRaise(true);
        stop->setDefaultAction(ac->action("media_stop"));
        stop->setAutoRaise(true);
        prev->setDefaultAction(ac->action("media_prev"));
        prev->setAutoRaise(true);
        next->setDefaultAction(ac->action("media_next"));
        next->setAutoRaise(true);

        setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
    }
开发者ID:biwin,项目名称:ktorrent,代码行数:26,代码来源:mediacontroller.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: state

void VlcMediaPlayer::emitStatus()
{
    Vlc::State s = state();
    bool audio_count;
    bool video_count;

    if (s == Vlc::Buffering ||
        s == Vlc::Playing ||
        s == Vlc::Paused) {
        audio_count = _vlcAudio->trackCount() > 0;
        video_count = _vlcVideo->trackCount() > 0;
    } else {
        audio_count = false;
        video_count = false;
    }

    VlcError::errmsg();

    emit currentState(s);
    emit hasAudio(audio_count);
    emit hasVideo(video_count);

    // Deprecated
    bool play = s == Vlc::Playing;
    bool buffering = s == Vlc::Buffering;
    emit playing(play, buffering);
}
开发者ID:Skiminok,项目名称:vlc-qt,代码行数:27,代码来源:MediaPlayer.cpp


示例4: QTimer

void WorkPreviewerThread::playFile(QString file) {
    if(mFillTimer == NULL) {
        mFillTimer = new QTimer(this);
        //connect us up
        QObject::connect(mFillTimer,
                         SIGNAL(timeout()),
                         this,
                         SLOT(fillBuffer()));
    }

    mFillTimer->stop();
    try {
        if(mSoundFile)
            delete mSoundFile;
        mSoundFile = new SoundFile(file.toStdString());
        if(*mSoundFile) {
            //run every millisecond
            mFillTimer->start(1);
        } else {
            delete mSoundFile;
            mSoundFile = NULL;
            emit(playing(false));
        }
    } catch (...) {
        mSoundFile = NULL;
    }
}
开发者ID:x37v,项目名称:data-jockey-old,代码行数:27,代码来源:workpreviewer.cpp


示例5: viewport

void
WPiano::capture_mouse(bool capture)
{
	if (capture == mouse_captured_)
		return;
	if (capture && playing())
		return;

	if (capture) {
#ifdef Q_WS_WIN
		QRect v = viewport();
		QPoint p1 = mapToGlobal(v.topLeft());
		QPoint p2 = mapToGlobal(v.bottomRight());
		RECT rect = {p1.x(), p1.y(), p2.x(), p2.y()};
		ClipCursor(&rect);

		// be sure that cursor doesn't reach the clip boundary
		update_timer_.start(update_freq, this);
#else
		grabMouse();
#endif
		drop_pivot();
		setCursor(Qt::BlankCursor);
	} else {
#ifdef Q_WS_WIN
		ClipCursor(NULL);
		update_timer_.stop();
#else
		releaseMouse();
#endif
		setCursor(Qt::ArrowCursor);
	}
	mouse_captured_ = capture;
	setMouseTracking(mouse_captured_);
}
开发者ID:an146,项目名称:vomid,代码行数:35,代码来源:w_piano.cpp


示例6: isFinished

bool SoundManager::isFinished(WSound *sound) const
{
  if (current_ == sound)
    return !playing();
  else
    return true;
}
开发者ID:AlexanderKotliar,项目名称:wt,代码行数:7,代码来源:SoundManager.C


示例7: while

void PlayerGst::timerUpdate()
{
	GstMessage* message;
	while(!usePlaybin && (message = gst_bus_pop(bus), message)) {
		switch (GST_MESSAGE_TYPE (message)) {
		case GST_MESSAGE_ERROR: {
			GError *err;
			gchar *debug;
			gst_message_parse_error (message, &err, &debug);
			QString str;
			str = "Error #"+QString::number(err->code)+" in module "+QString::number(err->domain)+"\n"+QString::fromUtf8(err->message);
			if(err->code == 6 && err->domain == 851) {
				str += "\nMay be you should to install gstreamer0.10-plugins-ugly or gstreamer0.10-plugins-bad";
			}
			QMessageBox::warning(0, "Gstreamer error", str);
			g_error_free (err);
			g_free (debug);
			break;
		}
		case GST_MESSAGE_EOS:
			need_finish();
			//QMessageBox::information(0, "", "EOS");
			return;
		default:
			break;
		}
	}
    if(playing()) {
		gint64 p;
		GstFormat fmt = GST_FORMAT_TIME;
		gst_element_query_position(pipeline, &fmt, &p);
		emit position((double)(p - Gstart) / Glength);
    }
}
开发者ID:sushantg11,项目名称:cuberok,代码行数:34,代码来源:player_gst.cpp


示例8: lock

AUD_Handle* AUD_SoftwareDevice::play(AUD_IReader* reader, bool keep)
{
	// prepare the reader
	reader = m_mixer->prepare(reader);
	if(reader == NULL)
		return NULL;

	// play sound
	AUD_SoftwareHandle* sound = new AUD_SoftwareHandle;
	sound->keep = keep;
	sound->reader = reader;
	sound->volume = 1.0f;
	sound->loopcount = 0;
	sound->stop = NULL;
	sound->stop_data = NULL;

	lock();
	m_playingSounds.push_back(sound);

	if(!m_playback)
		playing(m_playback = true);
	unlock();

	return sound;
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:25,代码来源:AUD_SoftwareDevice.cpp


示例9: playing

void AUD_SoftwareDevice::destroy()
{
	if(m_playback)
		playing(m_playback = false);

	delete m_mixer;

	AUD_SoftwareHandle* handle;

	// delete all playing sounds
	while(!m_playingSounds.empty())
	{
		handle = m_playingSounds.front();
		m_playingSounds.pop_front();
		delete handle->reader;
		delete handle;
	}

	// delete all paused sounds
	while(!m_pausedSounds.empty())
	{
		handle = m_pausedSounds.front();
		m_pausedSounds.pop_front();
		delete handle->reader;
		delete handle;
	}

	pthread_mutex_destroy(&m_mutex);
}
开发者ID:OldBrunet,项目名称:BGERTPS,代码行数:29,代码来源:AUD_SoftwareDevice.cpp


示例10: updateScope

void AnimationPlayer::play()
{
    PlayStateUpdateScope updateScope(*this, TimingUpdateOnDemand);

    if (!playing())
        m_startTime = nullValue();

    if (playStateInternal() == Idle) {
        // We may not go into the pending state, but setting it to something other
        // than Idle here will force an update.
        ASSERT(isNull(m_startTime));
        m_playState = Pending;
        m_held = true;
        m_holdTime = 0;
    }

    m_finished = false;
    unpauseInternal();
    if (!m_content)
        return;
    double currentTime = this->currentTimeInternal();
    if (m_playbackRate > 0 && (currentTime < 0 || currentTime >= sourceEnd()))
        setCurrentTimeInternal(0, TimingUpdateOnDemand);
    else if (m_playbackRate < 0 && (currentTime <= 0 || currentTime > sourceEnd()))
        setCurrentTimeInternal(sourceEnd(), TimingUpdateOnDemand);
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:26,代码来源:AnimationPlayer.cpp


示例11: hexagon

void CritterObject::think()
{
    if (movementQueue()->size() > 0)
    {
        if (!_moving)
        {
            _moving = true;

            delete _ui;
            _orientation = hexagon()->orientationTo(movementQueue()->back());
            auto animation = _generateMovementAnimation();
            animation->setActionFrame(_running ? 2 : 4);
            animation->addEventHandler("actionFrame",    std::bind(&CritterObject::onMovementAnimationEnded, this, std::placeholders::_1));
            animation->addEventHandler("animationEnded", std::bind(&CritterObject::onMovementAnimationEnded, this, std::placeholders::_1));
            animation->play();
            _ui = animation;
        }
    }
    else
    {
        auto anim = (UI::Animation*)ui();
        if (!_moving && (!anim || !anim->playing()))
        {
            if (SDL_GetTicks() > _nextIdleAnim)
            {
                setActionAnimation("aa");
                _setupNextIdleAnim();
            }
        }
    }
    Object::think();
}
开发者ID:nishazzar,项目名称:falltergeist,代码行数:32,代码来源:CritterObject.cpp


示例12: lower

void DynamicPlaylist::lower(QWidget *top)
{
    if(top == this)
        return;

    if(playing()) {
        PlaylistList l;
        l.append(this);
        for(PlaylistList::Iterator it = m_playlists.begin();
            it != m_playlists.end(); ++it)
        {
            (*it)->synchronizePlayingItems(l, true);
        }
    }

    PlaylistItemList list = PlaylistItem::playingItems();
    for(PlaylistItemList::Iterator it = list.begin(); it != list.end(); ++it) {
        if((*it)->playlist() == this) {
            list.erase(it);
            break;
        }
    }

    if(!list.isEmpty())
        TrackSequenceManager::instance()->setCurrentPlaylist(list.front()->playlist());
}
开发者ID:KDE,项目名称:juk,代码行数:26,代码来源:dynamicplaylist.cpp


示例13: 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


示例14: requestMessage

void StateManager::Internals::addedToEntity()
{
    StateManager* man = &mState;

    requestMessage("Get.Input",    [man](Kunlaboro::Message& msg){ msg.payload = man->mInput; msg.handled = true;    });
    requestMessage("Get.Settings", [man](Kunlaboro::Message& msg){ msg.payload = man->mSettings; msg.handled = true; });
    requestMessage("Get.Sounds",   [man](Kunlaboro::Message& msg){ msg.payload = man->mSound; msg.handled = true;    });
    requestMessage("Get.Font",     [man](Kunlaboro::Message& msg){ msg.payload = &man->mGlobalFont; msg.handled = true; });
    requestMessage("Get.GameView", [man](Kunlaboro::Message& msg){ msg.payload = man->mGameView; msg.handled = true; });
    requestMessage("Get.UiView",   [man](Kunlaboro::Message& msg){ msg.payload = man->mUiView; msg.handled = true;   });

    requestMessage("Now Playing",  [this](const Kunlaboro::Message& msg)
    {
        mCurrentSong = boost::any_cast<std::string>(msg.payload);
        mSongPopout = 0;
        mSongTimeout = 2;
    });
    requestMessage("LD26.Update",  [this](const Kunlaboro::Message& msg)
    {
        float dt = boost::any_cast<float>(msg.payload);

        if (mSongTimeout > 0)
            mSongTimeout = std::max(0.f, mSongTimeout - dt);

        if (!mCurrentSong.empty() && mSongTimeout > 0 && mSongPopout < 1)
            mSongPopout = std::min(1.f, mSongPopout + dt);
        else if (mSongTimeout == 0 && mSongPopout > 0)
            mSongPopout = std::max(0.f, mSongPopout - dt);
        else if (mSongTimeout == 0 && mSongPopout == 0 && !mCurrentSong.empty())
            mCurrentSong.clear();
    });
    changeRequestPriority("LD26.Update", -11);
    requestMessage("LD26.DrawUi",  [this](const Kunlaboro::Message& msg)
    {
        sf::RenderTarget& target = *boost::any_cast<sf::RenderTarget*>(msg.payload);

        sf::RectangleShape rect;
        rect.setSize(sf::Vector2f(512, 96));
        rect.setOrigin(rect.getSize()/2.f);
        rect.setFillColor(sf::Color::Black);
        rect.setOutlineColor(sf::Color::White);
        rect.setOutlineThickness(6.f);

        rect.setPosition(target.getSize().x + 262 - (512 * mSongPopout), target.getSize().y - 100);

        target.draw(rect);

        sf::Text playing("Now Playing:", mState.mGlobalFont);
        sf::FloatRect bounds = playing.getLocalBounds();
        playing.setPosition(rect.getPosition() - sf::Vector2f(350, 72) + sf::Vector2f(bounds.left + bounds.width/2, bounds.top + bounds.height/2));

        target.draw(playing);
        playing.setString(mCurrentSong);
        playing.move(0, bounds.height + 16);
        playing.setCharacterSize(20U);

        target.draw(playing);
    });
}
开发者ID:ace13,项目名称:ld26,代码行数:59,代码来源:StateManager.cpp


示例15: playing

bool AnimationPlayer::canStartAnimationOnCompositor()
{
    // FIXME: Timeline playback rates should be compositable
    if (m_playbackRate == 0 || (std::isinf(sourceEnd()) && m_playbackRate < 0) || (timeline() && timeline()->playbackRate() != 1))
        return false;

    return m_timeline && m_content && m_content->isAnimation() && playing();
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:8,代码来源:AnimationPlayer.cpp


示例16: playing

void AudioBody::notifyReloaded (const DiskResource *r)
{
    (void) r;
    bool was_playing = playing();
    if (was_playing) stop();
    reinitialise();
    if (was_playing) play();
}
开发者ID:AugustoMoura,项目名称:GritEnginePR,代码行数:8,代码来源:audio.cpp


示例17:

void
WPiano::playStarted()
{
	if (playing()) {
		capture_mouse(false);
		update_timer_.start(update_freq, this);
	}
}
开发者ID:an146,项目名称:vomid,代码行数:8,代码来源:w_piano.cpp


示例18: noteOff

void Simpleton::noteOff(const int32_t note) {
  if (playing()) {
		Source *source = noteList.getSource(note);
		if (source != NULL) {
			source->noteOff();
		}
  }
}
开发者ID:eatingbits,项目名称:simpleton,代码行数:8,代码来源:Simpleton.cpp


示例19: file

void TuneListenerFile::check()
{
    TuneData existedTune = FCurrentTune;
    FCurrentTune.clear(); // just a reset
    if (QFile::exists(FFileName))
    {
        QFile file(FFileName);
        if (file.open(QIODevice::ReadOnly))
            switch (FFileFormat)
            {
                case Plain:
                {
                    QTextStream stream( &file );
                    stream.setCodec("UTF-8");
                    stream.setAutoDetectUnicode(true);
                    FCurrentTune.title = stream.readLine();
                    FCurrentTune.artist = stream.readLine();
                    FCurrentTune.source = stream.readLine();
                    FCurrentTune.track = stream.readLine();
                    FCurrentTune.length = stream.readLine().toInt();
                    break;
                }

                case XML:
                {
                    QDomDocument d;
                    d.setContent(&file, false);
                    QDomElement now_playing=d.documentElement();
                    QDomElement song=now_playing.firstChildElement("song");
                    if (!song.firstChildElement("title").text().isNull())
                        FCurrentTune.title = song.firstChildElement("title").text();
                    if (!song.firstChildElement("artist").text().isNull())
                        FCurrentTune.artist = song.firstChildElement("artist").text();
                    if (!song.firstChildElement("album").text().isNull())
                        FCurrentTune.source = song.firstChildElement("album").text();
                    if (!song.firstChildElement("track").text().isNull())
                        FCurrentTune.track = song.firstChildElement("track").text();
                    if (!song.firstChildElement("length").text().isNull())
                        FCurrentTune.length = song.firstChildElement("length").text().toInt();
                }
            }
    }
    else if (!FWaitForCreated && existedTune.isEmpty())
    {
        FWaitForCreated = true;
        return; // we will return to this function when file created. just exit for now.
    }
    // Common code
    TuneData tune = currentTune();
    if (FPreviousTune != tune)
    {
        FPreviousTune = tune;
        if (tune.isEmpty())
            emit stopped();
        else
            emit playing(tune);
    }
}
开发者ID:RoadWorksSoftware,项目名称:eyecu-qt,代码行数:58,代码来源:tunelistenerfile.cpp


示例20: updateScope

bool Animation::preCommit(int compositorGroup, bool startOnCompositor)
{
    PlayStateUpdateScope updateScope(*this, TimingUpdateOnDemand, DoNotSetCompositorPending);

    bool softChange = m_compositorState && (paused() || m_compositorState->playbackRate != m_playbackRate);
    bool hardChange = m_compositorState && (m_compositorState->effectChanged || m_compositorState->startTime != m_startTime);

    // FIXME: softChange && !hardChange should generate a Pause/ThenStart,
    // not a Cancel, but we can't communicate these to the compositor yet.

    bool changed = softChange || hardChange;
    bool shouldCancel = (!playing() && m_compositorState) || changed;
    bool shouldStart = playing() && (!m_compositorState || changed);

    if (startOnCompositor && shouldCancel && shouldStart && m_compositorState && m_compositorState->pendingAction == Start) {
        // Restarting but still waiting for a start time.
        return false;
    }

    if (shouldCancel) {
        cancelAnimationOnCompositor();
        m_compositorState = nullptr;
    }

    ASSERT(!m_compositorState || !std::isnan(m_compositorState->startTime));

    if (!shouldStart) {
        m_currentTimePending = false;
    }

    if (shouldStart) {
        m_compositorGroup = compositorGroup;
        if (startOnCompositor) {
            if (isCandidateForAnimationOnCompositor())
                createCompositorPlayer();

            if (maybeStartAnimationOnCompositor())
                m_compositorState = adoptPtr(new CompositorState(*this));
            else
                cancelIncompatibleAnimationsOnCompositor();
        }
    }

    return true;
}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:45,代码来源:Animation.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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