History

Rename SRC_ERR to SRC_ERROR and make typedef

evpobr committed 6 years ago

Commit ee346bb1 parent 37540f64 files · +32 −32Browse files

Unified · Split

4 files
  1. src/common.h +9 −9
  2. src/src_linear.c +5 −5
  3. src/src_sinc.c +13 −13
  4. src/src_zoh.c +5 −5
src/common.h+9−9
@@ -74,7 +74,7 @@ enum SRC_MODE · 73 unmodified lines
74 SRC_MODE_CALLBACK = 174 SRC_MODE_CALLBACK = 1
75} ;75} ;
76 76
77enum SRC_ERR77typedef enum SRC_ERROR
78{78{
79 SRC_ERR_NO_ERROR = 0,79 SRC_ERR_NO_ERROR = 0,
80 80
@@ -103,12 +103,12 @@ enum SRC_ERR · 22 unmodified lines
103 103
104 /* This must be the last error number. */104 /* This must be the last error number. */
105 SRC_ERR_MAX_ERROR105 SRC_ERR_MAX_ERROR
106} ;106} SRC_ERROR ;
107 107
108struct SRC_STATE_tag108struct SRC_STATE_tag
109{ double last_ratio, last_position ;109{ double last_ratio, last_position ;
110 110
111 enum SRC_ERR error ;111 SRC_ERROR error ;
112 int channels ;112 int channels ;
113 113
114 /* SRC_MODE_PROCESS or SRC_MODE_CALLBACK */114 /* SRC_MODE_PROCESS or SRC_MODE_CALLBACK */
@@ -118,16 +118,16 @@ struct SRC_STATE_tag · 3 unmodified lines
118 void *private_data ;118 void *private_data ;
119 119
120 /* Varispeed process function. */120 /* Varispeed process function. */
121 enum SRC_ERR (*vari_process) (SRC_STATE *state, SRC_DATA *data) ;121 SRC_ERROR (*vari_process) (SRC_STATE *state, SRC_DATA *data) ;
122 122
123 /* Constant speed process function. */123 /* Constant speed process function. */
124 enum SRC_ERR (*const_process) (SRC_STATE *state, SRC_DATA *data) ;124 SRC_ERROR (*const_process) (SRC_STATE *state, SRC_DATA *data) ;
125 125
126 /* State reset. */126 /* State reset. */
127 void (*reset) (SRC_STATE *state) ;127 void (*reset) (SRC_STATE *state) ;
128 128
129 /* State clone. */129 /* State clone. */
130 enum SRC_ERR (*copy) (SRC_STATE *from, SRC_STATE *to) ;130 SRC_ERROR (*copy) (SRC_STATE *from, SRC_STATE *to) ;
131 131
132 /* State private_data close. */132 /* State private_data close. */
133 void (*close) (SRC_STATE *state) ;133 void (*close) (SRC_STATE *state) ;
@@ -143,19 +143,19 @@ struct SRC_STATE_tag · 9 unmodified lines
143const char* sinc_get_name (int src_enum) ;143const char* sinc_get_name (int src_enum) ;
144const char* sinc_get_description (int src_enum) ;144const char* sinc_get_description (int src_enum) ;
145 145
146enum SRC_ERR sinc_set_converter (SRC_STATE *state, int src_enum) ;146SRC_ERROR sinc_set_converter (SRC_STATE *state, int src_enum) ;
147 147
148/* In src_linear.c */148/* In src_linear.c */
149const char* linear_get_name (int src_enum) ;149const char* linear_get_name (int src_enum) ;
150const char* linear_get_description (int src_enum) ;150const char* linear_get_description (int src_enum) ;
151 151
152enum SRC_ERR linear_set_converter (SRC_STATE *state, int src_enum) ;152SRC_ERROR linear_set_converter (SRC_STATE *state, int src_enum) ;
153 153
154/* In src_zoh.c */154/* In src_zoh.c */
155const char* zoh_get_name (int src_enum) ;155const char* zoh_get_name (int src_enum) ;
156const char* zoh_get_description (int src_enum) ;156const char* zoh_get_description (int src_enum) ;
157 157
158enum SRC_ERR zoh_set_converter (SRC_STATE *state, int src_enum) ;158SRC_ERROR zoh_set_converter (SRC_STATE *state, int src_enum) ;
159 159
160/*----------------------------------------------------------160/*----------------------------------------------------------
161** Common static inline functions.161** Common static inline functions.
src/src_linear.c+5−5
@@ -14,9 +14,9 @@ · 13 unmodified lines
14#include "src_config.h"14#include "src_config.h"
15#include "common.h"15#include "common.h"
16 16
17static enum SRC_ERR linear_vari_process (SRC_STATE *state, SRC_DATA *data) ;17static SRC_ERROR linear_vari_process (SRC_STATE *state, SRC_DATA *data) ;
18static void linear_reset (SRC_STATE *state) ;18static void linear_reset (SRC_STATE *state) ;
19static enum SRC_ERR linear_copy (SRC_STATE *from, SRC_STATE *to) ;19static SRC_ERROR linear_copy (SRC_STATE *from, SRC_STATE *to) ;
20static void linear_close (SRC_STATE *state) ;20static void linear_close (SRC_STATE *state) ;
21 21
22/*========================================================================================22/*========================================================================================
@@ -37,7 +37,7 @@ typedef struct · 14 unmodified lines
37/*----------------------------------------------------------------------------------------37/*----------------------------------------------------------------------------------------
38*/38*/
39 39
40static enum SRC_ERR40static SRC_ERROR
41linear_vari_process (SRC_STATE *state, SRC_DATA *data)41linear_vari_process (SRC_STATE *state, SRC_DATA *data)
42{ LINEAR_DATA *priv ;42{ LINEAR_DATA *priv ;
43 double src_ratio, input_index, rem ;43 double src_ratio, input_index, rem ;
@@ -158,7 +158,7 @@ linear_get_description (int src_enum) · 114 unmodified lines
158 return NULL ;158 return NULL ;
159} /* linear_get_descrition */159} /* linear_get_descrition */
160 160
161enum SRC_ERR161SRC_ERROR
162linear_set_converter (SRC_STATE *state, int src_enum)162linear_set_converter (SRC_STATE *state, int src_enum)
163{163{
164 LINEAR_DATA *priv = NULL ;164 LINEAR_DATA *priv = NULL ;
@@ -217,7 +217,7 @@ linear_reset (SRC_STATE *state) · 52 unmodified lines
217 return ;217 return ;
218} /* linear_reset */218} /* linear_reset */
219 219
220static enum SRC_ERR220SRC_ERROR
221linear_copy (SRC_STATE *from, SRC_STATE *to)221linear_copy (SRC_STATE *from, SRC_STATE *to)
222{222{
223 if (from->private_data == NULL)223 if (from->private_data == NULL)
src/src_sinc.c+13−13
@@ -56,16 +56,16 @@ typedef struct · 55 unmodified lines
56 float *buffer ;56 float *buffer ;
57} SINC_FILTER ;57} SINC_FILTER ;
58 58
59static enum SRC_ERR sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data) ;59static SRC_ERROR sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data) ;
60static enum SRC_ERR sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data) ;60static SRC_ERROR sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data) ;
61static enum SRC_ERR sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data) ;61static SRC_ERROR sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data) ;
62static enum SRC_ERR sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data) ;62static SRC_ERROR sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data) ;
63static enum SRC_ERR sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data) ;63static SRC_ERROR sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data) ;
64 64
65static int prepare_data (SINC_FILTER *filter, int channels, SRC_DATA *data, int half_filter_chan_len) WARN_UNUSED ;65static int prepare_data (SINC_FILTER *filter, int channels, SRC_DATA *data, int half_filter_chan_len) WARN_UNUSED ;
66 66
67static void sinc_reset (SRC_STATE *state) ;67static void sinc_reset (SRC_STATE *state) ;
68static enum SRC_ERR sinc_copy (SRC_STATE *from, SRC_STATE *to) ;68static SRC_ERROR sinc_copy (SRC_STATE *from, SRC_STATE *to) ;
69static void sinc_close (SRC_STATE *state) ;69static void sinc_close (SRC_STATE *state) ;
70 70
71static inline increment_t71static inline increment_t
@@ -141,7 +141,7 @@ sinc_get_description (int src_enum) · 69 unmodified lines
141 return NULL ;141 return NULL ;
142} /* sinc_get_descrition */142} /* sinc_get_descrition */
143 143
144enum SRC_ERR144SRC_ERROR
145sinc_set_converter (SRC_STATE *state, int src_enum)145sinc_set_converter (SRC_STATE *state, int src_enum)
146{ SINC_FILTER *filter, temp_filter ;146{ SINC_FILTER *filter, temp_filter ;
147 increment_t count ;147 increment_t count ;
@@ -264,7 +264,7 @@ sinc_reset (SRC_STATE *state) · 116 unmodified lines
264 memset (filter->buffer + filter->b_len, 0xAA, state->channels * sizeof (filter->buffer [0])) ;264 memset (filter->buffer + filter->b_len, 0xAA, state->channels * sizeof (filter->buffer [0])) ;
265} /* sinc_reset */265} /* sinc_reset */
266 266
267static enum SRC_ERR267static SRC_ERROR
268sinc_copy (SRC_STATE *from, SRC_STATE *to)268sinc_copy (SRC_STATE *from, SRC_STATE *to)
269{269{
270 if (from->private_data == NULL)270 if (from->private_data == NULL)
@@ -353,7 +353,7 @@ calc_output_single (SINC_FILTER *filter, increment_t increment, increment_t star · 82 unmodified lines
353 return (left + right) ;353 return (left + right) ;
354} /* calc_output_single */354} /* calc_output_single */
355 355
356static enum SRC_ERR356static SRC_ERROR
357sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data)357sinc_mono_vari_process (SRC_STATE *state, SRC_DATA *data)
358{ SINC_FILTER *filter ;358{ SINC_FILTER *filter ;
359 double input_index, src_ratio, count, float_increment, terminate, rem ;359 double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -509,7 +509,7 @@ calc_output_stereo (SINC_FILTER *filter, int channels, increment_t increment, in · 149 unmodified lines
509 output [ch] = (float) (scale * (left [ch] + right [ch])) ;509 output [ch] = (float) (scale * (left [ch] + right [ch])) ;
510} /* calc_output_stereo */510} /* calc_output_stereo */
511 511
512static enum SRC_ERR512SRC_ERROR
513sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data)513sinc_stereo_vari_process (SRC_STATE *state, SRC_DATA *data)
514{ SINC_FILTER *filter ;514{ SINC_FILTER *filter ;
515 double input_index, src_ratio, count, float_increment, terminate, rem ;515 double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -665,7 +665,7 @@ calc_output_quad (SINC_FILTER *filter, int channels, increment_t increment, incr · 149 unmodified lines
665 output [ch] = (float) (scale * (left [ch] + right [ch])) ;665 output [ch] = (float) (scale * (left [ch] + right [ch])) ;
666} /* calc_output_quad */666} /* calc_output_quad */
667 667
668static enum SRC_ERR668SRC_ERROR
669sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data)669sinc_quad_vari_process (SRC_STATE *state, SRC_DATA *data)
670{ SINC_FILTER *filter ;670{ SINC_FILTER *filter ;
671 double input_index, src_ratio, count, float_increment, terminate, rem ;671 double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -820,7 +820,7 @@ calc_output_hex (SINC_FILTER *filter, int channels, increment_t increment, incre · 148 unmodified lines
820 output [ch] = (float) (scale * (left [ch] + right [ch])) ;820 output [ch] = (float) (scale * (left [ch] + right [ch])) ;
821} /* calc_output_hex */821} /* calc_output_hex */
822 822
823static enum SRC_ERR823SRC_ERROR
824sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data)824sinc_hex_vari_process (SRC_STATE *state, SRC_DATA *data)
825{ SINC_FILTER *filter ;825{ SINC_FILTER *filter ;
826 double input_index, src_ratio, count, float_increment, terminate, rem ;826 double input_index, src_ratio, count, float_increment, terminate, rem ;
@@ -985,7 +985,7 @@ calc_output_multi (SINC_FILTER *filter, increment_t increment, increment_t start · 158 unmodified lines
985 return ;985 return ;
986} /* calc_output_multi */986} /* calc_output_multi */
987 987
988static enum SRC_ERR988static SRC_ERROR
989sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data)989sinc_multichan_vari_process (SRC_STATE *state, SRC_DATA *data)
990{ SINC_FILTER *filter ;990{ SINC_FILTER *filter ;
991 double input_index, src_ratio, count, float_increment, terminate, rem ;991 double input_index, src_ratio, count, float_increment, terminate, rem ;
src/src_zoh.c+5−5
@@ -14,9 +14,9 @@ · 13 unmodified lines
14#include "src_config.h"14#include "src_config.h"
15#include "common.h"15#include "common.h"
16 16
17static enum SRC_ERR zoh_vari_process (SRC_STATE *state, SRC_DATA *data) ;17static SRC_ERROR zoh_vari_process (SRC_STATE *state, SRC_DATA *data) ;
18static void zoh_reset (SRC_STATE *state) ;18static void zoh_reset (SRC_STATE *state) ;
19static enum SRC_ERR zoh_copy (SRC_STATE *from, SRC_STATE *to) ;19static SRC_ERROR zoh_copy (SRC_STATE *from, SRC_STATE *to) ;
20static void zoh_close (SRC_STATE *state) ;20static void zoh_close (SRC_STATE *state) ;
21 21
22/*========================================================================================22/*========================================================================================
@@ -35,7 +35,7 @@ typedef struct · 12 unmodified lines
35/*----------------------------------------------------------------------------------------35/*----------------------------------------------------------------------------------------
36*/36*/
37 37
38static enum SRC_ERR38static SRC_ERROR
39zoh_vari_process (SRC_STATE *state, SRC_DATA *data)39zoh_vari_process (SRC_STATE *state, SRC_DATA *data)
40{ ZOH_DATA *priv ;40{ ZOH_DATA *priv ;
41 double src_ratio, input_index, rem ;41 double src_ratio, input_index, rem ;
@@ -149,7 +149,7 @@ zoh_get_description (int src_enum) · 107 unmodified lines
149 return NULL ;149 return NULL ;
150} /* zoh_get_descrition */150} /* zoh_get_descrition */
151 151
152enum SRC_ERR152SRC_ERROR
153zoh_set_converter (SRC_STATE *state, int src_enum)153zoh_set_converter (SRC_STATE *state, int src_enum)
154{154{
155 ZOH_DATA *priv = NULL ;155 ZOH_DATA *priv = NULL ;
@@ -208,7 +208,7 @@ zoh_reset (SRC_STATE *state) · 52 unmodified lines
208 return ;208 return ;
209} /* zoh_reset */209} /* zoh_reset */
210 210
211static enum SRC_ERR211static SRC_ERROR
212zoh_copy (SRC_STATE *from, SRC_STATE *to)212zoh_copy (SRC_STATE *from, SRC_STATE *to)
213{213{
214 if (from->private_data == NULL)214 if (from->private_data == NULL)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t