2017-01-09 21:56:22 -05:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2017-2018 Len Ovens <len@ovenwerks.net>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2017-01-09 21:56:22 -05:00
|
|
|
|
|
|
|
#ifndef __osc_osccueobserver_h__
|
|
|
|
#define __osc_osccueobserver_h__
|
|
|
|
|
|
|
|
#include <string>
|
2023-02-16 12:59:41 -05:00
|
|
|
#include <memory>
|
|
|
|
|
2017-01-09 21:56:22 -05:00
|
|
|
#include <sigc++/sigc++.h>
|
|
|
|
#include <lo/lo.h>
|
|
|
|
|
|
|
|
#include "pbd/controllable.h"
|
|
|
|
#include "pbd/stateful.h"
|
|
|
|
#include "ardour/types.h"
|
|
|
|
|
|
|
|
class OSCCueObserver
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2017-10-19 11:46:55 -04:00
|
|
|
OSCCueObserver (ArdourSurface::OSC& o, ArdourSurface::OSC::OSCSurface* sur);
|
2017-01-09 21:56:22 -05:00
|
|
|
~OSCCueObserver ();
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<ARDOUR::Stripable> strip () const { return _strip; }
|
2017-01-09 21:56:22 -05:00
|
|
|
lo_address address() const { return addr; };
|
|
|
|
void tick (void);
|
2023-02-16 18:33:28 -05:00
|
|
|
typedef std::vector<std::shared_ptr<ARDOUR::Stripable> > Sorted;
|
2017-01-09 21:56:22 -05:00
|
|
|
Sorted sends;
|
2017-10-19 11:46:55 -04:00
|
|
|
void clear_observer (void);
|
2023-02-16 18:33:28 -05:00
|
|
|
void refresh_strip (std::shared_ptr<ARDOUR::Stripable> new_strip, Sorted new_sends, bool force);
|
2017-01-09 21:56:22 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<ARDOUR::Stripable> _strip;
|
2017-10-19 11:46:55 -04:00
|
|
|
ArdourSurface::OSC& _osc;
|
2017-01-09 21:56:22 -05:00
|
|
|
|
|
|
|
PBD::ScopedConnectionList strip_connections;
|
|
|
|
PBD::ScopedConnectionList send_connections;
|
|
|
|
|
|
|
|
lo_address addr;
|
|
|
|
std::string path;
|
2017-10-19 11:46:55 -04:00
|
|
|
ArdourSurface::OSC::OSCSurface* sur;
|
2017-01-09 21:56:22 -05:00
|
|
|
float _last_meter;
|
2018-10-15 13:38:52 -04:00
|
|
|
float _last_signal;
|
2017-01-09 21:56:22 -05:00
|
|
|
std::vector<uint32_t> gain_timeout;
|
|
|
|
bool tick_enable;
|
2017-07-24 13:14:21 -04:00
|
|
|
std::vector<float> _last_gain;
|
2017-01-09 21:56:22 -05:00
|
|
|
|
|
|
|
void name_changed (const PBD::PropertyChange& what_changed, uint32_t id);
|
2023-02-16 18:33:28 -05:00
|
|
|
void send_change_message (std::string path, uint32_t id, std::shared_ptr<PBD::Controllable> controllable);
|
|
|
|
void send_gain_message (uint32_t id, std::shared_ptr<PBD::Controllable> controllable, bool force);
|
|
|
|
void send_enabled_message (std::string path, uint32_t id, std::shared_ptr<ARDOUR::Processor> proc);
|
2017-01-09 21:56:22 -05:00
|
|
|
void send_init (void);
|
2017-11-13 20:18:33 -05:00
|
|
|
void send_end (uint32_t new_sends_size);
|
2017-01-09 21:56:22 -05:00
|
|
|
void send_restart (void);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __osc_osccueobserver_h__ */
|