Ardour  9.0-pre0-582-g084a23a80d
importable_source.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2007 Tim Mayberry <mojofunk@gmail.com>
4  * Copyright (C) 2009 David Robillard <d@drobilla.net>
5  * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
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 #pragma once
23 
24 #include "pbd/failed_constructor.h"
26 #include "ardour/types.h"
27 
28 namespace ARDOUR {
29 
31 public:
33  virtual ~ImportableSource() {}
34 
35  virtual samplecnt_t read (Sample* buffer, samplecnt_t nframes) = 0;
36  virtual float ratio() const { return 1.0f; }
37  virtual uint32_t channels() const = 0;
38  virtual samplecnt_t length() const = 0;
39  virtual samplecnt_t samplerate() const = 0;
40  virtual void seek (samplepos_t pos) = 0;
41  virtual samplepos_t natural_position() const = 0;
42 
43  virtual bool clamped_at_unity () const = 0;
44 };
45 
46 }
47 
virtual samplecnt_t length() const =0
virtual bool clamped_at_unity() const =0
virtual samplecnt_t read(Sample *buffer, samplecnt_t nframes)=0
virtual samplecnt_t samplerate() const =0
virtual float ratio() const
virtual void seek(samplepos_t pos)=0
virtual samplepos_t natural_position() const =0
virtual uint32_t channels() const =0
#define LIBARDOUR_API
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t