#include "canvas/item.h"
#include "canvas/rectangle.h"
+#include "widgets/prompter.h"
+
#include "editor.h"
#include "marker.h"
#include "selection.h"
#include "editing.h"
#include "gui_thread.h"
#include "actions.h"
-#include "prompter.h"
#include "editor_drag.h"
#include "pbd/i18n.h"
}
location->name_changed.connect (*this, invalidator (*this), boost::bind (&Editor::location_changed, this, _1), gui_context());
+ location->position_lock_style_changed.connect (*this, invalidator (*this), boost::bind (&Editor::location_changed, this, _1), gui_context());
location->FlagsChanged.connect (*this, invalidator (*this), boost::bind (&Editor::location_flags_changed, this, location), gui_context());
pair<Location*,LocationMarkers*> newpair;
return;
}
- lam->set_name (location->name ());
+ if (location->position_lock_style() == MusicTime) {
+ lam->set_name ("\u266B" + location->name ()); // BEAMED EIGHTH NOTES
+ } else {
+ lam->set_name (location->name ());
+ }
+
lam->set_position (location->start(), location->end());
if (location->is_auto_loop()) {
Location* loc = find_location_from_marker (marker, is_start);
if (_session && loc) {
- Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::really_remove_marker), loc));
+ Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::really_remove_marker), loc));
}
}
can_remove = !mm->meter().initial ();
delete meter_marker_menu;
build_meter_marker_menu (mm, can_remove);
- meter_marker_menu->popup (ev->button, ev->time);
+ meter_marker_menu->popup (1, ev->time);
} else if (tm) {
if (!tm->tempo().active()) {
return;
can_remove = !tm->tempo().initial() && !tm->tempo().locked_to_meter();
delete tempo_marker_menu;
build_tempo_marker_menu (tm, can_remove);
- tempo_marker_menu->popup (ev->button, ev->time);
+ tempo_marker_menu->popup (1, ev->time);
} else {
return;
}
build_range_marker_menu (loc, loc == transport_loop_location() || loc == transport_punch_location(), loc->is_session_range());
marker_menu_item = item;
- transport_marker_menu->popup (ev->button, ev->time);
+ transport_marker_menu->popup (1, ev->time);
} else if (loc->is_mark()) {
}
#endif
marker_menu_item = item;
- marker_menu->popup (ev->button, ev->time);
+ marker_menu->popup (1, ev->time);
} else if (loc->is_range_marker()) {
delete range_marker_menu;
build_range_marker_menu (loc, false, false);
marker_menu_item = item;
- range_marker_menu->popup (ev->button, ev->time);
+ range_marker_menu->popup (1, ev->time);
}
}
build_new_transport_marker_menu ();
}
- new_transport_marker_menu->popup (ev->button, ev->time);
+ new_transport_marker_menu->popup (1, ev->time);
}
if (!loc->tempo().initial()) {
if (loc->tempo().clamped()) {
- items.push_back (MenuElem (_("Unlock Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
+ items.push_back (MenuElem (_("Don't Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
} else {
- items.push_back (MenuElem (_("Lock Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
+ items.push_back (MenuElem (_("Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
}
+ }
- TempoSection* prev_ts = _session->tempo_map().previous_tempo_section (&loc->tempo());
- if (prev_ts && prev_ts->end_note_types_per_minute() != loc->tempo().note_types_per_minute()) {
- items.push_back (MenuElem (_("Continue"), sigc::mem_fun(*this, &Editor::continue_previous_tempo)));
- }
+ if (loc->tempo().type() == TempoSection::Ramp) {
+ items.push_back (MenuElem (_("Set Constant"), sigc::mem_fun(*this, &Editor::toggle_tempo_type)));
}
TempoSection* next_ts = _session->tempo_map().next_tempo_section (&loc->tempo());
items.push_back (MenuElem (_("Ramp to Next"), sigc::mem_fun(*this, &Editor::ramp_to_next_tempo)));
}
- if (loc->tempo().type() == TempoSection::Ramp) {
- items.push_back (MenuElem (_("Set Constant"), sigc::mem_fun(*this, &Editor::toggle_tempo_type)));
- }
-
if (loc->tempo().position_lock_style() == AudioTime && can_remove) {
+ items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Lock to Music"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style)));
} else if (can_remove) {
+ items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Lock to Audio"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style)));
}
+ items.push_back (SeparatorElem());
+
items.push_back (MenuElem (_("Edit..."), sigc::mem_fun(*this, &Editor::marker_menu_edit)));
items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &Editor::marker_menu_remove)));
items.back().set_sensitive (can_remove);
bool is_start;
if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
- set_selection_from_range (*l);
+ set_selection_from_range (*l);
}
}
bool is_start;
if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
- select_all_within (l->start(), l->end() - 1, 0, DBL_MAX, track_views, Selection::Set, false);
+ select_all_within (l->start(), l->end() - 1, 0, DBL_MAX, track_views, Selection::Set, false);
}
}
bool is_start;
if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
- separate_regions_using_location (*l);
+ separate_regions_using_location (*l);
}
}
bool is_start;
if ((l = find_location_from_marker (marker, is_start)) != 0) {
- Location* l2;
- if ((l2 = transport_loop_location()) != 0) {
- l2->set (l->start(), l->end());
-
- // enable looping, reposition and start rolling
- _session->request_locate (l2->start(), true);
- _session->request_play_loop(true);
+ if (l != transport_loop_location()) {
+ set_loop_range (l->start(), l->end(), _("loop range from marker"));
}
+ _session->request_locate (l->start(), true);
+ _session->request_play_loop (true);
}
}
}
}
-void
-Editor::continue_previous_tempo ()
-{
- TempoMarker* tm;
- MeterMarker* mm;
- dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
-
- if (tm) {
- TempoMap& tmap (_session->tempo_map());
- TempoSection* tsp = &tm->tempo();
- TempoSection* prev_ts = tmap.previous_tempo_section (&tm->tempo());
- if (prev_ts) {
- const Tempo tempo (prev_ts->end_note_types_per_minute(), tsp->note_type(), tsp->end_note_types_per_minute());
- const double pulse = tsp->pulse();
- const framepos_t frame = tsp->frame();
- const PositionLockStyle pls = tsp->position_lock_style();
-
- begin_reversible_command (_("continue previous tempo"));
- XMLNode &before = _session->tempo_map().get_state();
-
- tmap.replace_tempo (*tsp, tempo, pulse, frame, pls);
-
- XMLNode &after = _session->tempo_map().get_state();
- _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
- commit_reversible_command ();
- }
- }
-}
-
void
Editor::ramp_to_next_tempo ()
{
loc = find_location_from_marker (marker, is_start);
- if (!loc)
- return;
+ if (!loc) {
+ return;
+ }
- if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range())
+ if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range()) {
return;
+ }
- ArdourPrompter dialog (true);
+ ArdourWidgets::Prompter dialog (true);
string txt;
dialog.set_prompt (_("New Name:"));
} else {
- transport_punch_range_rect->hide();
+ transport_punch_range_rect->hide();
}
}
}
struct SortLocationsByPosition {
- bool operator() (Location* a, Location* b) {
- return a->start() < b->start();
- }
+ bool operator() (Location* a, Location* b) {
+ return a->start() < b->start();
+ }
};
void