Git Product home page Git Product logo

simpleoscdecoder's Introduction

                  >>> SimpleOSCReader Delphi FPC Lazarus UNIT <<<
                                  Version 1.0
                              -------------------
                This unit requiere INDY9 or 10 components
    If you want to use INDY10 components, please checkout the Lazarus version
                              -------------------
           By Axel GUILLAUMET - Hypernoika - http://www.hypernoika.cc/
                            This code is GPL Licence
                              -------------------
                  Feel free to use this unit in your software
				  
     http://www.hypernoika.cc/en/simpleoscdecoder-for-delphi-and-lazarus/

                 http://github.com/hypernoika/SimpleOSCDecoder

								 
                                   User guide:
                                   -----------

Web resources:
Install INDY on LAZARUS : http://wiki.freepascal.org/Indy_with_Lazarus
Last INDY version (Highly recommanded) : http://indy.fulgan.com/ 
INDY website : 	http://www.indyproject.org/								

1 - Copy SimpleOSCDecoder.pas into your project folder.
2 - In USES, declare SimpleOSCDecoder.
3 - Declare a public variable OSCMessage : TOSCMessage;
4 - On create OSCMessage := TOSCMessage.create; and on Destroy OSCMessage.free
5 - Check if your Delphi/Lazarus have the INDY Components installed
6.A) If you are using INDY9:
Put a TIdUDPSerer on a form, and put on OnUDPRead Event. 	
  OSCMessage.decodeOSCMessage(AData);	 
6.B) If you are using INDY10:
Put a TIdUDPSerer on a form, and create the OnUDPRead Event.  
Then declare a TMemoryStream as a local variable. And put this code to convert
the TIdBytes into a TMemoryStream:
  ADataStream := TMemoryStream.Create;
  ADataStream.Size := 0;
  WriteTIdBytesToStream (ADataStream, AData);
  ADataStream.Position := 0;
  OSCMessage.decodeOSCMessage(ADataStream);      
7 - Now, when you will receive an OSC message, you will get the results in the
following variables:
 > OSCMessage.Address : String -> Give the OSC complete adress
 > OSCMessage.Datatype : String -> Give you a string about the type of the last
received message: 
	'string' for string
	'integer' for integer
	'single' for single
	'untyped' for an unknown message
 > 	OSCMessage.OutString : String -> Give the last string message received
as string.
 >  OSCMessage.OutInt : Integer -> Give the last string message received
as integer.
 >  OSCMessage.OutSingle : Single -> Give the last string message received
as single.
 >  OSCMessage.OutUntyped : String -> Give the last string message received
as string.
8 - Enjoy :)

NB : Don't forget to include the Indy library path into the project options.

simpleoscdecoder's People

Contributors

hypernoika avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.