1 #ifndef _UADECONF_STRUCTURE_H_ 2 #define _UADECONF_STRUCTURE_H_ 3 4 #include <limits.h> 5 6 enum uade_option { 7 UC_ACTION_KEYS = 0x1000, 8 UC_AO_OPTION, 9 UC_BASE_DIR, 10 UC_BUFFER_TIME, 11 UC_CONTENT_DETECTION, 12 UC_CYGWIN_DRIVE_WORKAROUND, 13 UC_DISABLE_TIMEOUTS, 14 UC_ENABLE_TIMEOUTS, 15 UC_EAGLEPLAYER_OPTION, 16 UC_FILTER_TYPE, 17 UC_FORCE_LED_OFF, 18 UC_FORCE_LED_ON, 19 UC_FORCE_LED, 20 UC_FREQUENCY, 21 UC_GAIN, 22 UC_HEADPHONES, 23 UC_HEADPHONES2, 24 UC_IGNORE_PLAYER_CHECK, 25 UC_NO_FILTER, 26 UC_NO_HEADPHONES, 27 UC_NO_PANNING, 28 UC_NO_POSTPROCESSING, 29 UC_NO_EP_END, 30 UC_NORMALISE, 31 UC_NTSC, 32 UC_ONE_SUBSONG, 33 UC_PAL, 34 UC_PANNING_VALUE, 35 UC_RANDOM_PLAY, 36 UC_RECURSIVE_MODE, 37 UC_RESAMPLER, 38 UC_SILENCE_TIMEOUT_VALUE, 39 UC_SONG_TITLE, 40 UC_SPEED_HACK, 41 UC_SUBSONG_TIMEOUT_VALUE, 42 UC_TIMEOUT_VALUE, 43 UC_USE_TEXT_SCOPE, 44 UC_VERBOSE 45 }; 46 47 struct uade_dir { 48 char name[PATH_MAX]; 49 }; 50 51 struct uade_ep_options { 52 char o[256]; 53 size_t s; 54 }; 55 56 struct uade_ao_options { 57 char o[256]; 58 }; 59 60 #define UADE_CHAR_CONFIG(x) char x; char x##_set; 61 #define UADE_FLOAT_CONFIG(x) float x; char x##_set; 62 #define UADE_INT_CONFIG(x) int x; char x##_set; 63 64 /* All the options are put into an instance of this structure. 65 * There can be many structures, one for uade.conf and the other for 66 * command line options. Then these structures are then merged together 67 * to know the complete behavior for each case. Note, these structures 68 * can be conflicting, so the options are merged in following order 69 * so that the last merge will determine true behavior: 70 * 71 * 1. set uade.conf options 72 * 2. set eagleplayer attributes 73 * 3. set song attributes 74 * 4. set command line options 75 * 76 * Merging works by looking at X_set members of this structure. X_set 77 * member indicates that feature X has explicitly been set, so the 78 * merge will notice the change in value. 79 */ 80 struct uade_config { 81 UADE_CHAR_CONFIG(action_keys); 82 83 struct uade_ao_options ao_options; 84 char ao_options_set; 85 86 struct uade_dir basedir; 87 char basedir_set; 88 89 UADE_INT_CONFIG(buffer_time); 90 UADE_CHAR_CONFIG(content_detection); 91 UADE_CHAR_CONFIG(cygwin_drive_workaround); 92 93 struct uade_ep_options ep_options; 94 char ep_options_set; 95 96 UADE_CHAR_CONFIG(filter_type); 97 UADE_INT_CONFIG(frequency); 98 UADE_CHAR_CONFIG(led_forced); 99 UADE_CHAR_CONFIG(led_state); 100 101 UADE_CHAR_CONFIG(gain_enable); 102 /* should be removed of uade_effect integrated */ 103 UADE_FLOAT_CONFIG(gain); 104 105 UADE_CHAR_CONFIG(headphones); 106 UADE_CHAR_CONFIG(headphones2); 107 UADE_CHAR_CONFIG(ignore_player_check); 108 109 char *resampler; 110 char resampler_set; 111 112 UADE_CHAR_CONFIG(no_ep_end); 113 UADE_CHAR_CONFIG(no_filter); 114 UADE_CHAR_CONFIG(no_postprocessing); 115 116 UADE_CHAR_CONFIG(normalise); 117 /* no normalise_parameter_set entry, use manual merging code */ 118 char *normalise_parameter; 119 120 UADE_CHAR_CONFIG(one_subsong); 121 UADE_FLOAT_CONFIG(panning); /* should be removed */ 122 UADE_CHAR_CONFIG(panning_enable); 123 UADE_CHAR_CONFIG(random_play); 124 UADE_CHAR_CONFIG(recursive_mode); 125 UADE_INT_CONFIG(silence_timeout); 126 127 char *song_title; 128 char song_title_set; 129 130 UADE_CHAR_CONFIG(speed_hack); 131 UADE_INT_CONFIG(subsong_timeout); 132 UADE_INT_CONFIG(timeout); 133 UADE_CHAR_CONFIG(use_text_scope); 134 UADE_CHAR_CONFIG(use_timeouts); 135 UADE_CHAR_CONFIG(use_ntsc); 136 UADE_CHAR_CONFIG(verbose); 137 }; 138 139 #endif 140