summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2013-09-21 09:17:25 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2013-09-21 09:17:25 +0100
commit19bb2b33a89a1291451f0740739a36daebe00bae (patch)
treed0cafb4792ec4ff61d04d16c1e86199b2714a36f /libs/ardour
parent66aa6dfc8ecdb7591768bc45866a8c2b0d77e767 (diff)
parentfd23ebd0886cd61f8ee68d52d6576d00a16c9032 (diff)
Merge remote-tracking branch 'remotes/origin/cairocanvas' into windows
Conflicts (hopefully resolved): gtk2_ardour/marker.cc gtk2_ardour/midi_region_view.h gtk2_ardour/region_gain_line.h gtk2_ardour/utils.cc gtk2_ardour/video_image_frame.cc gtk2_ardour/wscript libs/backends/jack/wscript
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/audioregion.h10
-rw-r--r--libs/ardour/ardour/rc_configuration_vars.h1
-rw-r--r--libs/ardour/ardour/region.h2
-rw-r--r--libs/ardour/ardour/silentfilesource.h2
-rw-r--r--libs/ardour/audioregion.cc31
-rw-r--r--libs/ardour/audiosource.cc3
-rw-r--r--libs/ardour/graph.cc2
-rw-r--r--libs/ardour/ltc_slave.cc2
-rw-r--r--libs/ardour/midi_diskstream.cc4
-rw-r--r--libs/ardour/region.cc18
-rw-r--r--libs/ardour/wscript2
11 files changed, 29 insertions, 48 deletions
diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h
index 83cd227bce..13e46e4979 100644
--- a/libs/ardour/ardour/audioregion.h
+++ b/libs/ardour/ardour/audioregion.h
@@ -94,7 +94,7 @@ class AudioRegion : public Region
virtual framecnt_t read_peaks (PeakData *buf, framecnt_t npeaks,
framecnt_t offset, framecnt_t cnt,
- uint32_t chan_n=0, double samples_per_unit= 1.0) const;
+ uint32_t chan_n=0, double frames_per_pixel = 1.0) const;
/* Readable interface */
@@ -235,12 +235,4 @@ class AudioRegion : public Region
} /* namespace ARDOUR */
-/* access from C objects */
-
-extern "C" {
- int region_read_peaks_from_c (void *arg, uint32_t npeaks, uint32_t start, uint32_t length, intptr_t data, uint32_t n_chan, double samples_per_unit);
- uint32_t region_length_from_c (void *arg);
- uint32_t sourcefile_length_from_c (void *arg, double);
-}
-
#endif /* __ardour_audio_region_h__ */
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h
index e05efbd510..78be86eaea 100644
--- a/libs/ardour/ardour/rc_configuration_vars.h
+++ b/libs/ardour/ardour/rc_configuration_vars.h
@@ -190,7 +190,6 @@ CONFIG_VARIABLE (WaveformScale, waveform_scale, "waveform-scale", Linear)
CONFIG_VARIABLE (WaveformShape, waveform_shape, "waveform-shape", Traditional)
CONFIG_VARIABLE (bool, allow_special_bus_removal, "allow-special-bus-removal", false)
CONFIG_VARIABLE (int32_t, processor_usage, "processor-usage", -1)
-CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", false)
CONFIG_VARIABLE (gain_t, max_gain, "max-gain", 2.0) /* +6.0dB */
CONFIG_VARIABLE (bool, update_editor_during_summary_drag, "update-editor-during-summary-drag", true)
CONFIG_VARIABLE (bool, never_display_periodic_midi, "never-display-periodic-midi", true)
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index 3ee829ed12..593832343f 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -220,7 +220,7 @@ class Region
bool at_natural_position () const;
void move_to_natural_position ();
- void trim_start (framepos_t new_position);
+ void move_start (frameoffset_t distance);
void trim_front (framepos_t new_position);
void trim_end (framepos_t new_position);
void trim_to (framepos_t position, framecnt_t length);
diff --git a/libs/ardour/ardour/silentfilesource.h b/libs/ardour/ardour/silentfilesource.h
index b8ac40e178..1ff251e71a 100644
--- a/libs/ardour/ardour/silentfilesource.h
+++ b/libs/ardour/ardour/silentfilesource.h
@@ -60,7 +60,7 @@ protected:
void set_header_timeline_position () {}
int read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t /*start*/, framecnt_t /*cnt*/,
- double /*samples_per_unit*/, framecnt_t /*fpp*/) const {
+ double /*frames_per_pixel*/, framecnt_t /*fpp*/) const {
memset (peaks, 0, sizeof (PeakData) * npeaks);
return 0;
}
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index d101583aa4..0909140f91 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -409,14 +409,22 @@ AudioRegion::set_envelope_active (bool yn)
}
}
+/** @param buf Buffer to put peak data in.
+ * @param npeaks Number of peaks to read (ie the number of PeakDatas in buf)
+ * @param offset Start position, as an offset from the start of this region's source.
+ * @param cnt Number of samples to read.
+ * @param chan_n Channel.
+ * @param frames_per_pixel Number of samples to use to generate one peak value.
+ */
+
ARDOUR::framecnt_t
-AudioRegion::read_peaks (PeakData *buf, framecnt_t npeaks, framecnt_t offset, framecnt_t cnt, uint32_t chan_n, double samples_per_unit) const
+AudioRegion::read_peaks (PeakData *buf, framecnt_t npeaks, framecnt_t offset, framecnt_t cnt, uint32_t chan_n, double frames_per_pixel) const
{
if (chan_n >= _sources.size()) {
return 0;
}
- if (audio_source(chan_n)->read_peaks (buf, npeaks, offset, cnt, samples_per_unit)) {
+ if (audio_source(chan_n)->read_peaks (buf, npeaks, offset, cnt, frames_per_pixel)) {
return 0;
} else {
if (_scale_amplitude != 1.0f) {
@@ -1852,22 +1860,3 @@ AudioRegion::verify_xfade_bounds (framecnt_t len, bool start)
}
-extern "C" {
-
- int region_read_peaks_from_c (void *arg, uint32_t npeaks, uint32_t start, uint32_t cnt, intptr_t data, uint32_t n_chan, double samples_per_unit)
-{
- return ((AudioRegion *) arg)->read_peaks ((PeakData *) data, (framecnt_t) npeaks, (framepos_t) start, (framecnt_t) cnt, n_chan,samples_per_unit);
-}
-
-uint32_t region_length_from_c (void *arg)
-{
-
- return ((AudioRegion *) arg)->length();
-}
-
-uint32_t sourcefile_length_from_c (void *arg, double zoom_factor)
-{
- return ( (AudioRegion *) arg)->audio_source()->available_peaks (zoom_factor) ;
-}
-
-} /* extern "C" */
diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc
index 1dce801884..d0b6205cb2 100644
--- a/libs/ardour/audiosource.cc
+++ b/libs/ardour/audiosource.cc
@@ -343,7 +343,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t
/* fix for near-end-of-file conditions */
if (cnt > _length - start) {
- // cerr << "too close to end @ " << _length << " given " << start << " + " << cnt << endl;
+ // cerr << "too close to end @ " << _length << " given " << start << " + " << cnt << " (" << _length - start << ")" << endl;
cnt = _length - start;
framecnt_t old = npeaks;
npeaks = min ((framecnt_t) floor (cnt / samples_per_visual_peak), npeaks);
@@ -509,6 +509,7 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t
}
if (zero_fill) {
+ cerr << "Zero fill end of peaks (@ " << npeaks << " with " << zero_fill << endl;
memset (&peaks[npeaks], 0, sizeof (PeakData) * zero_fill);
}
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc
index 50a66b6144..69c4953272 100644
--- a/libs/ardour/graph.cc
+++ b/libs/ardour/graph.cc
@@ -231,7 +231,7 @@ Graph::trigger (GraphNode* n)
void
Graph::dec_ref()
{
- if (g_atomic_int_dec_and_test (&_finished_refcount)) {
+ if (g_atomic_int_dec_and_test (const_cast<gint*> (&_finished_refcount))) {
/* We have run all the nodes that are at the `output' end of
the graph, so there is nothing more to do this time around.
diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc
index 2888e7c114..ced0226d00 100644
--- a/libs/ardour/ltc_slave.cc
+++ b/libs/ardour/ltc_slave.cc
@@ -588,7 +588,7 @@ LTC_Slave::approximate_current_delta() const
if (last_timestamp == 0 || engine_dll_initstate == 0) {
snprintf(delta, sizeof(delta), "\u2012\u2012\u2012\u2012");
} else if ((monotonic_cnt - last_timestamp) > 2 * frames_per_ltc_frame) {
- snprintf(delta, sizeof(delta), _("flywheel"));
+ snprintf(delta, sizeof(delta), "%s", _("flywheel"));
} else {
snprintf(delta, sizeof(delta), "\u0394<span foreground=\"green\" face=\"monospace\" >%s%s%" PRIi64 "</span>sm",
LEADINGZERO(llabs(current_delta)), PLUSMINUS(-current_delta), llabs(current_delta));
diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc
index 39932db8bf..a1a640cd1c 100644
--- a/libs/ardour/midi_diskstream.cc
+++ b/libs/ardour/midi_diskstream.cc
@@ -445,7 +445,7 @@ MidiDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
break;
}
}
- g_atomic_int_add(const_cast<gint*> (&_frames_pending_write), nframes);
+ g_atomic_int_add(const_cast<gint*>(&_frames_pending_write), nframes);
if (buf.size() != 0) {
Glib::Threads::Mutex::Lock lm (_gui_feed_buffer_mutex, Glib::Threads::TRY_LOCK);
@@ -807,7 +807,7 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush)
}
/* if there are 2+ chunks of disk i/o possible for
- this track, let the caller know so that it can arrange
+ this track), let the caller know so that it can arrange
for us to be called again, ASAP.
if we are forcing a flush, then if there is* any* extra
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 3b9dc308ec..1784cdbf3c 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -698,33 +698,32 @@ Region::set_start (framepos_t pos)
}
void
-Region::trim_start (framepos_t new_position)
+Region::move_start (frameoffset_t distance)
{
if (locked() || position_locked() || video_locked()) {
return;
}
framepos_t new_start;
- frameoffset_t const start_shift = new_position - _position;
- if (start_shift > 0) {
+ if (distance > 0) {
- if (_start > max_framepos - start_shift) {
- new_start = max_framepos;
+ if (_start > max_framepos - distance) {
+ new_start = max_framepos; // makes no sense
} else {
- new_start = _start + start_shift;
+ new_start = _start + distance;
}
if (!verify_start (new_start)) {
return;
}
- } else if (start_shift < 0) {
+ } else if (distance < 0) {
- if (_start < -start_shift) {
+ if (_start < -distance) {
new_start = 0;
} else {
- new_start = _start + start_shift;
+ new_start = _start + distance;
}
} else {
@@ -736,6 +735,7 @@ Region::trim_start (framepos_t new_position)
}
set_start_internal (new_start);
+
_whole_file = false;
first_edit ();
diff --git a/libs/ardour/wscript b/libs/ardour/wscript
index b99e70e6bb..e8c9fb8328 100644
--- a/libs/ardour/wscript
+++ b/libs/ardour/wscript
@@ -340,7 +340,7 @@ def build(bld):
obj.export_includes = ['.']
obj.includes = ['.', '../surfaces/control_protocol', '..']
- obj.name = 'ardour'
+ obj.name = 'libardour'
obj.target = 'ardour'
obj.uselib = ['GLIBMM','GTHREAD','AUBIO','SIGCPP','XML','UUID',
'JACK', 'ALSA', 'SNDFILE','SAMPLERATE','LRDF',