Ardour  9.0-pre0-582-g084a23a80d
export_channel_configuration.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2012 Sakari Bergen <sakari.bergen@beatwaves.net>
3  * Copyright (C) 2008-2013 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
5  * Copyright (C) 2022 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #pragma once
23 
24 #include <algorithm>
25 #include <list>
26 #include <string>
27 
28 #include "ardour/export_channel.h"
29 #include "ardour/export_pointers.h"
30 
31 #include "pbd/xml++.h"
32 
33 namespace ARDOUR {
34 
35 class Session;
36 
37 class LIBARDOUR_API ExportChannelConfiguration : public std::enable_shared_from_this<ExportChannelConfiguration>
38 {
39 private:
40  friend class ExportElementFactory;
42 
43 public:
44  bool operator== (ExportChannelConfiguration const& other) const
45  {
46  return channels == other.channels;
47  }
48  bool operator!= (ExportChannelConfiguration const& other) const
49  {
50  return channels != other.channels;
51  }
52 
53  XMLNode& get_state () const;
54  int set_state (const XMLNode&);
55 
56  typedef std::list<ExportChannelPtr> ChannelList;
57 
58  bool all_channels_have_ports () const;
59 
60  std::string name () const { return _name; }
61  void set_name (std::string name) { _name = name; }
62 
65 
66  bool get_split () const { return split; }
67  void set_split (bool value) { split = value; }
68 
69  uint32_t get_n_chans () const { return channels.size (); }
70  ChannelList const& get_channels () const { return channels; }
71  void clear_channels () { channels.clear (); }
72  void register_channel (ExportChannelPtr channel) { channels.push_back (channel); }
73  void register_channels (ChannelList const& new_channels)
74  {
75  std::copy (new_channels.begin (), new_channels.end (), std::back_inserter (channels));
76  }
77 
80  void configurations_for_files (std::list<std::shared_ptr<ExportChannelConfiguration>>& configs);
81 
82 private:
84 
86  bool split; // Split to mono files
87  std::string _name;
89 };
90 
91 } // namespace ARDOUR
92 
RegionExportChannelFactory::Type region_type
int set_state(const XMLNode &)
ExportChannelConfiguration(Session &session)
void register_channel(ExportChannelPtr channel)
void configurations_for_files(std::list< std::shared_ptr< ExportChannelConfiguration >> &configs)
void set_region_processing_type(RegionExportChannelFactory::Type type)
void register_channels(ChannelList const &new_channels)
RegionExportChannelFactory::Type region_processing_type() const
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
void session(lua_State *L)
bool operator==(const ProcessorSelection &a, const ProcessorSelection &b)
void split(std::string, std::vector< std::string > &, char)