RemoteVstPlugin: fixed too short arrays for preset names
[lmms.git] / include / AudioFileWave.h
blobeabe56d4a03224b49ed4acf5456fb3dc99ace192
1 /*
2 * AudioFileWave.h - AudioBackend which encodes wave-stream and writes it
3 * into a WAVE-file. This is used for song-export.
5 * Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
7 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this program (see COPYING); if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA.
26 #ifndef _AUDIO_FILE_WAVE_H
27 #define _AUDIO_FILE_WAVE_H
29 #include "lmmsconfig.h"
30 #include "AudioFileDevice.h"
32 #include <sndfile.h>
35 class AudioFileWave : public AudioFileDevice
37 public:
38 AudioFileWave( const sample_rate_t _sample_rate,
39 const ch_cnt_t _channels,
40 bool & _success_ful,
41 const QString & _file,
42 const bool _use_vbr,
43 const bitrate_t _nom_bitrate,
44 const bitrate_t _min_bitrate,
45 const bitrate_t _max_bitrate,
46 const int _depth,
47 AudioOutputContext * context );
48 virtual ~AudioFileWave();
50 static AudioFileDevice * getInst( const sample_rate_t _sample_rate,
51 const ch_cnt_t _channels,
52 bool & _success_ful,
53 const QString & _file,
54 const bool _use_vbr,
55 const bitrate_t _nom_bitrate,
56 const bitrate_t _min_bitrate,
57 const bitrate_t _max_bitrate,
58 const int _depth,
59 AudioOutputContext * context )
61 return new AudioFileWave( _sample_rate, _channels,
62 _success_ful, _file, _use_vbr,
63 _nom_bitrate, _min_bitrate,
64 _max_bitrate, _depth, context );
68 private:
69 virtual void writeBuffer( const surroundSampleFrame * _ab,
70 const fpp_t _frames,
71 float _master_gain );
73 bool startEncoding();
74 void finishEncoding();
77 SF_INFO m_si;
78 SNDFILE * m_sf;
80 } ;
83 #endif