diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-06 22:07:10 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-10-06 22:07:10 +0000 |
commit | aefcce1c99598cc8c1748940a01e2d8aa55caf85 (patch) | |
tree | 9a6b0a3be7faac2c82b58f3517640fa195c96825 /libs/ardour | |
parent | 77364b0e25bcf97d0f3000ee97c27b2dca8454c6 (diff) |
ogg/flac support bits and pieces; fix up MIDI note dragging and front-edge trims; BROKEN IN PERCUSSIVE MODE FOR NOW
git-svn-id: svn://localhost/ardour2/branches/3.0@5745 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/sndfile_helpers.h | 2 | ||||
-rw-r--r-- | libs/ardour/audiofilesource.cc | 5 | ||||
-rw-r--r-- | libs/ardour/sndfile_helpers.cc | 6 | ||||
-rw-r--r-- | libs/ardour/utils.cc | 11 | ||||
-rw-r--r-- | libs/ardour/wscript | 29 |
5 files changed, 37 insertions, 16 deletions
diff --git a/libs/ardour/ardour/sndfile_helpers.h b/libs/ardour/ardour/sndfile_helpers.h index 23ece80df2..54190dcae3 100644 --- a/libs/ardour/ardour/sndfile_helpers.h +++ b/libs/ardour/ardour/sndfile_helpers.h @@ -26,7 +26,7 @@ // Use this define when initializing arrarys for use in sndfile_*_format() #define SNDFILE_STR_LENGTH 32 -#define SNDFILE_HEADER_FORMATS 5 +#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]; diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 705fbc4eab..fa3a86e44b 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -349,13 +349,8 @@ AudioFileSource::safe_audio_file_extension(const ustring& file) ".vwe", ".VWE", ".paf", ".PAF", ".voc", ".VOC", -#ifdef HAVE_OGG ".ogg", ".OGG", -#endif /* HAVE_OGG */ -#ifdef HAVE_FLAC ".flac", ".FLAC", -#else -#endif // HAVE_FLAC #ifdef HAVE_COREAUDIO ".mp3", ".MP3", ".aac", ".AAC", diff --git a/libs/ardour/sndfile_helpers.cc b/libs/ardour/sndfile_helpers.cc index 08e1117fbb..56259f0812 100644 --- a/libs/ardour/sndfile_helpers.cc +++ b/libs/ardour/sndfile_helpers.cc @@ -35,6 +35,8 @@ const char * const sndfile_header_formats_strings[SNDFILE_HEADER_FORMATS+1] = { N_("AIFF"), N_("CAF"), N_("W64 (64 bit WAV)"), + N_("FLAC"), + N_("Ogg/Vorbis"), N_("raw (no header)"), 0 }; @@ -44,6 +46,8 @@ const char* const sndfile_file_endings_strings[SNDFILE_HEADER_FORMATS+1] = { N_(".aiff"), N_(".caf"), N_(".w64"), + N_(".flac"), + N_(".ogg"), N_(".raw"), 0 }; @@ -53,6 +57,8 @@ int sndfile_header_formats[SNDFILE_HEADER_FORMATS] = { SF_FORMAT_AIFF, SF_FORMAT_CAF, SF_FORMAT_W64, + SF_FORMAT_FLAC, + SF_FORMAT_OGG, SF_FORMAT_RAW }; diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index c8e6b1145f..1ecaba55e5 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -517,16 +517,7 @@ string_is_affirmative (const std::string& str) { /* to be used only with XML data - not intended to handle user input */ - if (str == "1" || str == "y" || str == "Y") { - return true; - } else { - std::string str_uc; - std::transform(str.begin(), str.end(), str_uc.begin(), ::toupper); - if (str_uc == "YES") { - return true; - } - } - return false; + return str == "1" || str == "y" || str == "Y" || (!g_strncasecmp(str.c_str(), "yes", str.length())); } extern "C" { diff --git a/libs/ardour/wscript b/libs/ardour/wscript index 0f64c32f54..fd71f2e6a7 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -3,6 +3,8 @@ import autowaf import os import glob import Options +import re +import subprocess from w18n import build_i18n # Version of this package (even if built as a child) @@ -119,6 +121,7 @@ libardour_sources = [ 'midi_track.cc', 'mix.cc', 'mtc_slave.cc', + 'mtdm.cc', 'mute_master.cc', 'named_selection.cc', 'onset_detector.cc', @@ -181,6 +184,20 @@ libardour_sources = [ 'version.cc' ] +def flac_supported(): + cmd = subprocess.Popen ("sndfile-info testfile.flac", + stdout = subprocess.PIPE, + stderr = subprocess.STDOUT, shell = True) + out = cmd.communicate()[0]; + return re.search ('unknown format', out) == None + +def ogg_supported(): + cmd = subprocess.Popen ("sndfile-info testfile.ogg", + stdout = subprocess.PIPE, + stderr = subprocess.STDOUT, shell = True) + out = cmd.communicate()[0]; + return re.search ('unknown format', out) == None + def set_options(opt): autowaf.set_options(opt) @@ -210,12 +227,24 @@ def configure(conf): conf.check(header_name='sys/vfs.h', define_name='HAVE_SYS_VFS_H') conf.check(header_name='wordexp.h', define_name='HAVE_WORDEXP') + if flac_supported(): + conf.define ('HAVE_FLAC', 1) + autowaf.display_msg(conf, 'Checking for FLAC support', True) + else: + autowaf.display_msg(conf, 'Checking for FLAC support', False) + if ogg_supported(): + conf.define ('HAVE_OGG', 1) + autowaf.display_msg(conf, 'Checking for Ogg/Vorbis support', True) + else: + autowaf.display_msg(conf, 'Checking for Ogg/Vorbis Support', False) + conf.write_config_header('libardour-config.h') # Boost headers autowaf.check_header(conf, 'boost/shared_ptr.hpp') autowaf.check_header(conf, 'boost/weak_ptr.hpp') + def build(bld): # Library obj = bld.new_task_gen('cxx', 'shlib') |