Ardour  8.12
sndfileimportable.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
4  * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef __ardour_sndfile_importable_source_h__
22 #define __ardour_sndfile_importable_source_h__
23 
24 #include <memory>
25 
26 #include <sndfile.h>
28 #include "ardour/types.h"
30 
31 namespace ARDOUR {
32 
34 public:
35  SndFileImportableSource (const std::string& path);
37 
38  samplecnt_t read (Sample* buffer, samplecnt_t nframes);
39  uint32_t channels() const;
42  void seek (samplepos_t pos);
43  bool clamped_at_unity () const;
45 
46 protected:
47  SF_INFO sf_info;
48  std::shared_ptr<SNDFILE> in;
49 
50  /* these are int64_t so as to be independent of whatever
51  * types Ardour may use for samplepos_t, samplecnt_t etc.
52  */
53  int64_t timecode;
54  int64_t get_timecode_info (SNDFILE*, SF_BROADCAST_INFO*, bool&);
55 };
56 
57 }
58 
59 #endif /* __ardour_sndfile_importable_source_h__ */
void seek(samplepos_t pos)
std::shared_ptr< SNDFILE > in
samplepos_t natural_position() const
int64_t get_timecode_info(SNDFILE *, SF_BROADCAST_INFO *, bool &)
samplecnt_t read(Sample *buffer, samplecnt_t nframes)
samplecnt_t samplerate() const
SndFileImportableSource(const std::string &path)
samplecnt_t length() const
#define LIBARDOUR_API
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t