kwave  18.07.70
SampleEncoderLinear.h
Go to the documentation of this file.
1 /*************************************************************************
2  SampleEncoderLinear.h - encoder for all non-compressed linear formats
3  -------------------
4  begin : Tue Apr 18 2006
5  copyright : (C) 2006 by Thomas Eschenbacher
6  email : Thomas.Eschenbacher@gmx.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef SAMPLE_ENCODER_LINEAR_H
19 #define SAMPLE_ENCODER_LINEAR_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 
25 #include "libkwave/ByteOrder.h"
26 #include "libkwave/SampleEncoder.h"
27 #include "libkwave/SampleFormat.h"
28 
29 namespace Kwave
30 {
31  class Q_DECL_EXPORT SampleEncoderLinear: public Kwave::SampleEncoder
32  {
33  public:
34 
42  unsigned int bits_per_sample,
43  Kwave::byte_order_t endianness);
44 
46  virtual ~SampleEncoderLinear() Q_DECL_OVERRIDE;
47 
54  virtual void encode(const Kwave::SampleArray &samples,
55  unsigned int count,
56  QByteArray &raw_data) Q_DECL_OVERRIDE;
57 
59  virtual unsigned int rawBytesPerSample() Q_DECL_OVERRIDE;
60 
61  private:
62 
64  unsigned int m_bytes_per_sample;
65 
67  void (*m_encoder)(const sample_t *, quint8 *, unsigned int);
68 
69  };
70 }
71 
72 #endif /* SAMPLE_ENCODER_LINEAR_H */
73 
74 //***************************************************************************
75 //***************************************************************************
byte_order_t
Definition: ByteOrder.h:25
Definition: App.h:33
qint32 sample_t
Definition: Sample.h:37