summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/SConscript29
-rw-r--r--libs/ardour/ardour/audiosource.h5
-rw-r--r--libs/ardour/ardour/jack_port.h6
-rw-r--r--libs/ardour/ardour/types.h4
-rw-r--r--libs/ardour/audio_playlist.cc67
-rw-r--r--libs/ardour/globals.cc2
-rw-r--r--libs/ardour/playlist.cc53
-rw-r--r--libs/ardour/sndfile_helpers.cc10
8 files changed, 108 insertions, 68 deletions
diff --git a/libs/ardour/SConscript b/libs/ardour/SConscript
index af08d4569c..bcbc7c78ac 100644
--- a/libs/ardour/SConscript
+++ b/libs/ardour/SConscript
@@ -232,33 +232,11 @@ def CheckJackRecomputeLatency(context):
context.Result(result)
return result
-#
-# See if JACK supports jack_port_ensure_monitor_input()
-#
-jack_ensure_monitor_input_test = """
-#include <jack/jack.h>
-int main(int argc, char** argv)
-{
- jack_port_t **port;
-
- jack_port_ensure_monitor (*port, 1);
- return 0;
-
-}
-"""
-
-def CheckJackEnsureMonitorInput(context):
- context.Message('Checking for jack_port_ensure_monitor_input()...')
- result = context.TryLink(jack_ensure_monitor_input_test, '.c')
- context.Result(result)
- return result
-
conf = Configure(ardour, custom_tests = {
'CheckJackClientOpen' : CheckJackClientOpen,
'CheckJackRecomputeLatencies' : CheckJackRecomputeLatencies,
'CheckJackRecomputeLatency' : CheckJackRecomputeLatency,
- 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset,
- 'CheckJackEnsureMonitorInput' : CheckJackEnsureMonitorInput
+ 'CheckJackVideoFrameOffset' : CheckJackVideoFrameOffset
})
if conf.CheckJackClientOpen():
@@ -272,11 +250,6 @@ if conf.CheckJackRecomputeLatency():
if conf.CheckJackVideoFrameOffset():
ardour.Append(CXXFLAGS="-DHAVE_JACK_VIDEO_SUPPORT")
-
-if conf.CheckJackEnsureMonitorInput():
- ardour.Append(CXXFLAGS='-DHAVE_JACK_PORT_ENSURE_MONITOR')
-else:
- print '\nWARNING: You need at least svn revision 985 of jack for hardware monitoring to work correctly.\n'
#
# Optional header files
diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h
index 7b22528bd1..3865019bc7 100644
--- a/libs/ardour/ardour/audiosource.h
+++ b/libs/ardour/ardour/audiosource.h
@@ -61,10 +61,6 @@ const nframes_t frames_per_peak = 256;
/* returns the number of items in this `audio_source' */
- virtual nframes_t length() const {
- return _length;
- }
-
virtual nframes_t available_peaks (double zoom) const;
virtual nframes_t read (Sample *dst, nframes_t start, nframes_t cnt) const;
@@ -120,7 +116,6 @@ const nframes_t frames_per_peak = 256;
bool _peaks_built;
mutable Glib::Mutex _lock;
mutable Glib::Mutex _peaks_ready_lock;
- nframes_t _length;
Glib::ustring peakpath;
Glib::ustring _captured_for;
diff --git a/libs/ardour/ardour/jack_port.h b/libs/ardour/ardour/jack_port.h
index c3c31c938d..d973ed2cab 100644
--- a/libs/ardour/ardour/jack_port.h
+++ b/libs/ardour/ardour/jack_port.h
@@ -62,13 +62,7 @@ class JackPort : public virtual Port {
}
void ensure_monitor_input (bool yn) {
-
-#ifdef HAVE_JACK_PORT_ENSURE_MONITOR
jack_port_ensure_monitor (_port, yn);
-#else
- jack_port_request_monitor(_port, yn);
-#endif
-
}
/*XXX completely bloody useless imho*/
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 0c5a8e044f..8dd9ccc211 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -279,7 +279,7 @@ namespace ARDOUR {
enum MonitorModel {
HardwareMonitoring,
SoftwareMonitoring,
- ExternalMonitoring,
+ ExternalMonitoring
};
enum DenormalModel {
@@ -292,7 +292,7 @@ namespace ARDOUR {
enum RemoteModel {
UserOrdered,
MixerOrdered,
- EditorOrdered,
+ EditorOrdered
};
enum CrossfadeModel {
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc
index f4c10cbc12..0631c9121b 100644
--- a/libs/ardour/audio_playlist.cc
+++ b/libs/ardour/audio_playlist.cc
@@ -337,6 +337,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
boost::shared_ptr<AudioRegion> top;
boost::shared_ptr<AudioRegion> bottom;
boost::shared_ptr<Crossfade> xfade;
+ RegionList* touched_regions;
if (in_set_state || in_partition) {
return;
@@ -398,7 +399,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
break;
case OverlapExternal:
-
+
/* [ -------- top ------- ]
* {=========== bottom =============}
*/
@@ -411,11 +412,15 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
*/
xfade_length = min ((nframes_t) 720, top->length());
-
- xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, top->first_frame(), StartOfIn));
- add_crossfade (xfade);
+
+ if (top_region_at (top->first_frame()) == top) {
+
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, top->first_frame(), StartOfIn));
+ add_crossfade (xfade);
+ }
if (top_region_at (top->last_frame() - 1) == top) {
+
/*
only add a fade out if there is no region on top of the end of 'top' (which
would cover it).
@@ -425,9 +430,58 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
add_crossfade (xfade);
}
break;
-
+ case OverlapStart:
+
+ /* { ==== top ============ }
+ * [---- bottom -------------------]
+ */
+
+ if (Config->get_xfade_model() == FullCrossfade) {
+ touched_regions = regions_touched (top->first_frame(), bottom->last_frame());
+ if (touched_regions->size() <= 2) {
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, Config->get_xfade_model(), Config->get_xfades_active()));
+ add_crossfade (xfade);
+ }
+ } else {
+
+ touched_regions = regions_touched (top->first_frame(),
+ top->first_frame() + min ((nframes_t)Config->get_short_xfade_seconds() * _session.frame_rate(),
+ top->length()));
+ if (touched_regions->size() <= 2) {
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, Config->get_xfade_model(), Config->get_xfades_active()));
+ add_crossfade (xfade);
+ }
+ }
+ break;
+ case OverlapEnd:
+
+
+ /* [---- top ------------------------]
+ * { ==== bottom ============ }
+ */
+
+ if (Config->get_xfade_model() == FullCrossfade) {
+
+ touched_regions = regions_touched (bottom->first_frame(), top->last_frame());
+ if (touched_regions->size() <= 2) {
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other,
+ Config->get_xfade_model(), Config->get_xfades_active()));
+ add_crossfade (xfade);
+ }
+
+ } else {
+ touched_regions = regions_touched (bottom->first_frame(),
+ bottom->first_frame() + min ((nframes_t)Config->get_short_xfade_seconds() * _session.frame_rate(),
+ bottom->length()));
+ if (touched_regions->size() <= 2) {
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, Config->get_xfade_model(), Config->get_xfades_active()));
+ add_crossfade (xfade);
+ }
+ }
+ break;
default:
- xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other, Config->get_xfade_model(), Config->get_xfades_active()));
+ xfade = boost::shared_ptr<Crossfade> (new Crossfade (region, other,
+ Config->get_xfade_model(), Config->get_xfades_active()));
add_crossfade (xfade);
}
}
@@ -471,6 +525,7 @@ void AudioPlaylist::notify_crossfade_added (boost::shared_ptr<Crossfade> x)
if (g_atomic_int_get(&block_notifications)) {
_pending_xfade_adds.insert (_pending_xfade_adds.end(), x);
} else {
+
NewCrossfade (x); /* EMIT SIGNAL */
}
}
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index badd13412e..7405077cf3 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -486,7 +486,7 @@ ARDOUR::coverage (nframes_t sa, nframes_t ea,
"B overlaps the end of A"
*/
- if ((sb >= sa) && (sb <= ea)) {
+ if ((sb > sa) && (sb <= ea)) {
return OverlapEnd;
}
/*
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 09b54000d8..8d20d8539d 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -70,6 +70,7 @@ struct RegionSortByLastLayerOp {
}
};
+
Playlist::Playlist (Session& sess, string nom, DataType type, bool hide)
: SessionObject(sess, nom)
, _type(type)
@@ -350,7 +351,9 @@ Playlist::notify_region_removed (boost::shared_ptr<Region> r)
/* this might not be true, but we have to act
as though it could be.
*/
+ pending_length = false;
LengthChanged (); /* EMIT SIGNAL */
+ pending_modified = false;
Modified (); /* EMIT SIGNAL */
}
}
@@ -367,7 +370,9 @@ Playlist::notify_region_added (boost::shared_ptr<Region> r)
pending_modified = true;
pending_length = true;
} else {
+ pending_length = false;
LengthChanged (); /* EMIT SIGNAL */
+ pending_modified = false;
Modified (); /* EMIT SIGNAL */
}
}
@@ -378,7 +383,9 @@ Playlist::notify_length_changed ()
if (holding_state ()) {
pending_length = true;
} else {
+ pending_length = false;
LengthChanged(); /* EMIT SIGNAL */
+ pending_modified = false;
Modified (); /* EMIT SIGNAL */
}
}
@@ -437,6 +444,7 @@ Playlist::flush_notifications ()
}
pending_modified = false;
Modified (); /* EMIT SIGNAL */
+
}
for (s = dependent_checks_needed.begin(); s != dependent_checks_needed.end(); ++s) {
@@ -458,7 +466,7 @@ void
Playlist::add_region (boost::shared_ptr<Region> region, nframes_t position, float times)
{
RegionLock rlock (this);
-
+ delay_notifications();
times = fabs (times);
int itimes = (int) floor (times);
@@ -494,6 +502,8 @@ Playlist::add_region (boost::shared_ptr<Region> region, nframes_t position, floa
boost::shared_ptr<Region> sub = RegionFactory::create (region, 0, length, name, region->layer(), region->flags());
add_region_internal (sub, pos);
}
+
+ release_notifications ();
}
void
@@ -654,7 +664,6 @@ Playlist::partition (nframes_t start, nframes_t end, bool just_top_level)
void
Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, RegionList& thawlist)
{
- RegionLock rlock (this);
boost::shared_ptr<Region> region;
boost::shared_ptr<Region> current;
string new_name;
@@ -662,14 +671,19 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
OverlapType overlap;
nframes_t pos1, pos2, pos3, pos4;
RegionList new_regions;
+ RegionList copy;
in_partition = true;
+ delay_notifications();
+
/* need to work from a copy, because otherwise the regions we add during the process
get operated on as well.
*/
-
- RegionList copy = regions;
+ {
+ RegionLock rlock (this);
+ copy = regions;
+ }
for (RegionList::iterator i = copy.begin(); i != copy.end(); i = tmp) {
@@ -677,9 +691,10 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
++tmp;
current = *i;
-
+
if (current->first_frame() == start && current->last_frame() == end) {
if (cutting) {
+ RegionLock rlock (this);
remove_region_internal (current);
}
continue;
@@ -688,14 +703,14 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
if ((overlap = current->coverage (start, end)) == OverlapNone) {
continue;
}
-
+
pos1 = current->position();
pos2 = start;
pos3 = end;
pos4 = current->last_frame();
if (overlap == OverlapInternal) {
-
+
/* split: we need 3 new regions, the front, middle and end.
cut: we need 2 regions, the front and end.
*/
@@ -715,9 +730,10 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
/* "middle" ++++++ */
- _session.region_name (new_name, current->name(), false);
+ _session.region_name (new_name, current->name(), false); //takes the session-wide region lock
region = RegionFactory::create (current, pos2 - pos1, pos3 - pos2, new_name,
regions.size(), Region::Flag(current->flags()|Region::Automatic|Region::LeftOfSplit|Region::RightOfSplit));
+ RegionLock rlock (this);
add_region_internal (region, start);
new_regions.push_back (region);
}
@@ -727,10 +743,11 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
_session.region_name (new_name, current->name(), false);
region = RegionFactory::create (current, pos3 - pos1, pos4 - pos3, new_name,
regions.size(), Region::Flag(current->flags()|Region::Automatic|Region::RightOfSplit));
-
- add_region_internal (region, end);
- new_regions.push_back (region);
-
+ {
+ RegionLock rlock (this);
+ add_region_internal (region, end);
+ new_regions.push_back (region);
+ }
/* "front" ***** */
current->freeze ();
@@ -755,8 +772,9 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
/* end +++++ */
_session.region_name (new_name, current->name(), false);
- region = RegionFactory::create (current, pos2 - pos1, pos4 - pos2, new_name, (layer_t) regions.size(),
+ region = RegionFactory::create (current, pos2 - pos1, pos4 - pos2, new_name, regions.size(),
Region::Flag(current->flags()|Region::Automatic|Region::LeftOfSplit));
+ RegionLock rlock (this);
add_region_internal (region, start);
new_regions.push_back (region);
}
@@ -791,6 +809,7 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
_session.region_name (new_name, current->name(), false);
region = RegionFactory::create (current, 0, pos3 - pos1, new_name,
regions.size(), Region::Flag(current->flags()|Region::Automatic|Region::RightOfSplit));
+ RegionLock rlock (this);
add_region_internal (region, pos1);
new_regions.push_back (region);
}
@@ -820,6 +839,7 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
*/
if (cutting) {
+ RegionLock rlock (this);
remove_region_internal (current);
}
new_regions.push_back (current);
@@ -831,6 +851,8 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
for (RegionList::iterator i = new_regions.begin(); i != new_regions.end(); ++i) {
check_dependents (*i, false);
}
+
+ release_notifications ();
}
boost::shared_ptr<Playlist>
@@ -1209,7 +1231,9 @@ Playlist::clear (bool with_signals)
}
if (with_signals) {
+ pending_length = false;
LengthChanged ();
+ pending_modified = false;
Modified ();
}
@@ -1587,7 +1611,7 @@ Playlist::relayer ()
/* don't send multiple Modified notifications
when multiple regions are relayered.
*/
-
+
freeze ();
/* build up a new list of regions on each layer */
@@ -1607,7 +1631,6 @@ Playlist::relayer ()
copy.sort (cmp);
}
-
for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) {
/* find the lowest layer that this region can go on */
diff --git a/libs/ardour/sndfile_helpers.cc b/libs/ardour/sndfile_helpers.cc
index d47a9b9423..96dc2c7779 100644
--- a/libs/ardour/sndfile_helpers.cc
+++ b/libs/ardour/sndfile_helpers.cc
@@ -63,11 +63,11 @@ int sndfile_header_formats[SNDFILE_HEADER_FORMATS] = {
};
const char * const sndfile_bitdepth_formats_strings[SNDFILE_BITDEPTH_FORMATS+1] = {
- N_("16 bit"),
- N_("24 bit"),
- N_("32 bit"),
- N_("8 bit"),
- N_("float"),
+ N_("Signed 16 bit PCM"),
+ N_("Signed 24 bit PCM"),
+ N_("Signed 32 bit PCM"),
+ N_("Signed 8 bit PCM"),
+ N_("32 bit float"),
0
};