mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-06 21:25:03 -05:00
audio: Move hosted audio "codec" drivers into their respective target dirs
They are nearly entirely generic wrappers around ALSA controls, unique per target, and are ripe for further consolidation. Change-Id: I05e4a450e3e89e03616906601c4f8fa46200dff5
This commit is contained in:
parent
d376e0afb7
commit
a79bdaf462
20 changed files with 62 additions and 43 deletions
|
|
@ -133,12 +133,16 @@ target/hosted/sonynwz/audio-nwz.c
|
|||
target/hosted/sonynwz/debug-nwz.c
|
||||
target/hosted/sonynwz/nvp-nwz.c
|
||||
target/hosted/sonynwz/nwz-db.c
|
||||
target/hosted/sonynwz/nwzlinux-codec.c
|
||||
#endif
|
||||
|
||||
#if ((defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX) || defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || defined(SONY_NWZ_LINUX)) && !defined(SIMULATOR))
|
||||
target/hosted/pcm-alsa.c
|
||||
target/hosted/alsa-controls.c
|
||||
#endif
|
||||
|
||||
#if ((defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX)) && !defined(SIMULATOR))
|
||||
drivers/lcd-memframe.c
|
||||
target/hosted/alsa-controls.c
|
||||
target/hosted/pcm-alsa.c
|
||||
target/hosted/backtrace-glibc.c
|
||||
target/hosted/filesystem-unix.c
|
||||
target/hosted/kernel-unix.c
|
||||
|
|
@ -154,18 +158,21 @@ target/hosted/power-linux.c
|
|||
target/hosted/agptek/button-agptek.c
|
||||
target/hosted/agptek/debug-agptek.c
|
||||
target/hosted/agptek/powermgmt-agptek.c
|
||||
target/hosted/agptek/rocker_codec.c
|
||||
#endif
|
||||
|
||||
#if defined(SURFANS_F28) && !defined(SIMULATOR)
|
||||
target/hosted/surfans/button-f28.c
|
||||
target/hosted/surfans/debug-f28.c
|
||||
target/hosted/surfans/powermgmt-f28.c
|
||||
target/hosted/surfanslinux_codec.c
|
||||
#endif
|
||||
|
||||
#if (defined(XDUOO_X3II) || defined(XDUOO_X20)) && !defined(SIMULATOR)
|
||||
target/hosted/xduoo/button-xduoo.c
|
||||
target/hosted/xduoo/debug-xduoo.c
|
||||
target/hosted/xduoo/powermgmt-xduoo.c
|
||||
target/hosted/xduoo/xduoolinux_codec.c
|
||||
#endif
|
||||
|
||||
#if defined(HIBY_LINUX) && !defined(SIMULATOR)
|
||||
|
|
@ -180,6 +187,7 @@ target/hosted/fiio/debug-fiio.c
|
|||
target/hosted/fiio/powermgmt-fiio.c
|
||||
target/hosted/fiio/system-fiio.c
|
||||
target/hosted/fiio/usb-fiio.c
|
||||
target/hosted/fiio/fiiolinux_codec.c
|
||||
#endif
|
||||
|
||||
#if (defined(EROS_Q)) && !defined(SIMULATOR)
|
||||
|
|
@ -187,6 +195,7 @@ target/hosted/aigo/button-erosq.c
|
|||
target/hosted/aigo/debug-erosq.c
|
||||
target/hosted/aigo/power-erosq.c
|
||||
target/hosted/aigo/powermgmt-erosq.c
|
||||
target/hosted/aigo/erosqlinux_codec.c
|
||||
#endif
|
||||
|
||||
#if defined(SAMSUNG_YPR0) && !defined(SIMULATOR)
|
||||
|
|
@ -549,40 +558,21 @@ drivers/audio/es9018.c
|
|||
drivers/audio/es9218.c
|
||||
#endif /* defined(HAVE_*) */
|
||||
#else /* PLATFORM_HOSTED */
|
||||
#if defined(SAMSUNG_YPR0) && defined(HAVE_AS3514)
|
||||
#if defined(HAVE_AS3514)
|
||||
drivers/audio/as3514.c
|
||||
target/hosted/pcm-alsa.c
|
||||
#elif defined(SAMSUNG_YPR1) && defined(HAVE_WM8978)
|
||||
#elif defined(HAVE_WM8978)
|
||||
drivers/audio/wm8978.c
|
||||
target/hosted/pcm-alsa.c
|
||||
#elif defined(HAVE_NWZ_LINUX_CODEC)
|
||||
drivers/audio/nwzlinux-codec.c
|
||||
target/hosted/alsa-controls.c
|
||||
target/hosted/pcm-alsa.c
|
||||
#elif defined(HAVE_ROCKER_CODEC) && !defined(SIMULATOR)
|
||||
drivers/audio/rocker_codec.c
|
||||
#elif defined(HAVE_SURFANS_LINUX_CODEC) && !defined(SIMULATOR)
|
||||
drivers/audio/surfanslinux_codec.c
|
||||
#elif defined(HAVE_XDUOO_LINUX_CODEC) && !defined(SIMULATOR)
|
||||
drivers/audio/xduoolinux_codec.c
|
||||
#elif defined(HAVE_FIIO_LINUX_CODEC) && !defined(SIMULATOR)
|
||||
drivers/audio/fiiolinux_codec.c
|
||||
#elif defined(HAVE_EROSQ_LINUX_CODEC) && !defined(SIMULATOR)
|
||||
drivers/audio/erosqlinux_codec.c
|
||||
#elif defined(HAVE_SDL_AUDIO)
|
||||
drivers/audio/sdl.c
|
||||
|
||||
#if (CONFIG_PLATFORM & PLATFORM_MAEMO5)
|
||||
target/hosted/maemo/pcm-gstreamer.c
|
||||
#else
|
||||
target/hosted/sdl/pcm-sdl.c
|
||||
#endif /* (CONFIG_PLATFORM & PLATFORM_MAEMO) */
|
||||
|
||||
#elif defined(CTRU)
|
||||
drivers/audio/ctru.c
|
||||
#endif
|
||||
#endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) */
|
||||
|
||||
#endif /* !defined(BOOTLOADER) */
|
||||
|
||||
/* build erosqn codec in bootloader for detection */
|
||||
|
|
@ -2034,10 +2024,10 @@ target/hosted/android/pcm-android.c
|
|||
target/hosted/android/powermgmt-android.c
|
||||
target/hosted/android/system-android.c
|
||||
target/hosted/android/telephony-android.c
|
||||
target/hosted/android/android-codec.c
|
||||
#ifdef APPLICATION
|
||||
target/hosted/android/app/button-application.c
|
||||
#endif
|
||||
drivers/audio/android.c
|
||||
#endif
|
||||
|
||||
#if defined(DX50) || defined(DX90)
|
||||
|
|
|
|||
|
|
@ -223,9 +223,10 @@ struct sound_settings_info
|
|||
#include "es9018.h"
|
||||
#elif defined(HAVE_ES9218)
|
||||
#include "es9218.h"
|
||||
#elif ((CONFIG_PLATFORM & (PLATFORM_ANDROID | PLATFORM_MAEMO \
|
||||
| PLATFORM_PANDORA | PLATFORM_SDL | PLATFORM_CTRU)) | defined(RG_NANO))
|
||||
#include "hosted_codec.h"
|
||||
#elif (CONFIG_PLATFORM & PLATFORM_ANDROID)
|
||||
#include "android_codec.h"
|
||||
#elif ((CONFIG_PLATFORM & (PLATFORM_MAEMO | PLATFORM_PANDORA | PLATFORM_SDL | PLATFORM_CTRU)) | defined(RG_NANO))
|
||||
#include "sdl_codec.h"
|
||||
#elif defined(DX50)
|
||||
#include "codec-dx50.h"
|
||||
#elif defined(DX90)
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
|
||||
#include "config.h"
|
||||
#include "audiohw.h"
|
||||
#include "pcm-android.h"
|
||||
|
||||
void audiohw_set_volume(int volume)
|
||||
{
|
||||
extern void pcm_set_mixer_volume(int);
|
||||
pcm_set_mixer_volume(volume);
|
||||
}
|
||||
|
||||
|
|
@ -36,6 +36,5 @@ void audiohw_set_balance(int balance)
|
|||
|
||||
void audiohw_close(void)
|
||||
{
|
||||
extern void pcm_shutdown(void);
|
||||
pcm_shutdown();
|
||||
}
|
||||
|
|
@ -18,19 +18,9 @@
|
|||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifndef HOSTED_CODEC_H
|
||||
#define HOSTED_CODEC_H
|
||||
#ifndef __ANDROID_CODEC_H
|
||||
#define __ANDROID_CODEC_H
|
||||
|
||||
#if (defined(HAVE_SDL_AUDIO) \
|
||||
&& !(CONFIG_PLATFORM & PLATFORM_MAEMO5)) \
|
||||
|| (CONFIG_PLATFORM & PLATFORM_CTRU)
|
||||
AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -80, 0, 0)
|
||||
#else
|
||||
#define AUDIOHW_CAPS (MONO_VOL_CAP)
|
||||
AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -99, 0, 0)
|
||||
#endif /* CONFIG_PLATFORM & PLATFORM_SDL */
|
||||
|
||||
#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
|
||||
/* Bass and treble tone controls */
|
||||
#ifdef AUDIOHW_HAVE_BASS
|
||||
AUDIOHW_SETTING(BASS, "dB", 0, 1, -24, 24, 0)
|
||||
|
|
@ -49,6 +39,5 @@ AUDIOHW_SETTING(BASS_CUTOFF, "", 0, 1, 1, 4, 1)
|
|||
#if defined(AUDIOHW_HAVE_TREBLE_CUTOFF)
|
||||
AUDIOHW_SETTING(TREBLE_CUTOFF, "", 0, 1, 1, 4, 1)
|
||||
#endif
|
||||
#endif /* CONFIG_PLATFORM & PLATFORM_ANDROID */
|
||||
|
||||
#endif /* HOSTED_CODEC_H */
|
||||
#endif /* __ANDROID_CODEC_H */
|
||||
7
firmware/target/hosted/android/pcm-android.h
Normal file
7
firmware/target/hosted/android/pcm-android.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#ifndef __PCM_ANDROID_H
|
||||
#define __PCM_ANDROID_H
|
||||
|
||||
void pcm_set_mixer_volume(int volume);
|
||||
void pcm_shutdown(void);
|
||||
|
||||
#endif /* __PCM_ANDROID_H */
|
||||
33
firmware/target/hosted/sdl/sdl_codec.h
Normal file
33
firmware/target/hosted/sdl/sdl_codec.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 by Thomas Martitz
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#ifndef _SDL_CODEC_H
|
||||
#define _SDL_CODEC_H
|
||||
|
||||
#if (defined(HAVE_SDL_AUDIO) \
|
||||
&& !(CONFIG_PLATFORM & PLATFORM_MAEMO5)) \
|
||||
|| (CONFIG_PLATFORM & PLATFORM_CTRU)
|
||||
AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -80, 0, 0)
|
||||
#else
|
||||
#define AUDIOHW_CAPS (MONO_VOL_CAP)
|
||||
AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -99, 0, 0)
|
||||
#endif /* CONFIG_PLATFORM & PLATFORM_SDL */
|
||||
|
||||
#endif /* _SDL_CODEC_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue