mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Allow e200 to compile without HAVE_RECORDING
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28104 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
95aae36c6c
commit
d343bbe846
3 changed files with 34 additions and 4 deletions
|
@ -529,13 +529,17 @@ void audiohw_disable_recording(void);
|
||||||
*/
|
*/
|
||||||
void audiohw_set_recvol(int left, int right, int type);
|
void audiohw_set_recvol(int left, int right, int type);
|
||||||
|
|
||||||
|
#endif /* HAVE_RECORDING */
|
||||||
|
|
||||||
|
#if defined(HAVE_RECORDING) || defined(HAVE_FMRADIO_IN)
|
||||||
/**
|
/**
|
||||||
* Enable or disable recording monitor.
|
* Enable or disable recording monitor.
|
||||||
* @param enable ture or false.
|
* @param enable true or false.
|
||||||
*/
|
*/
|
||||||
void audiohw_set_monitor(bool enable);
|
void audiohw_set_monitor(bool enable);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* HAVE_RECORDING */
|
|
||||||
|
|
||||||
#if CONFIG_CODEC != SWCODEC
|
#if CONFIG_CODEC != SWCODEC
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,9 @@ void pcm_set_frequency(unsigned int samplerate)
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
#ifdef CONFIG_SAMPR_TYPES
|
#ifdef CONFIG_SAMPR_TYPES
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
unsigned int type = samplerate & SAMPR_TYPE_MASK;
|
unsigned int type = samplerate & SAMPR_TYPE_MASK;
|
||||||
|
#endif
|
||||||
samplerate &= ~SAMPR_TYPE_MASK;
|
samplerate &= ~SAMPR_TYPE_MASK;
|
||||||
|
|
||||||
#ifdef HAVE_RECORDING
|
#ifdef HAVE_RECORDING
|
||||||
|
|
|
@ -45,8 +45,12 @@ void audio_set_output_source(int source)
|
||||||
void audio_input_mux(int source, unsigned flags)
|
void audio_input_mux(int source, unsigned flags)
|
||||||
{
|
{
|
||||||
static int last_source = AUDIO_SRC_PLAYBACK;
|
static int last_source = AUDIO_SRC_PLAYBACK;
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
static bool last_recording = false;
|
static bool last_recording = false;
|
||||||
bool recording = flags & SRCF_RECORDING;
|
bool recording = flags & SRCF_RECORDING;
|
||||||
|
#else
|
||||||
|
(void) flags;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (source)
|
switch (source)
|
||||||
{
|
{
|
||||||
|
@ -56,11 +60,16 @@ void audio_input_mux(int source, unsigned flags)
|
||||||
audio_channels = 2;
|
audio_channels = 2;
|
||||||
if (source != last_source)
|
if (source != last_source)
|
||||||
{
|
{
|
||||||
|
#if defined(HAVE_RECORDING) || defined(HAVE_FMRADIO_IN)
|
||||||
audiohw_set_monitor(false);
|
audiohw_set_monitor(false);
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
audiohw_disable_recording();
|
audiohw_disable_recording();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if defined(HAVE_RECORDING) && (INPUT_SRC_CAPS & SRC_CAP_MIC)
|
||||||
case AUDIO_SRC_MIC: /* recording only */
|
case AUDIO_SRC_MIC: /* recording only */
|
||||||
audio_channels = 1;
|
audio_channels = 1;
|
||||||
if (source != last_source)
|
if (source != last_source)
|
||||||
|
@ -69,26 +78,39 @@ void audio_input_mux(int source, unsigned flags)
|
||||||
audiohw_enable_recording(true); /* source mic */
|
audiohw_enable_recording(true); /* source mic */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (INPUT_SRC_CAPS & SRC_CAP_FMRADIO)
|
||||||
case AUDIO_SRC_FMRADIO: /* recording and playback */
|
case AUDIO_SRC_FMRADIO: /* recording and playback */
|
||||||
audio_channels = 2;
|
audio_channels = 2;
|
||||||
|
|
||||||
if (source == last_source && recording == last_recording)
|
if (source == last_source
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
|
&& recording == last_recording
|
||||||
|
#endif
|
||||||
|
)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
last_recording = recording;
|
last_recording = recording;
|
||||||
|
|
||||||
if (recording)
|
if (recording)
|
||||||
{
|
{
|
||||||
audiohw_set_monitor(false);
|
audiohw_set_monitor(false);
|
||||||
audiohw_enable_recording(false);
|
audiohw_enable_recording(false);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
audiohw_disable_recording();
|
audiohw_disable_recording();
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_RECORDING) || defined(HAVE_FMRADIO_IN)
|
||||||
audiohw_set_monitor(true); /* line 1 analog audio path */
|
audiohw_set_monitor(true); /* line 1 analog audio path */
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif /* (INPUT_SRC_CAPS & SRC_CAP_FMRADIO) */
|
||||||
} /* end switch */
|
} /* end switch */
|
||||||
|
|
||||||
last_source = source;
|
last_source = source;
|
||||||
|
@ -164,6 +186,7 @@ void audiohw_set_sampr_dividers(int fsel)
|
||||||
IISDIV = (IISDIV & ~0xc000003f) | regvals[fsel].iisdiv;
|
IISDIV = (IISDIV & ~0xc000003f) | regvals[fsel].iisdiv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_RECORDING
|
||||||
unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate)
|
unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate)
|
||||||
{
|
{
|
||||||
/* Check if the samplerate is in the list of recordable rates.
|
/* Check if the samplerate is in the list of recordable rates.
|
||||||
|
@ -175,3 +198,4 @@ unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate)
|
||||||
|
|
||||||
return samplerate * 2; /* Recording rates are 1/2 the codec clock */
|
return samplerate * 2; /* Recording rates are 1/2 the codec clock */
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue