summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-03-11 16:01:06 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-03-11 16:01:06 +0000
commitddfc8d2185ec9cef7afe74091ea544ec286f13a8 (patch)
tree03cd195a2624e7389c2ed1e3f1fa40e43bf68345 /libs
parentb6f309bb85307d36b6fa1eaea2e7178066cb3f38 (diff)
start marker implemented, along with GotoZero command for old behaviour; R binding for global rec-enable now works (menu item added)
git-svn-id: svn://localhost/trunk/ardour2@376 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/location.h6
-rw-r--r--libs/ardour/ardour/session.h4
-rw-r--r--libs/ardour/location.cc19
-rw-r--r--libs/ardour/session_state.cc16
4 files changed, 41 insertions, 4 deletions
diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h
index 3728d0b346..ee55adb600 100644
--- a/libs/ardour/ardour/location.h
+++ b/libs/ardour/ardour/location.h
@@ -51,7 +51,8 @@ class Location : public Stateful, public sigc::trackable
IsHidden = 0x8,
IsCDMarker = 0x10,
IsEnd = 0x20,
- IsRangeMarker = 0x40
+ IsRangeMarker = 0x40,
+ IsStart = 0x80
};
Location (jack_nframes_t sample_start,
@@ -89,6 +90,7 @@ class Location : public Stateful, public sigc::trackable
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);
bool is_auto_punch () { return _flags & IsAutoPunch; }
bool is_auto_loop () { return _flags & IsAutoLoop; }
@@ -96,6 +98,7 @@ class Location : public Stateful, public sigc::trackable
bool is_hidden () { return _flags & IsHidden; }
bool is_cd_marker () { return _flags & IsCDMarker; }
bool is_end() { return _flags & IsEnd; }
+ bool is_start() { return _flags & IsStart; }
bool is_range_marker() { return _flags & IsRangeMarker; }
sigc::signal<void,Location*> name_changed;
@@ -146,6 +149,7 @@ class Locations : public Stateful, public StateManager
Location* auto_loop_location () const;
Location* auto_punch_location () const;
Location* end_location() const;
+ Location* start_location() const;
uint32_t num_range_markers() const;
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 6756bbe992..d0da2fef26 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -353,7 +353,7 @@ class Session : public sigc::trackable, public Stateful
void request_auto_loop (bool yn);
jack_nframes_t last_transport_start() const { return _last_roll_location; }
void goto_end () { request_locate (end_location->start(), false);}
- void goto_start () { request_locate (0, false); }
+ void goto_start () { request_locate (start_location->start(), false); }
void use_rf_shuttle_speed ();
void request_transport_speed (float speed);
void request_overwrite_buffer (DiskStream*);
@@ -366,6 +366,7 @@ class Session : public sigc::trackable, public Stateful
int remove_region_from_region_list (Region&);
jack_nframes_t current_end_frame() const { return end_location->start(); }
+ jack_nframes_t current_start_frame() const { return start_location->start(); }
jack_nframes_t frame_rate() const { return _current_frame_rate; }
double frames_per_smpte_frame() const { return _frames_per_smpte_frame; }
jack_nframes_t frames_per_hour() const { return _frames_per_hour; }
@@ -1002,6 +1003,7 @@ class Session : public sigc::trackable, public Stateful
atomic_t _record_status;
jack_nframes_t _transport_frame;
Location* end_location;
+ Location* start_location;
Slave *_slave;
SlaveSource _slave_type;
volatile float _transport_speed;
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index 972384cc32..f4eea2cfc5 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -155,6 +155,14 @@ Location::set_is_end (bool yn, void *src)
}
void
+Location::set_is_start (bool yn, void *src)
+{
+ if (set_flag_internal (yn, IsStart)) {
+ FlagsChanged (this, src); /* EMIT SIGNAL */
+ }
+}
+
+void
Location::set_auto_punch (bool yn, void *src)
{
if (is_mark() || _start == _end) {
@@ -660,6 +668,17 @@ Locations::end_location () const
}
Location*
+Locations::start_location () const
+{
+ for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
+ if ((*i)->is_start()) {
+ return const_cast<Location*> (*i);
+ }
+ }
+ return 0;
+}
+
+Location*
Locations::auto_loop_location () const
{
for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 42614d15d0..241d54c8b6 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -126,6 +126,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
_transport_frame = 0;
last_stop_frame = 0;
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)));
_end_location_is_free = true;
atomic_set (&_record_status, Disabled);
auto_play = false;
@@ -560,11 +561,14 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial
if (new_session) {
- /* set an initial end point */
+ /* set initial start + end point */
+
+ start_location->set_end (0);
+ _locations.add (start_location);
end_location->set_end (initial_length);
_locations.add (end_location);
-
+
_state_of_the_state = Clean;
if (save_state (_current_snapshot_name)) {
@@ -1551,9 +1555,17 @@ Session::set_state (const XMLNode& node)
if ((location = _locations.end_location()) == 0) {
_locations.add (end_location);
} else {
+ delete end_location;
end_location = location;
}
+ if ((location = _locations.start_location()) == 0) {
+ _locations.add (start_location);
+ } else {
+ delete start_location;
+ start_location = location;
+ }
+
_locations.save_state (_("initial state"));
if ((child = find_named_node (node, "EditGroups")) == 0) {