summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct347
-rw-r--r--gtk2_ardour/audio_region_view.cc37
-rw-r--r--gtk2_ardour/audio_region_view.h5
-rw-r--r--gtk2_ardour/audio_streamview.cc42
-rw-r--r--gtk2_ardour/audio_streamview.h3
-rw-r--r--gtk2_ardour/audio_time_axis.cc42
-rw-r--r--gtk2_ardour/audio_time_axis.h3
-rw-r--r--gtk2_ardour/canvas-waveview.c49
-rw-r--r--gtk2_ardour/canvas-waveview.h3
-rw-r--r--gtk2_ardour/enums.h5
-rw-r--r--gtk2_ardour/logmeter.h4
-rw-r--r--gtk2_ardour/waveview.cc8
-rw-r--r--gtk2_ardour/waveview.h2
-rw-r--r--libs/libsndfile/SConscript3
-rwxr-xr-xlibs/libsndfile/configure8
15 files changed, 386 insertions, 175 deletions
diff --git a/SConstruct b/SConstruct
index 46cbfc7485..d9f6ebf6d0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -502,10 +502,184 @@ libraries['midi++2'] = LibraryInfo (LIBS='midi++', LIBPATH='#libs/midi++2', CPPP
libraries['pbd'] = LibraryInfo (LIBS='pbd', LIBPATH='#libs/pbd', CPPPATH='#libs/pbd')
libraries['gtkmm2ext'] = LibraryInfo (LIBS='gtkmm2ext', LIBPATH='#libs/gtkmm2ext', CPPPATH='#libs/gtkmm2ext')
+
+# SCons should really do this for us
+
+conf = Configure (env)
+
+have_cxx = conf.TryAction (Action (str(env['CXX']) + ' --version'))
+if have_cxx[0] != 1:
+ print "This system has no functional C++ compiler. You cannot build Ardour from source without one."
+ sys.exit (1)
+else:
+ print "Congratulations, you have a functioning C++ compiler."
+
+env = conf.Finish()
+
+
+#
+# Compiler flags and other system-dependent stuff
+#
+
+opt_flags = []
+debug_flags = [ '-g' ]
+
+# guess at the platform, used to define compiler flags
+
+config_guess = os.popen("tools/config.guess").read()[:-1]
+
+config_cpu = 0
+config_arch = 1
+config_kernel = 2
+config_os = 3
+config = config_guess.split ("-")
+
+print "system triple: " + config_guess
+
+# Autodetect
+if env['DIST_TARGET'] == 'auto':
+ if config[config_arch] == 'apple':
+ # The [.] matches to the dot after the major version, "." would match any character
+ if re.search ("darwin[0-7][.]", config[config_kernel]) != None:
+ env['DIST_TARGET'] = 'panther'
+ else:
+ env['DIST_TARGET'] = 'tiger'
+ else:
+ if re.search ("x86_64", config[config_cpu]) != None:
+ env['DIST_TARGET'] = 'x86_64'
+ elif re.search("i[0-5]86", config[config_cpu]) != None:
+ env['DIST_TARGET'] = 'i386'
+ elif re.search("powerpc", config[config_cpu]) != None:
+ env['DIST_TARGET'] = 'powerpc'
+ else:
+ env['DIST_TARGET'] = 'i686'
+ print "\n*******************************"
+ print "detected DIST_TARGET = " + env['DIST_TARGET']
+ print "*******************************\n"
+
+
+if config[config_cpu] == 'powerpc' and env['DIST_TARGET'] != 'none':
+ #
+ # Apple/PowerPC optimization options
+ #
+ # -mcpu=7450 does not reliably work with gcc 3.*
+ #
+ if env['DIST_TARGET'] == 'panther' or env['DIST_TARGET'] == 'tiger':
+ if config[config_arch] == 'apple':
+ opt_flags.extend ([ "-mcpu=7450", "-faltivec"])
+ else:
+ opt_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"])
+ else:
+ opt_flags.extend([ "-mcpu=750", "-mmultiple" ])
+ opt_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"])
+
+elif ((re.search ("i[0-9]86", config[config_cpu]) != None) or (re.search ("x86_64", config[config_cpu]) != None)) and env['DIST_TARGET'] != 'none':
+
+ build_host_supports_sse = 0
+
+ debug_flags.append ("-DARCH_X86")
+ opt_flags.append ("-DARCH_X86")
+
+ if config[config_kernel] == 'linux' :
+
+ if env['DIST_TARGET'] != 'i386':
+
+ flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
+ x86_flags = flag_line.split (": ")[1:][0].split (' ')
+
+ if "mmx" in x86_flags:
+ opt_flags.append ("-mmmx")
+ if "sse" in x86_flags:
+ build_host_supports_sse = 1
+ if "3dnow" in x86_flags:
+ opt_flags.append ("-m3dnow")
+
+ if config[config_cpu] == "i586":
+ opt_flags.append ("-march=i586")
+ elif config[config_cpu] == "i686":
+ opt_flags.append ("-march=i686")
+
+ if ((env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64')) and build_host_supports_sse:
+ opt_flags.extend (["-msse", "-mfpmath=sse"])
+ debug_flags.extend (["-msse", "-mfpmath=sse"])
+# end of processor-specific section
+
+# optimization section
+if env['FPU_OPTIMIZATION']:
+ if env['DIST_TARGET'] == 'tiger':
+ opt_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
+ debug_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
+ libraries['core'].Append(LINKFLAGS= '-framework Accelerate')
+ elif env['DIST_TARGET'] == 'i686' or env['DIST_TARGET'] == 'x86_64':
+ opt_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
+ debug_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
+ if env['DIST_TARGET'] == 'x86_64':
+ opt_flags.append ("-DUSE_X86_64_ASM")
+ debug_flags.append ("-DUSE_X86_64_ASM")
+ if build_host_supports_sse != 1:
+ print "\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)"
+# end optimization section
+
+#
+# save off guessed arch element in an env
+#
+env.Append(CONFIG_ARCH=config[config_arch])
+
+
+#
+# ARCH="..." overrides all
+#
+
+if env['ARCH'] != '':
+ opt_flags = env['ARCH'].split()
+
+#
+# prepend boiler plate optimization flags
+#
+
+opt_flags[:0] = [
+ "-O3",
+ "-fomit-frame-pointer",
+ "-ffast-math",
+ "-fstrength-reduce"
+ ]
+
+if env['DEBUG'] == 1:
+ env.Append(CCFLAGS=" ".join (debug_flags))
+else:
+ env.Append(CCFLAGS=" ".join (opt_flags))
+
+#
+# warnings flags
+#
+
+env.Append(CCFLAGS="-Wall")
+env.Append(CXXFLAGS="-Woverloaded-virtual")
+
+if env['EXTRA_WARN']:
+ env.Append(CCFLAGS="-Wextra -pedantic")
+ env.Append(CXXFLAGS="-ansi")
+
+if env['LIBLO']:
+ env.Append(CCFLAGS="-DHAVE_LIBLO")
+
+
+#
+# fix scons nitpickiness on APPLE
+#
+
+
+def prep_libcheck(topenv, libinfo):
+ if topenv['DIST_TARGET'] == 'panther' or topenv['DIST_TARGET'] == 'tiger':
+ libinfo.Append(CCFLAGS="-I/opt/local/include", LINKFLAGS="-L/opt/local/lib")
+
+prep_libcheck(env, env)
+
#
# Check for libusb
libraries['usb'] = LibraryInfo ()
+prep_libcheck(env, libraries['usb'])
conf = Configure (libraries['usb'])
if conf.CheckLib ('usb', 'usb_interrupt_write'):
@@ -519,6 +693,8 @@ libraries['usb'] = conf.Finish ()
# Check for FLAC
libraries['flac'] = LibraryInfo ()
+prep_libcheck(env, libraries['flac'])
+libraries['flac'].Append(CCFLAGS="-I/usr/local/include", LINKFLAGS="-L/usr/local/lib")
conf = Configure (libraries['flac'])
conf.CheckLib ('FLAC', 'FLAC__stream_decoder_new', language='CXX')
@@ -530,6 +706,8 @@ libraries['flac'] = conf.Finish ()
# boost (we don't link against boost, just use some header files)
libraries['boost'] = LibraryInfo ()
+prep_libcheck(env, libraries['boost'])
+libraries['boost'].Append(CCFLAGS="-I/usr/local/include", LINKFLAGS="-L/usr/local/lib")
conf = Configure (libraries['boost'])
if conf.CheckHeader ('boost/shared_ptr.hpp', language='CXX') == False:
print "Boost header files do not appear to be installed."
@@ -542,7 +720,8 @@ libraries['boost'] = conf.Finish ()
if env['LIBLO']:
libraries['lo'] = LibraryInfo ()
-
+ prep_libcheck(env, libraries['lo'])
+
conf = Configure (libraries['lo'])
if conf.CheckLib ('lo', 'lo_server_new') == False:
print "liblo does not appear to be installed."
@@ -554,6 +733,7 @@ if env['LIBLO']:
# Check for dmalloc
libraries['dmalloc'] = LibraryInfo ()
+prep_libcheck(env, libraries['dmalloc'])
#
# look for the threaded version
@@ -794,177 +974,12 @@ else:
config_prefix = '$DESTDIR' + final_config_prefix
-# SCons should really do this for us
-
-conf = Configure (env)
-
-have_cxx = conf.TryAction (Action (str(env['CXX']) + ' --version'))
-if have_cxx[0] != 1:
- print "This system has no functional C++ compiler. You cannot build Ardour from source without one."
- sys.exit (1)
-else:
- print "Congratulations, you have a functioning C++ compiler."
-
-env = conf.Finish()
-
-#
-# Compiler flags and other system-dependent stuff
-#
-
-opt_flags = []
-debug_flags = [ '-g' ]
-
-# guess at the platform, used to define compiler flags
-
-config_guess = os.popen("tools/config.guess").read()[:-1]
-
-config_cpu = 0
-config_arch = 1
-config_kernel = 2
-config_os = 3
-config = config_guess.split ("-")
-
-print "system triple: " + config_guess
-
-# Autodetect
-if env['DIST_TARGET'] == 'auto':
- if config[config_arch] == 'apple':
- # The [.] matches to the dot after the major version, "." would match any character
- if re.search ("darwin[0-7][.]", config[config_kernel]) != None:
- env['DIST_TARGET'] = 'panther'
- else:
- env['DIST_TARGET'] = 'tiger'
- else:
- if re.search ("x86_64", config[config_cpu]) != None:
- env['DIST_TARGET'] = 'x86_64'
- elif re.search("i[0-5]86", config[config_cpu]) != None:
- env['DIST_TARGET'] = 'i386'
- elif re.search("powerpc", config[config_cpu]) != None:
- env['DIST_TARGET'] = 'powerpc'
- else:
- env['DIST_TARGET'] = 'i686'
- print "\n*******************************"
- print "detected DIST_TARGET = " + env['DIST_TARGET']
- print "*******************************\n"
-
-
-if config[config_cpu] == 'powerpc' and env['DIST_TARGET'] != 'none':
- #
- # Apple/PowerPC optimization options
- #
- # -mcpu=7450 does not reliably work with gcc 3.*
- #
- if env['DIST_TARGET'] == 'panther' or env['DIST_TARGET'] == 'tiger':
- if config[config_arch] == 'apple':
- opt_flags.extend ([ "-mcpu=7450", "-faltivec"])
- else:
- opt_flags.extend ([ "-mcpu=7400", "-maltivec", "-mabi=altivec"])
- else:
- opt_flags.extend([ "-mcpu=750", "-mmultiple" ])
- opt_flags.extend (["-mhard-float", "-mpowerpc-gfxopt"])
-
-elif ((re.search ("i[0-9]86", config[config_cpu]) != None) or (re.search ("x86_64", config[config_cpu]) != None)) and env['DIST_TARGET'] != 'none':
-
- build_host_supports_sse = 0
-
- debug_flags.append ("-DARCH_X86")
- opt_flags.append ("-DARCH_X86")
-
- if config[config_kernel] == 'linux' :
-
- if env['DIST_TARGET'] != 'i386':
-
- flag_line = os.popen ("cat /proc/cpuinfo | grep '^flags'").read()[:-1]
- x86_flags = flag_line.split (": ")[1:][0].split (' ')
-
- if "mmx" in x86_flags:
- opt_flags.append ("-mmmx")
- if "sse" in x86_flags:
- build_host_supports_sse = 1
- if "3dnow" in x86_flags:
- opt_flags.append ("-m3dnow")
-
- if config[config_cpu] == "i586":
- opt_flags.append ("-march=i586")
- elif config[config_cpu] == "i686":
- opt_flags.append ("-march=i686")
-
- if ((env['DIST_TARGET'] == 'i686') or (env['DIST_TARGET'] == 'x86_64')) and build_host_supports_sse:
- opt_flags.extend (["-msse", "-mfpmath=sse"])
- debug_flags.extend (["-msse", "-mfpmath=sse"])
-# end of processor-specific section
-
-# optimization section
-if env['FPU_OPTIMIZATION']:
- if env['DIST_TARGET'] == 'tiger':
- opt_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
- debug_flags.append ("-DBUILD_VECLIB_OPTIMIZATIONS")
- libraries['core'].Append(LINKFLAGS= '-framework Accelerate')
- elif env['DIST_TARGET'] == 'i686' or env['DIST_TARGET'] == 'x86_64':
- opt_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
- debug_flags.append ("-DBUILD_SSE_OPTIMIZATIONS")
- if env['DIST_TARGET'] == 'x86_64':
- opt_flags.append ("-DUSE_X86_64_ASM")
- debug_flags.append ("-DUSE_X86_64_ASM")
- if build_host_supports_sse != 1:
- print "\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)"
-# end optimization section
-
-#
-# save off guessed arch element in an env
-#
-env.Append(CONFIG_ARCH=config[config_arch])
-
-
-#
-# ARCH="..." overrides all
-#
-
-if env['ARCH'] != '':
- opt_flags = env['ARCH'].split()
-
-#
-# prepend boiler plate optimization flags
-#
-
-opt_flags[:0] = [
- "-O3",
- "-fomit-frame-pointer",
- "-ffast-math",
- "-fstrength-reduce"
- ]
-
-if env['DEBUG'] == 1:
- env.Append(CCFLAGS=" ".join (debug_flags))
-else:
- env.Append(CCFLAGS=" ".join (opt_flags))
-
-#
-# warnings flags
-#
-
-env.Append(CCFLAGS="-Wall")
-env.Append(CXXFLAGS="-Woverloaded-virtual")
-
-if env['EXTRA_WARN']:
- env.Append(CCFLAGS="-Wextra -pedantic")
- env.Append(CXXFLAGS="-ansi")
-
-if env['LIBLO']:
- env.Append(CCFLAGS="-DHAVE_LIBLO")
-
#
# everybody needs this
#
env.Merge ([ libraries['core'] ])
-#
-# fix scons nitpickiness on APPLE
-#
-
-if env['DIST_TARGET'] == 'panther' or env['DIST_TARGET'] == 'tiger':
- env.Append(CCFLAGS="-I/opt/local/include", LINKFLAGS="-L/opt/local/lib")
#
# i18n support
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index dd2f972970..02debbaf8a 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -851,6 +851,8 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct)
wave->property_amplitude_above_axis() = _amplitude_above_axis;
wave->property_wave_color() = _region->muted() ? color_map[cMutedWaveForm] : color_map[cWaveForm];
wave->property_region_start() = _region->start();
+ wave->property_rectified() = (bool) (_flags & WaveformRectified);
+ wave->property_logscaled() = (bool) (_flags & WaveformLogScaled);
if (!(_flags & WaveformVisible)) {
wave->hide();
@@ -965,6 +967,8 @@ AudioRegionView::store_flags()
node->add_property ("waveform-visible", (_flags & WaveformVisible) ? "yes" : "no");
node->add_property ("envelope-visible", (_flags & EnvelopeVisible) ? "yes" : "no");
+ node->add_property ("waveform-rectified", (_flags & WaveformRectified) ? "yes" : "no");
+ node->add_property ("waveform-logscaled", (_flags & WaveformLogScaled) ? "yes" : "no");
_region->add_extra_xml (*node);
}
@@ -985,6 +989,18 @@ AudioRegionView::set_flags (XMLNode* node)
_flags |= EnvelopeVisible;
}
}
+
+ if ((prop = node->property ("waveform-rectified")) != 0) {
+ if (prop->value() == "yes") {
+ _flags |= WaveformRectified;
+ }
+ }
+
+ if ((prop = node->property ("waveform-logscaled")) != 0) {
+ if (prop->value() == "yes") {
+ _flags |= WaveformLogScaled;
+ }
+ }
}
void
@@ -1024,9 +1040,30 @@ AudioRegionView::set_waveform_shape (WaveformShape shape)
} else {
_flags &= ~WaveformRectified;
}
+ store_flags ();
+ }
+}
+
+void
+AudioRegionView::set_waveform_scale (WaveformScale scale)
+{
+ bool yn = (scale == LogWaveform);
+
+ if (yn != (bool) (_flags & WaveformLogScaled)) {
+ for (vector<WaveView *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
+ (*wave)->property_logscaled() = yn;
+ }
+
+ if (yn) {
+ _flags |= WaveformLogScaled;
+ } else {
+ _flags &= ~WaveformLogScaled;
+ }
+ store_flags ();
}
}
+
GhostRegion*
AudioRegionView::add_ghost (AutomationTimeAxisView& atv)
{
diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h
index 0ced1aca55..3c46e906df 100644
--- a/gtk2_ardour/audio_region_view.h
+++ b/gtk2_ardour/audio_region_view.h
@@ -72,8 +72,10 @@ class AudioRegionView : public RegionView
void set_envelope_visible (bool);
void set_waveform_visible (bool yn);
void set_waveform_shape (WaveformShape);
+ void set_waveform_scale (WaveformScale);
bool waveform_rectified() const { return _flags & WaveformRectified; }
+ bool waveform_logscaled() const { return _flags & WaveformLogScaled; }
bool waveform_visible() const { return _flags & WaveformVisible; }
bool envelope_visible() const { return _flags & EnvelopeVisible; }
@@ -116,7 +118,8 @@ class AudioRegionView : public RegionView
enum Flags {
EnvelopeVisible = 0x1,
WaveformVisible = 0x4,
- WaveformRectified = 0x8
+ WaveformRectified = 0x8,
+ WaveformLogScaled = 0x10,
};
void reset_fade_shapes ();
diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc
index 185a961064..d5760c7bb6 100644
--- a/gtk2_ardour/audio_streamview.cc
+++ b/gtk2_ardour/audio_streamview.cc
@@ -383,7 +383,47 @@ AudioStreamView::set_waveform_shape (WaveformShape shape)
arv->set_waveform_shape (shape);
}
}
-
+
+WaveformShape
+AudioStreamView::get_waveform_shape () const
+{
+ // assumes that the first represents all for our purposes
+
+ if (region_views.size() > 0) {
+ AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(region_views.front());
+ if (arv) {
+ if (arv->waveform_rectified())
+ return Rectified;
+ }
+ }
+ return Traditional;
+}
+
+void
+AudioStreamView::set_waveform_scale (WaveformScale scale)
+{
+ for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
+ AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
+ if (arv)
+ arv->set_waveform_scale (scale);
+ }
+}
+
+WaveformScale
+AudioStreamView::get_waveform_scale () const
+{
+ // assumes that the first represents all for our purposes
+
+ if (region_views.size() > 0) {
+ AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(region_views.front());
+ if (arv) {
+ if (arv->waveform_logscaled())
+ return LogWaveform;
+ }
+ }
+ return LinearWaveform;
+}
+
void
AudioStreamView::setup_rec_box ()
{
diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h
index c6db40f336..ed9c8b7f7f 100644
--- a/gtk2_ardour/audio_streamview.h
+++ b/gtk2_ardour/audio_streamview.h
@@ -59,6 +59,9 @@ class AudioStreamView : public StreamView
~AudioStreamView ();
void set_waveform_shape (WaveformShape);
+ WaveformShape get_waveform_shape () const;
+ void set_waveform_scale (WaveformScale);
+ WaveformScale get_waveform_scale () const;
int set_height (gdouble h);
int set_samples_per_unit (gdouble spp);
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 45c8700a6a..81ef046eeb 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -253,14 +253,40 @@ AudioTimeAxisView::append_extra_display_menu_items ()
waveform_item->set_active (editor.show_waveforms());
ignore_toggle = false;
+ waveform_items.push_back (SeparatorElem());
+
RadioMenuItem::Group group;
-
+
waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
+ waveform_items.push_back (SeparatorElem());
+
+ RadioMenuItem::Group group2;
+
+ waveform_items.push_back (RadioMenuElem (group2, _("Linear"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LinearWaveform)));
+ linearscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
+
+ waveform_items.push_back (RadioMenuElem (group2, _("Logarithmic"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LogWaveform)));
+ logscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
+
+ // setting initial item state
+ AudioStreamView* asv = audio_view();
+ if (asv) {
+ ignore_toggle = true;
+ if (asv->get_waveform_shape() == Rectified)
+ rectified_item->set_active(true);
+ else traditional_item->set_active(true);
+
+ if (asv->get_waveform_scale() == LogWaveform)
+ logscale_item->set_active(true);
+ else linearscale_item->set_active(true);
+ ignore_toggle = false;
+ }
+
items.push_back (MenuElem (_("Waveform"), *waveform_menu));
}
@@ -303,7 +329,7 @@ AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
{
AudioStreamView* asv = audio_view();
- if (asv) {
+ if (asv && !ignore_toggle) {
asv->set_waveform_shape (shape);
}
@@ -311,6 +337,18 @@ AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
}
void
+AudioTimeAxisView::set_waveform_scale (WaveformScale scale)
+{
+ AudioStreamView* asv = audio_view();
+
+ if (asv && !ignore_toggle) {
+ asv->set_waveform_scale (scale);
+ }
+
+ map_frozen ();
+}
+
+void
AudioTimeAxisView::add_gain_automation_child ()
{
XMLProperty* prop;
diff --git a/gtk2_ardour/audio_time_axis.h b/gtk2_ardour/audio_time_axis.h
index 2162771285..95bd8c0955 100644
--- a/gtk2_ardour/audio_time_axis.h
+++ b/gtk2_ardour/audio_time_axis.h
@@ -98,6 +98,7 @@ class AudioTimeAxisView : public RouteTimeAxisView
void toggle_show_waveforms ();
void set_waveform_shape (WaveformShape);
void toggle_waveforms ();
+ void set_waveform_scale (WaveformScale);
void show_all_automation ();
void show_existing_automation ();
@@ -125,6 +126,8 @@ class AudioTimeAxisView : public RouteTimeAxisView
Gtk::CheckMenuItem* waveform_item;
Gtk::RadioMenuItem* traditional_item;
Gtk::RadioMenuItem* rectified_item;
+ Gtk::RadioMenuItem* linearscale_item;
+ Gtk::RadioMenuItem* logscale_item;
Gtk::CheckMenuItem* gain_automation_item;
Gtk::CheckMenuItem* pan_automation_item;
};
diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c
index 080f6871fa..747761ea9a 100644
--- a/gtk2_ardour/canvas-waveview.c
+++ b/gtk2_ardour/canvas-waveview.c
@@ -26,6 +26,7 @@
#include <ardour/dB.h>
+#include "logmeter.h"
#include "canvas-waveview.h"
#include "rgb_macros.h"
@@ -49,7 +50,8 @@ enum {
PROP_HEIGHT,
PROP_WAVE_COLOR,
PROP_RECTIFIED,
- PROP_REGION_START
+ PROP_REGION_START,
+ PROP_LOGSCALED,
};
static void gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class);
@@ -253,6 +255,13 @@ gnome_canvas_waveview_class_init (GnomeCanvasWaveViewClass *class)
g_param_spec_boolean ("rectified", NULL, NULL,
FALSE,
(G_PARAM_READABLE | G_PARAM_WRITABLE)));
+
+ g_object_class_install_property
+ (gobject_class,
+ PROP_LOGSCALED,
+ g_param_spec_boolean ("logscaled", NULL, NULL,
+ FALSE,
+ (G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_object_class_install_property
(gobject_class,
@@ -308,6 +317,7 @@ gnome_canvas_waveview_init (GnomeCanvasWaveView *waveview)
waveview->gain_curve_function = NULL;
waveview->gain_src = NULL;
waveview->rectified = FALSE;
+ waveview->logscaled = FALSE;
waveview->region_start = 0;
waveview->samples_per_unit = 1.0;
waveview->amplitude_above_axis = 1.0;
@@ -577,7 +587,29 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_
free (gain);
}
+
+ /* do optional log scaling. this implementation is not particularly efficient */
+ if (waveview->logscaled) {
+ guint32 n;
+ GnomeCanvasWaveViewCacheEntry* buf = cache->data;
+
+ for (n = 0; n < cache->data_size; ++n) {
+
+ if (buf[n].max > 0.0f) {
+ buf[n].max = alt_log_meter(coefficient_to_dB(buf[n].max));
+ } else if (buf[n].max < 0.0f) {
+ buf[n].max = -alt_log_meter(coefficient_to_dB(-buf[n].max));
+ }
+
+ if (buf[n].min > 0.0f) {
+ buf[n].min = alt_log_meter(coefficient_to_dB(buf[n].min));
+ } else if (buf[n].min < 0.0f) {
+ buf[n].min = -alt_log_meter(coefficient_to_dB(-buf[n].min));
+ }
+ }
+ }
+
cache->start = ostart;
cache->end = new_cache_end;
@@ -770,6 +802,17 @@ gnome_canvas_waveview_set_property (GObject *object,
redraw = TRUE;
}
break;
+ case PROP_LOGSCALED:
+ if (waveview->logscaled != g_value_get_boolean(value)) {
+ waveview->logscaled = g_value_get_boolean(value);
+ if (waveview->cache_updater) {
+ waveview->cache->start = 0;
+ waveview->cache->end = 0;
+ }
+ redraw = TRUE;
+ calc_bounds = TRUE;
+ }
+ break;
case PROP_REGION_START:
waveview->region_start = g_value_get_uint(value);
redraw = TRUE;
@@ -869,6 +912,10 @@ gnome_canvas_waveview_get_property (GObject *object,
g_value_set_boolean (value, waveview->rectified);
break;
+ case PROP_LOGSCALED:
+ g_value_set_boolean (value, waveview->logscaled);
+ break;
+
case PROP_REGION_START:
g_value_set_uint (value, waveview->region_start);
break;
diff --git a/gtk2_ardour/canvas-waveview.h b/gtk2_ardour/canvas-waveview.h
index 75281f69eb..81cf35910e 100644
--- a/gtk2_ardour/canvas-waveview.h
+++ b/gtk2_ardour/canvas-waveview.h
@@ -101,7 +101,8 @@ struct _GnomeCanvasWaveView
uint32_t wave_color;
char rectified;
-
+ char logscaled;
+
/* These are updated by the update() routine
to optimize the render() routine, which may
be called several times after a single update().
diff --git a/gtk2_ardour/enums.h b/gtk2_ardour/enums.h
index 15ba874366..5b097d059a 100644
--- a/gtk2_ardour/enums.h
+++ b/gtk2_ardour/enums.h
@@ -8,6 +8,11 @@ enum WaveformShape {
Rectified
};
+enum WaveformScale {
+ LinearWaveform=0,
+ LogWaveform,
+};
+
enum Width {
Wide,
diff --git a/gtk2_ardour/logmeter.h b/gtk2_ardour/logmeter.h
index f7ed1dd2be..8d9f0b9d82 100644
--- a/gtk2_ardour/logmeter.h
+++ b/gtk2_ardour/logmeter.h
@@ -1,7 +1,7 @@
#ifndef __ardour_gtk_log_meter_h__
#define __ardour_gtk_log_meter_h__
-#if 0
+#if 1
inline float
_log_meter (float power, double lower_db, double upper_db, double non_linearity)
{
@@ -9,7 +9,7 @@ _log_meter (float power, double lower_db, double upper_db, double non_linearity)
}
inline float
-log_meter (float power)
+alt_log_meter (float power)
{
return _log_meter (power, -192.0, 0.0, 8.0);
}
diff --git a/gtk2_ardour/waveview.cc b/gtk2_ardour/waveview.cc
index 05cc97701d..92e4fdd24a 100644
--- a/gtk2_ardour/waveview.cc
+++ b/gtk2_ardour/waveview.cc
@@ -268,6 +268,14 @@ Glib::PropertyProxy_ReadOnly<guint> WaveView::property_region_start() const
{
return Glib::PropertyProxy_ReadOnly<guint> (this, "region_start");
}
+Glib::PropertyProxy<gint> WaveView::property_logscaled()
+{
+ return Glib::PropertyProxy<gint> (this, "logscaled");
+}
+Glib::PropertyProxy_ReadOnly<gint> WaveView::property_logscaled() const
+{
+ return Glib::PropertyProxy_ReadOnly<gint> (this, "logscaled");
+}
} // namespace Canvas
diff --git a/gtk2_ardour/waveview.h b/gtk2_ardour/waveview.h
index 15efbbcef5..56d0ed7675 100644
--- a/gtk2_ardour/waveview.h
+++ b/gtk2_ardour/waveview.h
@@ -147,6 +147,8 @@ public:
Glib::PropertyProxy_ReadOnly<gint> property_rectified() const;
Glib::PropertyProxy<guint> property_region_start();
Glib::PropertyProxy_ReadOnly<guint> property_region_start() const;
+ Glib::PropertyProxy<gint> property_logscaled();
+ Glib::PropertyProxy_ReadOnly<gint> property_logscaled() const;
};
} /* namespace Canvas */
diff --git a/libs/libsndfile/SConscript b/libs/libsndfile/SConscript
index f8e9fc5ecb..5817397e95 100644
--- a/libs/libsndfile/SConscript
+++ b/libs/libsndfile/SConscript
@@ -6,8 +6,9 @@ import glob
sndfile_files = glob.glob('src/*.c') + glob.glob('src/GSM610/*.c') + glob.glob('src/G72x/*.c')
-Import('env install_prefix')
+Import('env install_prefix libraries')
sndfile = env.Copy()
+sndfile.Merge([libraries['flac'] ])
domain = 'libsndfile'
diff --git a/libs/libsndfile/configure b/libs/libsndfile/configure
index 8aaca4e783..bfa95c3aac 100755
--- a/libs/libsndfile/configure
+++ b/libs/libsndfile/configure
@@ -12235,9 +12235,17 @@ rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
+
+ cat conftest.$ac_ext > blah1.c
+
+ echo $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext > blah1
+
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
+
+ cat conftest.err > blah2
+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"