introduce general audiohw api for recording

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15687 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Christian Gmeiner 2007-11-19 15:50:52 +00:00
parent 4f2473db6c
commit c583f3c8d1
12 changed files with 37 additions and 35 deletions

View file

@ -394,7 +394,7 @@ void audiohw_set_recvol(int left, int right, int type)
* Enable line in 1 analog monitoring * Enable line in 1 analog monitoring
* *
*/ */
void audiohw_set_monitor(int enable) void audiohw_set_monitor(bool enable)
{ {
/* LI1R_Mute_on - default */ /* LI1R_Mute_on - default */
unsigned int line_in1_r = as3514.regs[LINE_IN1_R] & ~(1 << 5); unsigned int line_in1_r = as3514.regs[LINE_IN1_R] & ~(1 << 5);

View file

@ -451,7 +451,7 @@ void audiohw_set_recvol(int left, int right, int type)
* Enable or disable recording monitor (so one can listen to the recording) * Enable or disable recording monitor (so one can listen to the recording)
* *
*/ */
void audiohw_set_monitor(int enable) void audiohw_set_monitor(bool enable)
{ {
if (enable) /* enable channel 2 */ if (enable) /* enable channel 2 */
uda1380_write_reg(REG_MUTE, uda1380_regs[REG_MUTE] & ~MUTE_CH2); uda1380_write_reg(REG_MUTE, uda1380_regs[REG_MUTE] & ~MUTE_CH2);

View file

@ -177,7 +177,7 @@ void audiohw_postinit(void)
{ {
sleep(HZ); sleep(HZ);
/* 4) Set the Active bit in register 12h. */ /* 4) Set the <EFBFBD>Active<EFBFBD> bit in register 12h. */
codec_set_active(true); codec_set_active(true);
audiohw_mute(false); audiohw_mute(false);
@ -316,7 +316,7 @@ void audiohw_set_recvol(int left, int right, int type)
} }
} }
void audiohw_set_monitor(int enable) void audiohw_set_monitor(bool enable)
{ {
if(enable) if(enable)
{ {

View file

@ -268,7 +268,7 @@ void audiohw_set_recvol(int left, int right, int type) {
(void)type; (void)type;
} }
void audiohw_set_monitor(int enable) { void audiohw_set_monitor(bool enable) {
(void)enable; (void)enable;
} }

View file

@ -311,7 +311,7 @@ void audiohw_set_recvol(int left, int right, int type) {
(void)type; (void)type;
} }
void audiohw_set_monitor(int enable) { void audiohw_set_monitor(bool enable) {
(void)enable; (void)enable;
} }

View file

@ -30,11 +30,6 @@ extern int audiohw_set_master_vol(int vol_l, int vol_r);
extern int audiohw_set_lineout_vol(int vol_l, int vol_r); extern int audiohw_set_lineout_vol(int vol_l, int vol_r);
extern void audiohw_set_sample_rate(int sampling_control); extern void audiohw_set_sample_rate(int sampling_control);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_set_monitor(int enable);
/* Register Descriptions */ /* Register Descriptions */
#define LINE_OUT_R 0x00 #define LINE_OUT_R 0x00
#define LINE_OUT_L 0x01 #define LINE_OUT_L 0x01

View file

@ -109,8 +109,38 @@ void audiohw_close(void);
/** /**
* Mute or enable sound. * Mute or enable sound.
* @param mute true or false * @param mute true or false.
*/ */
void audiohw_mute(bool mute); void audiohw_mute(bool mute);
#ifdef HAVE_RECORDING
/**
* Enable recording.
* @param source_mic if this is true, we want to record from microphone,
* else we want to record FM/LineIn.
*/
void audiohw_enable_recording(bool source_mic);
/**
* Disable recording.
*/
void audiohw_disable_recording(void);
/**
* Set gain of recording source.
* @param left gain value.
* @param right will not be used if recording from micophone (mono).
* @param type AUDIO_GAIN_MIC, AUDIO_GAIN_LINEIN.
*/
void audiohw_set_recvol(int left, int right, int type);
/**
* Enable or disable recording monitor.
* @param enable ture or false.
*/
void audiohw_set_monitor(bool enable);
#endif /*HAVE_RECORDING*/
#endif /* _AUDIOHW_H_ */ #endif /* _AUDIOHW_H_ */

View file

@ -40,10 +40,6 @@ extern void audiohw_reset(void);
extern void audiohw_set_frequency(unsigned fsel); extern void audiohw_set_frequency(unsigned fsel);
extern void audiohw_enable_output(bool enable); extern void audiohw_enable_output(bool enable);
extern void audiohw_set_headphone_vol(int vol_l, int vol_r); extern void audiohw_set_headphone_vol(int vol_l, int vol_r);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_monitor(bool enable);
#define HEADPHONE_MUTE 0x30 /* 0110000 = -73db */ #define HEADPHONE_MUTE 0x30 /* 0110000 = -73db */

View file

@ -45,10 +45,6 @@ extern void audiohw_set_treble(int value);
* 88200: 3 = 50 to 100 SCLK, LRCK: Audio Clk / 2 * 88200: 3 = 50 to 100 SCLK, LRCK: Audio Clk / 2
*/ */
extern void audiohw_set_frequency(unsigned fsel); extern void audiohw_set_frequency(unsigned fsel);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_set_monitor(int enable);
#define UDA1380_ADDR 0x30 #define UDA1380_ADDR 0x30

View file

@ -34,11 +34,6 @@ extern int audiohw_set_master_vol(int vol_l, int vol_r);
extern void audiohw_set_nsorder(int order); extern void audiohw_set_nsorder(int order);
extern void audiohw_set_sample_rate(int sampling_control); extern void audiohw_set_sample_rate(int sampling_control);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_set_monitor(int enable);
/* Register addresses and bits */ /* Register addresses and bits */
#define LINVOL 0x00 #define LINVOL 0x00
#define LINVOL_MASK 0x1f #define LINVOL_MASK 0x1f

View file

@ -37,11 +37,6 @@ extern void audiohw_set_treble(int value);
extern void audiohw_set_nsorder(int order); extern void audiohw_set_nsorder(int order);
extern void audiohw_set_sample_rate(int sampling_control); extern void audiohw_set_sample_rate(int sampling_control);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_set_monitor(int enable);
extern void audiohw_set_equalizer_band(int band, int freq, int bw, int gain); extern void audiohw_set_equalizer_band(int band, int freq, int bw, int gain);
#define RESET 0x00 #define RESET 0x00

View file

@ -37,11 +37,6 @@ extern void audiohw_set_treble(int value);
extern void audiohw_set_nsorder(int order); extern void audiohw_set_nsorder(int order);
extern void audiohw_set_sample_rate(int sampling_control); extern void audiohw_set_sample_rate(int sampling_control);
extern void audiohw_enable_recording(bool source_mic);
extern void audiohw_disable_recording(void);
extern void audiohw_set_recvol(int left, int right, int type);
extern void audiohw_set_monitor(int enable);
/* Register addresses */ /* Register addresses */
#define LOUT1VOL 0x02 #define LOUT1VOL 0x02
#define ROUT1VOL 0x03 #define ROUT1VOL 0x03