diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-01-18 19:58:34 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-01-18 19:58:34 +0000 |
commit | df1da084eddfb2f9b2016595649b435be43c15d3 (patch) | |
tree | c28f5b9bf75fb803a722a72949f3b68172dc5a0f /gtk2_ardour/editor_ops.cc | |
parent | 7356c65a2a35c8059d5132df7e9f149617952232 (diff) |
permit OSX native package without JACK; prevent excessive track name lengths from messing up JACK port names; splash screen tweaks for OS X; new region gain control operations ; work on AU plugin GUIs (totally incomplete); don't needlessly create prompters in a barcontroller (create on demand)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2938 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index eba74abe60..51a6d294cd 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -47,6 +47,7 @@ #include <ardour/region_factory.h> #include <ardour/playlist_factory.h> #include <ardour/reverse.h> +#include <ardour/dB.h> #include "ardour_ui.h" #include "editor.h" @@ -62,6 +63,7 @@ #include "gtk-custom-hruler.h" #include "gui_thread.h" #include "keyboard.h" +#include "utils.h" #include "i18n.h" @@ -4090,6 +4092,8 @@ Editor::denormalize_region () return; } + ExclusiveRegionSelection (*this, entered_regionview); + if (selection->regions.empty()) { return; } @@ -4108,6 +4112,62 @@ Editor::denormalize_region () commit_reversible_command (); } +void +Editor::adjust_region_scale_amplitude (bool up) +{ + if (!session) { + return; + } + + ExclusiveRegionSelection (*this, entered_regionview); + + if (selection->regions.empty()) { + return; + } + + begin_reversible_command ("denormalize"); + + for (RegionSelection::iterator r = selection->regions.begin(); r != selection->regions.end(); ++r) { + AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*r); + if (!arv) + continue; + XMLNode &before = arv->region()->get_state(); + + double fraction = gain_to_slider_position (arv->audio_region()->scale_amplitude ()); + + cerr << "slider pos for " << arv->audio_region()->scale_amplitude () + << " = " << fraction + << endl; + + if (up) { + fraction += 0.05; + fraction = min (fraction, 1.0); + } else { + fraction -= 0.05; + fraction = max (fraction, 0.0); + } + + if (!up && fraction <= 0) { + continue; + } + + if (up && fraction >= 1.0) { + continue; + } + + fraction = slider_position_to_gain (fraction); + fraction = coefficient_to_dB (fraction); + fraction = dB_to_coefficient (fraction); + + cerr << "set scale amp for " << arv->audio_region()->name() << " to " << fraction << endl; + + arv->audio_region()->set_scale_amplitude (fraction); + session->add_command (new MementoCommand<Region>(*(arv->region().get()), &before, &arv->region()->get_state())); + } + + commit_reversible_command (); +} + void Editor::reverse_region () |