Compare commits
No commits in common. "3523de5272a1f1a99751e2714c5d371492f74226" and "ab9cab625fe9157837f81cd196ca3031faf1a70d" have entirely different histories.
3523de5272
...
ab9cab625f
@ -605,6 +605,7 @@ public:
|
||||
void metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>&, int64_t, int64_t, gint);
|
||||
|
||||
/* editing operations that need to be public */
|
||||
void mouse_add_new_marker (Temporal::timepos_t where, ARDOUR::Location::Flags extra_flags = ARDOUR::Location::Flags (0), int32_t cue_id = 0);
|
||||
void split_regions_at (Temporal::timepos_t const & , RegionSelection&);
|
||||
void split_region_at_points (std::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false);
|
||||
RegionSelection get_regions_from_selection_and_mouse (Temporal::timepos_t const &);
|
||||
@ -1622,7 +1623,7 @@ private:
|
||||
void set_selection_from_loop ();
|
||||
void set_selection_from_region ();
|
||||
|
||||
void add_location_mark_with_flag (Temporal::timepos_t const & where, ARDOUR::Location::Flags flag, int32_t cue_id);
|
||||
void add_location_mark (Temporal::timepos_t const & where);
|
||||
void add_location_from_region ();
|
||||
void add_locations_from_region ();
|
||||
void add_location_from_selection ();
|
||||
|
@ -1180,7 +1180,7 @@ Editor::section_rect_event (GdkEvent* ev, Location* loc, ArdourCanvas::Rectangle
|
||||
MenuList& items (section_box_menu.items());
|
||||
items.clear ();
|
||||
|
||||
items.push_back (MenuElem (_("New Arrangement Marker"), sigc::bind (sigc::mem_fun(*this, &Editor::add_location_mark_with_flag), where, Location::Flags(Location::IsMark | Location::IsSection), 0)));
|
||||
items.push_back (MenuElem (_("New Arrangement Marker"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, Location::Flags(Location::IsMark | Location::IsSection), 0)));
|
||||
items.push_back (MenuElem (_("Select Arrangement Section"), sigc::bind (sigc::mem_fun(*_sections, &EditorSections::select), l)));
|
||||
#if 0
|
||||
items.push_back (SeparatorElem());
|
||||
|
@ -828,6 +828,52 @@ Editor::LocationMarkers::setup_lines ()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::mouse_add_new_marker (timepos_t where, Location::Flags extra_flags, int32_t cue_id)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
}
|
||||
|
||||
string markername;
|
||||
string namebase;
|
||||
Location::Flags flags = Location::Flags (extra_flags|Location::IsMark);
|
||||
|
||||
if (flags & Location::IsCueMarker) {
|
||||
/* XXX i18n needed for cue letter names */
|
||||
markername = string_compose (_("cue %1"), cue_marker_name (cue_id));
|
||||
} else {
|
||||
if (flags & Location::IsSection) {
|
||||
namebase = _("section");
|
||||
} else {
|
||||
namebase = _("mark");
|
||||
}
|
||||
_session->locations()->next_available_name (markername, namebase);
|
||||
|
||||
if (!choose_new_marker_name (markername)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Location *location = new Location (*_session, where, where, markername, flags, cue_id);
|
||||
begin_reversible_command (_("add marker"));
|
||||
|
||||
XMLNode &before = _session->locations()->get_state();
|
||||
_session->locations()->add (location, true);
|
||||
XMLNode &after = _session->locations()->get_state();
|
||||
_session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));
|
||||
|
||||
/* find the marker we just added */
|
||||
|
||||
LocationMarkers *lam = find_location_markers (location);
|
||||
if (lam) {
|
||||
/* make it the selected marker */
|
||||
selection->set (lam->start);
|
||||
}
|
||||
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
void
|
||||
Editor::mouse_add_new_loop (timepos_t where)
|
||||
{
|
||||
|
@ -1797,14 +1797,14 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||
case MarkerBarItem:
|
||||
if (!_dragging_playhead) {
|
||||
snap_to_with_modifier (where, event, Temporal::RoundNearest, SnapToGrid_Scaled);
|
||||
add_location_mark (where);
|
||||
mouse_add_new_marker (where);
|
||||
}
|
||||
return true;
|
||||
|
||||
case SectionMarkerBarItem:
|
||||
if (!_dragging_playhead && Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
|
||||
snap_to_with_modifier (where, event, Temporal::RoundNearest, SnapToGrid_Scaled);
|
||||
add_location_mark (where, Location::IsSection);
|
||||
mouse_add_new_marker (where, Location::IsSection);
|
||||
}
|
||||
return true;
|
||||
|
||||
|
@ -2348,36 +2348,21 @@ Editor::add_location_from_selection ()
|
||||
}
|
||||
|
||||
void
|
||||
Editor::add_location_mark_with_flag (timepos_t const & where, Location::Flags flags, int32_t cue_id)
|
||||
Editor::add_location_mark (timepos_t const & where)
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_session->locations()->mark_at (where, timecnt_t (1))) {
|
||||
return;
|
||||
}
|
||||
|
||||
string markername;
|
||||
string namebase;
|
||||
|
||||
select_new_marker = true;
|
||||
|
||||
if (flags & Location::IsCueMarker) {
|
||||
/* XXX i18n needed for cue letter names */
|
||||
markername = string_compose (_("cue %1"), cue_marker_name (cue_id));
|
||||
} else if (flags & Location::IsSection) {
|
||||
namebase = _("section");
|
||||
} else {
|
||||
namebase = _("mark");
|
||||
}
|
||||
|
||||
_session->locations()->next_available_name(markername, namebase);
|
||||
|
||||
if (!choose_new_marker_name (markername)) {
|
||||
_session->locations()->next_available_name(markername,"mark");
|
||||
if (!choose_new_marker_name(markername)) {
|
||||
return;
|
||||
}
|
||||
Location *location = new Location (*_session, where, where, markername, flags);
|
||||
Location *location = new Location (*_session, where, where, markername, Location::IsMark);
|
||||
begin_reversible_command (_("add marker"));
|
||||
|
||||
XMLNode &before = _session->locations()->get_state();
|
||||
@ -2459,7 +2444,13 @@ Editor::add_location_from_playhead_cursor ()
|
||||
void
|
||||
Editor::add_section_marker_from_playhead_cursor ()
|
||||
{
|
||||
add_location_mark_with_flag (timepos_t (_session->audible_sample ()), Location::Flags (Location::IsMark|Location::IsSection), 0);
|
||||
timepos_t where = timepos_t(_session->audible_sample());
|
||||
add_location_mark (where);
|
||||
Location *mark = _session->locations()->mark_at (where);
|
||||
if (mark) {
|
||||
mark->set_section(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
@ -7270,7 +7261,7 @@ Editor::set_edit_point ()
|
||||
|
||||
if (selection->markers.empty()) {
|
||||
|
||||
add_location_mark (where);
|
||||
mouse_add_new_marker (where);
|
||||
|
||||
} else {
|
||||
bool ignored;
|
||||
|
@ -289,17 +289,17 @@ Editor::popup_ruler_menu (timepos_t const & where, ItemType t)
|
||||
Gtk::MenuItem& add_menu = ruler_items.back();
|
||||
Gtk::Menu* a_menu = new Gtk::Menu;
|
||||
MenuList& add_items = a_menu->items();
|
||||
add_items.push_back (MenuElem (_("Location Marker"), sigc::bind (sigc::mem_fun(*this, &Editor::add_location_mark_with_flag), where, Location::Flags (0), 0)));
|
||||
add_items.push_back (MenuElem (_("Arrangement Marker"), sigc::bind (sigc::mem_fun(*this, &Editor::add_location_mark_with_flag), where, Location::Flags(Location::IsMark | Location::IsSection), 0)));
|
||||
add_items.push_back (MenuElem (_("Location Marker"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, Location::Flags (0), 0)));
|
||||
add_items.push_back (MenuElem (_("Arrangement Marker"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, Location::Flags(Location::IsMark | Location::IsSection), 0)));
|
||||
#ifndef LIVETRAX
|
||||
add_items.push_back (MenuElem (_("CD Track Marker"), sigc::bind (sigc::mem_fun(*this, &Editor::add_location_mark_with_flag), where, Location::Flags(Location::IsMark |Location::IsCDMarker), 0)));
|
||||
add_items.push_back (MenuElem (_("CD Track Marker"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, Location::Flags(Location::IsMark |Location::IsCDMarker), 0)));
|
||||
add_items.push_back (MenuElem ("Cue Marker..."));
|
||||
Gtk::MenuItem& cue_submenu = add_items.back();
|
||||
Gtk::Menu* cue_menu = new Gtk::Menu;
|
||||
MenuList& cue_items = cue_menu->items();
|
||||
cue_items.push_back (MenuElem (_("Stop All Cues"), sigc::bind (sigc::mem_fun (*this, &Editor::add_location_mark_with_flag), where, Location::IsCueMarker, CueRecord::stop_all)));
|
||||
cue_items.push_back (MenuElem (_("Stop All Cues"), sigc::bind (sigc::mem_fun (*this, &Editor::mouse_add_new_marker), where, Location::IsCueMarker, CueRecord::stop_all)));
|
||||
for (int32_t n = 0; n < TriggerBox::default_triggers_per_box; ++n) {
|
||||
cue_items.push_back (MenuElem (string_compose (_("Cue %1"), cue_marker_name (n)), sigc::bind (sigc::mem_fun(*this, &Editor::add_location_mark_with_flag), where, Location::IsCueMarker, n)));
|
||||
cue_items.push_back (MenuElem (string_compose (_("Cue %1"), cue_marker_name (n)), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, Location::IsCueMarker, n)));
|
||||
}
|
||||
cue_submenu.set_submenu (*cue_menu);
|
||||
#endif
|
||||
|
@ -1037,7 +1037,7 @@ LuaInstance::register_classes (lua_State* L, bool sandbox)
|
||||
|
||||
.addRefFunction ("find_location_from_marker", &PublicEditor::find_location_from_marker)
|
||||
.addFunction ("find_marker_from_location_id", &PublicEditor::find_marker_from_location_id)
|
||||
.addFunction ("mouse_add_new_marker", &PublicEditor::add_location_mark)
|
||||
.addFunction ("mouse_add_new_marker", &PublicEditor::mouse_add_new_marker)
|
||||
#if 0
|
||||
.addFunction ("get_regions_at", &PublicEditor::get_regions_at)
|
||||
.addFunction ("get_regions_after", &PublicEditor::get_regions_after)
|
||||
|
@ -259,10 +259,7 @@ public:
|
||||
virtual void add_location_from_playhead_cursor () = 0;
|
||||
virtual void add_section_marker_from_playhead_cursor () = 0;
|
||||
virtual void remove_location_at_playhead_cursor () = 0;
|
||||
void add_location_mark (Temporal::timepos_t const & where, ARDOUR::Location::Flags flags = ARDOUR::Location::IsMark, int32_t cue_id = 0) {
|
||||
add_location_mark_with_flag (where, flags, cue_id);
|
||||
}
|
||||
virtual void add_location_mark_with_flag (Temporal::timepos_t const & where, ARDOUR::Location::Flags, int32_t cue_id) = 0;
|
||||
virtual void add_location_mark (Temporal::timepos_t const & where) = 0;
|
||||
virtual void update_grid () = 0;
|
||||
virtual void remove_tracks () = 0;
|
||||
virtual void set_loop_range (Temporal::timepos_t const & start, Temporal::timepos_t const & end, std::string cmd) = 0;
|
||||
@ -396,6 +393,7 @@ public:
|
||||
virtual void toggle_meter_updating() = 0;
|
||||
virtual void split_regions_at (Temporal::timepos_t const &, RegionSelection&) = 0;
|
||||
virtual void split_region_at_points (std::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false) = 0;
|
||||
virtual void mouse_add_new_marker (Temporal::timepos_t where, ARDOUR::Location::Flags extra_flags = ARDOUR::Location::Flags (0), int32_t cue_id = 0) = 0;
|
||||
virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0;
|
||||
virtual void add_to_idle_resize (TimeAxisView*, int32_t) = 0;
|
||||
virtual Temporal::timecnt_t get_nudge_distance (Temporal::timepos_t const & pos, Temporal::timecnt_t& next) = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user