~ubuntu-branches/ubuntu/hardy/lmms/hardy

« back to all changes in this revision

Viewing changes to plugins/vestige/communication.h

  • Committer: Bazaar Package Importer
  • Author(s): Tobias Doerffel
  • Date: 2007-09-17 15:00:24 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070917150024-mo0zk4ks81jawqii
Tags: 0.3.0-1ubuntu1
* Resynchronized with Debian (LP: #139759, LP: #90806, LP: #102639,
  LP: #113447, LP: #121172, LP: #124890)
* reverted changes from 0.2.1-1.1ubuntu1 as upstream merged/included them

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * communication.h - header file defining stuff concerning communication between
3
 
 *                   LVSL-server and -client
4
 
 *
5
 
 * Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6
 
 * 
7
 
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
8
 
 *
9
 
 * This program is free software; you can redistribute it and/or
10
 
 * modify it under the terms of the GNU General Public
11
 
 * License as published by the Free Software Foundation; either
12
 
 * version 2 of the License, or (at your option) any later version.
13
 
 *
14
 
 * This program is distributed in the hope that it will be useful,
15
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 
 * General Public License for more details.
18
 
 *
19
 
 * You should have received a copy of the GNU General Public
20
 
 * License along with this program (see COPYING); if not, write to the
21
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22
 
 * Boston, MA 02111-1307, USA.
23
 
 *
24
 
 */
25
 
 
26
 
 
27
 
#ifndef _COMMUNICATION_H
28
 
#define _COMMUNICATION_H
29
 
 
30
 
#ifdef HAVE_CONFIG_H
31
 
#include <config.h>
32
 
#endif
33
 
 
34
 
#ifdef HAVE_UNISTD_H
35
 
#include <unistd.h>
36
 
#endif
37
 
 
38
 
#include <string>
39
 
 
40
 
 
41
 
template<typename T>
42
 
inline T readValue( int _fd = 0 )
43
 
{
44
 
        T i;
45
 
        read( _fd, &i, sizeof( i ) );
46
 
        return( i );
47
 
}
48
 
 
49
 
 
50
 
 
51
 
 
52
 
template<typename T>
53
 
inline void writeValue( const T & _i, int _fd = 1 )
54
 
{
55
 
        write( _fd, &_i, sizeof( _i ) );
56
 
}
57
 
 
58
 
 
59
 
 
60
 
 
61
 
static inline std::string readString( int _fd = 0 )
62
 
{
63
 
        Sint16 len = readValue<Sint16>( _fd );
64
 
        char * sc = new char[len];
65
 
        read( _fd, sc, len );
66
 
        std::string s( sc );
67
 
        delete[] sc;
68
 
        return( s );
69
 
}
70
 
 
71
 
 
72
 
 
73
 
 
74
 
static inline void writeString( const char * _str, int _fd = 1 )
75
 
{
76
 
        int len = strlen( _str ) + 1;
77
 
        writeValue<Sint16>( len, _fd );
78
 
        write( _fd, _str, len );
79
 
}
80
 
 
81
 
 
82
 
 
83
 
 
84
 
struct vstParameterDumpItem
85
 
{
86
 
        Sint32 index;
87
 
        char shortLabel[8];
88
 
        float value;
89
 
} ;
90
 
 
91
 
 
92
 
 
93
 
 
94
 
// summarized version of VstParameterProperties-struct - useful because client
95
 
// doesn't have to know about the latter one
96
 
struct vstParamProperties
97
 
{
98
 
        char label[64];
99
 
        char shortLabel[8];
100
 
        char categoryLabel[24];
101
 
        float minValue;
102
 
        float maxValue;
103
 
        float step;
104
 
        Sint16 category;
105
 
} ;
106
 
 
107
 
 
108
 
enum hostLanguages
109
 
{
110
 
        LVSL_LANG_ENGLISH = 1,
111
 
        LVSL_LANG_GERMAN,
112
 
        LVSL_LANG_FRENCH,
113
 
        LVSL_LANG_ITALIAN,
114
 
        LVSL_LANG_SPANISH,
115
 
        LVSL_LANG_JAPANESE
116
 
} ;
117
 
 
118
 
 
119
 
 
120
 
enum vstRemoteCommands
121
 
{
122
 
        // client -> server
123
 
        VST_LOAD_PLUGIN = 0,
124
 
        VST_CLOSE_PLUGIN,
125
 
        VST_SHOW_EDITOR,
126
 
        VST_PROCESS,
127
 
        VST_ENQUEUE_MIDI_EVENT,
128
 
        VST_SAMPLE_RATE,
129
 
        VST_BUFFER_SIZE,
130
 
        VST_BPM,
131
 
        VST_LANGUAGE,
132
 
        VST_GET_PARAMETER_COUNT = 20,
133
 
        VST_GET_PARAMETER_DUMP,
134
 
        VST_SET_PARAMETER_DUMP,
135
 
        VST_GET_PARAMETER_PROPERTIES,
136
 
 
137
 
        // server -> client
138
 
        VST_INITIALIZATION_DONE = 100,
139
 
        VST_FAILED_LOADING_PLUGIN,
140
 
        VST_QUIT_ACK,
141
 
        VST_SHM_KEY_AND_SIZE,
142
 
        VST_INPUT_COUNT,
143
 
        VST_OUTPUT_COUNT,
144
 
        VST_PLUGIN_XID,
145
 
        VST_PLUGIN_EDITOR_GEOMETRY,
146
 
        VST_PROCESS_DONE,
147
 
        VST_PLUGIN_NAME,
148
 
        VST_PLUGIN_VERSION,
149
 
        VST_PLUGIN_VENDOR_STRING,
150
 
        VST_PLUGIN_PRODUCT_STRING,
151
 
        VST_PARAMETER_COUNT,
152
 
        VST_PARAMETER_DUMP,
153
 
        VST_PARAMETER_PROPERTIES,
154
 
        VST_GET_SAMPLE_RATE = 120,
155
 
        VST_GET_BUFFER_SIZE,
156
 
 
157
 
        VST_DEBUG_MSG = 200,
158
 
        VST_UNDEFINED_CMD
159
 
 
160
 
} ;
161
 
 
162
 
 
163
 
 
164
 
 
165
 
#endif