summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-05-11 21:30:36 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-05-11 21:30:36 +0000
commita98fa4bc61e26cd94aeb6720325633c4e6618155 (patch)
tree21e55518ce42e5ffe3e974b32e10192525627b82 /gtk2_ardour/editor.cc
parent4d780bdcd0009943ec292dfd2177e60804d91245 (diff)
switch to 5 new fade curves, taken from mixbus2 branch. make xfade context menus functional even though the images are not accurate
git-svn-id: svn://localhost/ardour2/branches/3.0@12253 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r--gtk2_ardour/editor.cc218
1 files changed, 127 insertions, 91 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 6dfe47230f..5e3810977c 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -1341,64 +1341,98 @@ Editor::action_pre_activated (Glib::RefPtr<Action> const & a)
}
}
-/** Pop up a context menu for when the user clicks on a crossfade */
void
-Editor::popup_xfade_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
+Editor::fill_xfade_menu (Menu_Helpers::MenuList& items, bool start)
{
using namespace Menu_Helpers;
- MenuList& items (xfade_context_menu.items());
+ void (Editor::*emf)(FadeShape);
+ std::map<ARDOUR::FadeShape,Gtk::Image*>* images;
+
+ if (start) {
+ images = &_xfade_in_images;
+ emf = &Editor::set_fade_in_shape;
+ } else {
+ images = &_xfade_out_images;
+ emf = &Editor::set_fade_out_shape;
+ }
+
+ items.push_back (
+ ImageMenuElem (
+ _("Linear (for highly correlated material)"),
+ *(*images)[FadeLinear],
+ sigc::bind (sigc::mem_fun (*this, emf), FadeLinear)
+ )
+ );
+
+ dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
+
+ items.push_back (
+ ImageMenuElem (
+ _("ConstantPower"),
+ *(*images)[FadeConstantPower],
+ sigc::bind (sigc::mem_fun (*this, emf), FadeConstantPower)
+ ));
+
+ dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
+ items.push_back (
+ ImageMenuElem (
+ _("Symmetric"),
+ *(*images)[FadeSymmetric],
+ sigc::bind (sigc::mem_fun (*this, emf), FadeSymmetric)
+ )
+ );
+
+ dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
+
+ items.push_back (
+ ImageMenuElem (
+ _("Slow"),
+ *(*images)[FadeSlow],
+ sigc::bind (sigc::mem_fun (*this, emf), FadeSlow)
+ ));
+
+ dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
+
+ items.push_back (
+ ImageMenuElem (
+ _("Fast"),
+ *(*images)[FadeFast],
+ sigc::bind (sigc::mem_fun (*this, emf), FadeFast)
+ ));
+
+ dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
+}
+
+/** Pop up a context menu for when the user clicks on a start crossfade */
+void
+Editor::popup_xfade_in_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
+{
+ using namespace Menu_Helpers;
+
+ MenuList& items (xfade_in_context_menu.items());
+
if (items.empty()) {
- items.push_back (
- ImageMenuElem (
- _("Linear (for highly correlated material)"),
- *_xfade_images[FadeLinear],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLinear)
- )
- );
-
- dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
-
- items.push_back (
- ImageMenuElem (
- _("ConstantPower (-6dB)"),
- *_xfade_images[FadeFast],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeFast)
- ));
-
- dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
-
- items.push_back (
- ImageMenuElem (
- _("Linear-dB"),
- *_xfade_images[FadeSlow],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeSlow)
- )
- );
-
- dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
-
- items.push_back (
- ImageMenuElem (
- _("Smooth"),
- *_xfade_images[FadeLogB],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLogB)
- ));
-
- dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
-
- items.push_back (
- ImageMenuElem (
- _("Fast"),
- *_xfade_images[FadeLogA],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLogA)
- ));
-
- dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
+ fill_xfade_menu (items, true);
+ }
+
+ xfade_in_context_menu.popup (button, time);
+}
+
+/** Pop up a context menu for when the user clicks on an end crossfade */
+void
+Editor::popup_xfade_out_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
+{
+ using namespace Menu_Helpers;
+
+ MenuList& items (xfade_out_context_menu.items());
+
+ if (items.empty()) {
+ fill_xfade_menu (items, false);
}
- xfade_context_menu.popup (button, time);
+ xfade_out_context_menu.popup (button, time);
}
@@ -1448,36 +1482,34 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i
items.push_back (
ImageMenuElem (
- _("Slowest"),
- *_fade_in_images[FadeFast],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeFast)
+ _("Slow"),
+ *_fade_in_images[FadeSlow],
+ sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeSlow)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
- _("Slow"),
- *_fade_in_images[FadeLogB],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLogB)
+ _("Fast"),
+ *_fade_in_images[FadeFast],
+ sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeFast)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
- _("Fast"),
- *_fade_in_images[FadeLogA],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeLogA)
+ _("Symmetric"),
+ *_fade_in_images[FadeSlow],
+ sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeSymmetric)
));
- dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
-
items.push_back (
ImageMenuElem (
- _("Fastest"),
- *_fade_in_images[FadeSlow],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeSlow)
+ _("Constant Power"),
+ *_fade_in_images[FadeConstantPower],
+ sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_in_shape), FadeConstantPower)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
@@ -1512,8 +1544,8 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i
items.push_back (
ImageMenuElem (
- _("Slowest"),
- *_fade_out_images[FadeFast],
+ _("Slow"),
+ *_fade_out_images[FadeSlow],
sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeSlow)
));
@@ -1521,27 +1553,25 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i
items.push_back (
ImageMenuElem (
- _("Slow"),
- *_fade_out_images[FadeLogB],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeLogA)
+ _("Fast"),
+ *_fade_out_images[FadeFast],
+ sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeFast)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
items.push_back (
ImageMenuElem (
- _("Fast"),
- *_fade_out_images[FadeLogA],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeLogB)
+ _("Symmetric"),
+ *_fade_out_images[FadeSlow],
+ sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeSymmetric)
));
- dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
-
items.push_back (
ImageMenuElem (
- _("Fastest"),
- *_fade_out_images[FadeSlow],
- sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeFast)
+ _("Constant Power"),
+ *_fade_out_images[FadeConstantPower],
+ sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_out_shape), FadeConstantPower)
));
dynamic_cast<ImageMenuItem*>(&items.back())->set_always_show_image ();
@@ -5345,22 +5375,28 @@ void
Editor::setup_fade_images ()
{
_fade_in_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadein-linear")));
- _fade_in_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadein-short-cut")));
- _fade_in_images[FadeLogB] = new Gtk::Image (get_icon_path (X_("fadein-slow-cut")));
- _fade_in_images[FadeLogA] = new Gtk::Image (get_icon_path (X_("fadein-fast-cut")));
- _fade_in_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadein-long-cut")));
+ _fade_in_images[FadeSymmetric] = new Gtk::Image (get_icon_path (X_("fadein-short-cut")));
+ _fade_in_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadein-slow-cut")));
+ _fade_in_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadein-fast-cut")));
+ _fade_in_images[FadeConstantPower] = new Gtk::Image (get_icon_path (X_("fadein-long-cut")));
_fade_out_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadeout-linear")));
- _fade_out_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadeout-short-cut")));
- _fade_out_images[FadeLogB] = new Gtk::Image (get_icon_path (X_("fadeout-slow-cut")));
- _fade_out_images[FadeLogA] = new Gtk::Image (get_icon_path (X_("fadeout-fast-cut")));
- _fade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadeout-long-cut")));
-
- _xfade_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadeout-linear")));
- _xfade_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadeout-short-cut")));
- _xfade_images[FadeLogB] = new Gtk::Image (get_icon_path (X_("fadeout-slow-cut")));
- _xfade_images[FadeLogA] = new Gtk::Image (get_icon_path (X_("fadeout-fast-cut")));
- _xfade_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadeout-long-cut")));
+ _fade_out_images[FadeSymmetric] = new Gtk::Image (get_icon_path (X_("fadeout-short-cut")));
+ _fade_out_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadeout-slow-cut")));
+ _fade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadeout-fast-cut")));
+ _fade_out_images[FadeConstantPower] = new Gtk::Image (get_icon_path (X_("fadeout-long-cut")));
+
+ _xfade_in_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadeout-linear")));
+ _xfade_in_images[FadeSymmetric] = new Gtk::Image (get_icon_path (X_("fadeout-short-cut")));
+ _xfade_in_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadeout-slow-cut")));
+ _xfade_in_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadeout-fast-cut")));
+ _xfade_in_images[FadeConstantPower] = new Gtk::Image (get_icon_path (X_("fadeout-long-cut")));
+
+ _xfade_out_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("fadeout-linear")));
+ _xfade_out_images[FadeSymmetric] = new Gtk::Image (get_icon_path (X_("fadeout-short-cut")));
+ _xfade_out_images[FadeFast] = new Gtk::Image (get_icon_path (X_("fadeout-slow-cut")));
+ _xfade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("fadeout-fast-cut")));
+ _xfade_out_images[FadeConstantPower] = new Gtk::Image (get_icon_path (X_("fadeout-long-cut")));
}