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
This commit is contained in:
Paul Davis
2006-03-11 16:01:06 +00:00
parent b6f309bb85
commit ddfc8d2185
10 changed files with 70 additions and 8 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -154,6 +154,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)
{
@@ -659,6 +667,17 @@ Locations::end_location () const
return 0;
}
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
{

View File

@@ -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) {