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 #include <qstring.h> 00030 00031 class Metadata; 00032 class Encoder; 00033 00034 #ifdef MMX 00035 #define LAME_WORKAROUND 1 00036 #undef MMX 00037 #endif 00038 00039 #include <lame/lame.h> 00040 00041 #ifdef LAME_WORKAROUND 00042 #define MMX 1 00043 #endif 00044 00045 #include "encoder.h" 00046 00047 class LameEncoder : public Encoder 00048 { 00049 public: 00050 LameEncoder(const QString &outfile, int qualitylevel, Metadata *metadata, 00051 bool vbr = false); 00052 ~LameEncoder(); 00053 int addSamples(int16_t *bytes, unsigned int len); 00054 00055 private: 00056 int init_encoder(lame_global_flags *gf, int quality, bool vbr); 00057 void init_id3tags(lame_global_flags *gf); 00058 00059 int quality; 00060 int bits; 00061 int channels; 00062 int samplerate; 00063 int bytes_per_sample; 00064 int samples_per_channel; 00065 00066 int mp3buf_size; 00067 char *mp3buf; 00068 00069 int mp3bytes; 00070 00071 lame_global_flags *gf; 00072 }; 00073 00074 #endif 00075
1.5.5