LMMS
Loading...
Searching...
No Matches
vresampler.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 __VRESAMPLER_H
22#define __VRESAMPLER_H
23
24
25#include "resampler-table.h"
26
27
29{
30public:
31
32 VResampler (void) noexcept;
34
35 bool setup (double ratio,
36 unsigned int nchan,
37 unsigned int hlen);
38
39 bool setup (double ratio,
40 unsigned int nchan,
41 unsigned int hlen,
42 double frel);
43
44 void clear (void);
45 bool reset (void) noexcept;
46 int nchan (void) const noexcept { return _nchan; }
47 int inpsize (void) const noexcept;
48 double inpdist (void) const noexcept;
49 bool process (void);
50
51 void set_phase (double p);
52 void set_rrfilt (double t);
53 void set_rratio (double r);
54
55 unsigned int inp_count;
56 unsigned int out_count;
57 float *inp_data;
58 float *out_data;
59 void *inp_list;
60 void *out_list;
61
62private:
63
64 enum { NPHASE = 120 };
65
67 unsigned int _nchan;
68 unsigned int _inmax;
69 unsigned int _index;
70 unsigned int _nread;
71 unsigned int _nzero;
72 double _ratio;
73 double _phase;
74 double _pstep;
75 double _qstep;
76 double _wstep;
77 float *_buff;
78 float *_c1;
79 float *_c2;
80 void *_dummy [8];
81};
82
83
84#endif
Definition resampler-table.h:46
unsigned int _inmax
Definition vresampler.h:68
void set_rrfilt(double t)
unsigned int _nchan
Definition vresampler.h:67
bool setup(double ratio, unsigned int nchan, unsigned int hlen)
unsigned int inp_count
Definition vresampler.h:55
double _wstep
Definition vresampler.h:76
double _pstep
Definition vresampler.h:74
double _ratio
Definition vresampler.h:72
float * _buff
Definition vresampler.h:77
unsigned int _index
Definition vresampler.h:69
int nchan(void) const noexcept
Definition vresampler.h:46
Resampler_table * _table
Definition vresampler.h:66
unsigned int _nread
Definition vresampler.h:70
unsigned int out_count
Definition vresampler.h:56
int inpsize(void) const noexcept
~VResampler(void)
@ NPHASE
Definition vresampler.h:64
double _phase
Definition vresampler.h:73
void set_phase(double p)
unsigned int _nzero
Definition vresampler.h:71
float * _c1
Definition vresampler.h:78
bool process(void)
double inpdist(void) const noexcept
bool setup(double ratio, unsigned int nchan, unsigned int hlen, double frel)
bool reset(void) noexcept
void * inp_list
Definition vresampler.h:59
void * _dummy[8]
Definition vresampler.h:80
VResampler(void) noexcept
void set_rratio(double r)
float * out_data
Definition vresampler.h:58
float * inp_data
Definition vresampler.h:57
double _qstep
Definition vresampler.h:75
void * out_list
Definition vresampler.h:60
float * _c2
Definition vresampler.h:79
void clear(void)
struct huft * t
Definition inflate.c:943
uch * p
Definition crypt.c:594
int r
Definition crypt.c:458