Ardour  9.0-pre0-582-g084a23a80d
panner_shell.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011-2017 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2011 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2013-2014 Robin Gareus <robin@gareus.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #pragma once
22 
23 #include <cmath>
24 #include <cassert>
25 #include <vector>
26 #include <string>
27 #include <iostream>
28 
29 #include "evoral/Parameter.h"
30 #include "pbd/cartesian.h"
32 
34 #include "ardour/types.h"
35 #include "ardour/session_object.h"
36 
37 namespace ARDOUR {
38 
39 class Session;
40 class Route;
41 class Panner;
42 class BufferSet;
43 class AudioBuffer;
44 class Speakers;
45 class Pannable;
46 
51 {
52 public:
53  PannerShell (std::string name, Session&, std::shared_ptr<Pannable>, Temporal::TimeDomainProvider const &, bool is_send = false);
54  virtual ~PannerShell ();
55 
57 
58  bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) { return true; };
60 
62  void run (BufferSet& src, BufferSet& dest, samplepos_t start_sample, samplepos_t end_samples, pframes_t nframes);
63 
64  XMLNode& get_state () const;
65  int set_state (const XMLNode&, int version);
66 
67  PBD::Signal<void()> PannableChanged; /* Pannable changed -- l*/
68  PBD::Signal<void()> Changed; /* panner and/or outputs count and/or bypass state changed */
69 
70  std::shared_ptr<Panner> panner() const { return _panner; }
71  std::shared_ptr<Pannable> pannable() const { return _panlinked ? _pannable_route : _pannable_internal; }
72  std::shared_ptr<Pannable> unlinked_pannable () const { return _pannable_internal; }
73 
74  bool bypassed () const;
75  void set_bypassed (bool);
76 
77  bool is_send () const { return (_is_send); }
78  bool is_linked_to_route () const { return (_is_send && _panlinked); }
79  /* this function takes the process lock: */
80  void set_linked_to_route (bool);
81 
82  std::string current_panner_uri() const { return _current_panner_uri; }
83  std::string user_selected_panner_uri() const { return _user_selected_panner_uri; }
84  std::string panner_gui_uri() const { return _panner_gui_uri; }
85 
86  /* this function takes the process lock: */
87  bool select_panner_by_uri (std::string const uri);
88 
89  private:
90  void distribute_no_automation (BufferSet& src, BufferSet& dest, pframes_t nframes, gain_t gain_coeff);
91  bool set_user_selected_panner_uri (std::string const uri);
92 
93  std::shared_ptr<Panner> _panner;
94 
95  std::shared_ptr<Pannable> _pannable_internal;
96  std::shared_ptr<Pannable> _pannable_route;
97  bool _is_send;
98  bool _panlinked;
99  bool _bypassed;
100 
101  std::string _current_panner_uri;
103  std::string _panner_gui_uri;
105 };
106 
107 } // namespace ARDOUR
108 
std::string describe_parameter(Evoral::Parameter param)
std::shared_ptr< Pannable > unlinked_pannable() const
Definition: panner_shell.h:72
bool select_panner_by_uri(std::string const uri)
void distribute_no_automation(BufferSet &src, BufferSet &dest, pframes_t nframes, gain_t gain_coeff)
std::string _panner_gui_uri
Definition: panner_shell.h:103
PBD::Signal< void()> Changed
Definition: panner_shell.h:68
void configure_io(ChanCount in, ChanCount out)
bool bypassed() const
virtual ~PannerShell()
std::shared_ptr< Pannable > pannable() const
Definition: panner_shell.h:71
bool is_linked_to_route() const
Definition: panner_shell.h:78
std::string current_panner_uri() const
Definition: panner_shell.h:82
bool can_support_io_configuration(const ChanCount &, ChanCount &)
Definition: panner_shell.h:58
void set_linked_to_route(bool)
bool is_send() const
Definition: panner_shell.h:77
PannerShell(std::string name, Session &, std::shared_ptr< Pannable >, Temporal::TimeDomainProvider const &, bool is_send=false)
XMLNode & get_state() const
std::string panner_gui_uri() const
Definition: panner_shell.h:84
std::shared_ptr< Panner > _panner
Definition: panner_shell.h:93
std::string user_selected_panner_uri() const
Definition: panner_shell.h:83
std::shared_ptr< Panner > panner() const
Definition: panner_shell.h:70
bool set_user_selected_panner_uri(std::string const uri)
void set_bypassed(bool)
int set_state(const XMLNode &, int version)
std::shared_ptr< Pannable > _pannable_internal
Definition: panner_shell.h:95
std::string _user_selected_panner_uri
Definition: panner_shell.h:102
std::shared_ptr< Pannable > _pannable_route
Definition: panner_shell.h:96
void run(BufferSet &src, BufferSet &dest, samplepos_t start_sample, samplepos_t end_samples, pframes_t nframes)
The fundamental Panner function.
std::string _current_panner_uri
Definition: panner_shell.h:101
PBD::Signal< void()> PannableChanged
Definition: panner_shell.h:67
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
#define LIBARDOUR_API
uint32_t pframes_t
Temporal::samplepos_t samplepos_t