MythTV master
lameencoder.h
Go to the documentation of this file.
1/*
2 MP3 encoding support using liblame for MythMusic
3
4 (c) 2003 Stefan Frank
5
6 Please send an e-mail to sfr@gmx.net if you have
7 questions or comments.
8
9 Project Website: http://www.mythtv.org/
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 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24*/
25
26#ifndef LAMEENCODER_H_
27#define LAMEENCODER_H_
28
29class QString;
30class MusicMetadata;
31class Encoder;
32
33#include <lame/lame.h>
34
35#include "encoder.h"
36
37class LameEncoder : public Encoder
38{
39 public:
40 LameEncoder(const QString &outfile, int qualitylevel, MusicMetadata *metadata,
41 bool vbr = false);
42 ~LameEncoder() override;
43 int addSamples(int16_t *bytes, unsigned int len) override; // Encoder
44
45 private:
46 int init_encoder(lame_global_flags *gf, int quality, bool vbr) const;
47 static void init_id3tags(lame_global_flags *gf);
48
49 int m_bits {16};
50 int m_channels {2};
53
54 // worst-case estimate
55 int m_mp3BufSize {(int)(1.25 * 16384 + 7200)};
56 char *m_mp3Buf {nullptr};
57
58 lame_global_flags *m_gf {nullptr};
59};
60
61#endif
62
int m_mp3BufSize
Definition: lameencoder.h:55
char * m_mp3Buf
Definition: lameencoder.h:56
LameEncoder(const QString &outfile, int qualitylevel, MusicMetadata *metadata, bool vbr=false)
int m_channels
Definition: lameencoder.h:50
~LameEncoder() override
static void init_id3tags(lame_global_flags *gf)
Definition: lameencoder.cpp:46
lame_global_flags * m_gf
Definition: lameencoder.h:58
int m_samplesPerChannel
Definition: lameencoder.h:52
int addSamples(int16_t *bytes, unsigned int len) override
int m_bytesPerSample
Definition: lameencoder.h:51
int init_encoder(lame_global_flags *gf, int quality, bool vbr) const
Definition: lameencoder.cpp:60