ardour
panner_shell.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2004-2011 Paul Davis
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
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __ardour_panner_shell_h__
21 #define __ardour_panner_shell_h__
22 
23 #include <cmath>
24 #include <cassert>
25 #include <vector>
26 #include <string>
27 #include <iostream>
28 
29 #include <boost/noncopyable.hpp>
30 
31 #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&, boost::shared_ptr<Pannable>, bool is_send = false);
54  virtual ~PannerShell ();
55 
56  std::string describe_parameter (Evoral::Parameter param);
57 
58  bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) { return true; };
59  void configure_io (ChanCount in, ChanCount out);
60 
62  void run (BufferSet& src, BufferSet& dest, framepos_t start_frame, framepos_t end_frames, pframes_t nframes);
63 
64  XMLNode& get_state ();
65  int set_state (const XMLNode&, int version);
66 
67  PBD::Signal0<void> PannableChanged; /* Pannable changed -- l*/
68  PBD::Signal0<void> Changed; /* panner and/or outputs count and/or bypass state changed */
69 
70  boost::shared_ptr<Panner> panner() const { return _panner; }
71  boost::shared_ptr<Pannable> pannable() const { return _panlinked ? _pannable_route : _pannable_internal; }
72 
73  bool bypassed () const;
74  void set_bypassed (bool);
75 
76  bool is_send () const { return (_is_send); }
77  bool is_linked_to_route () const { return (_is_send && _panlinked); }
78  /* this function takes the process lock: */
79  void set_linked_to_route (bool);
80 
81  std::string current_panner_uri() const { return _current_panner_uri; }
82  std::string user_selected_panner_uri() const { return _user_selected_panner_uri; }
83  std::string panner_gui_uri() const { return _panner_gui_uri; }
84 
85  /* this function takes the process lock: */
86  bool select_panner_by_uri (std::string const uri);
87 
88  private:
89  void distribute_no_automation (BufferSet& src, BufferSet& dest, pframes_t nframes, gain_t gain_coeff);
90  bool set_user_selected_panner_uri (std::string const uri);
91 
93 
96  bool _is_send;
97  bool _panlinked;
98  bool _bypassed;
99 
100  std::string _current_panner_uri;
102  std::string _panner_gui_uri;
104 };
105 
106 } // namespace ARDOUR
107 
108 #endif /* __ardour_panner_shell_h__ */
PBD::Signal0< void > PannableChanged
Definition: panner_shell.h:67
std::string panner_gui_uri() const
Definition: panner_shell.h:83
boost::shared_ptr< Panner > _panner
Definition: panner_shell.h:92
std::string _user_selected_panner_uri
Definition: panner_shell.h:101
uint32_t pframes_t
Definition: types.h:61
float gain_t
Definition: types.h:58
bool can_support_io_configuration(const ChanCount &, ChanCount &)
Definition: panner_shell.h:58
boost::shared_ptr< Pannable > _pannable_internal
Definition: panner_shell.h:94
bool is_linked_to_route() const
Definition: panner_shell.h:77
Definition: amp.h:29
int64_t framepos_t
Definition: types.h:66
std::string _current_panner_uri
Definition: panner_shell.h:100
#define LIBARDOUR_API
const char * name
boost::shared_ptr< Pannable > _pannable_route
Definition: panner_shell.h:95
bool is_send() const
Definition: panner_shell.h:76
PBD::Signal0< void > Changed
Definition: panner_shell.h:68
Definition: xml++.h:95
boost::shared_ptr< Pannable > pannable() const
Definition: panner_shell.h:71
std::string _panner_gui_uri
Definition: panner_shell.h:102
boost::shared_ptr< Panner > panner() const
Definition: panner_shell.h:70
std::string current_panner_uri() const
Definition: panner_shell.h:81
std::string user_selected_panner_uri() const
Definition: panner_shell.h:82