本文整理汇总了C++中Mixer::UseVolumeSlider方法的典型用法代码示例。如果您正苦于以下问题:C++ Mixer::UseVolumeSlider方法的具体用法?C++ Mixer::UseVolumeSlider怎么用?C++ Mixer::UseVolumeSlider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mixer
的用法示例。
在下文中一共展示了Mixer::UseVolumeSlider方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillBuffers
void AudioIO::FillBuffers()
{
unsigned int numEmpty = 0;
unsigned int i;
// Playback buffers
for(i=0; i<mNumOutBuffers; i++) {
if (mOutBuffer[i].ID == 0)
numEmpty++;
}
if (numEmpty > (mNumOutBuffers/2)) {
sampleCount block = numEmpty * mBufferSize;
double deltat = block / mRate;
if (mT + deltat > mT1) {
deltat = mT1 - mT;
if(deltat < 0.0) return;
block = (sampleCount)(deltat * mRate + 0.5);
}
Mixer *mixer = new Mixer(mNumOutChannels, block, true,
mRate, mFormat);
mixer->UseVolumeSlider(mProject->GetControlToolBar());
mixer->Clear();
TrackListIterator iter2(mTracks);
int numSolo = 0;
Track *vt = iter2.First();
while (vt) {
if (vt->GetKind() == Track::Wave && vt->GetSolo())
numSolo++;
vt = iter2.Next();
}
TrackListIterator iter(mTracks);
vt = iter.First();
while (vt) {
if (vt->GetKind() == Track::Wave) {
Track *mt = vt;
// We want to extract mute and solo information from
// the top of the two tracks if they're linked
// (i.e. a stereo pair only has one set of mute/solo buttons)
Track *partner = mTracks->GetLink(vt);
if (partner && !vt->GetLinked())
mt = partner;
else
mt = vt;
// Cut if somebody else is soloing
if (numSolo>0 && !mt->GetSolo()) {
vt = iter.Next();
continue;
}
// Cut if we're muted (unless we're soloing)
if (mt->GetMute() && !mt->GetSolo()) {
vt = iter.Next();
continue;
}
WaveTrack *t = (WaveTrack *) vt;
switch (t->GetChannel()) {
case Track::LeftChannel:
mixer->MixLeft(t, mT, mT + deltat);
break;
case Track::RightChannel:
mixer->MixRight(t, mT, mT + deltat);
break;
case Track::MonoChannel:
mixer->MixMono(t, mT, mT + deltat);
break;
}
}
vt = iter.Next();
}
// Copy the mixed samples into the buffers
samplePtr outbytes = mixer->GetBuffer();
for(i=0; i<mNumOutBuffers && block>0; i++)
if (mOutBuffer[i].ID == 0) {
sampleCount count;
if (block > mBufferSize)
count = mBufferSize;
else
count = block;
memcpy(mOutBuffer[i].data, outbytes,
count*mNumOutChannels*SAMPLE_SIZE(mFormat));
block -= count;
outbytes += (count*mNumOutChannels*SAMPLE_SIZE(mFormat));
mOutBuffer[i].len = count;
mOutBuffer[i].ID = mOutID;
//.........这里部分代码省略.........