Ardour  9.0-pre0-582-g084a23a80d
osc_global_observer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-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_oscglobalobserver_h__
20 #define __osc_oscglobalobserver_h__
21 
22 #include "osc.h"
23 
24 #include <memory>
25 #include <string>
26 
27 #include <sigc++/sigc++.h>
28 #include <lo/lo.h>
29 
30 #include "pbd/controllable.h"
31 #include "pbd/stateful.h"
32 
33 #include "ardour/route_group.h"
34 #include "ardour/session.h"
35 #include "ardour/types.h"
36 
38 {
39 
40  public:
43 
44  lo_address address() const { return addr; };
45  void tick (void);
46  void clear_observer (void);
47  void jog_mode (uint32_t jogmode);
48 
49  private:
51 
54 
55  enum STRIP {
58  };
59 
61  bool _init;
65  lo_address addr;
66  std::string path;
67  std::string mark_text;
68  uint32_t gainmode;
69  std::bitset<32> feedback;
71  uint32_t _jog_mode;
73  uint32_t _heartbeat;
74  float _last_meter;
75  uint32_t master_timeout;
76  uint32_t monitor_timeout;
77  uint32_t last_punchin;
78  uint32_t last_punchout;
79  uint32_t last_click;
82  struct LocationMarker {
83  LocationMarker (const std::string& l, samplepos_t w)
84  : label (l), when (w) {}
85  std::string label;
87  };
88  std::vector<LocationMarker> lm;
89 
91  bool operator() (const LocationMarker& a, const LocationMarker& b) {
92  return (a.when < b.when);
93  }
94  };
95 
97  void send_change_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
98  void send_gain_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
99  void send_trim_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
102  void solo_active (bool active);
103  void session_name (std::string path, std::string name);
104  void extra_check (void);
105  void marks_changed (void);
106  void mark_update (void);
108  void group_changed (void);
109 };
110 
111 #endif /* __osc_oscglobalobserver_h__ */
ARDOUR::Session * session
void jog_mode(uint32_t jogmode)
void extra_check(void)
void solo_active(bool active)
std::vector< LocationMarker > lm
void session_name(std::string path, std::string name)
PBD::ScopedConnectionList strip_connections
void send_record_state_changed(void)
OSCGlobalObserver(ArdourSurface::OSC &o, ARDOUR::Session &s, ArdourSurface::OSC::OSCSurface *su)
lo_address address() const
void marks_changed(void)
void group_changed(ARDOUR::RouteGroup *)
void send_change_message(std::string path, std::shared_ptr< PBD::Controllable > controllable)
void update_mixer_scene_state()
void send_trim_message(std::string path, std::shared_ptr< PBD::Controllable > controllable)
void group_changed(void)
ArdourSurface::OSC & _osc
std::bitset< 32 > feedback
void send_gain_message(std::string path, std::shared_ptr< PBD::Controllable > controllable)
void clear_observer(void)
void mark_update(void)
PBD::ScopedConnectionList session_connections
void send_transport_state_changed(void)
ArdourSurface::OSC::OSCSurface * sur
GtkImageIconNameData name
Definition: gtkimage.h:6
PBD::PropertyDescriptor< bool > active
Temporal::samplepos_t samplepos_t
bool operator()(const LocationMarker &a, const LocationMarker &b)
LocationMarker(const std::string &l, samplepos_t w)