Add normalization gain factor to Export Analysis
[ardour.git] / libs / ardour / export_graph_builder.cc
1 /*
2   Copyright (C) 2008-2012 Paul Davis
3   Author: Sakari Bergen
4
5   This program is free software; you can redistribute it and/or modify
6   it under the terms of the GNU General Public License as published by
7   the Free Software Foundation; either version 2 of the License, or
8   (at your option) any later version.
9
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   GNU General Public License for more details.
14
15   You should have received a copy of the GNU General Public License
16   along with this program; if not, write to the Free Software
17   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 */
20
21 #include "ardour/export_graph_builder.h"
22
23 #include <vector>
24
25 #include <glibmm/miscutils.h>
26
27 #include "audiographer/process_context.h"
28 #include "audiographer/general/chunker.h"
29 #include "audiographer/general/interleaver.h"
30 #include "audiographer/general/normalizer.h"
31 #include "audiographer/general/analyser.h"
32 #include "audiographer/general/peak_reader.h"
33 #include "audiographer/general/sample_format_converter.h"
34 #include "audiographer/general/sr_converter.h"
35 #include "audiographer/general/silence_trimmer.h"
36 #include "audiographer/general/threader.h"
37 #include "audiographer/sndfile/tmp_file.h"
38 #include "audiographer/sndfile/sndfile_writer.h"
39
40 #include "ardour/audioengine.h"
41 #include "ardour/export_channel_configuration.h"
42 #include "ardour/export_filename.h"
43 #include "ardour/export_format_specification.h"
44 #include "ardour/export_timespan.h"
45 #include "ardour/session_directory.h"
46 #include "ardour/sndfile_helpers.h"
47
48 #include "pbd/file_utils.h"
49 #include "pbd/cpus.h"
50
51 using namespace AudioGrapher;
52 using std::string;
53
54 namespace ARDOUR {
55
56 ExportGraphBuilder::ExportGraphBuilder (Session const & session)
57         : session (session)
58         , thread_pool (hardware_concurrency())
59 {
60         process_buffer_frames = session.engine().samples_per_cycle();
61 }
62
63 ExportGraphBuilder::~ExportGraphBuilder ()
64 {
65 }
66
67 int
68 ExportGraphBuilder::process (framecnt_t frames, bool last_cycle)
69 {
70         assert(frames <= process_buffer_frames);
71
72         for (ChannelMap::iterator it = channels.begin(); it != channels.end(); ++it) {
73                 Sample const * process_buffer = 0;
74                 it->first->read (process_buffer, frames);
75                 ConstProcessContext<Sample> context(process_buffer, frames, 1);
76                 if (last_cycle) { context().set_flag (ProcessContext<Sample>::EndOfInput); }
77                 it->second->process (context);
78         }
79
80         return 0;
81 }
82
83 bool
84 ExportGraphBuilder::process_normalize ()
85 {
86         for (std::list<Normalizer *>::iterator it = normalizers.begin(); it != normalizers.end(); /* ++ in loop */) {
87                 if ((*it)->process()) {
88                         it = normalizers.erase (it);
89                 } else {
90                         ++it;
91                 }
92         }
93
94         return normalizers.empty();
95 }
96
97 unsigned
98 ExportGraphBuilder::get_normalize_cycle_count() const
99 {
100         unsigned max = 0;
101         for (std::list<Normalizer *>::const_iterator it = normalizers.begin(); it != normalizers.end(); ++it) {
102                 max = std::max(max, (*it)->get_normalize_cycle_count());
103         }
104         return max;
105 }
106
107 void
108 ExportGraphBuilder::reset ()
109 {
110         timespan.reset();
111         channel_configs.clear ();
112         channels.clear ();
113         normalizers.clear ();
114         analysis_map.clear();
115 }
116
117 void
118 ExportGraphBuilder::cleanup (bool remove_out_files/*=false*/)
119 {
120         ChannelConfigList::iterator iter = channel_configs.begin();
121
122         while (iter != channel_configs.end() ) {
123                 iter->remove_children(remove_out_files);
124                 iter = channel_configs.erase(iter);
125         }
126 }
127
128 void
129 ExportGraphBuilder::set_current_timespan (boost::shared_ptr<ExportTimespan> span)
130 {
131         timespan = span;
132 }
133
134 void
135 ExportGraphBuilder::add_config (FileSpec const & config)
136 {
137         ExportChannelConfiguration::ChannelList const & channels =
138                 config.channel_config->get_channels();
139         for(ExportChannelConfiguration::ChannelList::const_iterator it = channels.begin();
140             it != channels.end(); ++it) {
141                 (*it)->set_max_buffer_size(process_buffer_frames);
142         }
143
144         // If the sample rate is "session rate", change it to the real value.
145         // However, we need to copy it to not change the config which is saved...
146         FileSpec new_config (config);
147         new_config.format.reset(new ExportFormatSpecification(*new_config.format, false));
148         if(new_config.format->sample_rate() == ExportFormatBase::SR_Session) {
149                 framecnt_t session_rate = session.nominal_frame_rate();
150                 new_config.format->set_sample_rate(ExportFormatBase::nearest_sample_rate(session_rate));
151         }
152
153
154         if (!new_config.channel_config->get_split ()) {
155                 add_split_config (new_config);
156                 return;
157         }
158
159         // Split channel configurations are split into several channel configurations,
160         // each corresponding to a file, at this stage
161         typedef std::list<boost::shared_ptr<ExportChannelConfiguration> > ConfigList;
162         ConfigList file_configs;
163         new_config.channel_config->configurations_for_files (file_configs);
164
165         unsigned chan = 1;
166         for (ConfigList::iterator it = file_configs.begin(); it != file_configs.end(); ++it, ++chan) {
167                 FileSpec copy = new_config;
168                 copy.channel_config = *it;
169
170                 copy.filename.reset (new ExportFilename (*copy.filename));
171                 copy.filename->include_channel = true;
172                 copy.filename->set_channel (chan);
173
174                 add_split_config (copy);
175         }
176 }
177
178 void
179 ExportGraphBuilder::get_analysis_results (AnalysisResults& results) {
180         for (AnalysisMap::iterator i = analysis_map.begin(); i != analysis_map.end(); ++i) {
181                 ExportAnalysisPtr p = i->second->result ();
182                 if (p) {
183                         results.insert (std::make_pair (i->first, p));
184                 }
185         }
186 }
187
188 void
189 ExportGraphBuilder::add_split_config (FileSpec const & config)
190 {
191         for (ChannelConfigList::iterator it = channel_configs.begin(); it != channel_configs.end(); ++it) {
192                 if (*it == config) {
193                         it->add_child (config);
194                         return;
195                 }
196         }
197
198         // No duplicate channel config found, create new one
199         channel_configs.push_back (new ChannelConfig (*this, config, channels));
200 }
201
202 /* Encoder */
203
204 template <>
205 boost::shared_ptr<AudioGrapher::Sink<Sample> >
206 ExportGraphBuilder::Encoder::init (FileSpec const & new_config)
207 {
208         config = new_config;
209         init_writer (float_writer);
210         return float_writer;
211 }
212
213 template <>
214 boost::shared_ptr<AudioGrapher::Sink<int> >
215 ExportGraphBuilder::Encoder::init (FileSpec const & new_config)
216 {
217         config = new_config;
218         init_writer (int_writer);
219         return int_writer;
220 }
221
222 template <>
223 boost::shared_ptr<AudioGrapher::Sink<short> >
224 ExportGraphBuilder::Encoder::init (FileSpec const & new_config)
225 {
226         config = new_config;
227         init_writer (short_writer);
228         return short_writer;
229 }
230
231 void
232 ExportGraphBuilder::Encoder::add_child (FileSpec const & new_config)
233 {
234         filenames.push_back (new_config.filename);
235 }
236
237 void
238 ExportGraphBuilder::Encoder::destroy_writer (bool delete_out_file)
239 {
240         if (delete_out_file ) {
241
242                 if (float_writer) {
243                         float_writer->close ();
244                 }
245
246                 if (int_writer) {
247                         int_writer->close ();
248                 }
249
250                 if (short_writer) {
251                         short_writer->close ();
252                 }
253
254                 if (std::remove(writer_filename.c_str() ) != 0) {
255                         std::cout << "Encoder::destroy_writer () : Error removing file: " << strerror(errno) << std::endl;
256                 }
257         }
258
259         float_writer.reset ();
260         int_writer.reset ();
261         short_writer.reset ();
262 }
263
264 bool
265 ExportGraphBuilder::Encoder::operator== (FileSpec const & other_config) const
266 {
267         return get_real_format (config) == get_real_format (other_config);
268 }
269
270 int
271 ExportGraphBuilder::Encoder::get_real_format (FileSpec const & config)
272 {
273         ExportFormatSpecification & format = *config.format;
274         return format.format_id() | format.sample_format() | format.endianness();
275 }
276
277 template<typename T>
278 void
279 ExportGraphBuilder::Encoder::init_writer (boost::shared_ptr<AudioGrapher::SndfileWriter<T> > & writer)
280 {
281         unsigned channels = config.channel_config->get_n_chans();
282         int format = get_real_format (config);
283         config.filename->set_channel_config(config.channel_config);
284         writer_filename = config.filename->get_path (config.format);
285
286         writer.reset (new AudioGrapher::SndfileWriter<T> (writer_filename, format, channels, config.format->sample_rate(), config.broadcast_info));
287         writer->FileWritten.connect_same_thread (copy_files_connection, boost::bind (&ExportGraphBuilder::Encoder::copy_files, this, _1));
288 }
289
290 void
291 ExportGraphBuilder::Encoder::copy_files (std::string orig_path)
292 {
293         while (filenames.size()) {
294                 ExportFilenamePtr & filename = filenames.front();
295                 PBD::copy_file (orig_path, filename->get_path (config.format).c_str());
296                 filenames.pop_front();
297         }
298 }
299
300 /* SFC */
301
302 ExportGraphBuilder::SFC::SFC (ExportGraphBuilder &parent, FileSpec const & new_config, framecnt_t max_frames)
303         : data_width(0)
304 {
305         config = new_config;
306         data_width = sndfile_data_width (Encoder::get_real_format (config));
307         unsigned channels = new_config.channel_config->get_n_chans();
308         _analyse = config.format->analyse();
309         if (_analyse) {
310                 analyser.reset (new Analyser (config.format->sample_rate(), channels, max_frames,
311                                         (framecnt_t) ceil (parent.timespan->get_length () * config.format->sample_rate () / (double) parent.session.nominal_frame_rate ())));
312                 parent.add_analyser (config.filename->get_path (config.format), analyser);
313         }
314
315         if (data_width == 8 || data_width == 16) {
316                 short_converter = ShortConverterPtr (new SampleFormatConverter<short> (channels));
317                 short_converter->init (max_frames, config.format->dither_type(), data_width);
318                 add_child (config);
319                 if (_analyse) { analyser->add_output (short_converter); }
320
321         } else if (data_width == 24 || data_width == 32) {
322                 int_converter = IntConverterPtr (new SampleFormatConverter<int> (channels));
323                 int_converter->init (max_frames, config.format->dither_type(), data_width);
324                 add_child (config);
325                 if (_analyse) { analyser->add_output (int_converter); }
326         } else {
327                 int actual_data_width = 8 * sizeof(Sample);
328                 float_converter = FloatConverterPtr (new SampleFormatConverter<Sample> (channels));
329                 float_converter->init (max_frames, config.format->dither_type(), actual_data_width);
330                 add_child (config);
331                 if (_analyse) { analyser->add_output (float_converter); }
332         }
333 }
334
335 void
336 ExportGraphBuilder::SFC::set_peak (float gain)
337 {
338         if (_analyse) {
339                 analyser->set_normalization_gain (gain);
340         }
341 }
342
343 ExportGraphBuilder::FloatSinkPtr
344 ExportGraphBuilder::SFC::sink ()
345 {
346         if (_analyse) {
347                 return analyser;
348         } else if (data_width == 8 || data_width == 16) {
349                 return short_converter;
350         } else if (data_width == 24 || data_width == 32) {
351                 return int_converter;
352         } else {
353                 return float_converter;
354         }
355 }
356
357 void
358 ExportGraphBuilder::SFC::add_child (FileSpec const & new_config)
359 {
360         for (boost::ptr_list<Encoder>::iterator it = children.begin(); it != children.end(); ++it) {
361                 if (*it == new_config) {
362                         it->add_child (new_config);
363                         return;
364                 }
365         }
366
367         children.push_back (new Encoder());
368         Encoder & encoder = children.back();
369
370         if (data_width == 8 || data_width == 16) {
371                 short_converter->add_output (encoder.init<short> (new_config));
372         } else if (data_width == 24 || data_width == 32) {
373                 int_converter->add_output (encoder.init<int> (new_config));
374         } else {
375                 float_converter->add_output (encoder.init<Sample> (new_config));
376         }
377 }
378
379 void
380 ExportGraphBuilder::SFC::remove_children (bool remove_out_files)
381 {
382         boost::ptr_list<Encoder>::iterator iter = children.begin ();
383
384         while (iter != children.end() ) {
385
386                 if (remove_out_files) {
387                         iter->destroy_writer(remove_out_files);
388                 }
389                 iter = children.erase (iter);
390         }
391 }
392
393 bool
394 ExportGraphBuilder::SFC::operator== (FileSpec const & other_config) const
395 {
396         return config.format->sample_format() == other_config.format->sample_format();
397 }
398
399 /* Normalizer */
400
401 ExportGraphBuilder::Normalizer::Normalizer (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t /*max_frames*/)
402         : parent (parent)
403 {
404         std::string tmpfile_path = parent.session.session_directory().export_path();
405         tmpfile_path = Glib::build_filename(tmpfile_path, "XXXXXX");
406         std::vector<char> tmpfile_path_buf(tmpfile_path.size() + 1);
407         std::copy(tmpfile_path.begin(), tmpfile_path.end(), tmpfile_path_buf.begin());
408         tmpfile_path_buf[tmpfile_path.size()] = '\0';
409
410         config = new_config;
411         uint32_t const channels = config.channel_config->get_n_chans();
412         max_frames_out = 4086 - (4086 % channels); // TODO good chunk size
413
414         buffer.reset (new AllocatingProcessContext<Sample> (max_frames_out, channels));
415         peak_reader.reset (new PeakReader ());
416         normalizer.reset (new AudioGrapher::Normalizer (config.format->normalize_target()));
417         threader.reset (new Threader<Sample> (parent.thread_pool));
418
419         normalizer->alloc_buffer (max_frames_out);
420         normalizer->add_output (threader);
421
422         int format = ExportFormatBase::F_RAW | ExportFormatBase::SF_Float;
423         tmp_file.reset (new TmpFile<float> (&tmpfile_path_buf[0], format, channels, config.format->sample_rate()));
424         tmp_file->FileWritten.connect_same_thread (post_processing_connection,
425                                                    boost::bind (&Normalizer::start_post_processing, this));
426
427         add_child (new_config);
428
429         peak_reader->add_output (tmp_file);
430 }
431
432 ExportGraphBuilder::FloatSinkPtr
433 ExportGraphBuilder::Normalizer::sink ()
434 {
435         return peak_reader;
436 }
437
438 void
439 ExportGraphBuilder::Normalizer::add_child (FileSpec const & new_config)
440 {
441         for (boost::ptr_list<SFC>::iterator it = children.begin(); it != children.end(); ++it) {
442                 if (*it == new_config) {
443                         it->add_child (new_config);
444                         return;
445                 }
446         }
447
448         children.push_back (new SFC (parent, new_config, max_frames_out));
449         threader->add_output (children.back().sink());
450 }
451
452 void
453 ExportGraphBuilder::Normalizer::remove_children (bool remove_out_files)
454 {
455         boost::ptr_list<SFC>::iterator iter = children.begin ();
456
457         while (iter != children.end() ) {
458                 iter->remove_children (remove_out_files);
459                 iter = children.erase (iter);
460         }
461 }
462
463 bool
464 ExportGraphBuilder::Normalizer::operator== (FileSpec const & other_config) const
465 {
466         return config.format->normalize() == other_config.format->normalize() &&
467                 config.format->normalize_target() == other_config.format->normalize_target();
468 }
469
470 unsigned
471 ExportGraphBuilder::Normalizer::get_normalize_cycle_count() const
472 {
473         return static_cast<unsigned>(std::ceil(static_cast<float>(tmp_file->get_frames_written()) /
474                                                max_frames_out));
475 }
476
477 bool
478 ExportGraphBuilder::Normalizer::process()
479 {
480         framecnt_t frames_read = tmp_file->read (*buffer);
481         return frames_read != buffer->frames();
482 }
483
484 void
485 ExportGraphBuilder::Normalizer::start_post_processing()
486 {
487         const float gain = normalizer->set_peak (peak_reader->get_peak());
488         for (boost::ptr_list<SFC>::iterator i = children.begin(); i != children.end(); ++i) {
489                 (*i).set_peak (gain);
490         }
491         tmp_file->seek (0, SEEK_SET);
492         tmp_file->add_output (normalizer);
493         parent.normalizers.push_back (this);
494 }
495
496 /* SRC */
497
498 ExportGraphBuilder::SRC::SRC (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames)
499         : parent (parent)
500 {
501         config = new_config;
502         converter.reset (new SampleRateConverter (new_config.channel_config->get_n_chans()));
503         ExportFormatSpecification & format = *new_config.format;
504         converter->init (parent.session.nominal_frame_rate(), format.sample_rate(), format.src_quality());
505         max_frames_out = converter->allocate_buffers (max_frames);
506
507         add_child (new_config);
508 }
509
510 ExportGraphBuilder::FloatSinkPtr
511 ExportGraphBuilder::SRC::sink ()
512 {
513         return converter;
514 }
515
516 void
517 ExportGraphBuilder::SRC::add_child (FileSpec const & new_config)
518 {
519         if (new_config.format->normalize()) {
520                 add_child_to_list (new_config, normalized_children);
521         } else {
522                 add_child_to_list (new_config, children);
523         }
524 }
525
526 void
527 ExportGraphBuilder::SRC::remove_children (bool remove_out_files)
528 {
529         boost::ptr_list<SFC>::iterator sfc_iter = children.begin();
530
531         while (sfc_iter != children.end() ) {
532                 converter->remove_output (sfc_iter->sink() );
533                 sfc_iter->remove_children (remove_out_files);
534                 sfc_iter = children.erase (sfc_iter);
535         }
536
537         boost::ptr_list<Normalizer>::iterator norm_iter = normalized_children.begin();
538
539         while (norm_iter != normalized_children.end() ) {
540                 converter->remove_output (norm_iter->sink() );
541                 norm_iter->remove_children (remove_out_files);
542                 norm_iter = normalized_children.erase (norm_iter);
543         }
544
545 }
546
547 template<typename T>
548 void
549 ExportGraphBuilder::SRC::add_child_to_list (FileSpec const & new_config, boost::ptr_list<T> & list)
550 {
551         for (typename boost::ptr_list<T>::iterator it = list.begin(); it != list.end(); ++it) {
552                 if (*it == new_config) {
553                         it->add_child (new_config);
554                         return;
555                 }
556         }
557
558         list.push_back (new T (parent, new_config, max_frames_out));
559         converter->add_output (list.back().sink ());
560 }
561
562 bool
563 ExportGraphBuilder::SRC::operator== (FileSpec const & other_config) const
564 {
565         return config.format->sample_rate() == other_config.format->sample_rate();
566 }
567
568 /* SilenceHandler */
569 ExportGraphBuilder::SilenceHandler::SilenceHandler (ExportGraphBuilder & parent, FileSpec const & new_config, framecnt_t max_frames)
570         : parent (parent)
571 {
572         config = new_config;
573         max_frames_in = max_frames;
574         framecnt_t sample_rate = parent.session.nominal_frame_rate();
575
576         silence_trimmer.reset (new SilenceTrimmer<Sample>(max_frames_in));
577         silence_trimmer->set_trim_beginning (config.format->trim_beginning());
578         silence_trimmer->set_trim_end (config.format->trim_end());
579
580         framecnt_t sb = config.format->silence_beginning_at (parent.timespan->get_start(), sample_rate);
581         framecnt_t se = config.format->silence_end_at (parent.timespan->get_end(), sample_rate);
582
583         silence_trimmer->add_silence_to_beginning (sb);
584         silence_trimmer->add_silence_to_end (se);
585
586         add_child (new_config);
587 }
588
589 ExportGraphBuilder::FloatSinkPtr
590 ExportGraphBuilder::SilenceHandler::sink ()
591 {
592         return silence_trimmer;
593 }
594
595 void
596 ExportGraphBuilder::SilenceHandler::add_child (FileSpec const & new_config)
597 {
598         for (boost::ptr_list<SRC>::iterator it = children.begin(); it != children.end(); ++it) {
599                 if (*it == new_config) {
600                         it->add_child (new_config);
601                         return;
602                 }
603         }
604
605         children.push_back (new SRC (parent, new_config, max_frames_in));
606         silence_trimmer->add_output (children.back().sink());
607 }
608
609 void
610 ExportGraphBuilder::SilenceHandler::remove_children (bool remove_out_files)
611 {
612         boost::ptr_list<SRC>::iterator iter = children.begin();
613
614         while (iter != children.end() ) {
615                 silence_trimmer->remove_output (iter->sink() );
616                 iter->remove_children (remove_out_files);
617                 iter = children.erase (iter);
618         }
619 }
620
621 bool
622 ExportGraphBuilder::SilenceHandler::operator== (FileSpec const & other_config) const
623 {
624         ExportFormatSpecification & format = *config.format;
625         ExportFormatSpecification & other_format = *other_config.format;
626         return (format.trim_beginning() == other_format.trim_beginning()) &&
627                 (format.trim_end() == other_format.trim_end()) &&
628                 (format.silence_beginning_time() == other_format.silence_beginning_time()) &&
629                 (format.silence_end_time() == other_format.silence_end_time());
630 }
631
632 /* ChannelConfig */
633
634 ExportGraphBuilder::ChannelConfig::ChannelConfig (ExportGraphBuilder & parent, FileSpec const & new_config, ChannelMap & channel_map)
635         : parent (parent)
636 {
637         typedef ExportChannelConfiguration::ChannelList ChannelList;
638
639         config = new_config;
640
641         framecnt_t max_frames = parent.session.engine().samples_per_cycle();
642         interleaver.reset (new Interleaver<Sample> ());
643         interleaver->init (new_config.channel_config->get_n_chans(), max_frames);
644
645         // Make the chunk size divisible by the channel count
646         int chan_count = new_config.channel_config->get_n_chans();
647         max_frames_out = 8192;
648         if (chan_count > 0) {
649                 max_frames_out -= max_frames_out % chan_count;
650         }
651         chunker.reset (new Chunker<Sample> (max_frames_out));
652         interleaver->add_output(chunker);
653
654         ChannelList const & channel_list = config.channel_config->get_channels();
655         unsigned chan = 0;
656         for (ChannelList::const_iterator it = channel_list.begin(); it != channel_list.end(); ++it, ++chan) {
657                 ChannelMap::iterator map_it = channel_map.find (*it);
658                 if (map_it == channel_map.end()) {
659                         std::pair<ChannelMap::iterator, bool> result_pair =
660                                 channel_map.insert (std::make_pair (*it, IdentityVertexPtr (new IdentityVertex<Sample> ())));
661                         assert (result_pair.second);
662                         map_it = result_pair.first;
663                 }
664                 map_it->second->add_output (interleaver->input (chan));
665         }
666
667         add_child (new_config);
668 }
669
670 void
671 ExportGraphBuilder::ChannelConfig::add_child (FileSpec const & new_config)
672 {
673         assert (*this == new_config);
674
675         for (boost::ptr_list<SilenceHandler>::iterator it = children.begin(); it != children.end(); ++it) {
676                 if (*it == new_config) {
677                         it->add_child (new_config);
678                         return;
679                 }
680         }
681
682         children.push_back (new SilenceHandler (parent, new_config, max_frames_out));
683         chunker->add_output (children.back().sink ());
684 }
685
686 void
687 ExportGraphBuilder::ChannelConfig::remove_children (bool remove_out_files)
688 {
689         boost::ptr_list<SilenceHandler>::iterator iter = children.begin();
690
691         while(iter != children.end() ) {
692
693                 chunker->remove_output (iter->sink ());
694                 iter->remove_children (remove_out_files);
695                 iter = children.erase(iter);
696         }
697 }
698
699 bool
700 ExportGraphBuilder::ChannelConfig::operator== (FileSpec const & other_config) const
701 {
702         return config.channel_config == other_config.channel_config;
703 }
704
705 } // namespace ARDOUR