| Line No. | Rev | Author | Line |
|---|---|---|---|
| 1 | 6 | kaklik | /*! \file osc.h \brief Open Sound Control (OSC) client functions. */ |
| 2 | //***************************************************************************** |
||
| 3 | // |
||
| 4 | // File Name : 'osc.h' |
||
| 5 | // Title : Open Sound Control (OSC) client functions |
||
| 6 | // Author : Pascal Stang - Copyright (C) 2002 |
||
| 7 | // Created : 10/30/2002 |
||
| 8 | // Revised : 11/4/2002 |
||
| 9 | // Version : 0.1 |
||
| 10 | // Target MCU : Atmel AVR series |
||
| 11 | // Editor Tabs : 4 |
||
| 12 | // |
||
| 13 | // Description : This code implements a subset of the OSC protocol and |
||
| 14 | // messages. It is meant to be used with the OSC extension for the visual |
||
| 15 | // programming and data-processing package Pure-Data (or PD). Note that |
||
| 16 | // this code sends OSC messages over serial RS-232, not a network. You |
||
| 17 | // must use these functions with a suitable OSC SERIAL server (receiver) |
||
| 18 | // on a host machine. |
||
| 19 | // |
||
| 20 | // This code is distributed under the GNU Public License |
||
| 21 | // which can be found at http://www.gnu.org/licenses/gpl.txt |
||
| 22 | // |
||
| 23 | //***************************************************************************** |
||
| 24 | |||
| 25 | #ifndef OSC_H |
||
| 26 | #define OSC_H |
||
| 27 | |||
| 28 | #include "global.h" |
||
| 29 | |||
| 30 | // OSC serial packet structure: |
||
| 31 | // [HEADER][LENGTH][OSC MESSAGE][CHECKSUM] |
||
| 32 | // where |
||
| 33 | // [HEADER] is the byte 0xBE |
||
| 34 | // [LENGTH] is the number of bytes in OSC MESSGAGE (must be a multiple of four) |
||
| 35 | // [OSC MESSAGE] is defined by the OSC specification |
||
| 36 | // [CHECKSUM] is the 8-bit sum of bytes in the OSC MESSAGE |
||
| 37 | |||
| 38 | // defines |
||
| 39 | #define OSC_HEADER 0xBE |
||
| 40 | |||
| 41 | // function prototypes |
||
| 42 | |||
| 43 | //! Initializes the OSC function library |
||
| 44 | void oscInit(void); |
||
| 45 | |||
| 46 | //! sends an OSC message without any arguments (message with OSC address only) |
||
| 47 | void oscSendMessage(char *address); |
||
| 48 | |||
| 49 | //! sends an OSC message with one 32-bit integer argument |
||
| 50 | void oscSendMessageInt(char *address, u32 arg); |
||
| 51 | |||
| 52 | //! sends an OSC message with two 32-bit integer arguments |
||
| 53 | void oscSendMessageIntInt(char *address, u32 arg, u32 arg2); |
||
| 54 | |||
| 55 | //! sends an OSC message with a null-terminated string argument |
||
| 56 | void oscSendMessageString(char *address, char *arg); |
||
| 57 | |||
| 58 | // private functions |
||
| 59 | void oscWriteHeader(char *address, u08 arglen); ///< writes the OSC header+length |
||
| 60 | void oscWriteString(char *address); ///< writes the OSC address or strings |
||
| 61 | void oscWriteChecksum(void); ///< calculates and writes the OSC checksum |
||
| 62 | |||
| 63 | #endif |
Powered by WebSVN v2.8.3