mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
CoreAudioSource moved to coreaudiosource.cc.
Compiles with new libsndfile class hierarchy. git-svn-id: svn://localhost/ardour2/trunk@647 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
17916d84bc
commit
fdda19d3d4
6 changed files with 27 additions and 22 deletions
|
|
@ -98,7 +98,7 @@ arch_specific_objects = [ ]
|
||||||
|
|
||||||
osc_files = [ 'osc.cc' ]
|
osc_files = [ 'osc.cc' ]
|
||||||
vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
|
vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
|
||||||
coreaudio_files = [ 'coreaudio_source.cc' ]
|
coreaudio_files = [ 'coreaudiosource.cc' ]
|
||||||
extra_sources = [ ]
|
extra_sources = [ ]
|
||||||
|
|
||||||
if ardour['VST']:
|
if ardour['VST']:
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class AudioFileSource : public AudioSource {
|
||||||
cannot.
|
cannot.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static AudioFileSource* create (string path_plus_channel);
|
static AudioFileSource* create (const string& path_plus_channel);
|
||||||
static AudioFileSource* create (const XMLNode&);
|
static AudioFileSource* create (const XMLNode&);
|
||||||
|
|
||||||
static bool get_soundfile_info (string path, SoundFileInfo& _info, string& error);
|
static bool get_soundfile_info (string path, SoundFileInfo& _info, string& error);
|
||||||
|
|
|
||||||
|
|
@ -27,15 +27,22 @@ namespace ARDOUR {
|
||||||
|
|
||||||
class CoreAudioSource : public AudioFileSource {
|
class CoreAudioSource : public AudioFileSource {
|
||||||
public:
|
public:
|
||||||
CoreAudioSource (const string& path_plus_channel, bool build_peak = true);
|
|
||||||
CoreAudioSource (const XMLNode&);
|
CoreAudioSource (const XMLNode&);
|
||||||
|
CoreAudioSource (const string& path_plus_channel, Flag);
|
||||||
~CoreAudioSource ();
|
~CoreAudioSource ();
|
||||||
|
|
||||||
float sample_rate() const;
|
float sample_rate() const;
|
||||||
int update_header (jack_nframes_t when, struct tm&, time_t);
|
int update_header (jack_nframes_t when, struct tm&, time_t);
|
||||||
|
|
||||||
|
int flush_header () {return 0;};
|
||||||
|
void set_header_timeline_position () {};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
jack_nframes_t read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const;
|
jack_nframes_t read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const;
|
||||||
|
|
||||||
|
jack_nframes_t write_unlocked (Sample *dst, jack_nframes_t cnt, char * workbuf)
|
||||||
|
{ return 0; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ExtAudioFileRef af;
|
ExtAudioFileRef af;
|
||||||
|
|
@ -45,7 +52,7 @@ class CoreAudioSource : public AudioFileSource {
|
||||||
mutable jack_nframes_t tmpbufsize;
|
mutable jack_nframes_t tmpbufsize;
|
||||||
mutable Glib::Mutex _tmpbuf_lock;
|
mutable Glib::Mutex _tmpbuf_lock;
|
||||||
|
|
||||||
void init (const string &str, bool build_peak);
|
void init (const string &str);
|
||||||
};
|
};
|
||||||
|
|
||||||
}; /* namespace ARDOUR */
|
}; /* namespace ARDOUR */
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include <sigc++/bind.h>
|
#include <sigc++/bind.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
// if these headers come before sigc++ is included
|
// if these headers come before sigc++ is included
|
||||||
// the parser throws ObjC++ errors. (nil is a keyword)
|
// the parser throws ObjC++ errors. (nil is a keyword)
|
||||||
#ifdef HAVE_COREAUDIO
|
#ifdef HAVE_COREAUDIO
|
||||||
#include <ardour/coreaudio_source.h>
|
#include <ardour/coreaudiosource.h>
|
||||||
#include <AudioToolbox/ExtendedAudioFile.h>
|
#include <AudioToolbox/ExtendedAudioFile.h>
|
||||||
#include <AudioToolbox/AudioFormat.h>
|
#include <AudioToolbox/AudioFormat.h>
|
||||||
#endif // HAVE_COREAUDIO
|
#endif // HAVE_COREAUDIO
|
||||||
|
|
@ -216,11 +216,11 @@ AudioFileSource::create (const string& idstr)
|
||||||
AudioFileSource* es = 0;
|
AudioFileSource* es = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
es = new CoreAudioSource (idstr);
|
es = new CoreAudioSource (idstr, Flag(0x0));
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (failed_constructor& err) {
|
catch (failed_constructor& err) {
|
||||||
es = new SndFileSource (idstr);
|
es = new SndFileSource (idstr, Flag(0x0));
|
||||||
}
|
}
|
||||||
|
|
||||||
return es;
|
return es;
|
||||||
|
|
@ -229,9 +229,9 @@ AudioFileSource::create (const string& idstr)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
AudioFileSource*
|
AudioFileSource*
|
||||||
AudioFileSource::create (string idstr)
|
AudioFileSource::create (const string& idstr)
|
||||||
{
|
{
|
||||||
return new SndFileSource (idstr);
|
return new SndFileSource (idstr, Flag(0x0));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAVE_COREAUDIO
|
#endif // HAVE_COREAUDIO
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <pbd/error.h>
|
#include <pbd/error.h>
|
||||||
|
#include <ardour/coreaudiosource.h>
|
||||||
#include <ardour/coreaudio_source.h>
|
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
@ -31,22 +30,21 @@ using namespace PBD;
|
||||||
CoreAudioSource::CoreAudioSource (const XMLNode& node)
|
CoreAudioSource::CoreAudioSource (const XMLNode& node)
|
||||||
: AudioFileSource (node)
|
: AudioFileSource (node)
|
||||||
{
|
{
|
||||||
init (_name, true);
|
init (_name);
|
||||||
|
|
||||||
AudioSourceCreated (this); /* EMIT SIGNAL */
|
AudioSourceCreated (this); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreAudioSource::CoreAudioSource (const string& idstr, bool build_peak)
|
CoreAudioSource::CoreAudioSource (const string& idstr, Flag flags)
|
||||||
: AudioFileSource(idstr, build_peak)
|
: AudioFileSource(idstr, flags)
|
||||||
{
|
{
|
||||||
init (idstr, build_peak);
|
init (idstr);
|
||||||
|
|
||||||
if (build_peak) {
|
AudioSourceCreated (this); /* EMIT SIGNAL */
|
||||||
AudioSourceCreated (this); /* EMIT SIGNAL */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CoreAudioSource::init (const string& idstr, bool build_peak)
|
CoreAudioSource::init (const string& idstr)
|
||||||
{
|
{
|
||||||
string::size_type pos;
|
string::size_type pos;
|
||||||
string file;
|
string file;
|
||||||
|
|
@ -132,7 +130,7 @@ CoreAudioSource::init (const string& idstr, bool build_peak)
|
||||||
throw failed_constructor ();
|
throw failed_constructor ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (build_peak) {
|
if (_build_peakfiles) {
|
||||||
if (initialize_peakfile (false, file)) {
|
if (initialize_peakfile (false, file)) {
|
||||||
error << "initialize peakfile failed" << endmsg;
|
error << "initialize peakfile failed" << endmsg;
|
||||||
ExtAudioFileDispose (af);
|
ExtAudioFileDispose (af);
|
||||||
|
|
@ -155,7 +153,7 @@ CoreAudioSource::~CoreAudioSource ()
|
||||||
}
|
}
|
||||||
|
|
||||||
jack_nframes_t
|
jack_nframes_t
|
||||||
CoreAudioSource::read (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const
|
CoreAudioSource::read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_t cnt, char * workbuf) const
|
||||||
{
|
{
|
||||||
OSStatus err = noErr;
|
OSStatus err = noErr;
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue