1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
2 /*
3     bqaudiostream
4 
5     A small library wrapping various audio file read/write
6     implementations in C++.
7 
8     Copyright 2007-2015 Particular Programs Ltd.
9 
10     Permission is hereby granted, free of charge, to any person
11     obtaining a copy of this software and associated documentation
12     files (the "Software"), to deal in the Software without
13     restriction, including without limitation the rights to use, copy,
14     modify, merge, publish, distribute, sublicense, and/or sell copies
15     of the Software, and to permit persons to whom the Software is
16     furnished to do so, subject to the following conditions:
17 
18     The above copyright notice and this permission notice shall be
19     included in all copies or substantial portions of the Software.
20 
21     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
25     ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
26     CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27     WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 
29     Except as contained in this notice, the names of Chris Cannam and
30     Particular Programs Ltd shall not be used in advertising or
31     otherwise to promote the sale, use or other dealings in this
32     Software without prior written authorization.
33 */
34 
35 #ifndef BQ_CORE_AUDIO_READ_STREAM_H_
36 #define BQ_CORE_AUDIO_READ_STREAM_H_
37 
38 #include "AudioReadStream.h"
39 
40 #ifdef HAVE_COREAUDIO
41 
42 namespace breakfastquay
43 {
44 
45 class CoreAudioReadStream : public AudioReadStream
46 {
47 public:
48     CoreAudioReadStream(std::string path);
49     virtual ~CoreAudioReadStream();
50 
getTrackName()51     virtual std::string getTrackName() const { return m_track; }
getArtistName()52     virtual std::string getArtistName() const { return m_artist; }
53 
getError()54     virtual std::string getError() const { return m_error; }
55 
56 protected:
57     virtual size_t getFrames(size_t count, float *frames);
58 
59     std::string m_path;
60     std::string m_error;
61     std::string m_track;
62     std::string m_artist;
63 
64     class D;
65     D *m_d;
66 };
67 
68 }
69 
70 #endif
71 
72 #endif
73