Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 8th, 2012  |  syntax: None  |  size: 0.61 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /*
  2.     Simple example of sending an OSC message using oscpack.
  3. */
  4.  
  5. #include <oscpack/osc/OscOutboundPacketStream.h>
  6. #include <oscpack/ip/UdpSocket.h>
  7.  
  8.  
  9. #define ADDRESS "192.168.0.14"
  10. #define PORT 7000
  11.  
  12. #define OUTPUT_BUFFER_SIZE 1024
  13.  
  14. int main(int argc, char* argv[])
  15. {
  16.         UdpTransmitSocket transmitSocket( IpEndpointName( ADDRESS, PORT ) );
  17.        
  18.         char buffer[OUTPUT_BUFFER_SIZE];
  19.         osc::OutboundPacketStream p( buffer, OUTPUT_BUFFER_SIZE );
  20.        
  21.         p
  22.         << osc::BeginMessage( "/mc" )
  23.         << 23.0f << 23.0f << 3.1415f << 0.0f<<0.0f<<0.0f<<1.0f << osc::EndMessage;
  24.        
  25.         transmitSocket.Send( p.Data(), p.Size() );
  26. }