00001 /* 00002 MP3 encoding support using liblame for MythMusic 00003 00004 (c) 2003 Stefan Frank 00005 00006 Please send an e-mail to sfr@gmx.net if you have 00007 questions or comments. 00008 00009 Project Website: http://www.mythtv.org/ 00010 00011 This program is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 This program is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with this program; if not, write to the Free Software 00023 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00024 */ 00025 00026 #ifndef LAMEENCODER_H_ 00027 #define LAMEENCODER_H_ 00028 00029 class QString; 00030 class Metadata; 00031 class Encoder; 00032 00033 #ifdef MMX 00034 #define LAME_WORKAROUND 1 00035 #undef MMX 00036 #endif 00037 00038 #include <lame/lame.h> 00039 00040 #ifdef LAME_WORKAROUND 00041 #define MMX 1 00042 #endif 00043 00044 #include "encoder.h" 00045 00046 class LameEncoder : public Encoder 00047 { 00048 public: 00049 LameEncoder(const QString &outfile, int qualitylevel, Metadata *metadata, 00050 bool vbr = false); 00051 ~LameEncoder(); 00052 int addSamples(int16_t *bytes, unsigned int len); 00053 00054 private: 00055 int init_encoder(lame_global_flags *gf, int quality, bool vbr); 00056 void init_id3tags(lame_global_flags *gf); 00057 00058 int bits; 00059 int channels; 00060 int samplerate; 00061 int bytes_per_sample; 00062 int samples_per_channel; 00063 00064 int mp3buf_size; 00065 char *mp3buf; 00066 00067 int mp3bytes; 00068 00069 lame_global_flags *gf; 00070 }; 00071 00072 #endif 00073
1.6.3