本文整理汇总了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();
}