LMMS
Loading...
Searching...
No Matches
OutputSettings.h
Go to the documentation of this file.
1/*
2 * OutputSettings.h - Stores the settings for file rendering
3 *
4 * Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5 * Copyright (c) 2017 Michael Gregorius <michael.gregorius.git/at/arcor[dot]de>
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_OUTPUT_SETTINGS_H
27#define LMMS_OUTPUT_SETTINGS_H
28
29#include "LmmsTypes.h"
30
31namespace lmms
32{
33
34
36{
37public:
45
53
54public:
55 OutputSettings(sample_rate_t sampleRate, bitrate_t bitRate, BitDepth bitDepth, StereoMode stereoMode)
56 : m_sampleRate(sampleRate)
57 , m_bitRate(bitRate)
58 , m_bitDepth(bitDepth)
59 , m_stereoMode(stereoMode)
60 , m_compressionLevel(0.625) // 5/8
61 {
62 }
63
64 OutputSettings(sample_rate_t sampleRate, bitrate_t bitRate, BitDepth bitDepth)
65 : OutputSettings(sampleRate, bitRate, bitDepth, StereoMode::Stereo)
66 {
67 }
68
70 void setSampleRate(sample_rate_t sampleRate) { m_sampleRate = sampleRate; }
71
72 bitrate_t bitrate() const { return m_bitRate; }
74
75 BitDepth getBitDepth() const { return m_bitDepth; }
76 void setBitDepth(BitDepth bitDepth) { m_bitDepth = bitDepth; }
77
79 void setStereoMode(StereoMode stereoMode) { m_stereoMode = stereoMode; }
80
81
82 double getCompressionLevel() const{ return m_compressionLevel; }
83 void setCompressionLevel(double level){
84 // legal range is 0.0 to 1.0.
85 m_compressionLevel = level;
86 }
87
88private:
94};
95
96
97} // namespace lmms
98
99#endif // LMMS_OUTPUT_SETTINGS_H
BitDepth m_bitDepth
Definition OutputSettings.h:91
bitrate_t m_bitRate
Definition OutputSettings.h:90
double m_compressionLevel
Definition OutputSettings.h:93
StereoMode m_stereoMode
Definition OutputSettings.h:92
OutputSettings(sample_rate_t sampleRate, bitrate_t bitRate, BitDepth bitDepth)
Definition OutputSettings.h:64
void setSampleRate(sample_rate_t sampleRate)
Definition OutputSettings.h:70
StereoMode getStereoMode() const
Definition OutputSettings.h:78
double getCompressionLevel() const
Definition OutputSettings.h:82
StereoMode
Definition OutputSettings.h:47
@ JointStereo
Definition OutputSettings.h:50
@ Mono
Definition OutputSettings.h:48
void setCompressionLevel(double level)
Definition OutputSettings.h:83
BitDepth getBitDepth() const
Definition OutputSettings.h:75
void setBitDepth(BitDepth bitDepth)
Definition OutputSettings.h:76
void setStereoMode(StereoMode stereoMode)
Definition OutputSettings.h:79
void setBitrate(bitrate_t bitrate)
Definition OutputSettings.h:73
BitDepth
Definition OutputSettings.h:39
@ Depth32Bit
Definition OutputSettings.h:42
@ Depth16Bit
Definition OutputSettings.h:40
@ Count
Definition OutputSettings.h:43
@ Depth24Bit
Definition OutputSettings.h:41
sample_rate_t getSampleRate() const
Definition OutputSettings.h:69
OutputSettings(sample_rate_t sampleRate, bitrate_t bitRate, BitDepth bitDepth, StereoMode stereoMode)
Definition OutputSettings.h:55
bitrate_t bitrate() const
Definition OutputSettings.h:72
sample_rate_t m_sampleRate
Definition OutputSettings.h:89
Definition AudioAlsa.cpp:35
std::uint32_t sample_rate_t
Definition LmmsTypes.h:42
std::uint16_t bitrate_t
Definition LmmsTypes.h:46
Definition Stereo.h:25