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