Ardour  9.0-rc1-21-gd5464b39db
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 
37 namespace ArdourSurface {
38 
39 
41  LocationMarker (const std::string& l, samplepos_t w)
42  : label (l), when (w) {}
43  std::string label;
45 };
46 
48  bool operator() (const LocationMarker& a, const LocationMarker& b) {
49  return (a.when < b.when);
50  }
51 };
52 
54 {
55 
56  public:
59 
60  lo_address address() const { return addr; };
61  void tick (void);
62  void clear_observer (void);
63  void jog_mode (uint32_t jogmode);
64 
65  private:
66  friend ArdourSurface::OSC;
67 
69 
72 
73  enum STRIP {
76  };
77 
79  bool _init;
83  lo_address addr;
84  std::string path;
85  std::string mark_text;
86  uint32_t gainmode;
87  std::bitset<32> feedback;
89  uint32_t _jog_mode;
91  uint32_t _heartbeat;
92  float _last_meter;
93  uint32_t master_timeout;
94  uint32_t monitor_timeout;
95  uint32_t last_punchin;
96  uint32_t last_punchout;
97  uint32_t last_click;
100  std::vector<LocationMarker> lm;
101 
103  void send_change_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
104  void send_gain_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
105  void send_trim_message (std::string path, std::shared_ptr<PBD::Controllable> controllable);
108  void solo_active (bool active);
109  void session_name (std::string path, std::string name);
110  void extra_check (void);
111  void marks_changed (void);
112  void mark_update (void);
114  void group_changed (void);
115 };
116 
117 } /* namespace */
118 
119 #endif /* __osc_oscglobalobserver_h__ */
void send_change_message(std::string path, std::shared_ptr< PBD::Controllable > controllable)
void jog_mode(uint32_t jogmode)
void send_gain_message(std::string path, std::shared_ptr< PBD::Controllable > controllable)
OSCGlobalObserver(ArdourSurface::OSC &o, ARDOUR::Session &s, ArdourSurface::OSC::OSCSurface *su)
PBD::ScopedConnectionList strip_connections
void session_name(std::string path, std::string name)
void group_changed(ARDOUR::RouteGroup *)
std::vector< LocationMarker > lm
ArdourSurface::OSC::OSCSurface * sur
void send_trim_message(std::string path, std::shared_ptr< PBD::Controllable > controllable)
PBD::ScopedConnectionList session_connections
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)