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

C++ FMOD_Channel_SetPaused函数代码示例

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

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



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

示例1: FMOD_Channel_GetPaused

void SoundEngine::togglePauseChannel(unsigned int channel)
{
    FMOD_BOOL etat;
    FMOD_CHANNEL *canal=getChannel(channel);
    FMOD_Channel_GetPaused(canal, &etat);

    if (etat == 1) // Si la chanson est en pause
        FMOD_Channel_SetPaused(canal, 0); // On enlève la pause
    else // Sinon, elle est en cours de lecture
        FMOD_Channel_SetPaused(canal, 1); // On met en pause
}
开发者ID:bsignoret,项目名称:Bomberman-like-reseau,代码行数:11,代码来源:SoundEngine.cpp


示例2: while

	void ModuleIrisAudio::FadeBgmThreadProc(int duration){
		bgmIsFading = true;
		int time = duration;
		while (time >= 0){
			float v;
			FMOD_Channel_SetPaused(bgmChannel, true);
			FMOD_Channel_GetVolume(bgmChannel, &v);
			FMOD_Channel_SetVolume(bgmChannel, v - v / (duration / 1000));
			time -= 1000;
			FMOD_Channel_SetPaused(bgmChannel, false);
			Sleep(1000);
		}
		FMOD_Channel_Stop(bgmChannel);
		bgmIsFading = false;
	}
开发者ID:HADESAngelia,项目名称:Iris-2D-Project,代码行数:15,代码来源:ModuleIrisAudio.cpp


示例3: WStringToString

	bool ModuleIrisAudio::MePlay(wstring filePath, int volume, int rate){
		string sfilepath = WStringToString(filePath);
		const char* fpath = sfilepath.c_str();

		if (channels == 0){
			if (meChannel != NULL){
				BOOL isPlaying;
				FMOD_Channel_IsPlaying(meChannel, &isPlaying);
				if (isPlaying)
					FMOD_Channel_Stop(meChannel);
			}
		}

		FMOD_RESULT result;

		result = FMOD_System_CreateStream(fmodSystem, fpath, FMOD_DEFAULT, 0, &me);
		if (result != FMOD_OK)
			return false;

		result = FMOD_System_PlaySound(fmodSystem, FMOD_CHANNEL_FREE, me, true, &meChannel);
		if (result != FMOD_OK)
			return false;

		FMOD_Channel_SetMode(meChannel, FMOD_LOOP_NORMAL);
		FMOD_Channel_SetVolume(meChannel, volume / 100.0f);

		float frequancy;

		FMOD_Channel_GetFrequency(meChannel, &frequancy);
		FMOD_Channel_SetFrequency(meChannel, frequancy * (rate / 100.0));
		FMOD_Channel_SetPaused(meChannel, FALSE);

		return true;
	}
开发者ID:HADESAngelia,项目名称:Iris-2D-Project,代码行数:34,代码来源:ModuleIrisAudio.cpp


示例4: FindSample

bool Audio::Play(std::string name)
{
    FMOD_RESULT res;
    Sample *sample = FindSample(name);
//***BUG
    if (!sample) return false;

    if (sample->sample != NULL) {
        try {
            //sample found, play it
            res = FMOD_System_PlaySound(
                      system,
                      FMOD_CHANNEL_FREE,
                      sample->sample,
                      true,
                      &sample->channel);

            if (res!= FMOD_OK) return false;

            FMOD_Channel_SetLoopCount(sample->channel, -1);
            FMOD_Channel_SetPaused(sample->channel, false);

        } catch (...) {
            return false;
        }
    }

    return true;
}
开发者ID:narc0tiq,项目名称:Unnamed-Train-Game,代码行数:29,代码来源:audio.cpp


示例5: FMOD_Channel_SetPaused

// ----------------------------------------------------------------------------
void ofxSoundPlayerFMOD::setPaused(bool bP)
{
	if (getIsPlaying() == true){
		FMOD_Channel_SetPaused(channel,bP);
		bPaused = bP;
	}
}
开发者ID:alsdncka,项目名称:digitalstarcode,代码行数:8,代码来源:ofxSoundPlayerFMOD.cpp


示例6: FMOD_Channel_GetPaused

// toggles pause/unpause
void Sound::togglePause(void)
{
  FMOD_BOOL p;

  FMOD_Channel_GetPaused(channel, &p);
  FMOD_Channel_SetPaused(channel, !p);
}
开发者ID:jonquach,项目名称:bomberman,代码行数:8,代码来源:Sound.cpp


示例7: FMOD_System_PlaySound

bool Audio::Play(Sample *sample)
{
    FMOD_RESULT res;
    if (sample == NULL) return false;
    if (sample->sample == NULL) return false;

    try {
        res = FMOD_System_PlaySound(
                  system,
                  FMOD_CHANNEL_FREE,
                  sample->sample,
                  true,
                  &sample->channel);

        if (res!= FMOD_OK) return false;

        FMOD_Channel_SetLoopCount(sample->channel, -1);
        FMOD_Channel_SetPaused(sample->channel, false);

    } catch (...) {
        return false;
    }

    return true;
}
开发者ID:narc0tiq,项目名称:Unnamed-Train-Game,代码行数:25,代码来源:audio.cpp


示例8: I_StartSound

INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority)
{
	FMOD_SOUND *sound;
	FMOD_CHANNEL *chan;
	INT32 i;
	float frequency;

	sound = (FMOD_SOUND *)S_sfx[id].data;
	I_Assert(sound != NULL);

	FMR(FMOD_System_PlaySound(fsys, FMOD_CHANNEL_FREE, sound, true, &chan));

	if (sep == 0)
		sep = 1;

	FMR(FMOD_Channel_SetVolume(chan, (vol / 255.0) * (sfx_volume / 31.0)));
	FMR(FMOD_Channel_SetPan(chan, (sep - 128) / 127.0));

	FMR(FMOD_Sound_GetDefaults(sound, &frequency, NULL, NULL, NULL));
	FMR(FMOD_Channel_SetFrequency(chan, (pitch / 128.0) * frequency));

	FMR(FMOD_Channel_SetPriority(chan, priority));
	//UNREFERENCED_PARAMETER(priority);
	//FMR(FMOD_Channel_SetPriority(chan, 1 + ((0xff-vol)>>1))); // automatic priority 1 - 128 based on volume (priority 0 is music)

	FMR(FMOD_Channel_GetIndex(chan, &i));
	FMR(FMOD_Channel_SetPaused(chan, false));
	return i;
}
开发者ID:HipsterLion,项目名称:SRB2,代码行数:29,代码来源:win_snd.c


示例9: whitgl_sound_play

void whitgl_sound_play(int id, float adjust)
{
	int index = -1;
	int i;
	for(i=0; i<num_sounds; i++)
	{
		if(sounds[i].id == id)
		{
			index = i;
			continue;
		}
	}
	if(index == -1)
	{
		WHITGL_LOG("ERR Cannot find sound %d", id);
		return;
	}

	FMOD_RESULT result = FMOD_System_PlaySound(fmodSystem, FMOD_CHANNEL_FREE, sounds[index].sound, true, &sounds[index].channel);
	_whitgl_sound_errcheck("FMOD_System_PlaySound", result);

	float defaultFrequency;
	result = FMOD_Sound_GetDefaults(sounds[index].sound, &defaultFrequency, NULL, NULL, NULL);
	_whitgl_sound_errcheck("FMOD_Sound_GetDefaults", result);
	result = FMOD_Channel_SetFrequency(sounds[index].channel, defaultFrequency*adjust);
	_whitgl_sound_errcheck("FMOD_Channel_SetFrequency", result);
	result = FMOD_Channel_SetPaused(sounds[index].channel, false);
	_whitgl_sound_errcheck("FMOD_Channel_SetPaused", result);
}
开发者ID:whitingjp,项目名称:ld29,代码行数:29,代码来源:sound.c


示例10: sound_toggle_pause

void sound_toggle_pause(void)
{
    if (loaded) {
        FMOD_BOOL p;
        FMOD_Channel_GetPaused(_channel,&p);
        FMOD_Channel_SetPaused (_channel,!p);
    }
}
开发者ID:SailorOnDaTea,项目名称:kissplayer,代码行数:8,代码来源:sound.cpp


示例11: exception

void AudioManager::Play( const AudioManager::AudioType Type,
                         const string& ID,
                         const float Volume,
                         const float Pitch,
                         const float Pan,
                         const int32_t LoopCount,
                         const int32_t Priority,
                         const FMOD_CHANNELINDEX ChannelIndex )
{
	// Create local variables.

		float Frequency = Null;
		FMOD_CHANNEL* Channel = nullptr;
		unordered_map< string, SoundData >::iterator AudioMapIterator;

	// Check arguments.

		if( Type == MaxAudioTypes )
			throw exception();

	// Playback specified audio sample or stream.

		if( Initialized )
		{
			AudioMapIterator = AudioMaps[ Type ].Instance.find( ID );

			if( AudioMapIterator == AudioMaps[ Type ].Instance.end() )
				throw exception();

			if( FMOD_System_PlaySound( SystemInstance, ChannelIndex, AudioMapIterator->second.Instance, true, &Channel ) != FMOD_OK )
				throw exception();

			if( FMOD_Channel_SetChannelGroup( Channel, AudioMapIterator->second.Group ) != FMOD_OK )
				throw exception();

			if( FMOD_Channel_SetLoopCount( Channel, LoopCount ) != FMOD_OK )
				throw exception();

			if( FMOD_Channel_SetPriority( Channel, Priority ) != FMOD_OK )
				throw exception();

			if( FMOD_Channel_SetPan( Channel, Pan ) != FMOD_OK )
				throw exception();

			if( FMOD_Channel_GetFrequency( Channel, &Frequency ) != FMOD_OK )
				throw exception();

			if( FMOD_Channel_SetFrequency( Channel, ( Frequency * Pitch ) ) != FMOD_OK )
				throw exception();

			if( FMOD_Channel_SetVolume( Channel, Volume ) != FMOD_OK )
				throw exception();

			if( FMOD_Channel_SetPaused( Channel, false ) != FMOD_OK )
				throw exception();
		}
}
开发者ID:awillett,项目名称:Team8,代码行数:57,代码来源:AudioManager.cpp


示例12: FMOD_Channel_GetPaused

void Audio::pauseMusique() {
	if(!_canalMusique)
		return;
	
	FMOD_BOOL pause;
	FMOD_Channel_GetPaused(_canalMusique, &pause);
	
	FMOD_Channel_SetPaused(_canalMusique, !pause);
}
开发者ID:rems4e,项目名称:Projet2MIC,代码行数:9,代码来源:Audio.cpp


示例13: FMOD_Sound_Release

void Sound::load() {
    if (loaded) {
        FMOD_Sound_Release(audio);
    }
    char *path = &location[0u];
    FMOD_System_CreateSound(system, path, FMOD_SOFTWARE, 0, &audio);
    FMOD_Channel_SetChannelGroup(channel, channelGroup);
    FMOD_Channel_SetPaused(channel, true);
    loaded = true;
}
开发者ID:andreisergiu98,项目名称:squarly-hoop,代码行数:10,代码来源:Sound.cpp


示例14: set_paused

void set_paused(FMOD_CHANNEL **channel, int paused)
{
    FMOD_RESULT result;
    unsigned int blocksize;
    
    result = FMOD_System_GetDSPBufferSize(gSystem, &blocksize, 0);
    ERRCHECK(result);

    if (!paused)
    {
        unsigned int pausestart_hi = 0, pausestart_lo = 0;

        FMOD_System_GetDSPClock(gSystem, &pausestart_hi, &pausestart_lo);
        
        FMOD_64BIT_ADD(pausestart_hi, pausestart_lo, 0, blocksize * 2);   /* Into the future by 2 mixer blocks. */
        printf("\npause BOTH at %d \n", pausestart_lo);
       
        /* Make them both pause at exactly the same tick.  Mute them both to avoid a click as well. */
        FMOD_Channel_SetMute(channel[0], TRUE);
        FMOD_Channel_SetDelay(channel[0], FMOD_DELAYTYPE_DSPCLOCK_PAUSE, pausestart_hi, pausestart_lo);
        FMOD_Channel_SetMute(channel[1], TRUE);
        FMOD_Channel_SetDelay(channel[1], FMOD_DELAYTYPE_DSPCLOCK_PAUSE, pausestart_hi, pausestart_lo);
    }
    else
    {
        unsigned int syshi, syslo;
        int count;

        FMOD_System_GetDSPClock(gSystem, &syshi, &syslo);

        printf("\nunpause BOTH at %d\n", syslo);
        
        for (count = 0; count < 2; count++)
        { 
            unsigned int starttime_hi, starttime_lo; 
            unsigned int pausetime_hi = 0, pausetime_lo = 0;
            unsigned int hi = syshi, lo = syslo;
            
            FMOD_Channel_GetDelay(channel[count], FMOD_DELAYTYPE_DSPCLOCK_PAUSE, &pausetime_hi, &pausetime_lo);
            FMOD_Channel_GetDelay(channel[count], FMOD_DELAYTYPE_DSPCLOCK_START, &starttime_hi, &starttime_lo);

            FMOD_64BIT_ADD(hi, lo, 0, blocksize * 2);                   /* Push operation into the future by 2 mixer blocks so it doesnt conflict with mixer. */
            if (starttime_lo > pausetime_lo)                            /* Was already playing, unpause immediately. */
            {
                FMOD_64BIT_ADD(hi, lo, starttime_hi, starttime_lo);     /* Push forward the delayed start by the gap between starting and pausing */
                FMOD_64BIT_SUB(hi, lo, pausetime_hi, pausetime_lo);     /* Push forward the delayed start by the gap between starting and pausing */
            }
            printf("restart %d at %d\n", count, lo);
            FMOD_Channel_SetDelay(channel[count], FMOD_DELAYTYPE_DSPCLOCK_PAUSE, 0, 0);
            FMOD_Channel_SetDelay(channel[count], FMOD_DELAYTYPE_DSPCLOCK_START, hi, lo);
            FMOD_Channel_SetMute(channel[count], FALSE);
            FMOD_Channel_SetPaused(channel[count], FALSE);
        }
    }
}
开发者ID:chandonnet,项目名称:FTB2015,代码行数:55,代码来源:main.c


示例15: Java_org_fmod_realtimestitching_Example_cPause

void Java_org_fmod_realtimestitching_Example_cPause(JNIEnv *env, jobject thiz)
{
	FMOD_RESULT result = FMOD_OK;
	FMOD_BOOL paused = 0;

	result = FMOD_Channel_GetPaused(gChannel, &paused);
	CHECK_RESULT(result);

	result = FMOD_Channel_SetPaused(gChannel, !paused);
	CHECK_RESULT(result);
}
开发者ID:mperroteau,项目名称:Euterpe,代码行数:11,代码来源:main.c


示例16: pause_fiend_music

void pause_fiend_music(void)
{
	FMOD_BOOL paused;
	if(!sound_is_on)return;
	if(strcmp(current_music,"none")==0)return;
	
	FMOD_Channel_GetPaused(fmod_music_channel, &paused);
	if(!paused)
	{
		FMOD_Channel_SetPaused(fmod_music_channel, TRUE);
	}
}
开发者ID:arvidfm,项目名称:fiend,代码行数:12,代码来源:soundplay.c


示例17: MOD_Resume

void MOD_Resume (void)
{
	if(SND_Initialised == false || SND_MusicChannel.inuse == false)
		return;

	if(SND_MusicChannel.paused == true)
	{
		result = FMOD_Channel_SetPaused(SND_MusicChannel.channel, false);
		FMOD_ERROR(result, true, false);

		SND_MusicChannel.paused = false;
	}
}
开发者ID:infernuslord,项目名称:uqe-quake,代码行数:13,代码来源:snd_fmod.c


示例18: FMOD_Channel_SetPaused

void CSound::Resume(void) {
	// Check if we have a sound loaded
	if (!mLoaded) {
		return;
	}
#if __ENABLE_CFMOD
	// Check if we have a valid channel
	if (0 != mpChannel) {
		// Resume the channel that is playing the sound
		FMOD_Channel_SetPaused(mpChannel, 0);
	}
#endif
}
开发者ID:pandaforks,项目名称:Mirage--,代码行数:13,代码来源:CSound.cpp


示例19: FMOD_Channel_GetPaused

void        FMODSound::play(void)
{
  if (this->_channel)
    {
      FMOD_Channel_GetPaused(this->_channel, &(this->_tmp));
    }
  if (this->_tmp == true)
    FMOD_Channel_SetPaused(this->_channel, false);
  else
    FMOD_System_PlaySound(this->_system, FMOD_CHANNEL_FREE,
			  this->_sound, 0, &(this->_channel));
  FMOD_Channel_SetVolume(this->_channel, this->_volume);
}
开发者ID:antiqe,项目名称:RType,代码行数:13,代码来源:FMODSound.cpp


示例20: ERRCHECK

Sound::Sound(const Sound &_sound)
{
	//FMOD_SOUND *temp = *&_sound.sound;
	this->sound = *&_sound.sound;
	f_pos = _sound.f_pos;
	f_vel = _sound.f_vel;
	*result = FMOD_Channel_Set3DAttributes(channel,&f_pos,&f_vel);
	ERRCHECK();
	*result = FMOD_Channel_SetPaused(channel, true);
	ERRCHECK();

	pos = new Vector(_sound.pos->X_Y_Z[0],_sound.pos->X_Y_Z[1],_sound.pos->X_Y_Z[2]);
	vel = new Vector(_sound.vel->X_Y_Z[0],_sound.vel->X_Y_Z[1],_sound.vel->X_Y_Z[2]);
}
开发者ID:febreez123,项目名称:thenextdimension3D,代码行数:14,代码来源:Sound.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ FMOD_Channel_Stop函数代码示例发布时间:2022-05-30
下一篇:
C++ FMF_SetCell函数代码示例发布时间: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