Skip to content

Commit

Permalink
Reformat using clang-format.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Jun 1, 2015
1 parent 04e27cf commit 87a0475
Show file tree
Hide file tree
Showing 25 changed files with 5,169 additions and 5,183 deletions.
40 changes: 18 additions & 22 deletions audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,36 +56,32 @@ static audio_output *outputs[] = {
#ifdef CONFIG_AO
&audio_ao,
#endif
&audio_dummy,
&audio_pipe,
NULL
};

&audio_dummy, &audio_pipe, NULL};

audio_output *audio_get_output(char *name) {
audio_output **out;
audio_output **out;

// default to the first
if (!name)
return outputs[0];
// default to the first
if (!name)
return outputs[0];

for (out=outputs; *out; out++)
if (!strcasecmp(name, (*out)->name))
return *out;
for (out = outputs; *out; out++)
if (!strcasecmp(name, (*out)->name))
return *out;

return NULL;
return NULL;
}

void audio_ls_outputs(void) {
audio_output **out;
audio_output **out;

printf("Available audio outputs:\n");
for (out=outputs; *out; out++)
printf(" %s%s\n", (*out)->name, out==outputs ? " (default)" : "");
printf("Available audio outputs:\n");
for (out = outputs; *out; out++)
printf(" %s%s\n", (*out)->name, out == outputs ? " (default)" : "");

for (out=outputs; *out; out++) {
printf("\n");
printf("Options for output %s:\n", (*out)->name);
(*out)->help();
}
for (out = outputs; *out; out++) {
printf("\n");
printf("Options for output %s:\n", (*out)->name);
(*out)->help();
}
}
54 changes: 27 additions & 27 deletions audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@ typedef struct {
} audio_parameters;

typedef struct {
void (*help)(void);
char *name;

// start of program
int (*init)(int argc, char **argv);
// at end of program
void (*deinit)(void);

void (*start)(int sample_rate);
// block of samples
void (*play)(short buf[], int samples);
void (*stop)(void);
// may be null if not implemented
void (*flush)(void);
// returns the delay before the next frame to be sent to the device would actually be audible.
// almost certainly wrong if the buffer is empty, so put silent buffers into it to make it busy.
// will change dynamically, so keep watching it. Implemented in ALSA only.
uint32_t (*delay)();

// may be NULL, in which case soft volume is applied
void (*volume)(double vol);
// may be NULL, in which case soft volume parameters are used
void (*parameters)(audio_parameters* info);
void (*help)(void);
char *name;

// start of program
int (*init)(int argc, char **argv);
// at end of program
void (*deinit)(void);

void (*start)(int sample_rate);

// block of samples
void (*play)(short buf[], int samples);
void (*stop)(void);

// may be null if not implemented
void (*flush)(void);

// returns the delay before the next frame to be sent to the device would actually be audible.
// almost certainly wrong if the buffer is empty, so put silent buffers into it to make it busy.
// will change dynamically, so keep watching it. Implemented in ALSA only.
uint32_t (*delay)();

// may be NULL, in which case soft volume is applied
void (*volume)(double vol);

// may be NULL, in which case soft volume parameters are used
void (*parameters)(audio_parameters *info);
} audio_output;

audio_output *audio_get_output(char *name);
Expand Down
Loading

0 comments on commit 87a0475

Please sign in to comment.