mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Linear interpolation (instead of dichotomy converge) for fading at Session update. Mixing View update reads value of session fading to animate the cursor (which was preventing other manipulation of fading). Cleanup fading in OSC controller, with animation options and fade-in and fade-out controls.
92 lines
2.5 KiB
C++
92 lines
2.5 KiB
C++
#ifndef CONTROL_H
|
|
#define CONTROL_H
|
|
|
|
#include "NetworkToolkit.h"
|
|
|
|
#define OSC_SYNC "/sync"
|
|
|
|
#define OSC_INFO "/info"
|
|
#define OSC_INFO_LOG "/log"
|
|
|
|
#define OSC_OUTPUT "/output"
|
|
#define OSC_OUTPUT_ENABLE "/enable"
|
|
#define OSC_OUTPUT_DISABLE "/disable"
|
|
#define OSC_OUTPUT_FADING "/fading"
|
|
#define OSC_OUTPUT_FADE_IN "/fadein"
|
|
#define OSC_OUTPUT_FADE_OUT "/fadeout"
|
|
|
|
#define OSC_ALL "/all"
|
|
#define OSC_SELECTED "/selected"
|
|
#define OSC_CURRENT "/current"
|
|
#define OSC_VERSION "/version"
|
|
#define OSC_NEXT "/next"
|
|
#define OSC_PREVIOUS "/previous"
|
|
|
|
#define OSC_SOURCE_NAME "/name"
|
|
#define OSC_SOURCE_PLAY "/play"
|
|
#define OSC_SOURCE_PAUSE "/pause"
|
|
#define OSC_SOURCE_REPLAY "/replay"
|
|
#define OSC_SOURCE_ALPHA "/alpha"
|
|
#define OSC_SOURCE_LOOM "/loom"
|
|
#define OSC_SOURCE_TRANSPARENCY "/transparency"
|
|
#define OSC_SOURCE_DEPTH "/depth"
|
|
#define OSC_SOURCE_GRAB "/grab"
|
|
#define OSC_SOURCE_RESIZE "/resize"
|
|
#define OSC_SOURCE_TURN "/turn"
|
|
#define OSC_SOURCE_RESET "/reset"
|
|
|
|
|
|
class Session;
|
|
class Source;
|
|
|
|
class Control
|
|
{
|
|
// Private Constructor
|
|
Control();
|
|
Control(Control const& copy) = delete;
|
|
Control& operator=(Control const& copy) = delete;
|
|
|
|
public:
|
|
|
|
static Control& manager ()
|
|
{
|
|
// The only instance
|
|
static Control _instance;
|
|
return _instance;
|
|
}
|
|
~Control();
|
|
|
|
bool init();
|
|
void terminate();
|
|
|
|
// void setOscPort(int P);
|
|
|
|
protected:
|
|
|
|
class RequestListener : public osc::OscPacketListener {
|
|
protected:
|
|
virtual void ProcessMessage( const osc::ReceivedMessage& m,
|
|
const IpEndpointName& remoteEndpoint );
|
|
std::string FullMessage( const osc::ReceivedMessage& m );
|
|
};
|
|
|
|
bool receiveOutputAttribute(const std::string &attribute,
|
|
osc::ReceivedMessageArgumentStream arguments);
|
|
|
|
bool receiveSourceAttribute(Source *target, const std::string &attribute,
|
|
osc::ReceivedMessageArgumentStream arguments);
|
|
|
|
void sendCurrentSourceAttibutes(const IpEndpointName& remoteEndpoint);
|
|
void sendSourcesStatus(const IpEndpointName& remoteEndpoint, osc::ReceivedMessageArgumentStream arguments);
|
|
void sendOutputStatus(const IpEndpointName& remoteEndpoint);
|
|
|
|
private:
|
|
|
|
static void listen();
|
|
RequestListener listener_;
|
|
UdpListeningReceiveSocket *receiver_;
|
|
|
|
};
|
|
|
|
#endif // CONTROL_H
|