Ardour  8.12
export_format_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2013 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2009 David Robillard <d@drobilla.net>
4  * Copyright (C) 2011-2012 Sakari Bergen <sakari.bergen@beatwaves.net>
5  * Copyright (C) 2013-2014 Colin Fletcher <colin.m.fletcher@googlemail.com>
6  * Copyright (C) 2016-2018 Robin Gareus <robin@gareus.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (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
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef __ardour_export_format_manager_h__
24 #define __ardour_export_format_manager_h__
25 
26 #include <list>
27 #include <memory>
28 #include <string>
29 
30 #include "pbd/signals.h"
31 
32 #include "ardour/export_formats.h"
33 #include "ardour/export_pointers.h"
34 
35 namespace ARDOUR
36 {
37 
38 class ExportFormat;
39 class ExportFormatCompatibility;
40 class ExportFormatSpecification;
41 class AnyTime;
42 
44 {
45  public:
46 
47  typedef std::list<ExportFormatCompatibilityPtr> CompatList;
48  typedef std::list<ExportFormatPtr> FormatList;
49 
53 
56 
57  /* Quality states */
58 
60  public:
61  QualityState (ExportFormatBase::Quality quality, std::string name) :
62  quality (quality) { set_name (name); }
64  };
65  typedef std::shared_ptr<QualityState> QualityPtr;
66  typedef std::weak_ptr<QualityState> WeakQualityPtr;
67  typedef std::list<QualityPtr> QualityList;
68 
69  /* Sample rate states */
70 
72  public:
74  : rate (rate) { set_name (name); }
76  };
77  typedef std::shared_ptr<SampleRateState> SampleRatePtr;
78  typedef std::weak_ptr<SampleRateState> WeakSampleRatePtr;
79  typedef std::list<SampleRatePtr> SampleRateList;
80 
81  public:
82 
83  explicit ExportFormatManager (ExportFormatSpecPtr specification);
85 
86  /* Signals */
87 
88  PBD::Signal1<void,bool> CompleteChanged;
89  PBD::Signal0<void> DescriptionChanged;
90 
91  /* Access to lists */
92 
93  CompatList const & get_compatibilities () { return compatibilities; }
94  QualityList const & get_qualities () { return qualities; }
95  FormatList const & get_formats () { return formats; }
96  SampleRateList const & get_sample_rates () { return sample_rates; }
97 
98  /* Non interactive selections */
99 
100  void set_name (std::string name);
101 
102  void select_with_cue (bool);
103  void select_with_toc (bool);
104  void select_with_mp4chaps (bool);
105  void select_upload (bool);
106  void set_command (std::string);
109  void select_trim_beginning (bool value);
110  void select_silence_beginning (AnyTime const & time);
111  void select_trim_end (bool value);
112  void select_silence_end (AnyTime const & time);
113  void select_normalize (bool value);
114  void select_normalize_loudness (bool value);
115  void select_tp_limiter (bool value);
116  void select_normalize_dbfs (float value);
117  void select_normalize_lufs (float value);
118  void select_normalize_dbtp (float value);
119  void select_tagging (bool tag);
120  void select_demo_noise_level (float value);
121  void select_demo_noise_duration (int value);
122  void select_demo_noise_interval (int value);
123 
124  private:
125 
127  void init_qualities ();
128  void init_formats ();
130 
135 
136  /* Connected to signals */
137 
139  void change_quality_selection (bool select, WeakQualityPtr const & quality);
140  void change_format_selection (bool select, WeakExportFormatPtr const & format);
141  void change_sample_rate_selection (bool select, WeakSampleRatePtr const & rate);
142 
143  void change_sample_format_selection (bool select, WeakSampleFormatPtr const & format);
144  void change_dither_type_selection (bool select, WeakDitherTypePtr const & type);
145 
146  /* Do actual selection */
147 
149  void select_quality (QualityPtr const & quality);
150  void select_format (ExportFormatPtr const & format);
151  void select_sample_rate (SampleRatePtr const & rate);
152 
153  void select_sample_format (SampleFormatPtr const & format);
154  void select_dither_type (DitherTypePtr const & type);
155 
159 
160  /* Formats and compatibilities */
161 
165 
167 
169 
172 
177 
178  std::string prev_description;
179 
180 };
181 
182 } // namespace ARDOUR
183 
184 #endif /* __ardour_export_format_manager_h__ */
Class for managing selection and compatibility states.
QualityState(ExportFormatBase::Quality quality, std::string name)
SampleRateState(ExportFormatBase::SampleRate rate, std::string name)
void select_dither_type(DitherTypePtr const &type)
QualityPtr get_selected_quality()
void select_normalize_dbtp(float value)
void select_silence_end(AnyTime const &time)
void select_tp_limiter(bool value)
CompatList const & get_compatibilities()
void select_normalize_loudness(bool value)
std::weak_ptr< SampleRateState > WeakSampleRatePtr
void add_format(ExportFormatPtr ptr)
void add_sample_rate(SampleRatePtr ptr)
std::shared_ptr< SampleRateState > SampleRatePtr
std::list< QualityPtr > QualityList
void change_dither_type_selection(bool select, WeakDitherTypePtr const &type)
HasSampleFormat::WeakSampleFormatPtr WeakSampleFormatPtr
void select_normalize_dbfs(float value)
std::weak_ptr< QualityState > WeakQualityPtr
void select_quality(QualityPtr const &quality)
void select_tagging(bool tag)
void select_format(ExportFormatPtr const &format)
HasSampleFormat::SampleFormatList SampleFormatList
void select_demo_noise_interval(int value)
SampleFormatPtr get_selected_sample_format()
void select_sample_rate(SampleRatePtr const &rate)
void change_compatibility_selection(bool select, WeakExportFormatCompatibilityPtr const &compat)
void change_sample_format_selection(bool select, WeakSampleFormatPtr const &format)
PBD::Signal0< void > DescriptionChanged
std::shared_ptr< QualityState > QualityPtr
void select_src_quality(ExportFormatBase::SRCQuality value)
ExportFormatSpecPtr current_selection
void set_command(std::string)
void set_name(std::string name)
HasSampleFormat::WeakDitherTypePtr WeakDitherTypePtr
PBD::Signal1< void, bool > CompleteChanged
ExportFormatPtr get_selected_format()
ExportFormatManager(ExportFormatSpecPtr specification)
std::list< ExportFormatPtr > FormatList
void change_sample_rate_selection(bool select, WeakSampleRatePtr const &rate)
void select_trim_beginning(bool value)
HasSampleFormat::SampleFormatPtr SampleFormatPtr
void select_demo_noise_level(float value)
void select_normalize_lufs(float value)
void select_trim_end(bool value)
std::list< SampleRatePtr > SampleRateList
SampleRatePtr get_selected_sample_rate()
void select_silence_beginning(AnyTime const &time)
QualityList const & get_qualities()
ExportFormatBasePtr get_compatibility_intersection()
FormatList const & get_formats()
void add_quality(QualityPtr ptr)
void change_format_selection(bool select, WeakExportFormatPtr const &format)
void change_quality_selection(bool select, WeakQualityPtr const &quality)
void select_sample_format(SampleFormatPtr const &format)
SampleRateList const & get_sample_rates()
HasSampleFormat::DitherTypePtr DitherTypePtr
std::list< ExportFormatCompatibilityPtr > CompatList
void select_compatibility(WeakExportFormatCompatibilityPtr const &compat)
void select_demo_noise_duration(int value)
void add_compatibility(ExportFormatCompatibilityPtr ptr)
void select_normalize(bool value)
std::weak_ptr< DitherTypeState > WeakDitherTypePtr
std::shared_ptr< DitherTypeState > DitherTypePtr
std::weak_ptr< SampleFormatState > WeakSampleFormatPtr
std::list< SampleFormatPtr > SampleFormatList
std::shared_ptr< SampleFormatState > SampleFormatPtr
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
std::weak_ptr< ExportFormatCompatibility > WeakExportFormatCompatibilityPtr
std::shared_ptr< ExportFormat > ExportFormatPtr
std::shared_ptr< ExportFormatCompatibility > ExportFormatCompatibilityPtr
std::weak_ptr< ExportFormat > WeakExportFormatPtr
std::shared_ptr< ExportFormatBase > ExportFormatBasePtr
std::shared_ptr< ExportFormatSpecification > ExportFormatSpecPtr