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
This commit is contained in:
Paul Davis 2009-10-06 22:07:10 +00:00
parent 77364b0e25
commit aefcce1c99
24 changed files with 147 additions and 68 deletions

View file

@ -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];

View file

@ -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",

View file

@ -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
};

View file

@ -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" {

View file

@ -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')