Ardour  8.12
loudness_settings.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef _gtkardour_loudness_settings_h_
20 #define _gtkardour_loudness_settings_h_
21 
22 class XMLNode;
23 
25 {
26  enum {
32  LR_LAST
33  };
34 
35  std::string label;
36  bool enable[LR_LAST];
37  float level[LR_LAST];
38  float LUFS_range[2];
39  bool report;
40  bool user;
41 };
42 
44 {
46  ALoudnessPreset (std::string const&, bool enable[LR_LAST], float level[LR_LAST]);
48 
49  XMLNode& state () const;
50  bool operator==(ALoudnessPreset const&) const;
51 };
52 
54 {
55 public:
56  ALoudnessPresets (bool built_in_only);
58 
59  std::vector<ALoudnessPreset> const& presets () const {
60  return _p;
61  }
62 
63  bool push_back (CLoudnessPreset const&);
64  bool erase (CLoudnessPreset const&);
65  bool erase (size_t);
66 
67  CLoudnessPreset const&
68  operator[] (size_t which) const {
69  if (which >= _p.size ()) {
70  throw std::out_of_range ("preset index is out of range");
71  }
72  return _p[which];
73  }
74 
76  operator[] (size_t which) {
77  if (which >= _p.size ()) {
78  throw std::out_of_range ("preset index is out of range");
79  }
80  return _p[which];
81  }
82 
83  size_t n_presets () const {
84  return _p.size ();
85  }
86 
88 
89 private:
90  std::vector <ALoudnessPreset> _p;
91  bool _save;
92 };
93 
94 #endif
bool erase(CLoudnessPreset const &)
bool erase(size_t)
CLoudnessPreset const & operator[](size_t which) const
ALoudnessPresets(bool built_in_only)
std::vector< ALoudnessPreset > const & presets() const
std::vector< ALoudnessPreset > _p
bool find_preset(CLoudnessPreset &) const
bool push_back(CLoudnessPreset const &)
size_t n_presets() const
Definition: xml++.h:114
XMLNode & state() const
ALoudnessPreset(XMLNode const &)
bool operator==(ALoudnessPreset const &) const
ALoudnessPreset(CLoudnessPreset const &c)
ALoudnessPreset(std::string const &, bool enable[LR_LAST], float level[LR_LAST])
bool enable[LR_LAST]
float level[LR_LAST]