Ardour  8.7-14-g57a6773833
osc_cue_observer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017-2018 Len Ovens <len@ovenwerks.net>
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 along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __osc_osccueobserver_h__
20 #define __osc_osccueobserver_h__
21 
22 #include <string>
23 #include <memory>
24 
25 #include <sigc++/sigc++.h>
26 #include <lo/lo.h>
27 
28 #include "pbd/controllable.h"
29 #include "pbd/stateful.h"
30 #include "ardour/types.h"
31 
33 {
34 
35  public:
38 
39  std::shared_ptr<ARDOUR::Stripable> strip () const { return _strip; }
40  lo_address address() const { return addr; };
41  void tick (void);
42  typedef std::vector<std::shared_ptr<ARDOUR::Stripable> > Sorted;
44  void clear_observer (void);
45  void refresh_strip (std::shared_ptr<ARDOUR::Stripable> new_strip, Sorted new_sends, bool force);
46 
47  private:
48 
49  std::shared_ptr<ARDOUR::Stripable> _strip;
51 
54 
55  lo_address addr;
56  std::string path;
58  float _last_meter;
59  float _last_signal;
60  std::vector<uint32_t> gain_timeout;
62  std::vector<float> _last_gain;
63 
64  void name_changed (const PBD::PropertyChange& what_changed, uint32_t id);
65  void send_change_message (std::string path, uint32_t id, std::shared_ptr<PBD::Controllable> controllable);
66  void send_gain_message (uint32_t id, std::shared_ptr<PBD::Controllable> controllable, bool force);
67  void send_enabled_message (std::string path, uint32_t id, std::shared_ptr<ARDOUR::Processor> proc);
68  void send_init (void);
69  void send_end (uint32_t new_sends_size);
70  void send_restart (void);
71 };
72 
73 #endif /* __osc_osccueobserver_h__ */
void send_change_message(std::string path, uint32_t id, std::shared_ptr< PBD::Controllable > controllable)
lo_address address() const
void refresh_strip(std::shared_ptr< ARDOUR::Stripable > new_strip, Sorted new_sends, bool force)
void send_restart(void)
std::shared_ptr< ARDOUR::Stripable > _strip
std::shared_ptr< ARDOUR::Stripable > strip() const
PBD::ScopedConnectionList send_connections
ArdourSurface::OSC & _osc
void send_enabled_message(std::string path, uint32_t id, std::shared_ptr< ARDOUR::Processor > proc)
std::string path
void send_init(void)
PBD::ScopedConnectionList strip_connections
ArdourSurface::OSC::OSCSurface * sur
std::vector< uint32_t > gain_timeout
OSCCueObserver(ArdourSurface::OSC &o, ArdourSurface::OSC::OSCSurface *sur)
void send_end(uint32_t new_sends_size)
void send_gain_message(uint32_t id, std::shared_ptr< PBD::Controllable > controllable, bool force)
void clear_observer(void)
std::vector< float > _last_gain
void name_changed(const PBD::PropertyChange &what_changed, uint32_t id)
std::vector< std::shared_ptr< ARDOUR::Stripable > > Sorted
void tick(void)