/*
Copyright (C) 2007 Ben Levitt 

This file is part of Traverso

Traverso is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.

*/

#ifndef LAMEAUDIOWRITER_H
#define LAMEAUDIOWRITER_H

#include "AbstractAudioWriter.h"
#include "defines.h"


class QString;

class LameAudioWriter : public AbstractAudioWriter
{
	
public:
	LameAudioWriter();
	~LameAudioWriter();
	
	bool set_format_attribute(const QString& key, const QString& value);
	const char* get_extension();
	
protected:
	bool open_private();
	nframes_t write_private(void* buffer, nframes_t frameCount);
	bool close_private();
	
	struct	LameInfo;
	LameInfo* m_lameInfo;

	char	*m_buffer;
	long	m_bufferSize;
	FILE*	m_fid;
	
	int	m_method;	// 0=CBR, 1=ABR, 2=VBR-old, 3=VBR-new
	int	m_minBitrate;	// unused for CBR, ABR
	int	m_maxBitrate;	// used as the bitrate for CBR, ABR
	int	m_quality;	// performance / quality tradeoff 0=slow and good, 9=fast and rough
};

#endif
