1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 by Michael Sevakis
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
24 int audio_channels
= 2;
25 int audio_output_source
= AUDIO_SRC_PLAYBACK
;
27 void audio_set_output_source(int source
)
29 int oldmode
= set_fiq_status(FIQ_DISABLED
);
31 if ((unsigned)source
>= AUDIO_NUM_SOURCES
)
32 source
= AUDIO_SRC_PLAYBACK
;
34 audio_output_source
= source
;
36 /*if (source != AUDIO_SRC_PLAYBACK)
37 IISCONFIG |= (1 << 29);*/
39 set_fiq_status(oldmode
);
42 void audio_input_mux(int source
, unsigned flags
)
44 static int last_source
= AUDIO_SRC_PLAYBACK
;
45 static bool last_recording
= false;
46 bool recording
= flags
& SRCF_RECORDING
;
50 default: /* playback - no recording */
51 source
= AUDIO_SRC_PLAYBACK
;
52 case AUDIO_SRC_PLAYBACK
:
54 if (source
!= last_source
)
56 /*audiohw_set_monitor(false);
57 audiohw_disable_recording();*/
61 case AUDIO_SRC_MIC
: /* recording only */
63 if (source
!= last_source
)
65 /*audiohw_set_monitor(false);
66 audiohw_enable_recording(true); /. source mic */
70 case AUDIO_SRC_FMRADIO
: /* recording and playback */
73 if (source
== last_source
&& recording
== last_recording
)
76 last_recording
= recording
;
80 /*audiohw_set_monitor(false);
81 audiohw_enable_recording(false);*/
85 /*audiohw_disable_recording();
86 audiohw_set_monitor(true); /. line 1 analog audio path */
92 } /* audio_input_mux */