/[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 144 by capela, Thu Jun 24 18:25:11 2004 UTC revision 948 by capela, Tue Nov 28 15:31:20 2006 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-2006, 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 24  Line 24 
24  #define __LSCP_CLIENT_H  #define __LSCP_CLIENT_H
25    
26  #include "lscp/socket.h"  #include "lscp/socket.h"
27    #include "lscp/event.h"
28    
29  #if defined(__cplusplus)  #if defined(__cplusplus)
30  extern "C" {  extern "C" {
31  #endif  #endif
32    
33    //-------------------------------------------------------------------------
34    // MIDI channel omni mode.
35    
36    #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    
48    } lscp_server_info_t;
49    
50    
51  /** Engine info cache struct. */  /** Engine info cache struct. */
52  typedef struct _lscp_engine_info_t  typedef struct _lscp_engine_info_t
53  {  {
# Line 51  typedef struct _lscp_channel_info_t Line 66  typedef struct _lscp_channel_info_t
66      char **       audio_routing;      char **       audio_routing;
67      char *        instrument_file;      char *        instrument_file;
68      int           instrument_nr;      int           instrument_nr;
69        char *        instrument_name;
70      int           instrument_status;      int           instrument_status;
71      int           midi_device;      int           midi_device;
72      int           midi_port;      int           midi_port;
73      int           midi_channel;      int           midi_channel;
74      float         volume;      float         volume;
75        int           mute;
76        int           solo;
77    
78  } lscp_channel_info_t;  } lscp_channel_info_t;
79    
# Line 78  typedef enum _lscp_usage_t Line 96  typedef enum _lscp_usage_t
96  } lscp_usage_t;  } lscp_usage_t;
97    
98    
99  /** Subscribable event notification bit-wise flags. */  /** MIDI instrument parameter struct. */
100  typedef enum _lscp_event_t  typedef struct _lscp_midi_instrument_t
101    {
102        int bank_msb;
103        int bank_lsb;
104        int program;
105    
106    } lscp_midi_instrument_t;
107    
108    
109    /** MIDI instrument load mode. */
110    typedef enum _lscp_load_mode_t
111    {
112        LSCP_LOAD_DEFAULT = 0,
113        LSCP_LOAD_ON_DEMAND,
114        LSCP_LOAD_ON_DEMAND_HOLD,
115        LSCP_LOAD_PERSISTENT
116    
117    } lscp_load_mode_t;
118    
119    
120    /** MIDI instrument info cache struct. */
121    typedef struct _lscp_midi_instrument_info_t
122  {  {
123      LSCP_EVENT_NONE             = 0x0000,      char *           name;
124      LSCP_EVENT_CHANNELS         = 0x0001,      char *           engine_name;
125      LSCP_EVENT_VOICE_COUNT      = 0x0002,      char *           instrument_file;
126      LSCP_EVENT_STREAM_COUNT     = 0x0004,      int              instrument_nr;
127      LSCP_EVENT_BUFFER_FILL      = 0x0008,      char *           instrument_name;
128      LSCP_EVENT_CHANNEL_INFO     = 0x0010,      lscp_load_mode_t load_mode;
129      LSCP_EVENT_MISCELLANEOUS    = 0x1000      float            volume;
130    
131  } lscp_event_t;  } lscp_midi_instrument_info_t;
132    
133    
134  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
# Line 103  typedef lscp_status_t (*lscp_client_proc Line 142  typedef lscp_status_t (*lscp_client_proc
142  (  (
143      struct _lscp_client_t *pClient,      struct _lscp_client_t *pClient,
144      lscp_event_t event,      lscp_event_t event,
145      const char *pchBuffer,      const char *pchData,
146      int cchBuffer,      int cchData,
147      void *pvData      void *pvData
148  );  );
149    
# Line 138  int                     lscp_client_get_ Line 177  int                     lscp_client_get_
177  lscp_status_t           lscp_client_subscribe           (lscp_client_t *pClient, lscp_event_t events);  lscp_status_t           lscp_client_subscribe           (lscp_client_t *pClient, lscp_event_t events);
178  lscp_status_t           lscp_client_unsubscribe         (lscp_client_t *pClient, lscp_event_t events);  lscp_status_t           lscp_client_unsubscribe         (lscp_client_t *pClient, lscp_event_t events);
179    
180  lscp_event_t            lscp_client_events              (lscp_client_t *pClient);  lscp_event_t            lscp_client_get_events          (lscp_client_t *pClient);
181    
182  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
183  // Client command protocol functions.  // Client command protocol functions.
# Line 150  int                     lscp_get_channel Line 189  int                     lscp_get_channel
189  int *                   lscp_list_channels              (lscp_client_t *pClient);  int *                   lscp_list_channels              (lscp_client_t *pClient);
190  int                     lscp_add_channel                (lscp_client_t *pClient);  int                     lscp_add_channel                (lscp_client_t *pClient);
191  lscp_status_t           lscp_remove_channel             (lscp_client_t *pClient, int iSamplerChannel);  lscp_status_t           lscp_remove_channel             (lscp_client_t *pClient, int iSamplerChannel);
192  const char **           lscp_get_available_engines      (lscp_client_t *pClient);  
193    int                     lscp_get_available_engines      (lscp_client_t *pClient);
194    const char **           lscp_list_available_engines     (lscp_client_t *pClient);
195    
196  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);
197  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);
198    
199  int                     lscp_get_channel_voice_count    (lscp_client_t *pClient, int iSamplerChannel);  int                     lscp_get_channel_voice_count    (lscp_client_t *pClient, int iSamplerChannel);
200  int                     lscp_get_channel_stream_count   (lscp_client_t *pClient, int iSamplerChannel);  int                     lscp_get_channel_stream_count   (lscp_client_t *pClient, int iSamplerChannel);
201    int                     lscp_get_channel_stream_usage   (lscp_client_t *pClient, int iSamplerChannel);
202    
203  lscp_buffer_fill_t *    lscp_get_channel_buffer_fill    (lscp_client_t *pClient, lscp_usage_t iUsageType, int iSamplerChannel);  lscp_buffer_fill_t *    lscp_get_channel_buffer_fill    (lscp_client_t *pClient, lscp_usage_t iUsageType, int iSamplerChannel);
204    
# Line 170  lscp_status_t           lscp_set_channel Line 212  lscp_status_t           lscp_set_channel
212  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);
213  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);
214    
215    lscp_status_t           lscp_set_channel_mute           (lscp_client_t *pClient, int iSamplerChannel, int iMute);
216    lscp_status_t           lscp_set_channel_solo           (lscp_client_t *pClient, int iSamplerChannel, int iSolo);
217    
218  lscp_status_t           lscp_reset_channel              (lscp_client_t *pClient, int iSamplerChannel);  lscp_status_t           lscp_reset_channel              (lscp_client_t *pClient, int iSamplerChannel);
219    
220    lscp_status_t           lscp_reset_sampler              (lscp_client_t *pClient);
221    
222    lscp_server_info_t *    lscp_get_server_info            (lscp_client_t *pClient);
223    
224    int                     lscp_get_total_voice_count      (lscp_client_t *pClient);
225    int                     lscp_get_total_voice_count_max  (lscp_client_t *pClient);
226    
227    //-------------------------------------------------------------------------
228    // MIDI instrument mapping control functions.
229    
230    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);
231    lscp_status_t           lscp_unmap_midi_instrument      (lscp_client_t *pClient, lscp_midi_instrument_t *pMidiInstr);
232    
233    int                     lscp_get_midi_instruments       (lscp_client_t *pClient);
234    lscp_midi_instrument_t *lscp_list_midi_instruments      (lscp_client_t *pClient);
235    
236    lscp_midi_instrument_info_t *lscp_get_midi_instrument_info(lscp_client_t *pClient, lscp_midi_instrument_t *pMidiInstr);
237    
238    lscp_status_t           lscp_clear_midi_instruments     (lscp_client_t *pClient);
239    
240    
241  #if defined(__cplusplus)  #if defined(__cplusplus)
242  }  }

Legend:
Removed from v.144  
changed lines
  Added in v.948

  ViewVC Help
Powered by ViewVC