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

fix compile error when no audio support

This commit is contained in:
Jfreegman 2014-06-10 17:34:15 -04:00
parent 33000598fc
commit 328e7f8d57
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
2 changed files with 34 additions and 10 deletions

View File

@ -25,7 +25,11 @@
#include "toxic_windows.h"
#include "configdir.h"
#include "audio_call.h"
#ifdef _SUPPORT_AUDIO
#include "audio_call.h"
#endif
#include "settings.h"
#include "line_info.h"
@ -33,11 +37,14 @@ static void uset_autolog(struct user_settings *s, const char *val);
static void uset_time(struct user_settings *s, const char *val);
static void uset_alerts(struct user_settings *s, const char *val);
static void uset_colours(struct user_settings *s, const char *val);
static void uset_ain_dev(struct user_settings *s, const char *val);
static void uset_aout_dev(struct user_settings *s, const char *val);
static void uset_hst_size(struct user_settings *s, const char *val);
static void uset_dwnld_path(struct user_settings *s, const char *val);
#ifdef _SUPPORT_AUDIO
static void uset_ain_dev(struct user_settings *s, const char *val);
static void uset_aout_dev(struct user_settings *s, const char *val);
#endif
struct {
const char *key;
void (*func)(struct user_settings *s, const char *val);
@ -46,10 +53,13 @@ struct {
{ "time", uset_time },
{ "disable_alerts", uset_alerts },
{ "colour_theme", uset_colours },
{ "audio_in_dev", uset_ain_dev },
{ "audio_out_dev", uset_aout_dev },
{ "history_size", uset_hst_size },
{ "download_path", uset_dwnld_path },
#ifdef _SUPPORT_AUDIO
{ "audio_in_dev", uset_ain_dev },
{ "audio_out_dev", uset_aout_dev },
#endif
};
static void uset_autolog(struct user_settings *s, const char *val)
@ -84,6 +94,8 @@ static void uset_colours(struct user_settings *s, const char *val)
s->colour_theme = n == NATIVE_COLS ? NATIVE_COLS : DFLT_COLS;
}
#ifdef _SUPPORT_AUDIO
static void uset_ain_dev(struct user_settings *s, const char *val)
{
int n = atoi(val);
@ -104,6 +116,8 @@ static void uset_aout_dev(struct user_settings *s, const char *val)
s->audio_out_dev = (long int) n;
}
#endif /* _SUPPORT_AUDIO */
static void uset_hst_size(struct user_settings *s, const char *val)
{
int n = atoi(val);
@ -142,10 +156,13 @@ static void set_default_settings(struct user_settings *s)
uset_time(s, "24");
uset_alerts(s, "0");
uset_colours(s, "0");
uset_ain_dev(s, "0");
uset_aout_dev(s, "0");
uset_hst_size(s, "700");
uset_dwnld_path(s, NULL);
#ifdef _SUPPORT_AUDIO
uset_ain_dev(s, "0");
uset_aout_dev(s, "0");
#endif
}
int settings_load(struct user_settings *s, char *path)

View File

@ -20,7 +20,11 @@
*
*/
#define NUM_SETTINGS 8
#ifdef _SUPPORT_AUDIO
#define NUM_SETTINGS 8
#else
#define NUM_SETTINGS 6
#endif
/* holds user setting values */
struct user_settings {
@ -28,10 +32,13 @@ struct user_settings {
int alerts; /* boolean */
int time; /* 12 or 24 */
int colour_theme; /* boolean (0 for default toxic colours) */
long int audio_in_dev;
long int audio_out_dev;
int history_size; /* int between MIN_HISTORY and MAX_HISTORY */
char download_path[MAX_STR_SIZE];
#ifdef _SUPPORT_AUDIO
long int audio_in_dev;
long int audio_out_dev;
#endif
};
enum {