本文整理汇总了C++中AudioPlayer::ReinitAudio方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioPlayer::ReinitAudio方法的具体用法?C++ AudioPlayer::ReinitAudio怎么用?C++ AudioPlayer::ReinitAudio使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AudioPlayer
的用法示例。
在下文中一共展示了AudioPlayer::ReinitAudio方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreatePlayer
bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget,
TVState desiredState,
bool embed, const QRect &embedbounds,
bool muted)
{
if (HasPlayer())
{
LOG(VB_GENERAL, LOG_ERR, LOC +
"Attempting to setup a player, but it already exists.");
return false;
}
uint playerflags = kDecodeAllowEXT; // allow VDA etc for normal playback
playerflags |= muted ? kAudioMuted : kNoFlags;
playerflags |= useNullVideo ? kVideoIsNull : kNoFlags;
playerflags |= nohardwaredecoders ? kNoFlags : kDecodeAllowGPU;
MythPlayer *player = NULL;
if (kState_WatchingBD == desiredState)
player = new MythBDPlayer((PlayerFlags)playerflags);
else if (kState_WatchingDVD == desiredState)
player = new MythDVDPlayer((PlayerFlags)playerflags);
else
player = new MythPlayer((PlayerFlags)playerflags);
QString passthru_device =
gCoreContext->GetNumSetting("PassThruDeviceOverride", false) ?
gCoreContext->GetSetting("PassThruOutputDevice") : QString::null;
player->SetPlayerInfo(tv, widget, this);
AudioPlayer *audio = player->GetAudio();
audio->SetAudioInfo(gCoreContext->GetSetting("AudioOutputDevice"),
passthru_device,
gCoreContext->GetNumSetting("AudioSampleRate", 44100));
audio->SetStretchFactor(ts_normal);
player->SetLength(playingLen);
player->SetVideoFilters((useNullVideo) ? "onefield" : "");
if (!IsAudioNeeded())
audio->SetNoAudio();
else
{
QString subfn = buffer->GetSubtitleFilename();
if (!subfn.isEmpty() && player->GetSubReader())
player->GetSubReader()->LoadExternalSubtitles(subfn);
}
if (embed && !embedbounds.isNull())
player->EmbedInWidget(embedbounds);
bool isWatchingRecording = (desiredState == kState_WatchingRecording);
player->SetWatchingRecording(isWatchingRecording);
SetPlayer(player);
if (pipState == kPIPOff || pipState == kPBPLeft)
{
if (audio->HasAudioOut())
{
QString errMsg = audio->ReinitAudio();
}
}
else if (pipState == kPBPRight)
player->SetMuted(true);
return StartPlaying(-1);
}
示例2: CreatePlayer
bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget,
TVState desiredState,
WId embedwinid, const QRect *embedbounds,
bool muted)
{
int exact_seeking = gCoreContext->GetNumSetting("ExactSeeking", 0);
if (HasPlayer())
{
VERBOSE(VB_IMPORTANT, LOC_ERR +
"Attempting to setup a player, but it already exists.");
return false;
}
MythPlayer *player = NULL;
if (kState_WatchingBD == desiredState)
player = new MythBDPlayer(muted);
else if (kState_WatchingDVD == desiredState)
player = new MythDVDPlayer(muted);
else
player = new MythPlayer(muted);
if (nohardwaredecoders)
player->DisableHardwareDecoders();
QString passthru_device = gCoreContext->GetNumSetting(
"PassThruDeviceOverride", false) ?
gCoreContext->GetSetting("PassThruOutputDevice") : QString::null;
player->SetPlayerInfo(tv, widget, exact_seeking, this);
AudioPlayer *audio = player->GetAudio();
audio->SetAudioInfo(gCoreContext->GetSetting("AudioOutputDevice"),
passthru_device,
gCoreContext->GetNumSetting("AudioSampleRate", 44100));
audio->SetStretchFactor(ts_normal);
player->SetLength(playingLen);
if (useNullVideo)
player->SetNullVideo();
player->SetVideoFilters((useNullVideo) ? "onefield" : "");
if (!IsAudioNeeded())
audio->SetNoAudio();
else
{
QString subfn = buffer->GetSubtitleFilename();
if (!subfn.isEmpty() && player->GetSubReader())
player->GetSubReader()->LoadExternalSubtitles(subfn);
}
if ((embedwinid > 0) && embedbounds)
{
player->EmbedInWidget(
embedbounds->x(), embedbounds->y(),
embedbounds->width(), embedbounds->height(), embedwinid);
}
bool isWatchingRecording = (desiredState == kState_WatchingRecording);
player->SetWatchingRecording(isWatchingRecording);
SetPlayer(player);
if (pipState == kPIPOff || pipState == kPBPLeft)
{
if (audio->HasAudioOut())
{
QString errMsg = audio->ReinitAudio();
}
}
else if (pipState == kPBPRight)
player->SetMuted(true);
return StartPlaying(-1);
}