summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audiofilesource.h2
-rw-r--r--libs/ardour/ardour/audioregion.h3
-rw-r--r--libs/ardour/ardour/caimportable.h48
-rw-r--r--libs/ardour/ardour/configuration_vars.h5
-rw-r--r--libs/ardour/ardour/coreaudiosource.h6
-rw-r--r--libs/ardour/ardour/importable_source.h30
-rw-r--r--libs/ardour/ardour/resampled_source.h9
-rw-r--r--libs/ardour/ardour/session.h1
-rw-r--r--libs/ardour/ardour/sndfileimportable.h50
-rw-r--r--libs/ardour/ardour/sndfilesource.h1
10 files changed, 119 insertions, 36 deletions
diff --git a/libs/ardour/ardour/audiofilesource.h b/libs/ardour/ardour/audiofilesource.h
index 0e8b6e4fde..de388a06fc 100644
--- a/libs/ardour/ardour/audiofilesource.h
+++ b/libs/ardour/ardour/audiofilesource.h
@@ -170,6 +170,8 @@ class AudioFileSource : public AudioSource {
bool removable() const;
bool writable() const { return _flags & Writable; }
+ static Sample* get_interleave_buffer (nframes_t size);
+
private:
Glib::ustring old_peak_path (Glib::ustring audio_path);
Glib::ustring broken_peak_path (Glib::ustring audio_path);
diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h
index e88e10d521..81b7ef7c57 100644
--- a/libs/ardour/ardour/audioregion.h
+++ b/libs/ardour/ardour/audioregion.h
@@ -155,7 +155,8 @@ class AudioRegion : public Region
void recompute_gain_at_end ();
void recompute_gain_at_start ();
- nframes_t _read_at (const SourceList&, Sample *buf, Sample *mixdown_buffer,
+ nframes_t _read_at (const SourceList&, nframes_t limit,
+ Sample *buf, Sample *mixdown_buffer,
float *gain_buffer, nframes_t position, nframes_t cnt,
uint32_t chan_n = 0,
nframes_t read_frames = 0,
diff --git a/libs/ardour/ardour/caimportable.h b/libs/ardour/ardour/caimportable.h
new file mode 100644
index 0000000000..dc7f5769ae
--- /dev/null
+++ b/libs/ardour/ardour/caimportable.h
@@ -0,0 +1,48 @@
+/*
+ Copyright (C) 2007 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __ardour_ca_importable_source_h__
+#define __ardour_ca_importable_source_h__
+
+#include <pbd/failed_constructor.h>
+#include <ardour/types.h>
+#include <ardour/importable_source.h>
+
+#include <appleutility/CAAudioFile.h>
+
+namespace ARDOUR {
+
+class CAImportableSource : public ImportableSource {
+ public:
+ CAImportableSource (const std::string& path);
+ virtual ~CAImportableSource();
+
+ nframes_t read (Sample* buffer, nframes_t nframes);
+ uint32_t channels() const;
+ nframes_t length() const;
+ nframes_t samplerate() const;
+ void seek (nframes_t pos);
+
+ protected:
+ mutable CAAudioFile af;
+};
+
+}
+
+#endif /* __ardour_ca_importable_source_h__ */
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index f21de9be37..732585982d 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -33,8 +33,8 @@ CONFIG_VARIABLE (std::string, midi_port_name, "midi-port-name", "default")
CONFIG_VARIABLE (bool, trace_midi_input, "trace-midi-input", false)
CONFIG_VARIABLE (bool, trace_midi_output, "trace-midi-output", false)
CONFIG_VARIABLE (bool, send_mtc, "send-mtc", false)
-CONFIG_VARIABLE (bool, send_mmc, "send-mmc", false)
-CONFIG_VARIABLE (bool, mmc_control, "mmc-control", false)
+CONFIG_VARIABLE (bool, send_mmc, "send-mmc", true)
+CONFIG_VARIABLE (bool, mmc_control, "mmc-control", true)
CONFIG_VARIABLE (bool, midi_feedback, "midi-feedback", false)
CONFIG_VARIABLE (uint8_t, mmc_receive_device_id, "mmc-receive-device-id", 0)
CONFIG_VARIABLE (uint8_t, mmc_send_device_id, "mmc-send-device-id", 0)
@@ -157,6 +157,7 @@ CONFIG_VARIABLE (std::string, keyboard_layout, "keyboard-layout", "ansi")
CONFIG_VARIABLE (std::string, default_bindings, "default-bindings", "ardour")
CONFIG_VARIABLE (bool, default_narrow_ms, "default-narrow_ms", false)
CONFIG_VARIABLE (bool, rubberbanding_snaps_to_grid, "rubberbanding-snaps-to-grid", false)
+CONFIG_VARIABLE (long, font_scale, "font-scale", 102400)
/* denormal management */
diff --git a/libs/ardour/ardour/coreaudiosource.h b/libs/ardour/ardour/coreaudiosource.h
index ad21188531..d7282b35bd 100644
--- a/libs/ardour/ardour/coreaudiosource.h
+++ b/libs/ardour/ardour/coreaudiosource.h
@@ -21,7 +21,6 @@
#define __coreaudio_source_h__
#include <appleutility/CAAudioFile.h>
-
#include <ardour/audiofilesource.h>
namespace ARDOUR {
@@ -48,11 +47,8 @@ class CoreAudioSource : public AudioFileSource {
mutable CAAudioFile af;
uint16_t n_channels;
- mutable float *tmpbuf;
- mutable nframes_t tmpbufsize;
- mutable Glib::Mutex _tmpbuf_lock;
-
void init ();
+ int safe_read (Sample*, nframes_t start, nframes_t cnt, AudioBufferList&) const;
};
}; /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/importable_source.h b/libs/ardour/ardour/importable_source.h
index 5845d841b6..a33cf567e7 100644
--- a/libs/ardour/ardour/importable_source.h
+++ b/libs/ardour/ardour/importable_source.h
@@ -20,7 +20,6 @@
#ifndef __ardour_importable_source_h__
#define __ardour_importable_source_h__
-#include <sndfile.h>
#include <pbd/failed_constructor.h>
#include <ardour/types.h>
@@ -28,32 +27,15 @@ namespace ARDOUR {
class ImportableSource {
public:
- ImportableSource (const std::string& path)
- : in (sf_open (path.c_str(), SFM_READ, &sf_info), sf_close)
- {
- if (!in) throw failed_constructor();
-
- }
-
+ ImportableSource () {}
virtual ~ImportableSource() {}
- virtual nframes_t read (Sample* buffer, nframes_t nframes) {
- nframes_t per_channel = nframes / sf_info.channels;
- per_channel = sf_readf_float (in.get(), buffer, per_channel);
- return per_channel * sf_info.channels;
- }
-
+ virtual nframes_t read (Sample* buffer, nframes_t nframes) = 0;
virtual float ratio() const { return 1.0f; }
-
- uint channels() const { return sf_info.channels; }
-
- nframes_t length() const { return sf_info.frames; }
-
- nframes_t samplerate() const { return sf_info.samplerate; }
-
-protected:
- SF_INFO sf_info;
- boost::shared_ptr<SNDFILE> in;
+ virtual uint32_t channels() const = 0;
+ virtual nframes_t length() const = 0;
+ virtual nframes_t samplerate() const = 0;
+ virtual void seek (nframes_t pos) = 0;
};
}
diff --git a/libs/ardour/ardour/resampled_source.h b/libs/ardour/ardour/resampled_source.h
index 8ca56b52d3..6eca4cda98 100644
--- a/libs/ardour/ardour/resampled_source.h
+++ b/libs/ardour/ardour/resampled_source.h
@@ -30,18 +30,21 @@ namespace ARDOUR {
class ResampledImportableSource : public ImportableSource
{
public:
- ResampledImportableSource (const std::string& path,
- nframes_t rate, SrcQuality);
+ ResampledImportableSource (boost::shared_ptr<ImportableSource>, nframes_t rate, SrcQuality);
~ResampledImportableSource ();
nframes_t read (Sample* buffer, nframes_t nframes);
-
float ratio() const { return src_data.src_ratio; }
+ uint32_t channels() const { return source->channels(); }
+ nframes_t length() const { return source->length(); }
+ nframes_t samplerate() const { return source->samplerate(); }
+ void seek (nframes_t pos) { source->seek (pos); }
static const uint32_t blocksize;
private:
+ boost::shared_ptr<ImportableSource> source;
float* input;
SRC_STATE* src_state;
SRC_DATA src_data;
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index bc77157e9f..67a641ff59 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -175,6 +175,7 @@ class Session : public PBD::StatefulDestructible
union {
void* ptr;
bool yes_or_no;
+ nframes_t target2_frame;
SlaveSource slave;
Route* route;
};
diff --git a/libs/ardour/ardour/sndfileimportable.h b/libs/ardour/ardour/sndfileimportable.h
new file mode 100644
index 0000000000..5cd84f4f5f
--- /dev/null
+++ b/libs/ardour/ardour/sndfileimportable.h
@@ -0,0 +1,50 @@
+/*
+ Copyright (C) 2007 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __ardour_sndfile_importable_source_h__
+#define __ardour_sndfile_importable_source_h__
+
+#include <boost/shared_ptr.hpp>
+#include <sndfile.h>
+#include <pbd/failed_constructor.h>
+#include <ardour/types.h>
+#include <ardour/importable_source.h>
+
+namespace ARDOUR {
+
+class SndFileImportableSource : public ImportableSource {
+ public:
+ SndFileImportableSource (const std::string& path);
+ virtual ~SndFileImportableSource();
+
+ nframes_t read (Sample* buffer, nframes_t nframes);
+ uint32_t channels() const;
+ nframes_t length() const;
+ nframes_t samplerate() const;
+ void seek (nframes_t pos);
+
+ protected:
+ SF_INFO sf_info;
+ boost::shared_ptr<SNDFILE> in;
+
+};
+
+}
+
+#endif /* __ardour_sndfile_importable_source_h__ */
diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h
index 4fd71a4c96..dc83fc6ec1 100644
--- a/libs/ardour/ardour/sndfilesource.h
+++ b/libs/ardour/ardour/sndfilesource.h
@@ -102,7 +102,6 @@ class SndFileSource : public AudioFileSource {
void handle_header_position_change ();
static int64_t get_timecode_info (SNDFILE* sf, SF_BROADCAST_INFO* binfo, bool& exists);
- static Sample* get_interleave_buffer (nframes_t size);
};
} // namespace ARDOUR