incorrect but visible context menu for xfades
git-svn-id: svn://localhost/ardour2/branches/3.0@12243 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
7628316335
commit
c6d983bda5
@ -1341,6 +1341,67 @@ 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)
|
||||||
|
{
|
||||||
|
using namespace Menu_Helpers;
|
||||||
|
|
||||||
|
MenuList& items (xfade_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 ();
|
||||||
|
}
|
||||||
|
|
||||||
|
xfade_context_menu.popup (button, time);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Pop up a context menu for when the user clicks on a fade in or fade out */
|
/** Pop up a context menu for when the user clicks on a fade in or fade out */
|
||||||
void
|
void
|
||||||
Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
|
Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* item, ItemType item_type)
|
||||||
@ -1358,9 +1419,6 @@ Editor::popup_fade_context_menu (int button, int32_t time, ArdourCanvas::Item* i
|
|||||||
items.clear ();
|
items.clear ();
|
||||||
|
|
||||||
switch (item_type) {
|
switch (item_type) {
|
||||||
case StartCrossFadeItem:
|
|
||||||
case EndCrossFadeItem:
|
|
||||||
break;
|
|
||||||
case FadeInItem:
|
case FadeInItem:
|
||||||
case FadeInHandleItem:
|
case FadeInHandleItem:
|
||||||
if (arv->audio_region()->fade_in_active()) {
|
if (arv->audio_region()->fade_in_active()) {
|
||||||
@ -5297,6 +5355,13 @@ Editor::setup_fade_images ()
|
|||||||
_fade_out_images[FadeLogB] = new Gtk::Image (get_icon_path (X_("crossfade-out-slow-cut")));
|
_fade_out_images[FadeLogB] = new Gtk::Image (get_icon_path (X_("crossfade-out-slow-cut")));
|
||||||
_fade_out_images[FadeLogA] = new Gtk::Image (get_icon_path (X_("crossfade-out-fast-cut")));
|
_fade_out_images[FadeLogA] = new Gtk::Image (get_icon_path (X_("crossfade-out-fast-cut")));
|
||||||
_fade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("crossfade-out-long-cut")));
|
_fade_out_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("crossfade-out-long-cut")));
|
||||||
|
|
||||||
|
_xfade_images[FadeLinear] = new Gtk::Image (get_icon_path (X_("crossfade-out-linear")));
|
||||||
|
_xfade_images[FadeFast] = new Gtk::Image (get_icon_path (X_("crossfade-out-short-cut")));
|
||||||
|
_xfade_images[FadeLogB] = new Gtk::Image (get_icon_path (X_("crossfade-out-slow-cut")));
|
||||||
|
_xfade_images[FadeLogA] = new Gtk::Image (get_icon_path (X_("crossfade-out-fast-cut")));
|
||||||
|
_xfade_images[FadeSlow] = new Gtk::Image (get_icon_path (X_("crossfade-out-long-cut")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return Gtk::manage()d menu item for a given action from `editor_actions' */
|
/** @return Gtk::manage()d menu item for a given action from `editor_actions' */
|
||||||
|
@ -1337,6 +1337,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||||||
Gtk::Menu fade_context_menu;
|
Gtk::Menu fade_context_menu;
|
||||||
void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
|
void popup_fade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
|
||||||
|
|
||||||
|
Gtk::Menu xfade_context_menu;
|
||||||
|
void popup_xfade_context_menu (int, int, ArdourCanvas::Item*, ItemType);
|
||||||
|
|
||||||
void set_fade_in_shape (ARDOUR::FadeShape);
|
void set_fade_in_shape (ARDOUR::FadeShape);
|
||||||
void set_fade_out_shape (ARDOUR::FadeShape);
|
void set_fade_out_shape (ARDOUR::FadeShape);
|
||||||
|
|
||||||
@ -2059,6 +2062,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||||||
void setup_fade_images ();
|
void setup_fade_images ();
|
||||||
std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_in_images;
|
std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_in_images;
|
||||||
std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_out_images;
|
std::map<ARDOUR::FadeShape, Gtk::Image*> _fade_out_images;
|
||||||
|
std::map<ARDOUR::FadeShape, Gtk::Image*> _xfade_images;
|
||||||
|
|
||||||
Gtk::MenuItem& action_menu_item (std::string const &);
|
Gtk::MenuItem& action_menu_item (std::string const &);
|
||||||
void action_pre_activated (Glib::RefPtr<Gtk::Action> const &);
|
void action_pre_activated (Glib::RefPtr<Gtk::Action> const &);
|
||||||
|
@ -989,7 +989,7 @@ class CrossfadeEdgeDrag : public Drag
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
virtual std::pair<ARDOUR::framecnt_t, int> move_threshold () const {
|
||||||
return std::make_pair (1, 1);
|
return std::make_pair (4, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1483,6 +1483,14 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||||||
popup_fade_context_menu (1, event->button.time, item, item_type);
|
popup_fade_context_menu (1, event->button.time, item, item_type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case StartCrossFadeItem:
|
||||||
|
popup_xfade_context_menu (1, event->button.time, item, item_type);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EndCrossFadeItem:
|
||||||
|
popup_xfade_context_menu (1, event->button.time, item, item_type);
|
||||||
|
break;
|
||||||
|
|
||||||
case StreamItem:
|
case StreamItem:
|
||||||
popup_track_context_menu (1, event->button.time, item_type, false);
|
popup_track_context_menu (1, event->button.time, item_type, false);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user