52 int main(
int argc,
char* argv[]) {
64 std::cerr <<
"usage: iobridge <one device-file> <other device-file>" << std::endl;
72 if(WSAStartup(MAKEWORD(2,2), &wsaData)!=0) {
73 std::cerr <<
"iobridge: failed to initialize winsocks" << std::endl;
80 FD_DH(
"Initialize vDevice A");
85 FD_DH(
"Initialize vDevice B");
90 faudes_mutex_t wmutex;
92 faudes_mutex_init(&wmutex);
93 faudes_cond_init(&wcond);
108 std::cout <<
"% ################ iobridge: waiting for input events" << std::endl;
111 faudes_mutex_lock(&wmutex);
114 faudes_cond_wait(&wcond,&wmutex);
118 std::cout <<
"% ################ iobridge: sensed " << adev->
Name() <<
"-input " << adev->
EStr(ev) << std::endl;
122 std::cout <<
"% ################ iobridge: sensed " << bdev->
Name() <<
"-input " << bdev->
EStr(ev) << std::endl;
127 faudes_mutex_unlock(&wmutex);
Virtual base class to define the interface for event io.
virtual void Compile(void)
Compile inner data-structures.
virtual std::string EStr(Idx ev)
Convenience method.
static void StopAll(void)
Stop all devices.
virtual void Start(void)
Activate the device.
virtual void WriteOutput(Idx output)=0
Run output command.
static vDevice * FromFile(const std::string &rFileName)
Construct on heap from file.
virtual Idx ReadInput(void)
Read sensed input events.
void Name(const std::string &rName)
Set the device name.
void UseCondition(faudes_mutex_t *wmutex, faudes_cond_t *wcond)
Tell the device which condition to use for waiting.
int main(int argc, char *argv[])
volatile sig_atomic_t signal_in_progress
void catch_signal(int sig)
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)
std::string VersionString()
Return FAUDES_VERSION as std::string.