lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
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
34
namespace
lmms
35
{
36
37
38
class
LMMS_EXPORT
ProjectRenderer
:
public
QThread
39
{
40
Q_OBJECT
41
public
:
42
enum class
ExportFileFormat
:
int
43
{
44
Wave,
45
Flac,
46
Ogg,
47
MP3,
48
Count
49
} ;
50
constexpr
static
auto
NumFileFormats
=
static_cast<
std::size_t
>
(
ExportFileFormat::Count
);
51
52
struct
FileEncodeDevice
53
{
54
bool
isAvailable
()
const
{
return
m_getDevInst
!=
nullptr
; }
55
56
ExportFileFormat
m_fileFormat
;
57
const
char
*
m_description
;
58
const
char
*
m_extension
;
59
AudioFileDeviceInstantiaton
m_getDevInst
;
60
} ;
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
77
public
slots:
78
void
startProcessing
();
79
void
abortProcessing
();
80
81
void
updateConsoleProgress
();
82
83
84
signals:
85
void
progressChanged
(
int
);
86
87
88
private
:
89
void
run
()
override
;
90
91
AudioFileDevice
*
m_fileDev
;
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
AudioEngine.h
AudioFileDevice.h
OutputSettings.h
lmms::AudioFileDevice
Definition
AudioFileDevice.h:38
lmms::OutputSettings
Definition
OutputSettings.h:36
lmms::ProjectRenderer::updateConsoleProgress
void updateConsoleProgress()
Definition
ProjectRenderer.cpp:207
lmms::ProjectRenderer::fileEncodeDevices
static const std::array< FileEncodeDevice, 5 > fileEncodeDevices
Definition
ProjectRenderer.h:75
lmms::ProjectRenderer::run
void run() override
Definition
ProjectRenderer.cpp:154
lmms::ProjectRenderer::ProjectRenderer
ProjectRenderer(const OutputSettings &_os, ExportFileFormat _file_format, const QString &_out_file)
Definition
ProjectRenderer.cpp:78
lmms::ProjectRenderer::m_abort
volatile bool m_abort
Definition
ProjectRenderer.h:94
lmms::ProjectRenderer::m_fileDev
AudioFileDevice * m_fileDev
Definition
ProjectRenderer.h:91
lmms::ProjectRenderer::ExportFileFormat
ExportFileFormat
Definition
ProjectRenderer.h:43
lmms::ProjectRenderer::ExportFileFormat::Count
@ Count
Definition
ProjectRenderer.h:48
lmms::ProjectRenderer::NumFileFormats
static constexpr auto NumFileFormats
Definition
ProjectRenderer.h:50
lmms::ProjectRenderer::~ProjectRenderer
~ProjectRenderer() override=default
lmms::ProjectRenderer::progressChanged
void progressChanged(int)
lmms::ProjectRenderer::startProcessing
void startProcessing()
Definition
ProjectRenderer.cpp:135
lmms::ProjectRenderer::m_progress
volatile int m_progress
Definition
ProjectRenderer.h:93
lmms::ProjectRenderer::isReady
bool isReady() const
Definition
ProjectRenderer.h:65
lmms::ProjectRenderer::abortProcessing
void abortProcessing()
Definition
ProjectRenderer.cpp:199
lmms
Definition
RemotePluginBase.cpp:34
lmms::AudioFileDeviceInstantiaton
AudioFileDevice *(*)(const QString &, const OutputSettings &, const ch_cnt_t, AudioEngine *, bool &) AudioFileDeviceInstantiaton
Definition
AudioFileDevice.h:76
lmms::SfxrWave::Count
@ Count
Definition
Sfxr.h:43
lmms::ProjectRenderer::FileEncodeDevice
Definition
ProjectRenderer.h:53
lmms::ProjectRenderer::FileEncodeDevice::isAvailable
bool isAvailable() const
Definition
ProjectRenderer.h:54
lmms::ProjectRenderer::FileEncodeDevice::m_description
const char * m_description
Definition
ProjectRenderer.h:57
lmms::ProjectRenderer::FileEncodeDevice::m_fileFormat
ExportFileFormat m_fileFormat
Definition
ProjectRenderer.h:56
lmms::ProjectRenderer::FileEncodeDevice::m_getDevInst
AudioFileDeviceInstantiaton m_getDevInst
Definition
ProjectRenderer.h:59
lmms::ProjectRenderer::FileEncodeDevice::m_extension
const char * m_extension
Definition
ProjectRenderer.h:58
Generated on
for lmms by
1.18.0