Osc for Qt4

Osc for Qt4

Why? - Examples - Download! - Installation

ofqf is a native OSC implementation in Qt4. Native means that ofqf doesn't depend on other external libs (except for QtCore and QtNetwork) and ofqf isn't just a wrapper around liblo or something.

Why shoud I use ofqf?

If your app is using Qt, you do have several choices for OSC, but all involve wrapping external libraries with some QObject so you can use signals/slots to communicate with the rest of your app. In that case you will want to use ofqf!

Show me examples!

server

A simple OSC-server that can be shut down by the osc-message "/quit" is the following:

  QOscServer* s = new QOscServer(
    QHostAddress::Any,
    5000,
    QCoreApplication::instance()
    );
  PathObject* pathquit = new PathObject(
    "/quit",
    QVariant::Invalid,
    QCoreApplication::instance()
    );
  QObject::connect(
    pathquit, SIGNAL( data() ),
    QCoreApplication::instance(), SLOT( quit() )
    );

Thats it on the server side...

client

A simple client to stop that server on button-click:

int main( int argc, char** argv )
{
  QApplication* app = new QApplication( argc, argv );

  QPushButton* btn = new QPushButton( "Quit the server and this client", 0 );
  btn->show();

  QOscClient* c = new QOscClient( QHostAddress::LocalHost, 5000, app );
  PathObject* pathquit = new PathObject( "/quit", QVariant::Invalid, c );

  QObject::connect( btn, SIGNAL( clicked() ), pathquit, SLOT( send() ) );
  QObject::connect( btn, SIGNAL( clicked() ), btn, SLOT( close() );

  return app->exec();
}

Download

Grab the sources of version 0.1.1 from here: ofqf-0.1.2.tar.bz2

Installation

Building the lib and the samples is done with calling "scons".

If you want to install lib, headers and pkg-config-file you have to use "scons install" which installs by default to /usr/local. To select another prefix you have to use "scons install PREFIX=<dir>".

To uninstall the installed files use "scons -c install" or, if you used your own prefix, "scons -c install PREFIX=<dir>".