5 * Copyright (C) 2005-2013 Team XBMC
8 * This Program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This Program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with XBMC; see the file COPYING. If not, see
20 * <http://www.gnu.org/licenses/>.
24 #include "utils/StdString.h"
30 #define ENC_COMMENT 15
34 #define WRITEBUFFER_SIZE 131072 // 128k buffer
38 CDDARIP_ENCODER_LAME = 0,
39 CDDARIP_ENCODER_VORBIS,
42 CDDARIP_ENCODER_FFMPEG_M4A,
43 CDDARIP_ENCODER_FFMPEG_WMA
48 CDDARIP_QUALITY_CBR = 0,
49 CDDARIP_QUALITY_MEDIUM,
50 CDDARIP_QUALITY_STANDARD,
51 CDDARIP_QUALITY_EXTREME
54 namespace XFILE { class CFile; }
61 virtual bool Init(const char* strFile, int iInChannels, int iInRate, int iInBits) = 0;
62 virtual int Encode(int nNumBytesRead, uint8_t* pbtStream) = 0;
63 virtual bool Close() = 0;
65 void SetComment(const CStdString& str) { m_strComment = str; }
66 void SetArtist(const CStdString& str) { m_strArtist = str; }
67 void SetTitle(const CStdString& str) { m_strTitle = str; }
68 void SetAlbum(const CStdString& str) { m_strAlbum = str; }
69 void SetAlbumArtist(const CStdString& str) { m_strAlbumArtist = str; }
70 void SetGenre(const CStdString& str) { m_strGenre = str; }
71 void SetTrack(const CStdString& str) { m_strTrack = str; }
72 void SetTrackLength(int length) { m_iTrackLength = length; }
73 void SetYear(const CStdString& str) { m_strYear = str; }
76 bool FileCreate(const char* filename);
78 int FileWrite(const void *pBuffer, uint32_t iBytes);
79 int64_t FileSeek(int64_t iFilePosition, int iWhence = SEEK_SET);
81 int WriteStream(const void *pBuffer, uint32_t iBytes);
85 CStdString m_strComment;
86 CStdString m_strArtist;
87 CStdString m_strAlbumArtist;
88 CStdString m_strTitle;
89 CStdString m_strAlbum;
90 CStdString m_strGenre;
91 CStdString m_strTrack;
100 int m_iInBitsPerSample;
102 uint8_t m_btWriteBuffer[WRITEBUFFER_SIZE]; // 128k buffer for writing to disc
103 uint32_t m_dwWriteBufferPointer;