00001 /* 00002 * Copyright ( C ) 2007 Arnold Krille <arnold@arnoldarts.de> 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or ( at your option ) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 00017 */ 00018 00019 #include "qoscclient.h" 00020 //#include "qoscclient.moc" 00021 00022 //#include <QtCore/QDebug> 00023 #include <QtCore/QByteArray> 00024 #include <QtNetwork/QUdpSocket> 00025 00026 //#include <lo/lo.h> 00027 00028 QOscClient::QOscClient( const QHostAddress& address, quint16 port, QObject* p ) 00029 : QOscBase( p ) 00030 , _address( address ) 00031 , _port( port ) 00032 { 00033 //qDebug() << "QOscClient::QOscClient(" << address << "," << port << "," << p << ")"; 00034 } 00035 00036 QOscClient::~QOscClient() { 00037 //qDebug() << "QOscClient::~QOscClient()"; 00038 } 00039 00040 void QOscClient::setAddress( const QHostAddress& address, quint16 port ) { 00041 _address = address; 00042 _port = port; 00043 } 00044 00045 void QOscClient::sendData( QString path, QVariant data ) { 00046 //qDebug() << "QOscClient::sendData(" << path << "," << data << ")"; 00047 QByteArray out = oscMessage( path, data ); 00048 socket()->writeDatagram( out, _address, _port ); 00049 } 00050 void QOscClient::sendData( QString path, QList<QVariant> data ) { 00051 //qDebug() << "QOscClient::sendData(" << path << "," << data << ")"; 00052 QByteArray out = oscMessage( path, data ); 00053 socket()->writeDatagram( out, _address, _port ); 00054 } 00055
1.5.6