Loading...
Searching...
No Matches
CmdConnection Class Reference

`#include <jsonrpc.h>`

Inheritance diagram for CmdConnection:

## Classes

struct | methodnames

## Public Types

enum | msg_type { f_preset_changed , f_state_changed , f_freq_changed , f_display , f_display_state , f_selection_done , f_presetlist_changed , f_log_message , f_midi_changed , f_midi_value_changed , f_parameter_change_notify , f_plugins_changed , f_misc_msg , f_units_changed , END_OF_FLAGS }

## Public Member Functions

| CmdConnection (GxService &serv, const Glib::RefPtr< Gio::SocketConnection > &connection_)
| ~CmdConnection ()
bool | on_data_in (Glib::IOCondition cond)
bool | on_data_out (Glib::IOCondition cond)
void | send (gx_system::JsonStringWriter &jw)
bool | is_activated (msg_type n)
void | update_maxlevel (const std::string &id, float v)

## Private Member Functions

bool | find_token (const Glib::ustring &token, msg_type *start, msg_type *end)
void | activate (int n, bool v)
void | exec (Glib::ustring cmd)
void | call (gx_system::JsonWriter &jw, const methodnames *mn, JsonArray &params)
void | notify (gx_system::JsonStringWriter &jw, const methodnames *mn, JsonArray &params)
bool | request (gx_system::JsonStringParser &jp, gx_system::JsonStringWriter &jw, bool batch_start)
void | write_error (gx_system::JsonWriter &jw, int code, const char *message)
void | write_error (gx_system::JsonWriter &jw, int code, Glib::ustring &message)
void | error_response (gx_system::JsonWriter &jw, int code, const char *message)
void | error_response (gx_system::JsonWriter &jw, int code, const Glib::ustring &message)
void | send_notify_begin (gx_system::JsonStringWriter &jw, const char *method)
void | send_notify_end (gx_system::JsonStringWriter &jw, bool send_out=true)
void | listen (const Glib::ustring &tp)
void | unlisten (const Glib::ustring &tp)
void | process (gx_system::JsonStringParser &jp)

## Private Attributes

GxService & | serv
Glib::RefPtr< Gio::SocketConnection > | connection
std::list< std::string > | outgoing
unsigned int | current_offset
gx_system::JsonStringParser | jp
bool | midi_config_mode
std::bitset< END_OF_FLAGS > | flags
std::map< string, float > | maxlevel

## Friends

class | UiBuilderVirt

## Detailed Description

Definition at line 58 of file jsonrpc.h.

## Member Enumeration Documentation

## msg_type

enum CmdConnection::msg_type

Enumerator
f_preset_changed |
f_state_changed |
f_freq_changed |
f_display |
f_display_state |
f_selection_done |
f_presetlist_changed |
f_log_message |
f_midi_changed |
f_midi_value_changed |
f_parameter_change_notify |
f_plugins_changed |
f_misc_msg |
f_units_changed |
END_OF_FLAGS |

Definition at line 64 of file jsonrpc.h.

## Constructor & Destructor Documentation

## CmdConnection()

CmdConnection::CmdConnection | ( | GxService & | serv,
|  | const Glib::RefPtr< Gio::SocketConnection > & | connection_ )

## ~CmdConnection()

CmdConnection::~CmdConnection | ( |  | ) |

## Member Function Documentation

## activate()

void CmdConnection::activate | ( | int | n,
|  | bool | v )

inline private

Definition at line 92 of file jsonrpc.h.

## call()

void CmdConnection::call | ( | gx_system::JsonWriter & | jw,
|  | const methodnames * | mn,
|  | JsonArray & | params )

private

## error_response() [1/2]

void CmdConnection::error_response | ( | gx_system::JsonWriter & | jw,
|  | int | code,
|  | const char * | message )

private

## error_response() [2/2]

void CmdConnection::error_response | ( | gx_system::JsonWriter & | jw,
|  | int | code,
|  | const Glib::ustring & | message )

inline private

Definition at line 100 of file jsonrpc.h.

Referenced by error_response().

## exec()

void CmdConnection::exec | ( | Glib::ustring | cmd | ) |

private

## find_token()

bool CmdConnection::find_token | ( | const Glib::ustring & | token,
|  | msg_type * | start,
|  | msg_type * | end )

private

## is_activated()

bool CmdConnection::is_activated | ( | msg_type | n | ) |

inline

Definition at line 113 of file jsonrpc.h.

## listen()

void CmdConnection::listen | ( | const Glib::ustring & | tp | ) |

private

## notify()

void CmdConnection::notify | ( | gx_system::JsonStringWriter & | jw,
|  | const methodnames * | mn,
|  | JsonArray & | params )

private

## on_data_in()

bool CmdConnection::on_data_in | ( | Glib::IOCondition | cond | ) |

## on_data_out()

bool CmdConnection::on_data_out | ( | Glib::IOCondition | cond | ) |

## process()

void CmdConnection::process | ( | gx_system::JsonStringParser & | jp | ) |

private

## request()

bool CmdConnection::request | ( | gx_system::JsonStringParser & | jp,
|  | gx_system::JsonStringWriter & | jw,
|  | bool | batch_start )

private

## send()

void CmdConnection::send | ( | gx_system::JsonStringWriter & | jw | ) |

## send_notify_begin()

void CmdConnection::send_notify_begin | ( | gx_system::JsonStringWriter & | jw,
|  | const char * | method )

inline private

Definition at line 101 of file jsonrpc.h.

## send_notify_end()

void CmdConnection::send_notify_end | ( | gx_system::JsonStringWriter & | jw,
|  | bool | send_out = true )

private

## unlisten()

void CmdConnection::unlisten | ( | const Glib::ustring & | tp | ) |

private

## update_maxlevel()

void CmdConnection::update_maxlevel | ( | const std::string & | id,
|  | float | v )

inline

Definition at line 114 of file jsonrpc.h.

## write_error() [1/2]

void CmdConnection::write_error | ( | gx_system::JsonWriter & | jw,
|  | int | code,
|  | const char * | message )

private

## write_error() [2/2]

void CmdConnection::write_error | ( | gx_system::JsonWriter & | jw,
|  | int | code,
|  | Glib::ustring & | message )

inline private

Definition at line 98 of file jsonrpc.h.

Referenced by write_error().

## Friends And Related Symbol Documentation

## UiBuilderVirt

friend class UiBuilderVirt

friend

Definition at line 115 of file jsonrpc.h.

Referenced by UiBuilderVirt.

## Member Data Documentation

## connection

Glib::RefPtr<Gio::SocketConnection> CmdConnection::connection

private

Definition at line 83 of file jsonrpc.h.

## current_offset

unsigned int CmdConnection::current_offset

private

Definition at line 85 of file jsonrpc.h.

## flags

std::bitset<END_OF_FLAGS> CmdConnection::flags

private

Definition at line 88 of file jsonrpc.h.

Referenced by activate(), and is_activated().

## jp

gx_system::JsonStringParser CmdConnection::jp

private

Definition at line 86 of file jsonrpc.h.

Referenced by process(), and request().

## maxlevel

std::map<string,float> CmdConnection::maxlevel

private

Definition at line 89 of file jsonrpc.h.

Referenced by update_maxlevel().

## midi_config_mode

bool CmdConnection::midi_config_mode

private

Definition at line 87 of file jsonrpc.h.

## outgoing

std::list<std::string> CmdConnection::outgoing

private

Definition at line 84 of file jsonrpc.h.

## serv

GxService& CmdConnection::serv

private

Definition at line 82 of file jsonrpc.h.

Referenced by CmdConnection().

The documentation for this class was generated from the following file:

- src/headers/jsonrpc.h