1 /*
2  * dummy output driver. This file is part of Shairport.
3  * Copyright (c) James Laird 2013
4  * All rights reserved.
5  *
6  * Modifications for audio synchronisation
7  * and related work, copyright (c) Mike Brady 2014
8  * All rights reserved.
9  *
10  * Permission is hereby granted, free of charge, to any person
11  * obtaining a copy of this software and associated documentation
12  * files (the "Software"), to deal in the Software without
13  * restriction, including without limitation the rights to use,
14  * copy, modify, merge, publish, distribute, sublicense, and/or
15  * sell copies of the Software, and to permit persons to whom the
16  * Software is furnished to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be
19  * included in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  */
30 
31 #include "audio.h"
32 #include "common.h"
33 #include <stdio.h>
34 #include <sys/time.h>
35 #include <unistd.h>
36 
37 static int init(__attribute__((unused)) int argc, __attribute__((unused)) char **argv) { return 0; }
38 
39 static void deinit(void) {}
40 
41 static void start(int sample_rate, __attribute__((unused)) int sample_format) {
42   debug(1, "dummy audio output started at %d frames per second.", sample_rate);
43 }
44 
45 static int play(__attribute__((unused)) void *buf, __attribute__((unused)) int samples) {
46   return 0;
47 }
48 
49 static void stop(void) { debug(1, "dummy audio stopped\n"); }
50 
51 audio_output audio_dummy = {.name = "dummy",
52                             .help = NULL,
53                             .init = &init,
54                             .deinit = &deinit,
55                             .prepare = NULL,
56                             .start = &start,
57                             .stop = &stop,
58                             .is_running = NULL,
59                             .flush = NULL,
60                             .delay = NULL,
61                             .play = &play,
62                             .volume = NULL,
63                             .parameters = NULL,
64                             .mute = NULL};
65