当前位置: 首页>>代码示例>>C++>>正文


C++ PlayerPtr::SetVolume方法代码示例

本文整理汇总了C++中PlayerPtr::SetVolume方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerPtr::SetVolume方法的具体用法?C++ PlayerPtr::SetVolume怎么用?C++ PlayerPtr::SetVolume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PlayerPtr的用法示例。


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

示例1: Start

void Transport::Start(utfstring url){
#ifdef _DEBUG
	std::cerr << "Transport::Start called" << std::endl;
#endif
    // Check if this is already Prepared
    PlayerPtr player    = this->nextPlayer;
    this->nextPlayer.reset();
#ifdef _DEBUG
	std::cerr << "Transport: nextPlayer reset" << std::endl;
#endif

    // If the nextPlayer wasn't the same as the one started, lets create a new one
    if(!player || player->url!=url){
        // Or create a new player
    	Player::OutputPtr output;
#ifdef _DEBUG
	std::cerr << "Transport: new output created for player" << std::endl;
#endif
        player  = Player::Create(url, &output);
        player->SetVolume(this->volume);
#ifdef _DEBUG
	std::cerr << "Transport: new player created" << std::endl;
#endif
    }

    // Add to the players
    this->players.push_front(player);
    this->currentPlayer = player;
#ifdef _DEBUG
	std::cerr << "Transport: player added to player list" << std::endl;
#endif

    // Lets connect to the signals of the currentPlayer
    this->currentPlayer->PlaybackStarted.connect(this,&Transport::OnPlaybackStarted);
    this->currentPlayer->PlaybackAlmostEnded.connect(this,&Transport::OnPlaybackAlmostEnded);
    this->currentPlayer->PlaybackEnded.connect(this,&Transport::OnPlaybackEnded);
    this->currentPlayer->PlaybackError.connect(this, &Transport::OnPlaybackError);
#ifdef _DEBUG
	std::cerr << "Transport: player-Play() about to be called" << std::endl;
#endif
    // Start playing
    player->Play();
}
开发者ID:LeonJavaAndroid,项目名称:musikcube,代码行数:43,代码来源:Transport.cpp


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