VideoTools
|
A class for receiving and handling events published from a viewer process. More...
#include <gvviewerevent.h>
Classes | |
struct | Info |
A structure representing an interaction event received from a viewer process. More... | |
Public Types | |
enum | Type { Up, Down, Drag, Move, Invalid } |
Public Member Functions | |
ViewerEvent (const std::string &channel_name=std::string()) | |
Constructor. | |
Info | apply (const std::string &) |
Parses the event string and maintains an internal button state. | |
Info | apply (const std::vector< char > &) |
Overload taking a vector. | |
bool | init () |
Tries to subscribe to the viewer's event channel. More... | |
int | fd () const |
Returns the subsription file descriptor, or minus one if not init()isalised. More... | |
bool | receive (std::vector< char > &, std::string *type_p=nullptr) |
Receives the payload for an event on fd(). More... | |
std::string | channelName () const |
Returns the channel name, as passed to the ctor. | |
A class for receiving and handling events published from a viewer process.
Definition at line 39 of file gvviewerevent.h.
int Gv::ViewerEvent::fd | ( | ) | const |
Returns the subsription file descriptor, or minus one if not init()isalised.
Definition at line 47 of file gvviewerevent.cpp.
bool Gv::ViewerEvent::init | ( | ) |
Tries to subscribe to the viewer's event channel.
Returns true if newly subscribed.
Definition at line 42 of file gvviewerevent.cpp.
bool Gv::ViewerEvent::receive | ( | std::vector< char > & | buffer, |
std::string * | type_p = nullptr |
||
) |
Receives the payload for an event on fd().
Definition at line 52 of file gvviewerevent.cpp.