Ardour  9.0-pre0-582-g084a23a80d
audio_port.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2009 David Robillard <d@drobilla.net>
3  * Copyright (C) 2007-2010 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2007-2015 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
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 
25 
26 #include "ardour/port.h"
27 #include "ardour/audio_buffer.h"
28 
29 namespace ARDOUR {
30 
32 {
33 public:
35 
36  DataType type () const {
37  return DataType::AUDIO;
38  }
39 
42  void cycle_split ();
43 
44  void flush_buffers (pframes_t nframes);
45 
46  /* reset SRC, clear out any state */
47  void reinit (bool with_ratio);
48 
50  return get_audio_buffer (nframes);
51  }
52 
54  void set_buffer_size (pframes_t nframes);
55 
56 protected:
57  friend class PortManager;
58  AudioPort (std::string const &, PortFlags);
59 
60 
61  /* special access for PortManager only (hah, C++) */
63 
64 private:
68  bool _buf_valid;
69 };
70 
71 } // namespace ARDOUR
72 
Buffer & get_buffer(pframes_t nframes)
Definition: audio_port.h:49
DataType type() const
Definition: audio_port.h:36
ArdourZita::VMResampler _src
Definition: audio_port.h:66
void cycle_end(pframes_t)
AudioBuffer * _buffer
Definition: audio_port.h:65
AudioPort(std::string const &, PortFlags)
void cycle_start(pframes_t)
void reinit(bool with_ratio)
Sample * engine_get_whole_audio_buffer()
AudioBuffer & get_audio_buffer(pframes_t nframes)
Sample * _data
Definition: audio_port.h:67
void flush_buffers(pframes_t nframes)
void set_buffer_size(pframes_t nframes)
#define LIBARDOUR_API
uint32_t pframes_t