1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2009 by Bertrik Sikken
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
28 void audio_set_output_source(int source
)
33 void audio_input_mux(int source
, unsigned flags
)
35 static int last_source
= AUDIO_SRC_PLAYBACK
;
36 #if defined(HAVE_RECORDING) && (INPUT_SRC_CAPS & SRC_CAP_FMRADIO)
37 static bool last_recording
= false;
38 const bool recording
= flags
& SRCF_RECORDING
;
45 default: /* playback - no recording */
46 source
= AUDIO_SRC_PLAYBACK
;
47 case AUDIO_SRC_PLAYBACK
:
48 if (source
!= last_source
)
50 #if defined(HAVE_RECORDING) || defined(HAVE_FMRADIO_IN)
51 audiohw_set_monitor(false);
54 audiohw_disable_recording();
59 #if defined(HAVE_RECORDING) && (INPUT_SRC_CAPS & SRC_CAP_MIC)
60 case AUDIO_SRC_MIC
: /* recording only */
61 if (source
!= last_source
)
63 audiohw_set_monitor(false);
64 audiohw_enable_recording(true); /* source mic */
69 #if (INPUT_SRC_CAPS & SRC_CAP_FMRADIO)
71 case AUDIO_SRC_FMRADIO
: /* recording and playback */
72 if (source
== last_source
74 && recording
== last_recording
80 last_recording
= recording
;
84 audiohw_set_monitor(false);
85 audiohw_enable_recording(false);
91 audiohw_disable_recording();
93 #if defined(HAVE_RECORDING) || defined(HAVE_FMRADIO_IN)
94 audiohw_set_monitor(true); /* line 2 analog audio path */
98 #endif /* (INPUT_SRC_CAPS & SRC_CAP_FMRADIO) */
101 last_source
= source
;