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

C++ BASS_ChannelPlay函数代码示例

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

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



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

示例1: BASS_ChannelFlags

void AudioClip::play()
{
	if (loop)
		BASS_ChannelFlags(hm, BASS_SAMPLE_LOOP, BASS_SAMPLE_LOOP);
	else
        BASS_ChannelFlags(hm, 0, BASS_SAMPLE_LOOP);

	if (play_once)
	{
		if (oshot)
		{
			BASS_ChannelSetAttribute(hm, BASS_ATTRIB_PAN, pan);
			BASS_ChannelSetAttribute(hm, BASS_ATTRIB_VOL, volume);
			BASS_ChannelSetAttribute(hm, BASS_ATTRIB_TEMPO_PITCH, pitch);
			BASS_ChannelPlay(hm, TRUE);
			playing = true;
			oshot = false;
		}
	}
	else
	{
		BASS_ChannelSetAttribute(hm, BASS_ATTRIB_PAN, pan);
		BASS_ChannelSetAttribute(hm, BASS_ATTRIB_VOL, volume);
		BASS_ChannelSetAttribute(hm, BASS_ATTRIB_TEMPO_PITCH, pitch);
		BASS_ChannelPlay(hm, TRUE);
		playing = true;
	}
}
开发者ID:jozadaquebatista,项目名称:DQBIX-Game-Engine,代码行数:28,代码来源:audio.cpp


示例2: BASS_StreamGetFilePosition

bool Player::PrebufTimerProc()
{
        QWORD progress = BASS_StreamGetFilePosition(stream,BASS_FILEPOS_BUFFER)*100/BASS_StreamGetFilePosition(stream,BASS_FILEPOS_END);

        if (progress>75 || !BASS_StreamGetFilePosition(stream,BASS_FILEPOS_CONNECTED)) { // over 75% full (or end of download)
                { // get the broadcast name and URL
                        const char *icy=BASS_ChannelGetTags(stream,BASS_TAG_ICY);
                        if (!icy) icy=BASS_ChannelGetTags(stream,BASS_TAG_HTTP); // no ICY tags, try HTTP
                        if (icy) {

                        }
                }
                // get the stream title and set sync for subsequent titles
                //DoMeta();
                //BASS_ChannelSetSync(chan,BASS_SYNC_META,0,&MetaSync,0); // Shoutcast
                //BASS_ChannelSetSync(chan,BASS_SYNC_OGG_CHANGE,0,&MetaSync,0); // Icecast/OGG
                // set sync for end of stream
                //BASS_ChannelSetSync(chan,BASS_SYNC_END,0,&EndSync,0);
                // play it!
                BASS_ChannelPlay(stream,FALSE);

                return FALSE; // stop monitoring
        } else {
                return TRUE; // continue monitoring
        }
}
开发者ID:offtza01,项目名称:netradio,代码行数:26,代码来源:player.cpp


示例3: BASS_SampleGetChannel

		// play
		void BassSound3D::Play()
		{
			m_channel = BASS_SampleGetChannel(m_handle, FALSE);

			if (m_looping)
			{
				BASS_ChannelFlags(m_channel, BASS_SAMPLE_LOOP, BASS_SAMPLE_LOOP);
			}
			else
			{
				BASS_ChannelFlags(m_channel, 0, BASS_SAMPLE_LOOP);
			}

			BASS_ChannelSetAttribute(m_channel, BASS_ATTRIB_VOL, m_volume);

			BASS_ChannelSet3DAttributes(m_channel, -1, m_minDistance, m_maxDistance, -1, -1, -1);

			BASS_3DVECTOR pos(m_Position.x, m_Position.y, m_Position.z);
			BASS_3DVECTOR vel(m_velocity.x, m_velocity.y, m_velocity.z);
			BASS_ChannelSet3DPosition(m_channel, &pos, NULL, &vel);

			BASS_Apply3D();

			BASS_ChannelPlay(m_channel, FALSE);
		}
开发者ID:183amir,项目名称:kge,代码行数:26,代码来源:BassSound3D.cpp


示例4: BASS_SampleLoad

/// <summary>
/// Reproduce un sonido a efecto de realizar pruebas (LShift + H).
/// </summary>
void CSoundManager::TestSound ()
{
	DWORD TestSoundId = BASS_SampleLoad(false, "Data/Sounds/Sample/Muerte/swordSwing.wav", 0, 0, 1, BASS_SAMPLE_MONO);

	// Inicializa el canal 
	BASS_SampleGetChannel(TestSoundId, FALSE);
	// Añade la configuración del canal 
	m_bIsOk = BASS_ChannelSetAttribute(TestSoundId, BASS_ATTRIB_VOL, 100)?true:false;

	// Asigna propiedad de loop
	//BASS_ChannelFlags(TestSoundId, BASS_SAMPLE_LOOP, BASS_SAMPLE_LOOP); // set LOOP flag

	// Generador de float aleatorio dentro del siguiente rango [-60....0....+60]  
	//float randomSemitoneValue = (rand() % ((-60) - 60 + 1)) + (-60);


	// TO DO: No funciona
	//bool worked = BASS_ChannelSetAttribute(TestSoundId,BASS_ATTRIB_TEMPO_PITCH,randomSemitoneValue)?true:false;

	//if (worked == false)
	//{
	//	int errorCode = BASS_ErrorGetCode();
	//	errorCode = 0;
	//}


	// Reproducción del canal 
	BASS_ChannelPlay(TestSoundId, FALSE);
}
开发者ID:BGCX261,项目名称:zombigame-svn-to-git,代码行数:32,代码来源:SoundManager.cpp


示例5: MovingObject

Plane::Plane(std::string meshdir, std::string texturedir, Vector3 position)
: MovingObject(meshdir, texturedir, position, false){
	this->speed        = 0;
	this->acceleration = 50;
	this->deceleration = 5;
	this->max_speed	   = 200;
	this->min_speed	   = 50;
	this->std_speed    = 5;
	this->roll         = 3;
	this->v_roll       = 2;
	this->h_roll       = 1;
	this->friction     = 0.01;

	numBullets   = 10000;
	bulletsShoot = 0;

	cadencia = 0.25;

	name_ = "Plane " + id;

	motor = BASS_SampleLoad(false,"..\\..\\data\\sound\\motor.mp3",0,0,3,BASS_SAMPLE_LOOP);
	motorSampleChannel = BASS_SampleGetChannel(motor,false);
	BASS_ChannelPlay(motorSampleChannel,true);
	BASS_ChannelSetAttribute(motorSampleChannel,BASS_ATTRIB_VOL,0.5);
	BASS_ChannelSet3DAttributes(motorSampleChannel,BASS_3DMODE_NORMAL,1,500,360,360,0.1);

	bullet = BASS_SampleLoad(false,"..\\..\\data\\sound\\shot.mp3",0,0,3,0);
	bulletSampleChannel = BASS_SampleGetChannel(bullet,false);
	BASS_ChannelSetAttribute(bulletSampleChannel,BASS_ATTRIB_VOL,0.7);
	BASS_ChannelSet3DAttributes(bulletSampleChannel,BASS_3DMODE_NORMAL,0,500,360,360,0.1);
}
开发者ID:DaniBarca,项目名称:PlaneGame,代码行数:31,代码来源:plane.cpp


示例6: statusChanged

void BassPlayer::playPreproccessing() {
    emit statusChanged(media_title, LoadedMedia);

    BASS_CHANNELINFO info;
    if (BASS_ChannelGetInfo(chan, &info))
        channelsCount(info.chans);
    else
        channelsCount(2);

    if (eq_in_use) registerEQ();

    #ifdef BASS_USE_TEMPO
        applyTempoToChannel();
        newTempoProcessing(tempo());
    #endif

    setSampleRateQuality();
    newVolumeProcessing(volume());
    newPanProcessing(pan());

    if (BASS_ChannelPlay(chan, true)) { // stalled with big sized video files
        playPostprocessing(is_paused);

        syncHandle = BASS_ChannelSetSync((HSYNC)chan, BASS_SYNC_END, 0, &endTrackSync, this);
        syncDownloadHandle = BASS_ChannelSetSync(chan, BASS_SYNC_DOWNLOAD, 0, &endTrackDownloading, this);

//        BASS_SYNC_STALL
//        mixtime only	Sync when playback of the channel is stalled/resumed.
//        param : not used. data : 0 = stalled, 1 = resumed.
    } else {
        proceedErrorState();
        qCritical() << "IS NOT PLAYED";
    }
}
开发者ID:jeyboy,项目名称:playo3,代码行数:34,代码来源:bass_player.cpp


示例7: setPosition

void KNMusicBackendBassThread::play()
{
    //Check:
    // 1. The state is already playing.
    // 2. The channel is null.
    if(m_state==Playing || (!m_channel))
    {
        return;
    }
    //Start the position updater.
    m_positionUpdater->start();
    //Check the playing state before.
    if(m_state==Stopped)
    {
        //Reset the position to fit track playing.
        setPosition(0);
        //Set the volume to the last volume, because of the reset, the
        //volume is back to 1.0.
        BASS_ChannelSetAttribute(m_channel, BASS_ATTRIB_VOL, m_volume);
    }
    //Play the thread.
    BASS_ChannelPlay(m_channel, FALSE);
    //Update the state.
    setPlayingState(Playing);
}
开发者ID:AnkyoChu,项目名称:Mu,代码行数:25,代码来源:knmusicbackendbassthread.cpp


示例8: BASS_Start

/*
	Play
*/
VOID Application::play(HSTREAM stream)
{
	BASS_Start();
	BASS_ChannelPlay(stream, TRUE);
	equalizer.SetFX(stream);
	BASS_ChannelSetAttribute(stream, BASS_ATTRIB_VOL, numVolume);
}
开发者ID:vitahalyubimov,项目名称:Course-WinAPI,代码行数:10,代码来源:Application.cpp


示例9: PrebufTimerProc

gboolean PrebufTimerProc(gpointer data)
{ // monitor prebuffering progress
	DWORD progress=BASS_StreamGetFilePosition(chan,BASS_FILEPOS_BUFFER)
		*100/BASS_StreamGetFilePosition(chan,BASS_FILEPOS_END); // percentage of buffer filled
	if (progress>75 || !BASS_StreamGetFilePosition(chan,BASS_FILEPOS_CONNECTED)) { // over 75% full (or end of download)
		{ // get the broadcast name and URL
			const char *icy=BASS_ChannelGetTags(chan,BASS_TAG_ICY);
			if (!icy) icy=BASS_ChannelGetTags(chan,BASS_TAG_HTTP); // no ICY tags, try HTTP
			if (icy) {
				for (;*icy;icy+=strlen(icy)+1) {
					if (!strncasecmp(icy,"icy-name:",9))
						gtk_label_set_text_8859(GTK_LABEL(GetWidget("status2")),icy+9);
					if (!strncasecmp(icy,"icy-url:",8))
						gtk_label_set_text_8859(GTK_LABEL(GetWidget("status3")),icy+8);
				}
			} else
				gtk_label_set_text(GTK_LABEL(GetWidget("status2")),"");
		}
		// get the stream title and set sync for subsequent titles
		DoMeta();
		BASS_ChannelSetSync(chan,BASS_SYNC_META,0,&MetaSync,0); // Shoutcast
		BASS_ChannelSetSync(chan,BASS_SYNC_OGG_CHANGE,0,&MetaSync,0); // Icecast/OGG
		// set sync for end of stream
		BASS_ChannelSetSync(chan,BASS_SYNC_END,0,&EndSync,0);
		// play it!
		BASS_ChannelPlay(chan,FALSE);
		return FALSE; // stop monitoring
	} else {
		char text[20];
		sprintf(text,"buffering... %d%%",progress);
		gtk_label_set_text(GTK_LABEL(GetWidget("status2")),text);
		return TRUE; // continue monitoring
	}
}
开发者ID:adius,项目名称:FeetJ,代码行数:34,代码来源:netradio.c


示例10: GetNewChannel

HCHANNEL BassSoundEngine::PlayMusic(string filename, CHANNEL Ichannel, bool loop, float volume)
{
	if(Ichannel<0||Ichannel>=maxChannel)
	{
		Ichannel = GetNewChannel();
		if(Ichannel<0)
			return NULL;
	}else
		FreeChannel(Ichannel);

	HSTREAM sound = ReadMusic(filename);

	DWORD hr;

	// start play
	hr = BASS_ChannelPlay(sound, TRUE);

	// set volume
	volumeDes[Ichannel] = volume*defaultVolume;
	hr = BASS_ChannelSetAttribute(sound, BASS_ATTRIB_VOL, volumeDes[Ichannel]);

	// set loop
	if(loop)
		hr = BASS_ChannelFlags(sound, BASS_SAMPLE_LOOP, BASS_SAMPLE_LOOP);

	channel[Ichannel] = sound;

	return sound;
}
开发者ID:xuancong84,项目名称:ProjectDIVA,代码行数:29,代码来源:SoundEngine.cpp


示例11: ReadSound

void BassSoundEngine::PlaySound(string filename, float volume)
{
	HSAMPLE sound = ReadSound(filename);
	HSTREAM channel = BASS_SampleGetChannel(sound, FALSE);
	BASS_ChannelSetAttribute(channel, BASS_ATTRIB_VOL, volume*defaultVolume);
	BASS_ChannelPlay(channel, TRUE);
}
开发者ID:xuancong84,项目名称:ProjectDIVA,代码行数:7,代码来源:SoundEngine.cpp


示例12: loadBassThread

void KNMusicBackendBassThread::restore(const QString &updatedFilePath)
{
    //Check out the saved position, if it's -1, means it never saved before.
    //Ignore the invalid call.
    if(m_savedPosition==-1)
    {
        return;
    }
    //Check out the updated file path.
    QString restoreFilePath=
            updatedFilePath.isEmpty()?m_filePath:updatedFilePath;
    //Reload the bass thread.
    loadBassThread(restoreFilePath);
    //Reset the postion.
    setPosition(m_savedPosition);
    //Set the volume to the last volume, because of the reset, the
    //volume is back to 1.0.
    BASS_ChannelSetAttribute(m_channel, BASS_ATTRIB_VOL, m_volume);
    //Check out the state.
    if(m_state==Playing)
    {
        //Start the updater.
        m_positionUpdater->start();
        //Play the thread.
        BASS_ChannelPlay(m_channel, FALSE);
    }
    //Reset the saved position.
    m_savedPosition=-1;
}
开发者ID:AnkyoChu,项目名称:Mu,代码行数:29,代码来源:knmusicbackendbassthread.cpp


示例13: RecordingCallback

BOOL CALLBACK RecordingCallback(HRECORD handle, const void *buffer, DWORD length, void *user)
{
	DWORD bl;
	BASS_StreamPutData(chan,buffer,length); // feed recorded data to output stream
	bl=BASS_ChannelGetData(chan,NULL,BASS_DATA_AVAILABLE); // get output buffer level
	if (prebuf) { // prebuffering
		if (bl>=prebuf+length) { // gone 1 block past the prebuffering target
#ifdef ADJUSTRATE
			targbuf=bl; // target the current level
			prevbuf=0;
#endif
			prebuf=0; // finished prebuffering
			BASS_ChannelPlay(chan,FALSE); // start the output
		}
	} else { // playing
#ifdef ADJUSTRATE
		if (bl<targbuf) { // buffer level is below target, slow down...
			rate--;
			BASS_ChannelSetAttribute(chan,BASS_ATTRIB_FREQ,rate);
			prevbuf=0;
		} else if (bl>targbuf && bl>=prevbuf) { // buffer level is high and not falling, speed up...
			rate++;
			BASS_ChannelSetAttribute(chan,BASS_ATTRIB_FREQ,rate);
			prevbuf=bl;
		}
#endif
	}
	return TRUE; // continue recording
}
开发者ID:jaideng123,项目名称:ConsoleMusicPlayer,代码行数:29,代码来源:livefx.c


示例14: setupSDL

render::render(char* song, bool play) {
	this->play = play;
	running = setupSDL();

	if (play) {
		BASS_Init(-1, 44100, 0, NULL, NULL);
		HSTREAM stream;
		stream = BASS_StreamCreateFile(false, song, 0, 0, BASS_SAMPLE_FLOAT | BASS_STREAM_PRESCAN);
		sound_chan = stream;
		BASS_ChannelPlay(sound_chan, false);
	}


	srand(time(NULL));
	for (int i = 0; i < BALL_SIZE; i++) {
		balls[i].setX(rand()%BOX_SIZE*2);
		balls[i].setY(rand()%BOX_SIZE*2);
		balls[i].setZ(rand()%BOX_SIZE*2);
	}

	rotx = 0;
	roty = 0;
	rotz = 0;
	box_x = 0;
	box_y = 0;
	box_z = 0;
	posx = 0;
	posy = 0;
	posz = 100;
	max = BALL_SIZE;
}
开发者ID:hypereddie,项目名称:Bouncing-Boxes,代码行数:31,代码来源:render.cpp


示例15: switch

/*
	WM_COMMAND
*/
VOID DlgPlayList::Cls_OnCommand(HWND hwnd, INT id, HWND hwndCtl, UINT codeNotify)
{
	switch (id)
	{
		case IDC_PLAYLIST:
		{
			if (codeNotify == LBN_DBLCLK)
			{
				INT idx = SendMessage(hPlayList, LB_GETCURSEL, 0, 0);			//получение индекса выделенного элемента
				Application::_this->hStream = songs[idx].hStream;				//присвоение основному потоку поток выбранного элемента
				Application::_this->secPlaying = 0;								//обнуление секунд
				Application::_this->setRangeTrackBarPlaySong(Application::_this->hStream);		//установка диапазона для полосы прокурутки
				DlgEqualizer::_this->SetFX(Application::_this->hStream);		//установка настроек для каналов регуляции звучания
				BASS_Stop();			//остановка потока
				BASS_ChannelStop(Application::_this->hStream);		//остановка канала
				BASS_Start();			//запуск потока
				BASS_ChannelPlay(Application::_this->hStream, TRUE);	//запуск канала
				SetTimer(GetParent(hDlg), Application::_this->id_timer, 1000, 0);			//запуск таймера для времени проигрывания
				SetTimer(GetParent(hDlg), Application::_this->idTimerBySpectr, 100, 0);		//запуск таймера для спектра
				BASS_ChannelSetAttribute(Application::_this->hStream, BASS_ATTRIB_VOL, Application::_this->numVolume);
			}
			break;
		}
		case IDC_ADDSONG:
		{
			SendMessage(GetParent(hwnd), WM_COMMAND, IDC_ADDSONG, 0);
			break;
		}
		default:
			break;
	}
}
开发者ID:vitahalyubimov,项目名称:Course-WinAPI,代码行数:35,代码来源:DlgPlayList.cpp


示例16: playMOD

bool playMOD (int f, int a, int fromTrack) {
	if (soundOK) {

		stopMOD (a);

		setResourceForFatal (f);
		uint32_t length = openFileFromNum (f);
		if (length == 0) return NULL;

		char * memImage;
		memImage = loadEntireFileToMemory (bigDataFile, length);
		if (! memImage) return fatal (ERROR_MUSIC_MEMORY_LOW);

		mod[a] = BASS_MusicLoad (true, memImage, 0, length, BASS_MUSIC_LOOP|BASS_MUSIC_RAMP/*|BASS_MUSIC_PRESCAN needed too if we're going to set the position in bytes*/, 0);
		delete memImage;

		if (! mod[a]) {

		}
		else
		{
			setMusicVolume (a, defVol);

			if (! BASS_ChannelPlay (mod[a], true) )
				debugOut("playMOD: Error %d!\n", BASS_ErrorGetCode());

			BASS_ChannelSetPosition (mod[a], MAKELONG(fromTrack, 0), BASS_POS_MUSIC_ORDER);
			BASS_ChannelFlags(mod[a], BASS_SAMPLE_LOOP|BASS_MUSIC_RAMP, BASS_SAMPLE_LOOP|BASS_MUSIC_RAMP);
		}
		setResourceForFatal (-1);
	}
    return true;
}
开发者ID:opensludge,项目名称:opensludge,代码行数:33,代码来源:sound_bass.cpp


示例17: BASS_StreamPutData

void BASS_AudioInterface::insertData(float* data,int nSamples)
{
	
	for (int i=0;i<nSamples;i++)
	{
		if (mBuffSize < mMaxBuffSize)
		{
			mTempBuffer[mBuffSize++] = data[i];

		}
		
		if (mBuffSize == mFreq * mNumChannels / 10) {

			DWORD err = BASS_StreamPutData(mStream, mTempBuffer, mBuffSize * 4);
	
			mBuffSize = 0;
			
			DWORD state = BASS_ChannelIsActive(mStream);
	
			if (state != BASS_ACTIVE_PLAYING) {
				BASS_ChannelPlay(mStream, 0);
			}
		
		}
	
	}
		
}
开发者ID:Chaduke,项目名称:bah.mod,代码行数:28,代码来源:BASS_AudioInterface.cpp


示例18: OpenClicked

void OpenClicked(GtkButton *obj, gpointer data)
{
	int resp=gtk_dialog_run(GTK_DIALOG(filesel));
	gtk_widget_hide(filesel);
	if (resp==GTK_RESPONSE_ACCEPT) {
		char *file=gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel));
		// free both MOD and stream, it must be one of them! :)
		BASS_MusicFree(chan);
		BASS_StreamFree(chan);
		if (!(chan=BASS_StreamCreateFile(FALSE,file,0,0,BASS_SAMPLE_LOOP|BASS_SAMPLE_FLOAT))
			&& !(chan=BASS_MusicLoad(FALSE,file,0,0,BASS_MUSIC_RAMPS|BASS_SAMPLE_LOOP|BASS_SAMPLE_FLOAT,1))) {
			// whatever it is, it ain't playable
			gtk_button_set_label(obj,"click here to open a file...");
			Error("Can't play the file");
		} else {
			BASS_CHANNELINFO info;
			BASS_ChannelGetInfo(chan,&info);
			if (info.chans!=2) { // the DSP expects stereo
				gtk_button_set_label(obj,"click here to open a file...");
				BASS_MusicFree(chan);
				BASS_StreamFree(chan);
				Error("only stereo sources are supported");
			} else {
				gtk_button_set_label(obj,file);
				// setup DSPs on new channel and play it
				RotateToggled(GTK_TOGGLE_BUTTON(GetWidget("rotate")),0);
				EchoToggled(GTK_TOGGLE_BUTTON(GetWidget("echo")),0);
				FlangerToggled(GTK_TOGGLE_BUTTON(GetWidget("flanger")),0);
				BASS_ChannelPlay(chan,FALSE);
			}
		}
		g_free(file);
	}
}
开发者ID:AntonGerasimov,项目名称:Converter,代码行数:34,代码来源:dsptest.c


示例19: PlayFile

// select a file to play, and play it
BOOL PlayFile()
{
	BOOL ret=FALSE;
	regex_t fregex;
	GtkWidget *filesel; // file selector
	GtkFileFilter *filter;
	filesel=gtk_file_chooser_dialog_new("Open File",GTK_WINDOW(win),GTK_FILE_CHOOSER_ACTION_OPEN,
		GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL,GTK_STOCK_OPEN,GTK_RESPONSE_ACCEPT,NULL);
	filter=gtk_file_filter_new();
	gtk_file_filter_set_name(filter,"Playable files");
	regcomp(&fregex,"\\.(mo3|xm|mod|s3m|it|umx|mp[1-3]|ogg|wav|aif)$",REG_ICASE|REG_NOSUB|REG_EXTENDED);
	gtk_file_filter_add_custom(filter,GTK_FILE_FILTER_FILENAME,FileExtensionFilter,&fregex,NULL);
	gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel),filter);
	filter=gtk_file_filter_new();
	gtk_file_filter_set_name(filter,"All files");
	gtk_file_filter_add_pattern(filter,"*");
	gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel),filter);
	if (gtk_dialog_run(GTK_DIALOG(filesel))==GTK_RESPONSE_ACCEPT) {
		char *file=gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filesel));
		gtk_widget_hide(filesel);
		if (!(chan=BASS_StreamCreateFile(FALSE,file,0,0,BASS_SAMPLE_LOOP))
			&& !(chan=BASS_MusicLoad(FALSE,file,0,0,BASS_MUSIC_RAMP|BASS_SAMPLE_LOOP,1))) {
			Error("Can't play file");
		} else {
			BASS_ChannelPlay(chan,FALSE);
			ret=TRUE;
		}
		g_free(file);
	}
	gtk_widget_destroy(filesel);
	return ret;
}
开发者ID:AntonGerasimov,项目名称:Converter,代码行数:33,代码来源:spectrum.c


示例20: setPosition

void KNMusicBackendBassThread::play()
{
    //Check if the thread data if empty.
    if(m_filePath.isEmpty())
    {
        return;
    }
    //Check the state.
    if(m_playingState!=PlayingState)
    {
        //Start the position updater first.
        m_positionUpdater->start();
        //Check whether is now is playing or not.
        if(m_stoppedState)
        {
            //Reset flag.
            m_stoppedState=false;
            //Reset the position to fit track playing.
            setPosition(0);
            //Set the volume to the last volume, because of the reset, the
            //volume is back to 1.0.
            BASS_ChannelSetAttribute(m_channel, BASS_ATTRIB_VOL, m_lastVolume);
        }
        //Play the thread.
        BASS_ChannelPlay(m_channel, FALSE);
        //Reset the state.
        setState(PlayingState);
    }
}
开发者ID:loki1412,项目名称:Mu,代码行数:29,代码来源:knmusicbackendbassthread.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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