1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-27 01:03:26 +01:00

Allow toxic to compile without av

This commit is contained in:
mannol 2014-05-29 23:25:09 +02:00
parent 0c834b60f5
commit d18ba78d03
2 changed files with 21 additions and 2 deletions

View File

@ -23,11 +23,16 @@
#include <stdlib.h>
#include <string.h>
#ifdef _SUPPORT_AUDIO
#include "device.h"
#endif /* _SUPPORT_AUDIO */
#include "toxic_windows.h"
#include "configdir.h"
#include "audio_call.h"
#include "settings.h"
static void uset_autolog(struct user_settings *s, int val);
static void uset_time(struct user_settings *s, int val);
static void uset_alerts(struct user_settings *s, int val);
@ -43,8 +48,11 @@ struct {
{ "time", uset_time },
{ "disable_alerts", uset_alerts },
{ "colour_theme", uset_colours },
#ifdef _SUPPORT_AUDIO
{ "audio_in_dev", uset_ain_dev },
{ "audio_out_dev", uset_aout_dev },
#endif
};
static void uset_autolog(struct user_settings *s, int val)
@ -71,6 +79,8 @@ static void uset_colours(struct user_settings *s, int val)
s->colour_theme = val == NATIVE_COLS ? NATIVE_COLS : DFLT_COLS;
}
#ifdef _SUPPORT_AUDIO
static void uset_ain_dev(struct user_settings *s, int val)
{
if (val < 0 || val > MAX_DEVICES)
@ -87,6 +97,8 @@ static void uset_aout_dev(struct user_settings *s, int val)
s->audio_out_dev = (long int) val;
}
#endif /* _SUPPORT_AUDIO */
int settings_load(struct user_settings *s, char *path)
{
char *user_config_dir = get_user_config_dir();

View File

@ -20,7 +20,11 @@
*
*/
#define NUM_SETTINGS 6
#ifdef _SUPPORT_AUDIO
#define NUM_SETTINGS 6
#else
#define NUM_SETTINGS 4
#endif /* _SUPPORT_AUDIO */
/* holds user setting values */
struct user_settings {
@ -28,8 +32,11 @@ struct user_settings {
int alerts; /* boolean */
int time; /* 12 or 24 */
int colour_theme; /* boolean (0 for default toxic colours) */
#ifdef _SUPPORT_AUDIO
long int audio_in_dev;
long int audio_out_dev;
#endif /* _SUPPORT_AUDIO */
};
enum {