本文整理汇总了C++中setLoop函数的典型用法代码示例。如果您正苦于以下问题:C++ setLoop函数的具体用法?C++ setLoop怎么用?C++ setLoop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setLoop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qDebug
void MqttBridge::received(const QMQTT::Message &message){
//Now we have to pass on the different command to the DBUS command
//That will be done by emitting signals, as we have no
//knowlege of the dBus class, We will try to have a clean interface
qDebug()<<"Message Topic and payload "<<message.topic() << message.payload();
if (message.topic()==mediaPlayCommand) emit setPlay();
else if (message.topic()==mediaNextCommand) emit setNext();
else if (message.topic()==mediaPrevCommand) emit setPrevious();
else if (message.topic()==mediaVolumeCommand) {
double volume = message.payload().toDouble()/100;
emit setVolume(volume);
}
else if (message.topic()==mediaPlayIdCommand) {
QDBusObjectPath _path;
_path.setPath(message.payload());
emit setPlayId(_path);
}
else if (message.topic()==mediaPlayPauseCommand) emit setPlayPause();
else if (message.topic()==mediaRepeatCommand){
if (message.payload()=="0") emit setLoop("None");
else emit setLoop("Playlist");
}
else if (message.topic()==mediaMixCommand){
if (message.payload()=="0") emit setShuffle(false);
else emit setShuffle(true);
}
}
示例2: setLoop
void
LoopRuler::mouseReleaseEvent(QMouseEvent *mE)
{
if (mE->button() == Qt::LeftButton) {
if (m_loopingMode) {
// Cancel the loop if there was no drag
//
if (m_endLoop == m_startLoop) {
m_endLoop = m_startLoop = 0;
// to clear any other loop rulers
emit setLoop(m_startLoop, m_endLoop);
update();
}
// emit with the args around the right way
//
if (m_endLoop < m_startLoop)
emit setLoop(m_endLoop, m_startLoop);
else
emit setLoop(m_startLoop, m_endLoop);
} else {
// we need to re-emit this signal so that when the user releases the button
// after dragging the pointer, the pointer's position is updated again in the
// other views (typically, in the seg. canvas while the user has dragged the pointer
// in an edit view)
//
emit setPointerPosition(m_grid->snapX(m_lastMouseXPos));
}
emit stopMouseMove();
m_activeMousePress = false;
}
}
示例3: switch
void SongPlayback::checkLoop()
{
switch(loop_.effect) {
case 0:
{
float val = 0;
lowpass_->getParameter(FMOD_DSP_LOWPASS_CUTOFF,&val,0,0);
if(val < loop_.threshold )
{
setLoop();
}
break;
}
case 1:
{
float val = 0;
highpass_->getParameter(FMOD_DSP_HIGHPASS_CUTOFF,&val,0,0);
if(val > loop_.threshold )
{
setLoop();
}
break;
}
case 2:
{
if(prevEchoGen_ == loop_.threshold )
{
setLoop();
}
break;
}
case 3:
{
float val = 0;
flange_->getParameter(FMOD_DSP_FLANGE_RATE,&val,0,0);
if(val > loop_.threshold )
{
setLoop();
}
break;
}
case 4:
{
float val = 0;
tremolo_->getParameter(FMOD_DSP_TREMOLO_FREQUENCY,&val,0,0);
if(val > loop_.threshold )
{
setLoop();
}
break;
}
case 5:
break;
}
}
示例4: Audio
Audio::Audio(const FilePath& path, const Optional<AudioLoopTiming>& loop)
: Audio(path)
{
if (loop)
{
if (loop->endPos)
{
setLoop(Arg::loopBegin = loop->beginPos, Arg::loopEnd = loop->endPos);
}
else
{
setLoop(Arg::loopBegin = loop->beginPos);
}
}
}
示例5: switch
void ofxWMFVideoPlayer::setLoopState(ofLoopType loopType)
{
switch (loopType)
{
case OF_LOOP_NONE:
setLoop(false);
break;
case OF_LOOP_NORMAL:
setLoop(true);
break;
default:
ofLogError("ofxWMFVideoPlayer::setLoopState LOOP TYPE NOT SUPPORTED") << loopType << endl;
break;
}
}
示例6: calcVelocity
void NPC::update(float frameTime)
{
calcVelocity(frameTime);
spriteData.x += velocity.x * frameTime;
spriteData.y += velocity.y * frameTime;
// update Image to animate
if(velocity.x == 0.0 && velocity.y == 0.0) {
// don't animate if not moving
setLoop(false);
} else {
// animate
setLoop(true);
Entity::update(frameTime);
}
}
示例7: setLoop
bool VQAPlayer::open() {
_s = _vm->getResourceStream(_name);
if (!_s) {
return false;
}
if (!_decoder.loadStream(_s)) {
delete _s;
_s = nullptr;
return false;
}
_hasAudio = _decoder.hasAudio();
if (_hasAudio) {
_audioStream = Audio::makeQueuingAudioStream(_decoder.frequency(), false);
}
_repeatsCount = 0;
_loop = -1;
_frame = -1;
_frameBegin = -1;
_frameEnd = _decoder.numFrames() - 1;
_frameEndQueued = -1;
_repeatsCountQueued = -1;
if (_loopInitial >= 0) {
setLoop(_loopInitial, _repeatsCountInitial, kLoopSetModeImmediate, nullptr, nullptr);
} else {
_frameNext = 0;
setBeginAndEndFrame(0, _frameEnd, 0, kLoopSetModeJustStart, nullptr, nullptr);
}
return true;
}
示例8: switch
int MPlayerProcess::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QProcess::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: mediaPosition((*reinterpret_cast< int(*)>(_a[1]))); break;
case 1: volumeChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 2: durationChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 3: volumeLevelChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
case 4: fileNameChanged((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 5: paused(); break;
case 6: sizeChanged(); break;
case 7: openStream((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 8: togglePlayPause(); break;
case 9: setMediaPosition((*reinterpret_cast< int(*)>(_a[1]))); break;
case 10: setVolume((*reinterpret_cast< int(*)>(_a[1]))); break;
case 11: setLoop((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 12: setSpeed((*reinterpret_cast< int(*)>(_a[1]))); break;
case 13: setAudioDelay((*reinterpret_cast< int(*)>(_a[1]))); break;
case 14: readStandardOutput(); break;
default: ;
}
_id -= 15;
}
return _id;
}
示例9: stop
Sound& Sound::operator =(const Sound& right)
{
// Here we don't use the copy-and-swap idiom, because it would mess up
// the list of sound instances contained in the buffers
// Detach the sound instance from the previous buffer (if any)
if (m_buffer)
{
stop();
m_buffer->detachSound(this);
m_buffer = NULL;
}
// Copy the sound attributes
if (right.m_buffer)
setBuffer(*right.m_buffer);
setLoop(right.getLoop());
setPitch(right.getPitch());
setVolume(right.getVolume());
setPosition(right.getPosition());
setRelativeToListener(right.isRelativeToListener());
setMinDistance(right.getMinDistance());
setAttenuation(right.getAttenuation());
return *this;
}
示例10: setPitch
void ofxOpenALSoundPlayer::updateInternalsForNewPrime() {
setPitch(pitch);
setLocation(location.x, location.y, location.z);
setPan(pan);
setVolume(volume);
setLoop(bLoop);
}
示例11: loadBackgroundMusic
bool ofxOpenALSoundPlayer::load(string fileName, bool stream) {
if(!SoundEngineInitialized) {
ofxOpenALSoundPlayer::initializeSoundEngine();
}
if( fileName.length()-3 == fileName.rfind("mp3") )
iAmAnMp3=true;
if(iAmAnMp3) {
bLoadedOk = loadBackgroundMusic(fileName, false, true);
setLoop(bLoop);
isStreaming=true;
}
else {
isStreaming=false;
myId = 0; //assigned by AL
bLoadedOk=true;
if(SoundEngine_LoadEffect(ofToDataPath(fileName).c_str(), &myId) == noErr) {
length = SoundEngine_GetEffectLength(myId);
}
else {
cerr<<"faied to load sound "<<fileName<<endl;
bLoadedOk=false;
}
soundPlayerLock().lock();
soundPlayers.push_back(this);
soundPlayerLock().unlock();
}
return bLoadedOk;
}
示例12: LOGV
void AudioTrack::stop()
{
sp<AudioTrackThread> t = mAudioTrackThread;
LOGV("stop %p", this);
if (t != 0) {
t->mLock.lock();
}
if (android_atomic_and(~1, &mActive) == 1) {
mCblk->cv.signal();
mAudioTrack->stop();
// Cancel loops (If we are in the middle of a loop, playback
// would not stop until loopCount reaches 0).
setLoop(0, 0, 0);
// the playback head position will reset to 0, so if a marker is set, we need
// to activate it again
mMarkerReached = false;
// Force flush if a shared buffer is used otherwise audioflinger
// will not stop before end of buffer is reached.
if (mSharedBuffer != 0) {
flush();
}
if (t != 0) {
t->requestExit();
} else {
setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_NORMAL);
}
}
if (t != 0) {
t->mLock.unlock();
}
}
示例13: fabs
// Zeit hinzufgen // wird vom AnimationManager aufgerufen
void BaseAnimation::addTime( Ogre::Real timePassed )
{
if( !mPaused )
{
if( mDelay > 0.0 )
{
mDelay -= timePassed;
if( mDelay > 0.0 )
return;
else
{
timePassed = fabs(mDelay);
mDelay = 0.0;
}
}
timePassed *= mSpeed;
if (fabs(timePassed) - 0.0001 > 0)
{
Real elapsedTime = (mTimePlayed / mLength) * mLength;
MessagePump::getSingleton().sendMessage<MessageType_AnimationFrameReached>(
this, elapsedTime);
}
doAddTime(timePassed);
// Begrenzte Abspielanzahl
if( mTimesToPlay > 0 )
{
mTimePlayed += fabs(timePassed);
if( getTimesToPlayLeft() == 1 )
{
setLoop(false);
}
else if( getTimesToPlayLeft() == 0 )
{
setLoop(false);
mPaused = true;
MessagePump::getSingleton().sendMessage<MessageType_AnimationFinished>(this);
}
}
}
}
示例14: setFile
void ComAudio::preloadEffect(const char* pszFilePath)
{
#ifndef NO_AUDIO
CocosDenshion::SimpleAudioEngine::getInstance()->preloadEffect(pszFilePath);
#endif
setFile(pszFilePath);
setLoop(false);
}
示例15: SoundSource
Sound::Sound(const Sound& copy) :
SoundSource(copy),
m_buffer (NULL)
{
if (copy.m_buffer)
setBuffer(*copy.m_buffer);
setLoop(copy.getLoop());
}