Make the session start/end location a single location (with start and end) rather than two separate ones. Fixes #1298.
git-svn-id: svn://localhost/ardour2/branches/3.0@6929 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
d9cac66b5d
commit
895bad1dcd
|
@ -344,7 +344,7 @@ Editor::Editor ()
|
|||
editor_ruler_menu = 0;
|
||||
no_ruler_shown_update = false;
|
||||
marker_menu = 0;
|
||||
start_end_marker_menu = 0;
|
||||
session_range_marker_menu = 0;
|
||||
range_marker_menu = 0;
|
||||
marker_menu_item = 0;
|
||||
tm_marker_menu = 0;
|
||||
|
@ -1105,7 +1105,7 @@ Editor::set_session (Session *t)
|
|||
_session->locations()->removed.connect (_session_connections, invalidator (*this), ui_bind (&Editor::location_gone, this, _1), gui_context());
|
||||
_session->locations()->changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::refresh_location_display, this), gui_context());
|
||||
_session->locations()->StateChanged.connect (_session_connections, invalidator (*this), ui_bind (&Editor::refresh_location_display_s, this, _1), gui_context());
|
||||
_session->locations()->end_location()->changed.connect (_session_connections, invalidator (*this), ui_bind (&Editor::end_location_changed, this, _1), gui_context());
|
||||
_session->locations()->session_range_location()->changed.connect (_session_connections, invalidator (*this), ui_bind (&Editor::session_range_location_changed, this, _1), gui_context());
|
||||
_session->history().Changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::history_changed, this), gui_context());
|
||||
|
||||
if (Profile->get_sae()) {
|
||||
|
@ -3886,11 +3886,11 @@ Editor::get_nudge_distance (nframes64_t pos, nframes64_t& next)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::end_location_changed (Location* location)
|
||||
Editor::session_range_location_changed (Location* location)
|
||||
{
|
||||
ENSURE_GUI_THREAD (*this, &Editor::end_location_changed, location)
|
||||
ENSURE_GUI_THREAD (*this, &Editor::session_range_location_changed, location)
|
||||
//reset_scrolling_region ();
|
||||
nframes64_t session_span = location->start() + (nframes64_t) floorf (current_page_frames() * 0.10f);
|
||||
nframes64_t const session_span = location->end() + (nframes64_t) floorf (current_page_frames() * 0.10f);
|
||||
horizontal_adjustment.set_upper (session_span / frames_per_unit);
|
||||
}
|
||||
|
||||
|
|
|
@ -977,7 +977,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||
void queue_visual_change_y (double);
|
||||
void ensure_visual_change_idle_handler ();
|
||||
|
||||
void end_location_changed (ARDOUR::Location*);
|
||||
void session_range_location_changed (ARDOUR::Location*);
|
||||
|
||||
/* track views */
|
||||
TrackViewList track_views;
|
||||
|
@ -1468,13 +1468,13 @@ public:
|
|||
void transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
|
||||
void new_transport_marker_context_menu (GdkEventButton*, ArdourCanvas::Item*);
|
||||
void build_range_marker_menu (bool loop_or_punch);
|
||||
void build_marker_menu (bool start_or_end);
|
||||
void build_marker_menu (bool);
|
||||
void build_tm_marker_menu ();
|
||||
void build_new_transport_marker_menu ();
|
||||
|
||||
Gtk::Menu* tm_marker_menu;
|
||||
Gtk::Menu* marker_menu;
|
||||
Gtk::Menu* start_end_marker_menu;
|
||||
Gtk::Menu* session_range_marker_menu;
|
||||
Gtk::Menu* range_marker_menu;
|
||||
Gtk::Menu* transport_marker_menu;
|
||||
Gtk::Menu* new_transport_marker_menu;
|
||||
|
|
|
@ -2491,10 +2491,10 @@ MarkerDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
|||
break;
|
||||
}
|
||||
|
||||
/* set up copies for us to manipulate during the drag */
|
||||
/* Set up copies for us to manipulate during the drag */
|
||||
|
||||
for (MarkerSelection::iterator i = _editor->selection->markers.begin(); i != _editor->selection->markers.end(); ++i) {
|
||||
Location *l = _editor->find_location_from_marker (*i, is_start);
|
||||
Location* l = _editor->find_location_from_marker (*i, is_start);
|
||||
_copied_locations.push_back (new Location (*l));
|
||||
}
|
||||
}
|
||||
|
@ -2506,7 +2506,7 @@ MarkerDrag::motion (GdkEvent* event, bool)
|
|||
bool is_start;
|
||||
bool move_both = false;
|
||||
Marker* marker;
|
||||
Location *real_location;
|
||||
Location *real_location;
|
||||
Location *copy_location = 0;
|
||||
|
||||
nframes64_t const newframe = adjusted_current_frame (event);
|
||||
|
@ -2592,7 +2592,7 @@ MarkerDrag::motion (GdkEvent* event, bool)
|
|||
|
||||
if (copy_location->is_mark()) {
|
||||
|
||||
/* just move it */
|
||||
/* now move it */
|
||||
|
||||
copy_location->set_start (copy_location->start() + f_delta);
|
||||
|
||||
|
|
|
@ -101,6 +101,11 @@ Editor::add_new_location (Location *location)
|
|||
lam->end = new Marker (*this, *transport_marker_group, color,
|
||||
location->name(), Marker::PunchOut, location->end());
|
||||
|
||||
} else if (location->is_session_range()) {
|
||||
// session range
|
||||
lam->start = new Marker (*this, *marker_group, color, _("start"), Marker::Start, location->start());
|
||||
lam->end = new Marker (*this, *marker_group, color, _("end"), Marker::End, location->end());
|
||||
|
||||
} else {
|
||||
// range marker
|
||||
if (location->is_cd_marker() && ruler_cd_marker_action->get_active()) {
|
||||
|
@ -110,7 +115,6 @@ Editor::add_new_location (Location *location)
|
|||
location->name(), Marker::End, location->end());
|
||||
}
|
||||
else {
|
||||
|
||||
lam->start = new Marker (*this, *range_marker_group, color,
|
||||
location->name(), Marker::Start, location->start());
|
||||
lam->end = new Marker (*this, *range_marker_group, color,
|
||||
|
@ -155,7 +159,7 @@ Editor::location_changed (Location *location)
|
|||
return;
|
||||
}
|
||||
|
||||
lam->set_name (location->name());
|
||||
lam->set_name (location->name ());
|
||||
lam->set_position (location->start(), location->end());
|
||||
|
||||
if (location->is_auto_loop()) {
|
||||
|
@ -365,8 +369,15 @@ Editor::LocationMarkers::show()
|
|||
void
|
||||
Editor::LocationMarkers::set_name (const string& str)
|
||||
{
|
||||
start->set_name (str);
|
||||
if (end) { end->set_name (str); }
|
||||
/* XXX: hack: don't change names of session start/end markers */
|
||||
|
||||
if (start->type() != Marker::Start) {
|
||||
start->set_name (str);
|
||||
}
|
||||
|
||||
if (end && end->type() != Marker::End) {
|
||||
end->set_name (str);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -510,12 +521,12 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
|
|||
} else {
|
||||
|
||||
if (loc->is_mark()) {
|
||||
bool start_or_end = loc->is_start() || loc->is_end();
|
||||
Menu *markerMenu;
|
||||
if (start_or_end) {
|
||||
if (start_end_marker_menu == 0)
|
||||
if (loc->is_session_range ()) {
|
||||
if (session_range_marker_menu == 0) {
|
||||
build_marker_menu (true);
|
||||
markerMenu = start_end_marker_menu;
|
||||
}
|
||||
markerMenu = session_range_marker_menu;
|
||||
} else {
|
||||
if (marker_menu == 0)
|
||||
build_marker_menu (false);
|
||||
|
@ -573,13 +584,13 @@ Editor::transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item*)
|
|||
}
|
||||
|
||||
void
|
||||
Editor::build_marker_menu (bool start_or_end)
|
||||
Editor::build_marker_menu (bool session_range)
|
||||
{
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
Menu *markerMenu = new Menu;
|
||||
if (start_or_end) {
|
||||
start_end_marker_menu = markerMenu;
|
||||
if (session_range) {
|
||||
session_range_marker_menu = markerMenu;
|
||||
} else {
|
||||
marker_menu = markerMenu;
|
||||
}
|
||||
|
@ -595,7 +606,9 @@ Editor::build_marker_menu (bool start_or_end)
|
|||
items.push_back (MenuElem (_("Create range to next marker"), sigc::mem_fun(*this, &Editor::marker_menu_range_to_next)));
|
||||
|
||||
items.push_back (MenuElem (_("Hide"), sigc::mem_fun(*this, &Editor::marker_menu_hide)));
|
||||
if (start_or_end) return;
|
||||
if (session_range) {
|
||||
return;
|
||||
}
|
||||
items.push_back (MenuElem (_("Rename"), sigc::mem_fun(*this, &Editor::marker_menu_rename)));
|
||||
items.push_back (MenuElem (_("Lock"), sigc::bind (sigc::mem_fun(*this, &Editor::marker_menu_lock), true)));
|
||||
items.push_back (MenuElem (_("Unlock"), sigc::bind (sigc::mem_fun(*this, &Editor::marker_menu_lock), false)));
|
||||
|
@ -1203,7 +1216,7 @@ Editor::goto_nth_marker (int n)
|
|||
ordered.sort (cmp);
|
||||
|
||||
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
|
||||
if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_start()) {
|
||||
if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
|
||||
if (n == 0) {
|
||||
_session->request_locate ((*i)->start(), _session->transport_rolling());
|
||||
break;
|
||||
|
|
|
@ -226,7 +226,7 @@ LocationEditRow::set_location (Location *loc)
|
|||
item_table.attach (remove_button, 6, 7, 0, 1, FILL, FILL, 4, 0);
|
||||
}
|
||||
|
||||
if (location->is_end() || location->is_start()) {
|
||||
if (location->is_session_range()) {
|
||||
remove_button.set_sensitive (false);
|
||||
}
|
||||
|
||||
|
@ -671,7 +671,7 @@ LocationUI::do_location_remove (ARDOUR::Location *loc)
|
|||
cannot be removed.
|
||||
*/
|
||||
|
||||
if (loc->is_end()) {
|
||||
if (loc->is_session_range()) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@ class Marker : public sigc::trackable
|
|||
Mark,
|
||||
Tempo,
|
||||
Meter,
|
||||
Start,
|
||||
End,
|
||||
Start, ///< session start
|
||||
End, ///< session end
|
||||
LoopStart,
|
||||
LoopEnd,
|
||||
PunchIn,
|
||||
|
|
|
@ -48,7 +48,7 @@ sigc::signal<void> ColorsChanged;
|
|||
sigc::signal<void,uint32_t> ColorChanged;
|
||||
|
||||
ThemeManager::ThemeManager()
|
||||
: ArdourDialog (_("ThemeManager")),
|
||||
: ArdourDialog (_("Theme Manager")),
|
||||
dark_button (_("Dark Theme")),
|
||||
light_button (_("Light Theme")),
|
||||
reset_button (_("Restore Defaults"))
|
||||
|
|
|
@ -46,9 +46,8 @@ class Location : public PBD::StatefulDestructible
|
|||
IsAutoLoop = 0x4,
|
||||
IsHidden = 0x8,
|
||||
IsCDMarker = 0x10,
|
||||
IsEnd = 0x20,
|
||||
IsRangeMarker = 0x40,
|
||||
IsStart = 0x80
|
||||
IsRangeMarker = 0x20,
|
||||
IsSessionRange = 0x40
|
||||
};
|
||||
|
||||
Location (nframes64_t sample_start,
|
||||
|
@ -94,8 +93,7 @@ class Location : public PBD::StatefulDestructible
|
|||
void set_auto_loop (bool yn, void *src);
|
||||
void set_hidden (bool yn, void *src);
|
||||
void set_cd (bool yn, void *src);
|
||||
void set_is_end (bool yn, void* src);
|
||||
void set_is_start (bool yn, void* src);
|
||||
void set_is_session_range (bool yn, void* src);
|
||||
void set_is_range_marker (bool yn, void* src);
|
||||
|
||||
bool is_auto_punch () const { return _flags & IsAutoPunch; }
|
||||
|
@ -103,8 +101,7 @@ class Location : public PBD::StatefulDestructible
|
|||
bool is_mark () const { return _flags & IsMark; }
|
||||
bool is_hidden () const { return _flags & IsHidden; }
|
||||
bool is_cd_marker () const { return _flags & IsCDMarker; }
|
||||
bool is_end() const { return _flags & IsEnd; }
|
||||
bool is_start() const { return _flags & IsStart; }
|
||||
bool is_session_range () const { return _flags & IsSessionRange; }
|
||||
bool is_range_marker() const { return _flags & IsRangeMarker; }
|
||||
bool matches (Flags f) const { return _flags & f; }
|
||||
|
||||
|
@ -159,8 +156,7 @@ class Locations : public PBD::StatefulDestructible
|
|||
|
||||
Location* auto_loop_location () const;
|
||||
Location* auto_punch_location () const;
|
||||
Location* end_location() const;
|
||||
Location* start_location() const;
|
||||
Location* session_range_location() const;
|
||||
|
||||
int next_available_name(std::string& result,std::string base);
|
||||
uint32_t num_range_markers() const;
|
||||
|
|
|
@ -299,10 +299,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
bool get_play_loop () const { return play_loop; }
|
||||
|
||||
nframes_t last_transport_start() const { return _last_roll_location; }
|
||||
void goto_end () { request_locate (end_location->start(), false);}
|
||||
void goto_start () { request_locate (start_location->start(), false); }
|
||||
void set_session_start (nframes_t start) { start_location->set_start(start); }
|
||||
void set_session_end (nframes_t end) { end_location->set_start(end); config.set_end_marker_is_free (false); }
|
||||
void goto_end () { request_locate (_session_range_location->end(), false);}
|
||||
void goto_start () { request_locate (_session_range_location->start(), false); }
|
||||
void set_session_start (nframes_t start) { _session_range_location->set_start(start); }
|
||||
void set_session_end (nframes_t end) { _session_range_location->set_end(end); config.set_end_marker_is_free (false); }
|
||||
void use_rf_shuttle_speed ();
|
||||
void allow_auto_play (bool yn);
|
||||
void request_transport_speed (double speed);
|
||||
|
@ -316,8 +316,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
int wipe ();
|
||||
|
||||
nframes_t get_maximum_extent () const;
|
||||
nframes_t current_end_frame() const { return end_location->start(); }
|
||||
nframes_t current_start_frame() const { return start_location->start(); }
|
||||
nframes_t current_end_frame() const { return _session_range_location->end(); }
|
||||
nframes_t current_start_frame() const { return _session_range_location->start(); }
|
||||
/// "actual" sample rate of session, set by current audioengine rate, pullup/down etc.
|
||||
nframes_t frame_rate() const { return _current_frame_rate; }
|
||||
/// "native" sample rate of session, regardless of current audioengine rate, pullup/down etc
|
||||
|
@ -845,8 +845,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
int transport_sub_state;
|
||||
mutable gint _record_status;
|
||||
volatile nframes64_t _transport_frame;
|
||||
Location* end_location;
|
||||
Location* start_location;
|
||||
Location* _session_range_location;
|
||||
Slave* _slave;
|
||||
bool _silent;
|
||||
|
||||
|
|
|
@ -400,9 +400,8 @@ setup_enum_writer ()
|
|||
REGISTER_CLASS_ENUM (Location, IsAutoLoop);
|
||||
REGISTER_CLASS_ENUM (Location, IsHidden);
|
||||
REGISTER_CLASS_ENUM (Location, IsCDMarker);
|
||||
REGISTER_CLASS_ENUM (Location, IsEnd);
|
||||
REGISTER_CLASS_ENUM (Location, IsSessionRange);
|
||||
REGISTER_CLASS_ENUM (Location, IsRangeMarker);
|
||||
REGISTER_CLASS_ENUM (Location, IsStart);
|
||||
REGISTER_BITS (_Location_Flags);
|
||||
|
||||
REGISTER_CLASS_ENUM (Panner, SameDirection);
|
||||
|
|
|
@ -290,7 +290,7 @@ ExportHandler::export_cd_marker_file (TimespanPtr timespan, FormatPtr file_forma
|
|||
Locations::LocationList temp;
|
||||
|
||||
for (i = locations.begin(); i != locations.end(); ++i) {
|
||||
if ((*i)->start() >= timespan->get_start() && (*i)->end() <= timespan->get_end() && (*i)->is_cd_marker() && !(*i)->is_end()) {
|
||||
if ((*i)->start() >= timespan->get_start() && (*i)->end() <= timespan->get_end() && (*i)->is_cd_marker() && !(*i)->is_session_range()) {
|
||||
temp.push_back (*i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,11 +49,6 @@ Location::Location (const Location& other)
|
|||
_end (other._end),
|
||||
_flags (other._flags)
|
||||
{
|
||||
/* start and end flags can never be copied, because there can only ever be one of each */
|
||||
|
||||
_flags = Flags (_flags & ~IsStart);
|
||||
_flags = Flags (_flags & ~IsEnd);
|
||||
|
||||
/* copy is not locked even if original was */
|
||||
|
||||
_locked = false;
|
||||
|
@ -103,18 +98,15 @@ Location::set_start (nframes64_t s)
|
|||
start_changed(this); /* EMIT SIGNAL */
|
||||
end_changed(this); /* EMIT SIGNAL */
|
||||
|
||||
if ( is_start() ) {
|
||||
|
||||
Session::StartTimeChanged (); /* EMIT SIGNAL */
|
||||
AudioFileSource::set_header_position_offset ( s );
|
||||
}
|
||||
|
||||
if ( is_end() ) {
|
||||
Session::EndTimeChanged (); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_session_range()) {
|
||||
start_changed (this); /* EMIT SIGNAL */
|
||||
Session::StartTimeChanged (); /* EMIT SIGNAL */
|
||||
AudioFileSource::set_header_position_offset (s);
|
||||
}
|
||||
|
||||
if (((is_auto_punch() || is_auto_loop()) && s >= _end) || s > _end) {
|
||||
return -1;
|
||||
|
@ -141,19 +133,16 @@ Location::set_end (nframes64_t e)
|
|||
_end = e;
|
||||
start_changed(this); /* EMIT SIGNAL */
|
||||
end_changed(this); /* EMIT SIGNAL */
|
||||
|
||||
if ( is_start() ) {
|
||||
Session::StartTimeChanged (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
if ( is_end() ) {
|
||||
Session::EndTimeChanged (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (is_session_range()) {
|
||||
_end = e;
|
||||
end_changed (this); /* EMIT SIGNAL */
|
||||
Session::EndTimeChanged (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
if (((is_auto_punch() || is_auto_loop()) && e <= _start) || e < _start) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -232,17 +221,9 @@ Location::set_cd (bool yn, void *src)
|
|||
}
|
||||
|
||||
void
|
||||
Location::set_is_end (bool yn, void *src)
|
||||
Location::set_is_session_range (bool yn, void *src)
|
||||
{
|
||||
if (set_flag_internal (yn, IsEnd)) {
|
||||
FlagsChanged (this, src); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Location::set_is_start (bool yn, void *src)
|
||||
{
|
||||
if (set_flag_internal (yn, IsStart)) {
|
||||
if (set_flag_internal (yn, IsSessionRange)) {
|
||||
FlagsChanged (this, src); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
|
@ -531,7 +512,7 @@ Locations::clear ()
|
|||
LocationList::iterator tmp = i;
|
||||
++tmp;
|
||||
|
||||
if (!(*i)->is_end() && !(*i)->is_start()) {
|
||||
if (!(*i)->is_session_range()) {
|
||||
locations.erase (i);
|
||||
}
|
||||
|
||||
|
@ -556,7 +537,7 @@ Locations::clear_markers ()
|
|||
tmp = i;
|
||||
++tmp;
|
||||
|
||||
if ((*i)->is_mark() && !(*i)->is_end() && !(*i)->is_start()) {
|
||||
if ((*i)->is_mark() && !(*i)->is_session_range()) {
|
||||
locations.erase (i);
|
||||
}
|
||||
|
||||
|
@ -621,7 +602,7 @@ Locations::remove (Location *loc)
|
|||
bool was_current = false;
|
||||
LocationList::iterator i;
|
||||
|
||||
if (loc->is_end() || loc->is_start()) {
|
||||
if (loc->is_session_range()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -848,21 +829,10 @@ Locations::marks_either_side (nframes64_t const frame, nframes64_t& before, nfra
|
|||
}
|
||||
|
||||
Location*
|
||||
Locations::end_location () const
|
||||
Locations::session_range_location () const
|
||||
{
|
||||
for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
|
||||
if ((*i)->is_end()) {
|
||||
return const_cast<Location*> (*i);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Location*
|
||||
Locations::start_location () const
|
||||
{
|
||||
for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
|
||||
if ((*i)->is_start()) {
|
||||
if ((*i)->is_session_range()) {
|
||||
return const_cast<Location*> (*i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -712,9 +712,9 @@ Session::hookup_io ()
|
|||
void
|
||||
Session::playlist_length_changed ()
|
||||
{
|
||||
/* we can't just increase end_location->end() if pl->get_maximum_extent()
|
||||
/* we can't just increase session_range_location->end() if pl->get_maximum_extent()
|
||||
if larger. if the playlist used to be the longest playlist,
|
||||
and its now shorter, we have to decrease end_location->end(). hence,
|
||||
and its now shorter, we have to decrease session_range_location->end(). hence,
|
||||
we have to iterate over all diskstreams and check the
|
||||
playlists currently in use.
|
||||
*/
|
||||
|
@ -954,11 +954,8 @@ Session::handle_locations_changed (Locations::LocationList& locations)
|
|||
set_loop = true;
|
||||
}
|
||||
|
||||
if (location->is_start()) {
|
||||
start_location = location;
|
||||
}
|
||||
if (location->is_end()) {
|
||||
end_location = location;
|
||||
if (location->is_session_range()) {
|
||||
_session_range_location = location;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2376,8 +2373,8 @@ Session::find_current_end ()
|
|||
|
||||
nframes_t max = get_maximum_extent ();
|
||||
|
||||
if (max > end_location->end()) {
|
||||
end_location->set_end (max);
|
||||
if (max > _session_range_location->end()) {
|
||||
_session_range_location->set_end (max);
|
||||
set_dirty();
|
||||
DurationChanged(); /* EMIT SIGNAL */
|
||||
}
|
||||
|
|
|
@ -178,8 +178,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
|
|||
transport_sub_state = 0;
|
||||
_transport_frame = 0;
|
||||
_requested_return_frame = -1;
|
||||
end_location = new Location (0, 0, _("end"), Location::Flags ((Location::IsMark|Location::IsEnd)));
|
||||
start_location = new Location (0, 0, _("start"), Location::Flags ((Location::IsMark|Location::IsStart)));
|
||||
_session_range_location = new Location (0, 0, _("session"), Location::Flags (Location::IsSessionRange));
|
||||
g_atomic_int_set (&_record_status, Disabled);
|
||||
loop_changing = false;
|
||||
play_loop = false;
|
||||
|
@ -538,11 +537,8 @@ Session::create (const string& mix_template, nframes_t initial_length, BusProfil
|
|||
|
||||
/* set initial start + end point */
|
||||
|
||||
start_location->set_end (0);
|
||||
_locations.add (start_location);
|
||||
|
||||
end_location->set_end (initial_length);
|
||||
_locations.add (end_location);
|
||||
_session_range_location->set (0, initial_length);
|
||||
_locations.add (_session_range_location);
|
||||
|
||||
_state_of_the_state = Clean;
|
||||
|
||||
|
@ -1094,12 +1090,9 @@ Session::state(bool full_state)
|
|||
// for a template, just create a new Locations, populate it
|
||||
// with the default start and end, and get the state for that.
|
||||
Locations loc;
|
||||
Location* start = new Location(0, 0, _("start"), Location::Flags ((Location::IsMark|Location::IsStart)));
|
||||
Location* end = new Location(0, 0, _("end"), Location::Flags ((Location::IsMark|Location::IsEnd)));
|
||||
start->set_end(0);
|
||||
loc.add (start);
|
||||
end->set_end(compute_initial_length());
|
||||
loc.add (end);
|
||||
Location* range = new Location (0, 0, _("session"), Location::Flags (Location::IsSessionRange));
|
||||
range->set (0, compute_initial_length ());
|
||||
loc.add (range);
|
||||
node->add_child_nocopy (loc.get_state());
|
||||
}
|
||||
|
||||
|
@ -1290,21 +1283,14 @@ Session::set_state (const XMLNode& node, int version)
|
|||
set_auto_punch_location (location);
|
||||
}
|
||||
|
||||
if ((location = _locations.end_location()) == 0) {
|
||||
_locations.add (end_location);
|
||||
if ((location = _locations.session_range_location()) == 0) {
|
||||
_locations.add (_session_range_location);
|
||||
} else {
|
||||
delete end_location;
|
||||
end_location = location;
|
||||
delete _session_range_location;
|
||||
_session_range_location = location;
|
||||
}
|
||||
|
||||
if ((location = _locations.start_location()) == 0) {
|
||||
_locations.add (start_location);
|
||||
} else {
|
||||
delete start_location;
|
||||
start_location = location;
|
||||
}
|
||||
|
||||
AudioFileSource::set_header_position_offset (start_location->start());
|
||||
AudioFileSource::set_header_position_offset (_session_range_location->start());
|
||||
|
||||
if ((child = find_named_node (node, "Sources")) == 0) {
|
||||
error << _("Session: XML state has no sources section") << endmsg;
|
||||
|
|
|
@ -400,7 +400,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
|
|||
if (did_record) {
|
||||
begin_reversible_command ("capture");
|
||||
|
||||
Location* loc = _locations.end_location();
|
||||
Location* loc = _locations.session_range_location();
|
||||
bool change_end = false;
|
||||
|
||||
if (_transport_frame < loc->end()) {
|
||||
|
|
Loading…
Reference in New Issue