ardour
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libs
ardour
ardour
buffer.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2006 Paul Davis
3
4
This program is free software; you can redistribute it and/or modify it
5
under the terms of the GNU General Public License as published by the Free
6
Software Foundation; either version 2 of the License, or (at your option)
7
any later version.
8
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
for more details.
13
14
You should have received a copy of the GNU General Public License along
15
with this program; if not, write to the Free Software Foundation, Inc.,
16
675 Mass Ave, Cambridge, MA 02139, USA.
17
*/
18
19
#ifndef __ardour_buffer_h__
20
#define __ardour_buffer_h__
21
22
#include <stddef.h>
23
24
#include <boost/utility.hpp>
25
26
#include "
ardour/libardour_visibility.h
"
27
#include "
ardour/types.h
"
28
#include "
ardour/data_type.h
"
29
30
namespace
ARDOUR
{
31
32
42
class
LIBARDOUR_API
Buffer
:
public
boost::noncopyable
43
{
44
public
:
45
virtual
~Buffer
() {}
46
48
static
Buffer
* create(
DataType
type,
size_t
capacity);
49
51
size_t
capacity
()
const
{
return
_capacity; }
52
55
DataType
type
()
const
{
return
_type; }
56
57
bool
silent
()
const
{
return
_silent; }
58
64
virtual
void
resize (
size_t
) = 0;
65
67
virtual
void
silence (
framecnt_t
len,
framecnt_t
offset = 0) = 0;
68
70
virtual
void
clear
() { silence(_capacity, 0); }
71
72
virtual
void
read_from (
const
Buffer
& src,
framecnt_t
len,
framecnt_t
dst_offset = 0,
framecnt_t
src_offset = 0) = 0;
73
virtual
void
merge_from (
const
Buffer
& src,
framecnt_t
len,
framecnt_t
dst_offset = 0,
framecnt_t
src_offset = 0) = 0;
74
75
protected
:
76
Buffer
(
DataType
type)
77
: _type(type), _capacity(0), _silent (true)
78
{}
79
80
DataType
_type
;
81
pframes_t
_capacity
;
82
bool
_silent
;
83
};
84
85
86
}
// namespace ARDOUR
87
88
#endif // __ardour_buffer_h__
ARDOUR::Buffer::type
DataType type() const
Definition:
buffer.h:55
types.h
ARDOUR::Buffer::silent
bool silent() const
Definition:
buffer.h:57
ARDOUR::Buffer::_capacity
pframes_t _capacity
Definition:
buffer.h:81
ARDOUR::pframes_t
uint32_t pframes_t
Definition:
types.h:61
ARDOUR::Buffer
Definition:
buffer.h:42
ARDOUR::Buffer::Buffer
Buffer(DataType type)
Definition:
buffer.h:76
ARDOUR::Buffer::_type
DataType _type
Definition:
buffer.h:80
ARDOUR::framecnt_t
int64_t framecnt_t
Definition:
types.h:76
ARDOUR::Buffer::~Buffer
virtual ~Buffer()
Definition:
buffer.h:45
ARDOUR
Definition:
amp.h:29
libardour_visibility.h
LIBARDOUR_API
#define LIBARDOUR_API
Definition:
libardour_visibility.h:40
ARDOUR::Buffer::capacity
size_t capacity() const
Definition:
buffer.h:51
data_type.h
ARDOUR::Buffer::clear
virtual void clear()
Definition:
buffer.h:70
ARDOUR::DataType
Definition:
data_type.h:37
ARDOUR::Buffer::_silent
bool _silent
Definition:
buffer.h:82
Generated on Sun May 24 2015 12:15:05 for ardour by
1.8.8