Ardour  9.0-pre0-582-g084a23a80d
sr_converter.h
Go to the documentation of this file.
1 #ifndef AUDIOGRAPHER_SR_CONVERTER_H
2 #define AUDIOGRAPHER_SR_CONVERTER_H
3 
4 #include <samplerate.h>
5 
8 #include "audiographer/sink.h"
10 #include "audiographer/types.h"
12 
13 namespace AudioGrapher
14 {
15 
18  : public ListedSource<float>
19  , public Sink<float>
20  , public FlagDebuggable<>
21  , public Throwing<>
22 {
23  public:
25  SampleRateConverter (uint32_t channels);
27 
29  void init (samplecnt_t in_rate, samplecnt_t out_rate, int quality = 0);
30 
33 
39  void process (ProcessContext<float> const & c);
41 
42  private:
43 
45  void reset ();
46 
47  bool active;
48  uint32_t channels;
50 
51  float * leftover_data;
54 
55  float * data_out;
57 
58  SRC_DATA src_data;
59  SRC_STATE* src_state;
60 };
61 
62 } // namespace
63 
64 #endif // AUDIOGRAPHER_SR_CONVERTER_H
A debugging class for nodes that support a certain set of flags.
An generic Source that uses a std::list for managing outputs.
Definition: listed_source.h:17
void process(ProcessContext< float > const &c)
SampleRateConverter(uint32_t channels)
Constructor. RT safe.
samplecnt_t allocate_buffers(samplecnt_t max_samples)
Returns max amount of samples that will be output RT safe.
void init(samplecnt_t in_rate, samplecnt_t out_rate, int quality=0)
Init converter Not RT safe.
void set_end_of_input(ProcessContext< float > const &c)