~ubuntu-branches/ubuntu/wily/tetraproc/wily

« back to all changes in this revision

Viewing changes to source/oscform.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2011-03-24 14:56:48 UTC
  • Revision ID: james.westby@ubuntu.com-20110324145648-r9qi83fs3wej4801
Tags: upstream-0.8.2
ImportĀ upstreamĀ versionĀ 0.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// ----------------------------------------------------------------------------
 
2
//
 
3
//  Copyright (C) 2006-2008 Fons Adriaensen <fons@linuxaudio.org>
 
4
//    
 
5
//  This program is free software; you can redistribute it and/or modify
 
6
//  it under the terms of the GNU General Public License as published by
 
7
//  the Free Software Foundation; either version 2 of the License, or
 
8
//  (at your option) any later version.
 
9
//
 
10
//  This program is distributed in the hope that it will be useful,
 
11
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
//  GNU General Public License for more details.
 
14
//
 
15
//  You should have received a copy of the GNU General Public License
 
16
//  along with this program; if not, write to the Free Software
 
17
//  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
//
 
19
// ----------------------------------------------------------------------------
 
20
 
 
21
 
 
22
#ifndef __OSCFORM_H
 
23
#define __OSCFORM_H
 
24
 
 
25
 
 
26
#include <stdlib.h>
 
27
#include <stdio.h>
 
28
 
 
29
 
 
30
class Oscform
 
31
{
 
32
public:
 
33
 
 
34
    Oscform (int size);
 
35
    ~Oscform (void);
 
36
 
 
37
    int put_command (const char *v);
 
38
    int put_format (const char *v);
 
39
    int put_int (int v);
 
40
    int put_float (float v);
 
41
    int put_string (const char *v);
 
42
    int write (FILE *F);
 
43
 
 
44
    int read (FILE *F);
 
45
    const char *get_command (void) { return _pcomm; }
 
46
    const char *get_format (void) { return _pform; }
 
47
    int get_datalen (void) { return _isize; }
 
48
    int get_int (int *v);
 
49
    int get_float (float *v);
 
50
    int get_float1 (float *v);
 
51
    int get_string (const char **p, int *n);
 
52
 
 
53
private:
 
54
 
 
55
    char   *_data;
 
56
    int     _size;
 
57
    int     _iform; 
 
58
    int     _idata;
 
59
    int     _inext;
 
60
    int     _isize;
 
61
    char   *_pcomm;
 
62
    char   *_pform;
 
63
};
 
64
 
 
65
 
 
66
#endif