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:
Taybin Rutkin 2006-06-27 21:57:15 +00:00
parent 17916d84bc
commit fdda19d3d4
6 changed files with 27 additions and 22 deletions

View file

@ -98,7 +98,7 @@ arch_specific_objects = [ ]
osc_files = [ 'osc.cc' ]
vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
coreaudio_files = [ 'coreaudio_source.cc' ]
coreaudio_files = [ 'coreaudiosource.cc' ]
extra_sources = [ ]
if ardour['VST']:

View file

@ -62,7 +62,7 @@ class AudioFileSource : public AudioSource {
cannot.
*/
static AudioFileSource* create (string path_plus_channel);
static AudioFileSource* create (const string& path_plus_channel);
static AudioFileSource* create (const XMLNode&);
static bool get_soundfile_info (string path, SoundFileInfo& _info, string& error);

View file

@ -27,15 +27,22 @@ namespace ARDOUR {
class CoreAudioSource : public AudioFileSource {
public:
CoreAudioSource (const string& path_plus_channel, bool build_peak = true);
CoreAudioSource (const XMLNode&);
CoreAudioSource (const string& path_plus_channel, Flag);
~CoreAudioSource ();
float sample_rate() const;
int update_header (jack_nframes_t when, struct tm&, time_t);
int flush_header () {return 0;};
void set_header_timeline_position () {};
protected:
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:
ExtAudioFileRef af;
@ -45,7 +52,7 @@ class CoreAudioSource : public AudioFileSource {
mutable jack_nframes_t tmpbufsize;
mutable Glib::Mutex _tmpbuf_lock;
void init (const string &str, bool build_peak);
void init (const string &str);
};
}; /* namespace ARDOUR */

View file

@ -20,7 +20,7 @@
#include <algorithm>
#include <stdlib.h>
#include <cstdlib>
#include <sigc++/bind.h>

View file

@ -42,7 +42,7 @@
// if these headers come before sigc++ is included
// the parser throws ObjC++ errors. (nil is a keyword)
#ifdef HAVE_COREAUDIO
#include <ardour/coreaudio_source.h>
#include <ardour/coreaudiosource.h>
#include <AudioToolbox/ExtendedAudioFile.h>
#include <AudioToolbox/AudioFormat.h>
#endif // HAVE_COREAUDIO
@ -216,11 +216,11 @@ AudioFileSource::create (const string& idstr)
AudioFileSource* es = 0;
try {
es = new CoreAudioSource (idstr);
es = new CoreAudioSource (idstr, Flag(0x0));
}
catch (failed_constructor& err) {
es = new SndFileSource (idstr);
es = new SndFileSource (idstr, Flag(0x0));
}
return es;
@ -229,9 +229,9 @@ AudioFileSource::create (const string& idstr)
#else
AudioFileSource*
AudioFileSource::create (string idstr)
AudioFileSource::create (const string& idstr)
{
return new SndFileSource (idstr);
return new SndFileSource (idstr, Flag(0x0));
}
#endif // HAVE_COREAUDIO

View file

@ -18,8 +18,7 @@
*/
#include <pbd/error.h>
#include <ardour/coreaudio_source.h>
#include <ardour/coreaudiosource.h>
#include "i18n.h"
@ -31,22 +30,21 @@ using namespace PBD;
CoreAudioSource::CoreAudioSource (const XMLNode& node)
: AudioFileSource (node)
{
init (_name, true);
init (_name);
AudioSourceCreated (this); /* EMIT SIGNAL */
}
CoreAudioSource::CoreAudioSource (const string& idstr, bool build_peak)
: AudioFileSource(idstr, build_peak)
CoreAudioSource::CoreAudioSource (const string& idstr, Flag flags)
: AudioFileSource(idstr, flags)
{
init (idstr, build_peak);
init (idstr);
if (build_peak) {
AudioSourceCreated (this); /* EMIT SIGNAL */
}
AudioSourceCreated (this); /* EMIT SIGNAL */
}
void
CoreAudioSource::init (const string& idstr, bool build_peak)
CoreAudioSource::init (const string& idstr)
{
string::size_type pos;
string file;
@ -132,7 +130,7 @@ CoreAudioSource::init (const string& idstr, bool build_peak)
throw failed_constructor ();
}
if (build_peak) {
if (_build_peakfiles) {
if (initialize_peakfile (false, file)) {
error << "initialize peakfile failed" << endmsg;
ExtAudioFileDispose (af);
@ -155,7 +153,7 @@ CoreAudioSource::~CoreAudioSource ()
}
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;