• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ setLoop函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setLoop函数的典型用法代码示例。如果您正苦于以下问题:C++ setLoop函数的具体用法?C++ setLoop怎么用?C++ setLoop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setLoop函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
    }



}
开发者ID:tipih,项目名称:mqtttodbudbridge,代码行数:31,代码来源:mqttbridge.cpp


示例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;
    }
}
开发者ID:EQ4,项目名称:RosegardenW,代码行数:35,代码来源:LoopRuler.cpp


示例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;
	}
}
开发者ID:freshfunkee,项目名称:KinectMusicController,代码行数:59,代码来源:SongPlayback.cpp


示例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);
			}
		}
	}
开发者ID:azaika,项目名称:OpenSiv3D,代码行数:15,代码来源:SivAudio.cpp


示例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;
	}
}
开发者ID:fingerx,项目名称:ofxWMFVideoPlayer,代码行数:15,代码来源:ofxWMFVideoPlayer.cpp


示例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);
    }
}
开发者ID:cknolla,项目名称:WichitaGame,代码行数:15,代码来源:npc.cpp


示例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;
}
开发者ID:dreammaster,项目名称:scummvm,代码行数:34,代码来源:vqa_player.cpp


示例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;
}
开发者ID:shiroyasha,项目名称:oldPorjects,代码行数:28,代码来源:moc_MPlayerProcess.cpp


示例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;
}
开发者ID:krruzic,项目名称:cpp3ds,代码行数:26,代码来源:Sound.cpp


示例10: setPitch

void ofxOpenALSoundPlayer::updateInternalsForNewPrime() {
	setPitch(pitch);
	setLocation(location.x, location.y, location.z);
	setPan(pan);
	setVolume(volume);
	setLoop(bLoop);
}
开发者ID:Daandelange,项目名称:openFrameworks,代码行数:7,代码来源:ofxOpenALSoundPlayer.cpp


示例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;
}
开发者ID:Daandelange,项目名称:openFrameworks,代码行数:35,代码来源:ofxOpenALSoundPlayer.cpp


示例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();
    }
}
开发者ID:OMFGB,项目名称:frameworks_base,代码行数:34,代码来源:AudioTrack.cpp


示例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);
			}
		}
	}
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:48,代码来源:BaseAnimation.cpp


示例14: setFile

void ComAudio::preloadEffect(const char* pszFilePath)
{
#ifndef NO_AUDIO
    CocosDenshion::SimpleAudioEngine::getInstance()->preloadEffect(pszFilePath);
#endif
    setFile(pszFilePath);
    setLoop(false);
}
开发者ID:LeeWei92,项目名称:cocos2dx-3.2-qt,代码行数:8,代码来源:CCComAudio.cpp


示例15: SoundSource

Sound::Sound(const Sound& copy) :
SoundSource(copy),
m_buffer   (NULL)
{
    if (copy.m_buffer)
        setBuffer(*copy.m_buffer);
    setLoop(copy.getLoop());
}
开发者ID:Sonkun,项目名称:SFML,代码行数:8,代码来源:Sound.cpp


示例16: setFeatureIdsArrayPath

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ErodeDilateCoordinationNumber::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
  reader->openFilterGroup(this, index);
  setFeatureIdsArrayPath(reader->readDataArrayPath("FeatureIdsArrayPath", getFeatureIdsArrayPath() ) );
  setCoordinationNumber( reader->readValue("CoordinationNumber", getCoordinationNumber()) );
  setLoop( reader->readValue("Loop", getLoop()) );
  reader->closeFilterGroup();
}
开发者ID:BlueQuartzSoftware,项目名称:DREAM3D,代码行数:11,代码来源:ErodeDilateCoordinationNumber.cpp


示例17: open

int SocketUDP::openAsSender(const string& ip, int port, bool blocking)
{
    int r;

    _leaveGroup = false;

    r = _ip.setString(ip);
    if (r != E_OK)
        return r;

    r = open(_family, _type, _protocol);
    if (r != E_OK)
        return r;

    memset(&_addr.sin_zero, '\0', 8);
    _addr.sin_family = AF_INET;
    _addr.sin_addr.s_addr = inet_addr(ip.c_str());
    _addr.sin_port = htons(port);

    if (_ip.getType() == IPv4::TYPE_MULTICAST) {

        r = setTtl(DEFAULT_MULTICAST_TTL);
        if (r != E_OK)
            return r;

        r = setLoop(DEFAULT_LOOPBACK);
        if (r != E_OK)
            return r;

/*
        // seta valores default para TTL e LOOP
        if (setsockopt(IPPROTO_IP, IP_MULTICAST_TTL, (char *)&ttl, sizeof(ttl)) < 0) {
            throw 1;
        }
        if (setsockopt(IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&loop, sizeof(loop)) < 0) {
            throw 1;
        }

        // permite envio dos pacotes de qualquer interface
        _mreq.imr_interface.s_addr = htonl(INADDR_ANY);
        if (setsockopt(IPPROTO_IP, IP_MULTICAST_IF, (char *)&_mreq.imr_interface,
            sizeof(struct ip_mreq)) < 0) {
            throw 1;
        }
*/            
    } else {
        r = setTtl(DEFAULT_UNICAST_TTL);
        if (r != E_OK)
            return r;
    }

    r = setblocking(blocking);
    if (r != E_OK)
        return r;

    return E_OK;
}
开发者ID:chubahowsmall,项目名称:ead-cel,代码行数:57,代码来源:SocketUDP.cpp


示例18: setDelay

void KTimerJob::load( KConfig *cfg, const QString& grp )
{
	KConfigGroup groupcfg = cfg->group(grp);
    setDelay( groupcfg.readEntry( "Delay", 100 ) );
    setCommand( groupcfg.readPathEntry( "Command", QString() ) );
    setLoop( groupcfg.readEntry( "Loop", false ) );
    setOneInstance( groupcfg.readEntry( "OneInstance", d->oneInstance ) );
    setState( (States)groupcfg.readEntry( "State", (int)Stopped ) );
}
开发者ID:KDE,项目名称:ktimer,代码行数:9,代码来源:ktimer.cpp


示例19: setMultiPlay

sfSoundPlayer* sfSoundPlayer::init(string inFilePath) {
	printFileName = "";
	isPaused = 0;
	setMultiPlay(0);
	setVolume(0);
	setLoop(1);
	setFilePath(inFilePath);
	return this;
}
开发者ID:ArthurClemens,项目名称:SoundField,代码行数:9,代码来源:sfSoundPlayer.cpp


示例20: SoundSource

Sound::Sound(const Sound& copy)
: SoundSource(copy)
, m_buffer(nullptr)
{
    if (copy.m_buffer)
        setBuffer(*copy.m_buffer);
	m_pauseOffset = copy.m_pauseOffset;
    setLoop(copy.getLoop());
	setStateADPCM(copy.getStateADPCM());
}
开发者ID:krruzic,项目名称:cpp3ds,代码行数:10,代码来源:Sound.cpp



注:本文中的setLoop函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setMainWidget函数代码示例发布时间:2022-05-30
下一篇:
C++ setLocation函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap