From 3fb90523ccee037be68c356dee6ca15e2ffe59e9 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Fri, 7 Oct 2022 17:21:01 +0200 Subject: [PATCH] Remove unused code in sndfile_helpers No need to worry about maintaining this code with missing formats like mp3. --- libs/ardour/ardour/sndfile_helpers.h | 26 -------- libs/ardour/sndfile_helpers.cc | 95 ---------------------------- 2 files changed, 121 deletions(-) diff --git a/libs/ardour/ardour/sndfile_helpers.h b/libs/ardour/ardour/sndfile_helpers.h index d4597e58a6..d0454fbd29 100644 --- a/libs/ardour/ardour/sndfile_helpers.h +++ b/libs/ardour/ardour/sndfile_helpers.h @@ -21,34 +21,8 @@ #ifndef __sndfile_helpers_h__ #define __sndfile_helpers_h__ -#include -#include - #include "ardour/types.h" -// Use this define when initializing arrarys for use in sndfile_*_format() -#define SNDFILE_STR_LENGTH 32 - -#define SNDFILE_HEADER_FORMATS 7 -extern const char * const sndfile_header_formats_strings[SNDFILE_HEADER_FORMATS+1]; -extern const char * const sndfile_file_endings_strings[SNDFILE_HEADER_FORMATS+1]; - -extern int sndfile_header_formats[SNDFILE_HEADER_FORMATS]; - -#define SNDFILE_BITDEPTH_FORMATS 5 -extern const char * const sndfile_bitdepth_formats_strings[SNDFILE_BITDEPTH_FORMATS+1]; - -extern int sndfile_bitdepth_formats[SNDFILE_BITDEPTH_FORMATS]; - -#define SNDFILE_ENDIAN_FORMATS 2 -extern const char * const sndfile_endian_formats_strings[SNDFILE_ENDIAN_FORMATS+1]; - -extern int sndfile_endian_formats[SNDFILE_ENDIAN_FORMATS]; - -int sndfile_bitdepth_format_by_index (int); -int sndfile_header_format_by_index (int); -int sndfile_endian_format_by_index (int); - int sndfile_data_width (int format); // It'd be nice if libsndfile did this for us diff --git a/libs/ardour/sndfile_helpers.cc b/libs/ardour/sndfile_helpers.cc index 19e766ce18..6f5039b430 100644 --- a/libs/ardour/sndfile_helpers.cc +++ b/libs/ardour/sndfile_helpers.cc @@ -18,106 +18,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef COMPILER_MSVC -#include -#endif -#include - #include #include "ardour/sndfile_helpers.h" -#include "pbd/i18n.h" - -using std::map; using namespace std; -const char * const sndfile_header_formats_strings[SNDFILE_HEADER_FORMATS+1] = { - N_("WAV"), - N_("AIFF"), - N_("CAF"), - N_("W64 (64-bit WAV)"), - N_("FLAC"), - N_("Ogg/Vorbis"), - N_("raw (no header)"), - 0 -}; - -const char* const sndfile_file_endings_strings[SNDFILE_HEADER_FORMATS+1] = { - N_(".wav"), - N_(".aiff"), - N_(".caf"), - N_(".w64"), - N_(".flac"), - N_(".ogg"), - N_(".raw"), - 0 -}; - -int sndfile_header_formats[SNDFILE_HEADER_FORMATS] = { - SF_FORMAT_WAV, - SF_FORMAT_AIFF, - SF_FORMAT_CAF, - SF_FORMAT_W64, - SF_FORMAT_FLAC, - SF_FORMAT_OGG, - SF_FORMAT_RAW -}; - -const char * const sndfile_bitdepth_formats_strings[SNDFILE_BITDEPTH_FORMATS+1] = { - N_("Signed 16-bit PCM"), - N_("Signed 24-bit PCM"), - N_("Signed 32-bit PCM"), - N_("Signed 8-bit PCM"), - N_("32-bit float"), - 0 -}; - -int sndfile_bitdepth_formats[SNDFILE_BITDEPTH_FORMATS] = { - SF_FORMAT_PCM_16, - SF_FORMAT_PCM_24, - SF_FORMAT_PCM_32, - SF_FORMAT_PCM_S8, - SF_FORMAT_FLOAT -}; - -const char * const sndfile_endian_formats_strings[SNDFILE_ENDIAN_FORMATS+1] = { - N_("Little-endian (Intel)"), - N_("Big-endian (PowerPC)"), - 0 -}; - -int sndfile_endian_formats[SNDFILE_ENDIAN_FORMATS] = { - SF_ENDIAN_LITTLE, - SF_ENDIAN_BIG -}; - -int -sndfile_header_format_by_index (int index) -{ - if (index >= 0 && index < SNDFILE_HEADER_FORMATS) { - return sndfile_header_formats[index]; - } - return -1; -} - -int -sndfile_bitdepth_format_by_index (int index) -{ - if (index >= 0 && index < SNDFILE_BITDEPTH_FORMATS) { - return sndfile_bitdepth_formats[index]; - } - return -1; -} - -int -sndfile_endian_format_by_index (int index) -{ - if (index >= 0 && index < SNDFILE_ENDIAN_FORMATS) { - return sndfile_endian_formats[index]; - } - return -1; -} - int sndfile_data_width (int format) {