- bool inconsistent;
- switch (styles) {
- case 1:
- case 2:
- case 4:
- inconsistent = false;
- break;
- default:
- inconsistent = true;
- break;
- }
-
- RadioMenuItem* i;
-
- if (!inconsistent && first_track) {
-
- alignment_items.push_back (RadioMenuElem (align_group, _("Automatic (based on I/O connections)")));
- i = dynamic_cast<RadioMenuItem*> (&alignment_items.back());
- i->set_active (automatic != 0 && existing == 0 && capture == 0);
- i->signal_activate().connect (sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::set_align_choice), i, Automatic, true));
-
- switch (first_track->alignment_choice()) {
- case Automatic:
- switch (first_track->alignment_style()) {
- case ExistingMaterial:
- alignment_items.push_back (MenuElem (_("(Currently: Existing Material)")));
- break;
- case CaptureTime:
- alignment_items.push_back (MenuElem (_("(Currently: Capture Time)")));
- break;
- }
- break;
- default:
- break;
- }
-
- alignment_items.push_back (RadioMenuElem (align_group, _("Align With Existing Material")));
- i = dynamic_cast<RadioMenuItem*> (&alignment_items.back());
- i->set_active (existing != 0 && capture == 0 && automatic == 0);
- i->signal_activate().connect (sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::set_align_choice), i, UseExistingMaterial, true));
-
- alignment_items.push_back (RadioMenuElem (align_group, _("Align With Capture Time")));
- i = dynamic_cast<RadioMenuItem*> (&alignment_items.back());
- i->set_active (existing == 0 && capture != 0 && automatic == 0);
- i->signal_activate().connect (sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::set_align_choice), i, UseCaptureTime, true));
-
- items.push_back (MenuElem (_("Alignment"), *alignment_menu));
-
- } else {
- /* show nothing */
- }
-
- Menu* mode_menu = manage (new Menu);
- MenuList& mode_items = mode_menu->items ();
- mode_menu->set_name ("ArdourContextMenu");
-
- RadioMenuItem::Group mode_group;
-
- int normal = 0;
- int tape = 0;
- int non_layered = 0;
-
- for (TrackSelection::const_iterator i = s.begin(); i != s.end(); ++i) {
- RouteTimeAxisView* r = dynamic_cast<RouteTimeAxisView*> (*i);
- if (!r || !r->is_track ()) {
- continue;