summaryrefslogtreecommitdiff
path: root/libs/audiographer/audiographer/sndfile/sndfile.h
blob: 2fccfc458ebcb8f2f891166529d6a9c6592ba28e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef AUDIOGRAPHER_SNDFILE_H
#define AUDIOGRAPHER_SNDFILE_H

#include "sndfile_writer.h"
#include "sndfile_reader.h"

namespace AudioGrapher
{

/** Reader/Writer for audio files using libsndfile.
  * Only short, int and float are valid template parameters
  */
template<typename T = DefaultSampleType>
class Sndfile : public SndfileWriter<T>, public SndfileReader<T>
{
  public:

	Sndfile (std::string const & filename, SndfileBase::Mode mode = SndfileBase::ReadWrite, int format = 0,
	         ChannelCount channels = 0, samplecnt_t samplerate = 0)
	  : SndfileHandle (filename, mode, format, channels, samplerate)
	{}

	Sndfile (Sndfile const & other) : SndfileHandle (other) {}
	using SndfileHandle::operator=;

};

} // namespace

#endif // AUDIOGRAPHER_SNDFILE_H