LMMS
Loading...
Searching...
No Matches
AudioFileWave.h
Go to the documentation of this file.
1/*
2 * AudioFileWave.h - AudioDevice which encodes wave-stream and writes it
3 * into a WAVE-file. This is used for song-export.
4 *
5 * Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6 *
7 * This file is part of LMMS - https://lmms.io
8 *
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.
13 *
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.
18 *
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.
23 *
24 */
25
26#ifndef LMMS_AUDIO_FILE_WAVE_H
27#define LMMS_AUDIO_FILE_WAVE_H
28
29#include "lmmsconfig.h"
30#include "AudioFileDevice.h"
31
32#include <sndfile.h>
33
34namespace lmms
35{
36
38{
39public:
40 AudioFileWave( OutputSettings const & outputSettings,
41 const ch_cnt_t channels,
42 bool & successful,
43 const QString & file,
45 ~AudioFileWave() override;
46
47 static AudioFileDevice * getInst( const QString & outputFilename,
48 OutputSettings const & outputSettings,
49 const ch_cnt_t channels,
51 bool & successful )
52 {
53 return new AudioFileWave( outputSettings, channels, successful,
54 outputFilename, audioEngine );
55 }
56
57
58private:
59 void writeBuffer(const SampleFrame* _ab, const f_cnt_t _frames) override;
60
61 bool startEncoding();
62 void finishEncoding();
63
64private:
65 SF_INFO m_si;
66 SNDFILE * m_sf;
67} ;
68
69
70} // namespace lmms
71
72#endif // LMMS_AUDIO_FILE_WAVE_H
AudioEngine * audioEngine()
Definition AudioDevice.h:121
ch_cnt_t channels() const
Definition AudioDevice.h:106
Definition AudioEngine.h:66
AudioFileDevice(OutputSettings const &outputSettings, const ch_cnt_t _channels, const QString &_file, AudioEngine *audioEngine)
Definition AudioFileDevice.cpp:35
SNDFILE * m_sf
Definition AudioFileWave.h:66
~AudioFileWave() override
Definition AudioFileWave.cpp:47
static AudioFileDevice * getInst(const QString &outputFilename, OutputSettings const &outputSettings, const ch_cnt_t channels, AudioEngine *audioEngine, bool &successful)
Definition AudioFileWave.h:47
SF_INFO m_si
Definition AudioFileWave.h:65
void writeBuffer(const SampleFrame *_ab, const f_cnt_t _frames) override
Definition AudioFileWave.cpp:96
void finishEncoding()
Definition AudioFileWave.cpp:126
AudioFileWave(OutputSettings const &outputSettings, const ch_cnt_t channels, bool &successful, const QString &file, AudioEngine *audioEngine)
Definition AudioFileWave.cpp:34
bool startEncoding()
Definition AudioFileWave.cpp:55
Definition OutputSettings.h:36
Definition SampleFrame.h:41
Definition AudioAlsa.cpp:35
std::uint16_t ch_cnt_t
Definition LmmsTypes.h:44
std::uint64_t f_cnt_t
Definition LmmsTypes.h:43
struct zdirent * file
Definition win32.c:1500