mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-06 00:00:22 +00:00
Reenable _SNDRAW and _SNDPLAYFILE
This commit is contained in:
parent
237f42799b
commit
8c9390173e
|
@ -248,25 +248,12 @@ got_seq:
|
|||
void sub__sndplayfile(qbs *filename, int32 sync, double volume, int32 passed){
|
||||
if (new_error) return;
|
||||
sndsetup();
|
||||
static int32 handle;
|
||||
static int32 setvolume;
|
||||
static qbs *syncstr=NULL; if (!syncstr) syncstr=qbs_new(0,0);
|
||||
setvolume=0;
|
||||
if (passed&2){
|
||||
if ((volume<0)||(volume>1)){error(5); return;}
|
||||
if (volume!=1) setvolume=1;
|
||||
}
|
||||
if ((!setvolume)&&(!sync)) syncstr->len=0;
|
||||
if ((setvolume)&&(!sync)) qbs_set(syncstr,qbs_new_txt("VOL"));
|
||||
if ((!setvolume)&&(sync)) qbs_set(syncstr,qbs_new_txt("SYNC"));
|
||||
if ((setvolume)&&(sync)) qbs_set(syncstr,qbs_new_txt("SYNC,VOL"));
|
||||
if (syncstr->len){
|
||||
handle=func__sndopen(filename,syncstr,1);
|
||||
}else{
|
||||
int32 handle;
|
||||
handle = func__sndopen(filename, NULL, 0);
|
||||
if (!handle) return;
|
||||
if (passed & 2) {
|
||||
sub__sndvol(handle, volume);
|
||||
}
|
||||
if (handle==0) return;
|
||||
if (setvolume) sub__sndvol(handle,volume);
|
||||
sub__sndplay(handle);
|
||||
sub__sndclose(handle);
|
||||
}
|
||||
|
|
|
@ -287,7 +287,6 @@ void snd_init(){
|
|||
int32 snd_raw_channel=0;
|
||||
|
||||
int32 func__sndopenraw(){
|
||||
/*
|
||||
static int32 handle; handle=list_add(snd_handles);
|
||||
static snd_struct *snd; snd=(snd_struct*)list_get(snd_handles,handle);
|
||||
snd->internal=0;
|
||||
|
@ -309,7 +308,6 @@ int32 func__sndopenraw(){
|
|||
snd->al_buffer_state=(uint8*)calloc(4,1);
|
||||
snd->al_buffer_index=(int32*)calloc(4,4);
|
||||
return handle;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -317,7 +315,6 @@ int32 func__sndopenraw(){
|
|||
|
||||
|
||||
void sub__sndraw(float left,float right,int32 handle,int32 passed){
|
||||
/*
|
||||
if (passed&2){
|
||||
if (handle==0) return;//note: this would be an invalid handle
|
||||
}else{
|
||||
|
@ -374,7 +371,7 @@ void sub__sndraw(float left,float right,int32 handle,int32 passed){
|
|||
error:
|
||||
error(5);
|
||||
return;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
void snd_mainloop(){
|
||||
|
@ -409,15 +406,9 @@ void snd_mainloop(){
|
|||
|
||||
}//2
|
||||
|
||||
|
||||
/*
|
||||
if (snd->type==1){//RAW
|
||||
|
||||
if (snd->close!=2){
|
||||
|
||||
if (snd->stream_buffer_start){
|
||||
|
||||
|
||||
static int32 repeat;
|
||||
do{
|
||||
repeat=0;
|
||||
|
@ -577,13 +568,8 @@ gotbuffer:
|
|||
}//not playing
|
||||
}//time>3 secs
|
||||
}//sndclose==1
|
||||
|
||||
}//RAW
|
||||
*/
|
||||
}//list_index loop
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
int32 sndupdate_dont_free_resources=0;
|
||||
|
|
Loading…
Reference in a new issue