Ardour  8.12
coreaudiosource.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2009 Taybin Rutkin <taybin@taybin.com>
3  * Copyright (C) 2006-2011 David Robillard <d@drobilla.net>
4  * Copyright (C) 2006-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2013 John Emmas <john@creativepost.co.uk>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #ifndef __coreaudio_source_h__
23 #define __coreaudio_source_h__
24 
25 #ifdef COREAUDIO105
26 #include "CAAudioFile.h"
27 #else
28 #include "CAExtAudioFile.h"
29 #endif
30 #include "ardour/audiofilesource.h"
31 #include <string>
32 
33 namespace ARDOUR {
34 
36  public:
38  CoreAudioSource (ARDOUR::Session&, const std::string& path, int chn, Flag);
40 
41  void set_path (const std::string& p);
42 
43  float sample_rate() const;
44  int update_header (samplepos_t when, struct tm&, time_t);
45 
46  uint32_t channel_count () const { return n_channels; }
47 
48  int flush_header () {return 0;};
50  bool clamped_at_unity () const { return false; }
51 
52  void flush () {}
53 
54  static int get_soundfile_info (std::string path, SoundFileInfo& _info, std::string& error_msg);
55 
56  protected:
57  void close ();
60 
61  private:
62 #ifdef COREAUDIO105
63  mutable CAAudioFile af;
64 #else
65  mutable CAExtAudioFile af;
66 #endif
67  uint16_t n_channels;
68 
69  void init_cafile ();
70  int safe_read (Sample*, samplepos_t start, samplecnt_t cnt, AudioBufferList&) const;
71 };
72 
73 }; /* namespace ARDOUR */
74 
75 #endif /* __coreaudio_source_h__ */
76 
uint32_t channel_count() const
void set_path(const std::string &p)
samplecnt_t write_unlocked(Sample *, samplecnt_t)
CoreAudioSource(ARDOUR::Session &, const std::string &path, int chn, Flag)
float sample_rate() const
int safe_read(Sample *, samplepos_t start, samplecnt_t cnt, AudioBufferList &) const
CoreAudioSource(ARDOUR::Session &, const XMLNode &)
samplecnt_t read_unlocked(Sample *dst, samplepos_t start, samplecnt_t cnt) const
static int get_soundfile_info(std::string path, SoundFileInfo &_info, std::string &error_msg)
int update_header(samplepos_t when, struct tm &, time_t)
bool clamped_at_unity() const
Definition: xml++.h:114
#define LIBARDOUR_API
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t