Ardour  9.0-pre0-427-gd2a3450e2f
sample_format_converter.h
Go to the documentation of this file.
1 #ifndef AUDIOGRAPHER_SAMPLE_FORMAT_CONVERTER_H
2 #define AUDIOGRAPHER_SAMPLE_FORMAT_CONVERTER_H
3 
5 #include "audiographer/sink.h"
8 
9 namespace AudioGrapher
10 {
11 
13 enum /*LIBAUDIOGRAPHER_API*/ DitherType
14 {
19 };
20 
24 template <typename TOut>
26  : public Sink<float>
27  , public ListedSource<TOut>
28  , public Throwing<>
29 {
30  public:
36 
44  void init (samplecnt_t max_samples, int type, int data_width);
45 
47  void set_clip_floats (bool yn) { clip_floats = yn; }
48 
50  void process (ProcessContext<float> const & c_in);
51 
54 
55  private:
56  void reset();
57  void init_common (samplecnt_t max_samples); // not-template-specialized part of init
59 
63  TOut * data_out;
64 
66 
67 };
68 
69 } // namespace
70 
71 #endif // AUDIOGRAPHER_SAMPLE_FORMAT_CONVERTER_H
An generic Source that uses a std::list for managing outputs.
Definition: listed_source.h:17
void process(ProcessContext< float > &c_in)
This version is only different in the case when TOut = float, and float clipping is on.
void init_common(samplecnt_t max_samples)
void check_sample_and_channel_count(samplecnt_t samples, ChannelCount channels_)
void init(samplecnt_t max_samples, int type, int data_width)
SampleFormatConverter(ChannelCount channels)
void process(ProcessContext< float > const &c_in)
Processes data without modifying it.
void set_clip_floats(bool yn)
Set whether or not clipping to [-1.0, 1.0] should occur when TOut = float. Clipping is off by default...
void * GDither
Definition: gdither_types.h:43
@ GDitherRect
Definition: gdither_types.h:29
@ GDitherNone
Definition: gdither_types.h:28
@ GDitherShaped
Definition: gdither_types.h:31
@ GDitherTri
Definition: gdither_types.h:30
DitherType
Dither types from the gdither library.
@ D_Tri
Triangular dithering.
@ D_None
No didtering.
@ D_Shaped
Actually noise shaping, only works for 46kHzish signals.
@ D_Rect
Rectangular dithering, i.e. white noise.