LMMS
Loading...
Searching...
No Matches
resampler.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------------
2//
3// Copyright (C) 2006-2023 Fons Adriaensen <fons@linuxaudio.org>
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//
18// ----------------------------------------------------------------------------
19
20
21#ifndef __RESAMPLER_H
22#define __RESAMPLER_H
23
24
25#include "resampler-table.h"
26
27
29{
30public:
31
32 Resampler (void) noexcept;
33 ~Resampler (void);
34
35 bool setup (unsigned int fs_inp,
36 unsigned int fs_out,
37 unsigned int nchan,
38 unsigned int hlen);
39
40 bool setup (unsigned int fs_inp,
41 unsigned int fs_out,
42 unsigned int nchan,
43 unsigned int hlen,
44 double frel);
45
46 void clear (void);
47 bool reset (void) noexcept;
48 int nchan (void) const noexcept { return _nchan; }
49 int filtlen (void) const noexcept { return inpsize (); } // Deprecated
50 int inpsize (void) const noexcept;
51 double inpdist (void) const noexcept;
52 bool process (void);
53
54 unsigned int inp_count;
55 unsigned int out_count;
56 float *inp_data;
57 float *out_data;
58 float **inp_list;
59 float **out_list;
60
61private:
62
64 unsigned int _nchan;
65 unsigned int _inmax;
66 unsigned int _index;
67 unsigned int _nread;
68 unsigned int _nzero;
69 unsigned int _phase;
70 unsigned int _pstep;
71 float *_buff;
72 void *_dummy [8];
73};
74
75
76#endif
Definition resampler-table.h:46
bool setup(unsigned int fs_inp, unsigned int fs_out, unsigned int nchan, unsigned int hlen)
float * _buff
Definition resampler.h:71
unsigned int inp_count
Definition resampler.h:54
unsigned int _index
Definition resampler.h:66
void clear(void)
int inpsize(void) const noexcept
~Resampler(void)
int filtlen(void) const noexcept
Definition resampler.h:49
unsigned int _inmax
Definition resampler.h:65
float ** inp_list
Definition resampler.h:58
double inpdist(void) const noexcept
bool setup(unsigned int fs_inp, unsigned int fs_out, unsigned int nchan, unsigned int hlen, double frel)
bool process(void)
float * inp_data
Definition resampler.h:56
unsigned int _nread
Definition resampler.h:67
float * out_data
Definition resampler.h:57
unsigned int _nzero
Definition resampler.h:68
unsigned int _pstep
Definition resampler.h:70
int nchan(void) const noexcept
Definition resampler.h:48
unsigned int _nchan
Definition resampler.h:64
Resampler(void) noexcept
Resampler_table * _table
Definition resampler.h:63
bool reset(void) noexcept
unsigned int out_count
Definition resampler.h:55
float ** out_list
Definition resampler.h:59
void * _dummy[8]
Definition resampler.h:72
unsigned int _phase
Definition resampler.h:69