cwEuCon.h/cpp : Added initial interface for communicating with an an application or UI.

This commit is contained in:
kevin.larke 2020-04-09 21:07:45 -04:00
parent efc1c27f85
commit d505a4af5a
2 changed files with 64 additions and 1 deletions

View File

@ -714,6 +714,30 @@ cw::rc_t cw::eucon::exec( handle_t h, unsigned sockTimeOutMs )
}
bool cw::eucon::areMsgsWaiting( handle_t h )
{
eucon_t* p = _handleToPtr(h);
}
cw::rc_t cw::eucon::getMsgs( handle_t h, msgCallback_t cbFunc, void* cbArg )
{
rc_t rc = kOkRC;
eucon_t* p = _handleToPtr(h);
return rc;
}
cw::rc_t cw::eucon::sendCtlMsg( handle_t h, unsigned ctlTId, unsigned channel, unsigned ivalue, float fvalue )
{
rc_t rc = kOkRC;
eucon_t* p = _handleToPtr(h);
return rc;
}
namespace cw
{

View File

@ -13,7 +13,7 @@ namespace cw
};
typedef handle<struct eucon_str> handle_t;
typedef struct args_str
{
unsigned recvBufByteN; // Socket receive buffer size
@ -25,9 +25,48 @@ namespace cw
unsigned maxFaderBankN; // maximum number of fader banks to support
} args_t;
// Create the EuCon simulation manager.
rc_t create( handle_t& hRef, const args_t& a );
// Destroy the EuCon simulation manager.
rc_t destroy( handle_t& hRef );
// Update the manager. This function polls the network socket
// for incoming information from the FaderBankArray.
rc_t exec( handle_t h, unsigned sockTimeOutMs );
// Are messages waiting
bool areMsgsWaiting( handle_t h );
enum
{
kFaderValueTId,
kMuteValueTId,
kTouchValueTId
};
typedef struct msg_str
{
unsigned msgTId;
unsigned channel;
union
{
int ivalue;
float fvalue;
} u;
} msg_t;
typedef void (*msgCallback_t)( void* cbArg, const msg_t* msg );
// Switches the internal double buffer and calls back with the parsed messages.
rc_t getMsgs( handle_t h, msgCallback_t cbFunc, void* cbArg );
// Send a message to a physical control
rc_t sendCtlMsg( handle_t h, unsigned ctlTId, unsigned channel, unsigned ivalue, float fvalue );
rc_t test();
}
}