本文整理汇总了C++中AudioNodeStream::SetStreamTimeParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioNodeStream::SetStreamTimeParameter方法的具体用法?C++ AudioNodeStream::SetStreamTimeParameter怎么用?C++ AudioNodeStream::SetStreamTimeParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AudioNodeStream
的用法示例。
在下文中一共展示了AudioNodeStream::SetStreamTimeParameter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Context
void
OscillatorNode::Start(double aWhen, ErrorResult& aRv)
{
if (!WebAudioUtils::IsTimeValid(aWhen)) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return;
}
if (mStartCalled) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
mStartCalled = true;
AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
if (!ns) {
// Nothing to play, or we're already dead for some reason
return;
}
// TODO: Perhaps we need to do more here.
ns->SetStreamTimeParameter(OscillatorNodeEngine::START,
Context(), aWhen);
MarkActive();
}
示例2: Context
void
AudioBufferSourceNode::Stop(double aWhen, ErrorResult& aRv)
{
if (!WebAudioUtils::IsTimeValid(aWhen)) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return;
}
if (!mStartCalled) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
if (!ns || !Context()) {
// We've already stopped and had our stream shut down
return;
}
ns->SetStreamTimeParameter(STOP, Context(), std::max(0.0, aWhen));
}
示例3: Context
void
AudioBufferSourceNode::Stop(double aWhen, ErrorResult& aRv)
{
if (!mStartCalled) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (!mBuffer) {
// We don't have a buffer, so the stream is never marked as finished.
// Therefore we need to drop our playing ref right now.
mPlayingRef.Drop(this);
}
AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
if (!ns || !Context()) {
// We've already stopped and had our stream shut down
return;
}
ns->SetStreamTimeParameter(STOP, Context()->DestinationStream(),
std::max(0.0, aWhen));
}
示例4: Stop
void
AudioBufferSourceNode::Stop(double aWhen, ErrorResult& aRv)
{
if (!WebAudioUtils::IsTimeValid(aWhen)) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return;
}
if (!mStartCalled) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
WEB_AUDIO_API_LOG("%f: %s %u Stop(%f)", Context()->CurrentTime(),
NodeType(), Id(), aWhen);
AudioNodeStream* ns = mStream;
if (!ns || !Context()) {
// We've already stopped and had our stream shut down
return;
}
ns->SetStreamTimeParameter(STOP, Context(), std::max(0.0, aWhen));
}