comparison src/crossfade/crossfade.h @ 3134:354e90c81253

crossfade: more cleanups
author Michal Lipski <tallica@o2.pl>
date Thu, 07 May 2009 13:13:54 +0200
parents c33daa1689a4
children 85b7dcee821f
comparison
equal deleted inserted replaced
3133:005959102811 3134:354e90c81253
44 44
45 #include "debug.h" 45 #include "debug.h"
46 46
47 #undef VOLUME_NORMALIZER 47 #undef VOLUME_NORMALIZER
48 48
49 #define OUTPUT_RATE the_rate 49 #define OUTPUT_RATE 44100 /*FIXME I know...*/
50 #define OUTPUT_NCH 2 50 #define OUTPUT_NCH 2
51 #define OUTPUT_BPS (OUTPUT_RATE * OUTPUT_NCH * 2) 51 #define OUTPUT_BPS (OUTPUT_RATE * OUTPUT_NCH * 2)
52 52
53 #if defined(HAVE_LIBSAMPLERATE) 53 #if defined(HAVE_LIBSAMPLERATE)
54 # define MAX_RATE 192000 54 # define MAX_RATE 192000
55 #else 55 #else
56 # define MAX_RATE 48000 56 # define MAX_RATE 48000
57 #endif 57 #endif
58 58
59 #define SYNC_OUTPUT_TIMEOUT 2000 59 #define SYNC_OUTPUT_TIMEOUT 2000
60
61 #define OUTPUT_METHOD_BUILTIN_OSS 0
62 #define OUTPUT_METHOD_PLUGIN 1
63 #define OUTPUT_METHOD_BUILTIN_NULL 2
64 60
65 #define FADE_CONFIG_XFADE 0 61 #define FADE_CONFIG_XFADE 0
66 #define FADE_CONFIG_MANUAL 1 62 #define FADE_CONFIG_MANUAL 1
67 #define FADE_CONFIG_ALBUM 2 63 #define FADE_CONFIG_ALBUM 2
68 #define FADE_CONFIG_START 3 64 #define FADE_CONFIG_START 3
121 #define FC_OFFSET_NONE 0 117 #define FC_OFFSET_NONE 0
122 #define FC_OFFSET_LOCK_IN 1 118 #define FC_OFFSET_LOCK_IN 1
123 #define FC_OFFSET_LOCK_OUT 2 119 #define FC_OFFSET_LOCK_OUT 2
124 #define FC_OFFSET_CUSTOM 3 120 #define FC_OFFSET_CUSTOM 3
125 121
126 #define DEFAULT_OSS_ALT_AUDIO_DEVICE "/dev/dsp"
127 #define DEFAULT_OSS_ALT_MIXER_DEVICE "/dev/mixer"
128 #define DEFAULT_OP_CONFIG_STRING "OSS.so=0,1,2304,0; filewriter.so=1,0,2304,1" 122 #define DEFAULT_OP_CONFIG_STRING "OSS.so=0,1,2304,0; filewriter.so=1,0,2304,1"
129 #define DEFAULT_OP_NAME "ALSA.so" 123 #define DEFAULT_OP_NAME "ALSA.so"
130 124
131 #define DEFAULT_OP_CONFIG \ 125 #define DEFAULT_OP_CONFIG \
132 { FALSE, FALSE, 2304, FALSE } 126 { FALSE, FALSE, 2304, FALSE }
133 127
134 #define CONFIG_DEFAULT \ 128 #define CONFIG_DEFAULT \
135 { 1, /* output_method */ \ 129 { NULL, /* op_config_string */ \
136 44100, /* output_rate */ \
137 2, /* output_quality */ \
138 0, /* oss_audio_device */ \
139 FALSE, /* oss_use_alt_audio_device */ \
140 NULL, /* oss_alt_audio_device */ \
141 0, /* oss_mixer_device */ \
142 FALSE, /* oss_use_alt_mixer_device */ \
143 NULL, /* oss_alt_mixer_device */ \
144 FALSE, /* oss_mixer_use_master */ \
145 0, /* oss_buffer_size_ms */ \
146 250, /* oss_preload_size_ms */ \
147 22, /* oss_fragments */ \
148 12, /* oss_fragment_size */ \
149 FALSE, /* oss_maxbuf_enable */ \
150 NULL, /* op_config_string */ \
151 NULL, /* op_name */ \ 130 NULL, /* op_name */ \
152 NULL, /* ep_name */ \ 131 NULL, /* ep_name */ \
153 FALSE, /* ep_enable */ \ 132 FALSE, /* ep_enable */ \
154 TRUE, /* volnorm_enable */ \ 133 TRUE, /* volnorm_enable */ \
155 8000, /* volnorm_target */ \ 134 8000, /* volnorm_target */ \
452 } 431 }
453 plugin_config_t; 432 plugin_config_t;
454 433
455 typedef struct 434 typedef struct
456 { 435 {
457 /* output: method */
458 gint output_method;
459 gint output_rate;
460 gint output_quality;
461
462 /* output: builtin OSS */
463 gint oss_audio_device;
464 gboolean oss_use_alt_audio_device;
465 gchar *oss_alt_audio_device;
466
467 gint oss_mixer_device;
468 gboolean oss_use_alt_mixer_device;
469 gchar *oss_alt_mixer_device;
470 gboolean oss_mixer_use_master;
471
472 gint oss_buffer_size_ms;
473 gint oss_preload_size_ms;
474
475 gint oss_fragments;
476 gint oss_fragment_size;
477 gboolean oss_maxbuf_enable;
478
479 /* output: plugin */ 436 /* output: plugin */
480 gchar *op_config_string; /* stores configs for all plugins */ 437 gchar *op_config_string; /* stores configs for all plugins */
481 gchar *op_name; /* name of the current plugin */ 438 gchar *op_name; /* name of the current plugin */
482 439
483 /* effects */ 440 /* effects */