#include "pbd/error.h"
#include "ardour/amp.h"
-#include "ardour/audioplaylist.h"
-#include "ardour/audioregion.h"
-#include "ardour/audiosource.h"
#include "ardour/debug.h"
#include "ardour/delivery.h"
#include "ardour/diskstream.h"
#include "ardour/io_processor.h"
#include "ardour/meter.h"
+#include "ardour/playlist.h"
#include "ardour/port.h"
#include "ardour/processor.h"
#include "ardour/route_group_specialized.h"
void
Track::RecEnableControl::set_value (double val)
{
- track->set_record_enabled (val >= 0.5 ? true : false, this);
+ boost::shared_ptr<Track> t = track.lock ();
+ if (!t) {
+ return;
+ }
+
+ t->set_record_enabled (val >= 0.5 ? true : false, this);
}
double
-Track::RecEnableControl::get_value (void) const
+Track::RecEnableControl::get_value () const
{
- return (track->record_enabled() ? 1.0 : 0.0);
+ boost::shared_ptr<Track> t = track.lock ();
+ if (!t) {
+ return 0;
+ }
+
+ return (t->record_enabled() ? 1.0 : 0.0);
}
bool
return false;
}
- _diskstream->set_name (str);
+ if (_diskstream->playlist()->all_regions_empty ()) {
+ /* Only rename the diskstream (and therefore the playlist) if
+ the playlist has never had a region added to it. Otherwise
+ people can get confused if, say, they have notes about a
+ playlist with a given name and then it changes (see mantis
+ #4759).
+ */
+ _diskstream->set_name (str);
+ }
/* save state so that the statefile fully reflects any filename changes */
}
int
-Track::can_internal_playback_seek (framepos_t p)
+Track::can_internal_playback_seek (framecnt_t p)
{
return _diskstream->can_internal_playback_seek (p);
}
int
-Track::internal_playback_seek (framepos_t p)
+Track::internal_playback_seek (framecnt_t p)
{
return _diskstream->internal_playback_seek (p);
}
}
framecnt_t
-Track::check_initial_delay (framecnt_t nframes, framecnt_t& transport_frame)
+Track::check_initial_delay (framecnt_t nframes, framepos_t& transport_frame)
{
if (_roll_delay > nframes) {