LMMS
Loading...
Searching...
No Matches
ProjectRenderer.h
Go to the documentation of this file.
1/*
2 * ProjectRenderer.h - ProjectRenderer class for easily rendering projects
3 *
4 * Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
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 GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_PROJECT_RENDERER_H
26#define LMMS_PROJECT_RENDERER_H
27
28#include "AudioFileDevice.h"
29#include "AudioEngine.h"
30#include "OutputSettings.h"
31
32#include "lmms_export.h"
33
34namespace lmms
35{
36
37
38class LMMS_EXPORT ProjectRenderer : public QThread
39{
40 Q_OBJECT
41public:
42 enum class ExportFileFormat : int
43 {
44 Wave,
45 Flac,
46 Ogg,
47 MP3,
49 } ;
50 constexpr static auto NumFileFormats = static_cast<std::size_t>(ExportFileFormat::Count);
51
61
62 ProjectRenderer(const OutputSettings& _os, ExportFileFormat _file_format, const QString& _out_file);
63 ~ProjectRenderer() override = default;
64
65 bool isReady() const
66 {
67 return m_fileDev != nullptr;
68 }
69
70 static ExportFileFormat getFileFormatFromExtension(
71 const QString & _ext );
72
73 static QString getFileExtensionFromFormat( ExportFileFormat fmt );
74
75 static const std::array<FileEncodeDevice, 5> fileEncodeDevices;
76
77public slots:
78 void startProcessing();
79 void abortProcessing();
80
82
83
84signals:
85 void progressChanged( int );
86
87
88private:
89 void run() override;
90
92
93 volatile int m_progress;
94 volatile bool m_abort;
95
96} ;
97
98
99} // namespace lmms
100
101#endif // LMMS_PROJECT_RENDERER_H
static void run(LV2_Handle instance, uint32_t n_samples)
Definition bindings_test_plugin.c:112
Definition AudioFileDevice.h:38
Definition OutputSettings.h:36
void updateConsoleProgress()
Definition ProjectRenderer.cpp:205
static const std::array< FileEncodeDevice, 5 > fileEncodeDevices
Definition ProjectRenderer.h:75
ProjectRenderer(const OutputSettings &_os, ExportFileFormat _file_format, const QString &_out_file)
Definition ProjectRenderer.cpp:78
volatile bool m_abort
Definition ProjectRenderer.h:94
AudioFileDevice * m_fileDev
Definition ProjectRenderer.h:91
ExportFileFormat
Definition ProjectRenderer.h:43
@ Count
Definition ProjectRenderer.h:48
static constexpr auto NumFileFormats
Definition ProjectRenderer.h:50
~ProjectRenderer() override=default
void startProcessing()
Definition ProjectRenderer.cpp:135
volatile int m_progress
Definition ProjectRenderer.h:93
bool isReady() const
Definition ProjectRenderer.h:65
void abortProcessing()
Definition ProjectRenderer.cpp:197
Definition AudioAlsa.cpp:35
AudioFileDevice *(*)(const QString &, const OutputSettings &, const ch_cnt_t, AudioEngine *, bool &) AudioFileDeviceInstantiaton
Definition AudioFileDevice.h:71
@ Count
Definition Sfxr.h:43
Definition ProjectRenderer.h:53
bool isAvailable() const
Definition ProjectRenderer.h:54
const char * m_description
Definition ProjectRenderer.h:57
ExportFileFormat m_fileFormat
Definition ProjectRenderer.h:56
AudioFileDeviceInstantiaton m_getDevInst
Definition ProjectRenderer.h:59
const char * m_extension
Definition ProjectRenderer.h:58
fmt[0]
Definition fileio.c:2503