Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated SDL Sound code #336

Merged
merged 1 commit into from Nov 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions garglk/Jamfile
Expand Up @@ -20,6 +20,8 @@ if $(OS) = MINGW

if $(USESDL) = yes
{
SubDirCcFlags
-DGARGLK_USESDL ;
SubDirHdrs $(TOP) support sdl ;
SubDirHdrs $(TOP) support sdl_sound ;
}
Expand Down
2 changes: 1 addition & 1 deletion garglk/cggestal.c
Expand Up @@ -110,7 +110,7 @@ glui32 glk_gestalt_ext(glui32 id, glui32 val, glui32 *arr,
return gli_conf_sound;

case gestalt_Sound2:
return FALSE;
return gli_conf_sound;

case gestalt_Unicode:
return TRUE;
Expand Down
16 changes: 16 additions & 0 deletions garglk/garglk.h
Expand Up @@ -30,6 +30,10 @@

#include <stddef.h>

#ifdef GARGLK_USESDL
#include <SDL_timer.h>
#endif

#include "gi_dispa.h"

/* First, we define our own TRUE and FALSE and NULL, because ANSI
Expand Down Expand Up @@ -565,6 +569,18 @@ struct glk_schannel_struct
int notify;
int buffered;

#ifdef GARGLK_USESDL
int paused;

/* for volume fades */
int volume_notify;
int volume_timeout;
int target_volume;
double float_volume;
double volume_delta;
SDL_TimerID timer;
#endif

gidispatch_rock_t disprock;
channel_t *chain_next, *chain_prev;
};
Expand Down