/[svn]/liblscp/trunk/lscp/client.h
ViewVC logotype

Diff of /liblscp/trunk/lscp/client.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 253 by capela, Mon Sep 27 14:40:08 2004 UTC revision 1020 by capela, Thu Jan 11 15:25:04 2007 UTC
# Line 2  Line 2 
2  //  //
3  /****************************************************************************  /****************************************************************************
4     liblscp - LinuxSampler Control Protocol API     liblscp - LinuxSampler Control Protocol API
5     Copyright (C) 2004, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved.
6    
7     This library is free software; you can redistribute it and/or     This library is free software; you can redistribute it and/or
8     modify it under the terms of the GNU Lesser General Public     modify it under the terms of the GNU Lesser General Public
# Line 14  Line 14 
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15     Lesser General Public License for more details.     Lesser General Public License for more details.
16    
17     You should have received a copy of the GNU Lesser General Public     You should have received a copy of the GNU General Public License along
18     License along with this library; if not, write to the Free Software     with this program; if not, write to the Free Software Foundation, Inc.,
19     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20    
21  *****************************************************************************/  *****************************************************************************/
22    
# Line 33  extern "C" { Line 33  extern "C" {
33  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
34  // MIDI channel omni mode.  // MIDI channel omni mode.
35    
36  #define LSCP_MIDI_CHANNEL_ALL   (-1)  #define LSCP_MIDI_CHANNEL_ALL   16
37    
38    
39  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
40  // Client data structures.  // Client data structures.
41    
42    /** Server info cache struct. */
43    typedef struct _lscp_server_info_t
44    {
45            char *        description;
46            char *        version;
47            char *        protocol_version;
48    
49    } lscp_server_info_t;
50    
51    
52  /** Engine info cache struct. */  /** Engine info cache struct. */
53  typedef struct _lscp_engine_info_t  typedef struct _lscp_engine_info_t
54  {  {
55      char *        description;          char *        description;
56      char *        version;          char *        version;
57    
58  } lscp_engine_info_t;  } lscp_engine_info_t;
59    
# Line 51  typedef struct _lscp_engine_info_t Line 61  typedef struct _lscp_engine_info_t
61  /** Channel info cache struct. */  /** Channel info cache struct. */
62  typedef struct _lscp_channel_info_t  typedef struct _lscp_channel_info_t
63  {  {
64      char *        engine_name;          char *        engine_name;
65      int           audio_device;          int           audio_device;
66      int           audio_channels;          int           audio_channels;
67      char **       audio_routing;          int  *        audio_routing;
68      char *        instrument_file;          char *        instrument_file;
69      int           instrument_nr;          int           instrument_nr;
70      int           instrument_status;          char *        instrument_name;
71      int           midi_device;          int           instrument_status;
72      int           midi_port;          int           midi_device;
73      int           midi_channel;          int           midi_port;
74      float         volume;          int           midi_channel;
75            int           midi_map;
76            float         volume;
77            int           mute;
78            int           solo;
79    
80  } lscp_channel_info_t;  } lscp_channel_info_t;
81    
# Line 69  typedef struct _lscp_channel_info_t Line 83  typedef struct _lscp_channel_info_t
83  /** Buffer fill cache struct. */  /** Buffer fill cache struct. */
84  typedef struct _lscp_buffer_fill_t  typedef struct _lscp_buffer_fill_t
85  {  {
86      unsigned int  stream_id;          unsigned int  stream_id;
87      unsigned long stream_usage;          unsigned long stream_usage;
88    
89  } lscp_buffer_fill_t;  } lscp_buffer_fill_t;
90    
# Line 78  typedef struct _lscp_buffer_fill_t Line 92  typedef struct _lscp_buffer_fill_t
92  /** Buffer fill stream usage types. */  /** Buffer fill stream usage types. */
93  typedef enum _lscp_usage_t  typedef enum _lscp_usage_t
94  {  {
95      LSCP_USAGE_BYTES = 0,          LSCP_USAGE_BYTES = 0,
96      LSCP_USAGE_PERCENTAGE          LSCP_USAGE_PERCENTAGE
97    
98  } lscp_usage_t;  } lscp_usage_t;
99    
100    
101    /** Effect send info cache struct. */
102    typedef struct _lscp_fxsend_info_t
103    {
104            char *        name;
105            int           midi_controller;
106            int *         audio_routing;
107    
108    } lscp_fxsend_info_t;
109    
110    
111    /** MIDI instrument parameter struct. */
112    typedef struct _lscp_midi_instrument_t
113    {
114            int map;
115            int bank;
116            int prog;
117    
118    } lscp_midi_instrument_t;
119    
120    
121    /** MIDI instrument load mode. */
122    typedef enum _lscp_load_mode_t
123    {
124            LSCP_LOAD_DEFAULT = 0,
125            LSCP_LOAD_ON_DEMAND,
126            LSCP_LOAD_ON_DEMAND_HOLD,
127            LSCP_LOAD_PERSISTENT
128    
129    } lscp_load_mode_t;
130    
131    
132    /** MIDI instrument info cache struct. */
133    typedef struct _lscp_midi_instrument_info_t
134    {
135            char *           name;
136            char *           engine_name;
137            char *           instrument_file;
138            int              instrument_nr;
139            char *           instrument_name;
140            lscp_load_mode_t load_mode;
141            float            volume;
142    
143    } lscp_midi_instrument_info_t;
144    
145    
146    /** MIDI instrument map mode. */
147    typedef enum _lscp_midi_map_mode_t
148    {
149            LSCP_MIDI_MAP_NONE = -1,
150            LSCP_MIDI_MAP_DEFAULT = -2,
151            LSCP_MIDI_MAP_ALL = -3
152    
153    } lscp_midi_map_mode_t;
154    
155    
156  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
157  // Client socket main structure.  // Client socket main structure.
158    
# Line 93  typedef struct _lscp_client_t lscp_clien Line 162  typedef struct _lscp_client_t lscp_clien
162  /** Client event callback procedure prototype. */  /** Client event callback procedure prototype. */
163  typedef lscp_status_t (*lscp_client_proc_t)  typedef lscp_status_t (*lscp_client_proc_t)
164  (  (
165      struct _lscp_client_t *pClient,          struct _lscp_client_t *pClient,
166      lscp_event_t event,          lscp_event_t event,
167      const char *pchData,          const char *pchData,
168      int cchData,          int cchData,
169      void *pvData          void *pvData
170  );  );
171    
172  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
173  // Client versioning teller fuunction.  // Client versioning teller function.
174    
175  const char *            lscp_client_package             (void);  const char *            lscp_client_package             (void);
176  const char *            lscp_client_version             (void);  const char *            lscp_client_version             (void);
# Line 142  int                     lscp_get_channel Line 211  int                     lscp_get_channel
211  int *                   lscp_list_channels              (lscp_client_t *pClient);  int *                   lscp_list_channels              (lscp_client_t *pClient);
212  int                     lscp_add_channel                (lscp_client_t *pClient);  int                     lscp_add_channel                (lscp_client_t *pClient);
213  lscp_status_t           lscp_remove_channel             (lscp_client_t *pClient, int iSamplerChannel);  lscp_status_t           lscp_remove_channel             (lscp_client_t *pClient, int iSamplerChannel);
214  const char **           lscp_get_available_engines      (lscp_client_t *pClient);  
215    int                     lscp_get_available_engines      (lscp_client_t *pClient);
216    const char **           lscp_list_available_engines     (lscp_client_t *pClient);
217    
218  lscp_engine_info_t *    lscp_get_engine_info            (lscp_client_t *pClient, const char *pszEngineName);  lscp_engine_info_t *    lscp_get_engine_info            (lscp_client_t *pClient, const char *pszEngineName);
219  lscp_channel_info_t *   lscp_get_channel_info           (lscp_client_t *pClient, int iSamplerChannel);  lscp_channel_info_t *   lscp_get_channel_info           (lscp_client_t *pClient, int iSamplerChannel);
# Line 161  lscp_status_t           lscp_set_channel Line 232  lscp_status_t           lscp_set_channel
232  lscp_status_t           lscp_set_channel_midi_device    (lscp_client_t *pClient, int iSamplerChannel, int iMidiDevice);  lscp_status_t           lscp_set_channel_midi_device    (lscp_client_t *pClient, int iSamplerChannel, int iMidiDevice);
233  lscp_status_t           lscp_set_channel_midi_port      (lscp_client_t *pClient, int iSamplerChannel, int iMidiPort);  lscp_status_t           lscp_set_channel_midi_port      (lscp_client_t *pClient, int iSamplerChannel, int iMidiPort);
234  lscp_status_t           lscp_set_channel_midi_channel   (lscp_client_t *pClient, int iSamplerChannel, int iMidiChannel);  lscp_status_t           lscp_set_channel_midi_channel   (lscp_client_t *pClient, int iSamplerChannel, int iMidiChannel);
235    lscp_status_t           lscp_set_channel_midi_map       (lscp_client_t *pClient, int iSamplerChannel, int iMidiMap);
236    
237  lscp_status_t           lscp_set_channel_volume         (lscp_client_t *pClient, int iSamplerChannel, float fVolume);  lscp_status_t           lscp_set_channel_volume         (lscp_client_t *pClient, int iSamplerChannel, float fVolume);
238    
239    lscp_status_t           lscp_set_channel_mute           (lscp_client_t *pClient, int iSamplerChannel, int iMute);
240    lscp_status_t           lscp_set_channel_solo           (lscp_client_t *pClient, int iSamplerChannel, int iSolo);
241    
242  lscp_status_t           lscp_reset_channel              (lscp_client_t *pClient, int iSamplerChannel);  lscp_status_t           lscp_reset_channel              (lscp_client_t *pClient, int iSamplerChannel);
243    
244  lscp_status_t           lscp_reset_sampler              (lscp_client_t *pClient);  lscp_status_t           lscp_reset_sampler              (lscp_client_t *pClient);
245    
246    lscp_server_info_t *    lscp_get_server_info            (lscp_client_t *pClient);
247    
248    int                     lscp_get_total_voice_count      (lscp_client_t *pClient);
249    int                     lscp_get_total_voice_count_max  (lscp_client_t *pClient);
250    
251    float                   lscp_get_volume                 (lscp_client_t *pClient );
252    lscp_status_t           lscp_set_volume                 (lscp_client_t *pClient, float fVolume);
253    
254    //-------------------------------------------------------------------------
255    // Effect sends control functions.
256    
257    int                     lscp_create_fxsend              (lscp_client_t *pClient, int iSamplerChannel, int iMidiController, const char *pszFxName);
258    lscp_status_t           lscp_destroy_fxsend             (lscp_client_t *pClient, int iSamplerChannel, int iFxSend);
259    
260    int                     lscp_get_fxsends                (lscp_client_t *pClient, int iSamplerChannel);
261    int *                   lscp_list_fxsends               (lscp_client_t *pClient, int iSamplerChannel);
262    
263    lscp_fxsend_info_t *    lscp_get_fxsend_info            (lscp_client_t *pClient, int iSamplerChannel, int iFxSend);
264    
265    lscp_status_t           lscp_set_fxsend_audio_channel   (lscp_client_t *pClient, int iSamplerChannel, int iFxSend, int iAudioSrc, int iAudioDst);
266    
267    //-------------------------------------------------------------------------
268    // MIDI instrument mapping control functions.
269    
270    int                     lscp_add_midi_instrument_map    (lscp_client_t *pClient, const char *pszMapName);
271    lscp_status_t           lscp_remove_midi_instrument_map (lscp_client_t *pClient, int iMidiMap);
272    
273    int                     lscp_get_midi_instrument_maps   (lscp_client_t *pClient);
274    int *                   lscp_list_midi_instrument_maps  (lscp_client_t *pClient);
275    
276    const char *            lscp_get_midi_instrument_map_name (lscp_client_t *pClient, int iMidiMap);
277    lscp_status_t           lscp_set_midi_instrument_map_name (lscp_client_t *pClient, int iMidiMap, const char *pszMapName);
278    
279    lscp_status_t           lscp_map_midi_instrument        (lscp_client_t *pClient, lscp_midi_instrument_t *pMidiInstr, const char *pszEngineName, const char *pszFileName, int iInstrIndex, float fVolume, lscp_load_mode_t load_mode, const char *pszName);
280    lscp_status_t           lscp_unmap_midi_instrument      (lscp_client_t *pClient, lscp_midi_instrument_t *pMidiInstr);
281    
282    int                     lscp_get_midi_instruments       (lscp_client_t *pClient, int iMidiMap);
283    lscp_midi_instrument_t *lscp_list_midi_instruments      (lscp_client_t *pClient, int iMidiMap);
284    
285    lscp_midi_instrument_info_t *lscp_get_midi_instrument_info(lscp_client_t *pClient, lscp_midi_instrument_t *pMidiInstr);
286    
287    lscp_status_t           lscp_clear_midi_instruments     (lscp_client_t *pClient, int iMidiMap);
288    
289    
290  #if defined(__cplusplus)  #if defined(__cplusplus)
291  }  }
292  #endif  #endif

Legend:
Removed from v.253  
changed lines
  Added in v.1020

  ViewVC Help
Powered by ViewVC