本文整理汇总了C++中boost::scoped_ptr::getId3Info方法的典型用法代码示例。如果您正苦于以下问题:C++ scoped_ptr::getId3Info方法的具体用法?C++ scoped_ptr::getId3Info怎么用?C++ scoped_ptr::getId3Info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::scoped_ptr
的用法示例。
在下文中一共展示了scoped_ptr::getId3Info方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
void
Sound_as::probeAudio()
{
#ifdef USE_SOUND
if ( ! externalSound ) {
// Only probe for sound complete
assert(_soundHandler);
assert(!_soundCompleted);
if (!_soundHandler->isSoundPlaying(soundId)) {
stopProbeTimer();
// dispatch onSoundComplete
callMethod(&owner(), NSV::PROP_ON_SOUND_COMPLETE);
}
return;
}
if (!_mediaParser) return; // nothing to do here w/out a media parser
if ( ! _soundLoaded ) {
#ifdef GNASH_DEBUG_SOUND_AS
log_debug("Probing audio for load");
#endif
if (_mediaParser->parsingCompleted()) {
_soundLoaded = true;
if (!isStreaming) {
stopProbeTimer(); // will be re-started on Sound.start()
}
bool success = _mediaParser->getAudioInfo() != 0;
callMethod(&owner(), NSV::PROP_ON_LOAD, success);
// TODO: check if this should be called anyway.
if (success) handleId3Data(_mediaParser->getId3Info(), owner());
}
// If this is an event sound, we are done. Otherwise, if there is
// any data available, we should start playback.
if (!isStreaming || _mediaParser->isBufferEmpty()) {
return;
}
}
if (isAttached()) {
#ifdef GNASH_DEBUG_SOUND_AS
log_debug("Probing audio for end");
#endif
boost::mutex::scoped_lock lock(_soundCompletedMutex);
if (_soundCompleted) {
// when _soundCompleted is true we're NOT attached !
// MediaParser may be still needed,
// if this is a non-streaming sound
if ( isStreaming ) {
_mediaParser.reset(); // no use for this anymore...
}
_inputStream = 0;
_soundCompleted = false;
stopProbeTimer();
// dispatch onSoundComplete
callMethod(&owner(), NSV::PROP_ON_SOUND_COMPLETE);
}
}
else {
#ifdef GNASH_DEBUG_SOUND_AS
log_debug("Probing audio for start");
#endif
bool parsingCompleted = _mediaParser->parsingCompleted();
try {
log_debug("Attaching aux streamer");
_inputStream = attachAuxStreamerIfNeeded();
}
catch (const MediaException& e) {
assert(!_inputStream);
assert(!_audioDecoder.get());
log_error(_("Could not create audio decoder: %s"), e.what());
_mediaParser.reset(); // no use for this anymore...
stopProbeTimer();
return;
}
if ( ! _inputStream ) {
if ( parsingCompleted ) {
log_error(_("No audio in Sound input."));
stopProbeTimer();
_mediaParser.reset(); // no use for this anymore...
} else {
// keep probing
}
} else {
// An audio decoder was constructed, good!
assert(_audioDecoder.get());
}
}
#endif // USE_SOUND
}