这篇教程C++ updateVolume函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中updateVolume函数的典型用法代码示例。如果您正苦于以下问题:C++ updateVolume函数的具体用法?C++ updateVolume怎么用?C++ updateVolume使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了updateVolume函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ModelOscillatorObject::OscillatorObject( Model * _parent, int _idx ) : Model( _parent ), m_volumeModel( DefaultVolume / NUM_OF_OSCILLATORS, MinVolume, MaxVolume, 1.0f, this, tr( "Osc %1 volume" ).arg( _idx+1 ) ), m_panModel( DefaultPanning, PanningLeft, PanningRight, 1.0f, this, tr( "Osc %1 panning" ).arg( _idx+1 ) ), m_coarseModel( -_idx*KeysPerOctave, -2 * KeysPerOctave, 2 * KeysPerOctave, 1.0f, this, tr( "Osc %1 coarse detuning" ).arg( _idx+1 ) ), m_fineLeftModel( 0.0f, -100.0f, 100.0f, 1.0f, this, tr( "Osc %1 fine detuning left" ).arg( _idx+1 ) ), m_fineRightModel( 0.0f, -100.0f, 100.0f, 1.0f, this, tr( "Osc %1 fine detuning right" ).arg( _idx + 1 ) ), m_phaseOffsetModel( 0.0f, 0.0f, 360.0f, 1.0f, this, tr( "Osc %1 phase-offset" ).arg( _idx+1 ) ), m_stereoPhaseDetuningModel( 0.0f, 0.0f, 360.0f, 1.0f, this, tr( "Osc %1 stereo phase-detuning" ).arg( _idx+1 ) ), m_waveShapeModel( Oscillator::SineWave, 0, Oscillator::NumWaveShapes-1, this, tr( "Osc %1 wave shape" ).arg( _idx+1 ) ), m_modulationAlgoModel( Oscillator::SignalMix, 0, Oscillator::NumModulationAlgos-1, this, tr( "Modulation type %1" ).arg( _idx+1 ) ), m_sampleBuffer( new SampleBuffer ), m_volumeLeft( 0.0f ), m_volumeRight( 0.0f ), m_detuningLeft( 0.0f ), m_detuningRight( 0.0f ), m_phaseOffsetLeft( 0.0f ), m_phaseOffsetRight( 0.0f ){ // Connect knobs with Oscillators' inputs connect( &m_volumeModel, SIGNAL( dataChanged() ), this, SLOT( updateVolume() ) ); connect( &m_panModel, SIGNAL( dataChanged() ), this, SLOT( updateVolume() ) ); updateVolume(); connect( &m_coarseModel, SIGNAL( dataChanged() ), this, SLOT( updateDetuningLeft() ) ); connect( &m_coarseModel, SIGNAL( dataChanged() ), this, SLOT( updateDetuningRight() ) ); connect( &m_fineLeftModel, SIGNAL( dataChanged() ), this, SLOT( updateDetuningLeft() ) ); connect( &m_fineRightModel, SIGNAL( dataChanged() ), this, SLOT( updateDetuningRight() ) ); updateDetuningLeft(); updateDetuningRight(); connect( &m_phaseOffsetModel, SIGNAL( dataChanged() ), this, SLOT( updatePhaseOffsetLeft() ) ); connect( &m_phaseOffsetModel, SIGNAL( dataChanged() ), this, SLOT( updatePhaseOffsetRight() ) ); connect( &m_stereoPhaseDetuningModel, SIGNAL( dataChanged() ), this, SLOT( updatePhaseOffsetLeft() ) ); updatePhaseOffsetLeft(); updatePhaseOffsetRight();}
开发者ID:StCyr,项目名称:lmms,代码行数:60,
示例2: stop/** Play some music (.ogg etc...) * NB: if an old music was played, it is first stop with stopMusic() * /param filepath file path, CPath::lookup is done here * /param async stream music from hard disk, preload in memory if false * /param loop must be true to play the music in loop. */bool CMusicChannelFader::play(const std::string &filepath, uint xFadeTime, bool async, bool loop){ stop(xFadeTime); // Find the next best free music channel uint nextFader = _MaxMusicFader; for (uint i = 0; i < _MaxMusicFader; ++i) if (!_MusicFader[i].Playing) { nextFader = i; break; } if (nextFader == _MaxMusicFader) { nextFader = (_ActiveMusicFader + 1) % _MaxMusicFader; _MusicFader[nextFader].MusicChannel->stop(); _MusicFader[nextFader].Fade = false; _MusicFader[nextFader].Playing = false; } _ActiveMusicFader = nextFader; // Play a song in it :) _CMusicFader &fader = _MusicFader[_ActiveMusicFader]; if (xFadeTime) fader.fadeIn(xFadeTime); else fader.XFadeVolume = 1.0f; fader.Playing = true; updateVolume(); // make sure at ok volume to start :) fader.Playing = fader.MusicChannel->play(filepath, async, loop); return fader.Playing;}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:32,
|