bool slaved() const { return _slaved; }
void set_slaved(bool yn) { _slaved = yn; }
- int set_loop (Location *loc);
-
- PBD::Signal1<void,Location *> LoopSet;
PBD::Signal0<void> SpeedChanged;
PBD::Signal0<void> ReverseChanged;
double _target_speed;
bool _seek_required;
bool _slaved;
- Location* loop_location;
bool in_set_state;
samplepos_t playback_sample;
bool _need_butler;
namespace ARDOUR {
+class Location;
class Session;
class Route;
virtual void realtime_handle_transport_stopped () {}
virtual void realtime_locate () {}
+ virtual void set_loop (Location *loc) { _loop_location = loc; }
+
/* most processors won't care about this, but plugins that
receive MIDI or similar data from an input source that
may suddenly go "quiet" because of monitoring changes
// absolute alignment to session i/o
samplecnt_t _capture_offset;
samplecnt_t _playback_offset;
+ Location* _loop_location;
};
} // namespace ARDOUR
class RouteGroup;
class Send;
class InternalReturn;
+class Location;
class MonitorControl;
class MonitorProcessor;
class Pannable;
virtual void realtime_locate () {}
virtual void non_realtime_locate (samplepos_t);
virtual void set_pending_declick (int);
+ int set_loop (ARDOUR::Location *);
/* end of vfunc-based API */
FedBy _fed_by;
InstrumentInfo _instrument_info;
+ Location* _loop_location;
virtual ChanCount input_streams () const;
class DiskReader;
class DiskWriter;
class IO;
-class Location;
class RecordEnableControl;
class RecordSafeControl;
void non_realtime_speed_change ();
int overwrite_existing_buffers ();
samplecnt_t get_captured_samples (uint32_t n = 0) const;
- int set_loop (ARDOUR::Location *);
void transport_looped (samplepos_t);
void transport_stopped_wallclock (struct tm &, time_t, bool);
bool pending_overwrite () const;
, i_am_the_modifier (false)
, _seek_required (false)
, _slaved (false)
- , loop_location (0)
, in_set_state (false)
, playback_sample (0)
, _need_butler (false)
return 0;
}
-int
-DiskIOProcessor::set_loop (Location *location)
-{
- if (location) {
- if (location->start() >= location->end()) {
- error << string_compose(_("Location \"%1\" not valid for track loop (start >= end)"), location->name()) << endl;
- return -1;
- }
- }
-
- loop_location = location;
-
- LoopSet (location); /* EMIT SIGNAL */
- return 0;
-}
-
void
DiskIOProcessor::non_realtime_locate (samplepos_t location)
{
just once.
*/
- if ((loc = loop_location) != 0) {
+ if ((loc = _loop_location) != 0) {
loop_start = loc->start();
loop_end = loc->end();
loop_length = loop_end - loop_start;
if (ms & MonitoringDisk) {
/* disk data needed */
- Location* loc = loop_location;
+ Location* loc = _loop_location;
DEBUG_TRACE (DEBUG::MidiDiskstreamIO, string_compose (
"%1 MDS pre-read read %8 offset = %9 @ %4..%5 from %2 write to %3, LOOPED ? %6 .. %7\n", _name,
samplepos_t loop_end = 0;
samplepos_t loop_start = 0;
samplecnt_t loop_length = 0;
- Location* loc = loop_location;
+ Location* loc = _loop_location;
samplepos_t effective_start = start;
Evoral::Range<samplepos_t>* loop_range (0);
last_recordable_sample = max_samplepos;
}
- const Location* const loop_loc = loop_location;
+ const Location* const loop_loc = _loop_location;
samplepos_t loop_start = 0;
samplepos_t loop_end = 0;
samplepos_t loop_length = 0;
, _output_latency (0)
, _capture_offset (0)
, _playback_offset (0)
+ , _loop_location (0)
{
}
, _pinmgr_proxy (0)
, _owner (0)
, _input_latency (0)
+ , _output_latency (0)
+ , _capture_offset (0)
+ , _playback_offset (0)
+ , _loop_location (other._loop_location)
{
}
, _declickable (false)
, _have_internal_generator (false)
, _default_type (default_type)
+ , _loop_location (NULL)
, _track_number (0)
, _strict_io (false)
, _in_configure_processors (false)
processors_changed (RouteProcessorChange ()); /* EMIT SIGNAL */
}
+int
+Route::set_loop (Location* l)
+{
+ _loop_location = l;
+ Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
+ for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
+ (*i)->set_loop (l);
+ }
+}
+
#ifdef USE_TRACKS_CODE_FEATURES
/* This is the Tracks version of Track::monitoring_state().
abort(); /* NOTREACHED */
return MonitoringSilence;
}
-
#endif
boost::shared_ptr<RouteList> rl = routes.reader ();
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
- boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
- if (tr && !tr->is_private_route()) {
- tr->set_loop (yn ? loc : 0);
+ if (*i && !(*i)->is_private_route()) {
+ (*i)->set_loop (yn ? loc : 0);
}
}
}
return _disk_writer->get_captured_samples (n);
}
-int
-Track::set_loop (Location* l)
-{
- if (_disk_reader->set_loop (l)) {
- return -1;
- }
- return _disk_writer->set_loop (l);
-}
-
void
Track::transport_looped (samplepos_t p)
{