do not create timepos_t from timepos_t unnecessarily
This commit is contained in:
parent
40c29640f5
commit
2bad9e0a85
|
@ -675,13 +675,15 @@ Editor::mouse_add_new_marker (timepos_t where, bool is_cd)
|
||||||
string markername;
|
string markername;
|
||||||
int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark);
|
int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark);
|
||||||
|
|
||||||
|
cerr << "adding new marker @ " << where << endl;
|
||||||
|
|
||||||
if (_session) {
|
if (_session) {
|
||||||
_session->locations()->next_available_name(markername, _("mark"));
|
_session->locations()->next_available_name(markername, _("mark"));
|
||||||
if (!choose_new_marker_name(markername)) {
|
if (!choose_new_marker_name(markername)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Location *location = new Location (*_session, timepos_t (where), timepos_t (where), markername, (Location::Flags) flags);
|
Location *location = new Location (*_session, where, where, markername, (Location::Flags) flags);
|
||||||
begin_reversible_command (_("add marker"));
|
begin_reversible_command (_("add marker"));
|
||||||
|
|
||||||
XMLNode &before = _session->locations()->get_state();
|
XMLNode &before = _session->locations()->get_state();
|
||||||
|
@ -748,7 +750,7 @@ Editor::mouse_add_new_range (timepos_t where)
|
||||||
|
|
||||||
string name;
|
string name;
|
||||||
_session->locations()->next_available_name (name, _("range"));
|
_session->locations()->next_available_name (name, _("range"));
|
||||||
Location* loc = new Location (*_session, timepos_t (where), timepos_t (end), name, Location::IsRangeMarker);
|
Location* loc = new Location (*_session, where, end, name, Location::IsRangeMarker);
|
||||||
|
|
||||||
begin_reversible_command (_("new range marker"));
|
begin_reversible_command (_("new range marker"));
|
||||||
XMLNode& before = _session->locations()->get_state ();
|
XMLNode& before = _session->locations()->get_state ();
|
||||||
|
|
Loading…
Reference in New Issue