2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
liblscp - LinuxSampler Control Protocol API |
liblscp - LinuxSampler Control Protocol API |
5 |
Copyright (C) 2004-2006, 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 |
23 |
#include "common.h" |
#include "common.h" |
24 |
|
|
25 |
#include <ctype.h> |
#include <ctype.h> |
26 |
|
#include <sys/time.h> |
27 |
|
#include <sys/errno.h> |
28 |
|
|
29 |
|
|
30 |
// Split chunk size magic: |
// Split chunk size magic: |
121 |
int iErrno; |
int iErrno; |
122 |
char *pszResult; |
char *pszResult; |
123 |
int cchResult; |
int cchResult; |
124 |
|
ssize_t sz; |
125 |
|
|
126 |
lscp_status_t ret = LSCP_FAILED; |
lscp_status_t ret = LSCP_FAILED; |
127 |
|
|
158 |
|
|
159 |
// Send data, and then, wait for the result... |
// Send data, and then, wait for the result... |
160 |
cchQuery = strlen(pszQuery); |
cchQuery = strlen(pszQuery); |
161 |
if (send(pClient->cmd.sock, pszQuery, cchQuery, 0) < cchQuery) { |
sz = send(pClient->cmd.sock, pszQuery, cchQuery, 0); |
162 |
|
if (sz < cchQuery) { |
163 |
lscp_socket_perror("lscp_client_call: send"); |
lscp_socket_perror("lscp_client_call: send"); |
164 |
pszResult = "Failure during send operation"; |
pszResult = "Failure during send operation"; |
165 |
|
if (sz < 0) |
166 |
|
iErrno = -errno; |
167 |
lscp_client_set_result(pClient, pszResult, iErrno); |
lscp_client_set_result(pClient, pszResult, iErrno); |
168 |
return ret; |
return ret; |
169 |
} |
} |
914 |
if (pChannelInfo->engine_name) |
if (pChannelInfo->engine_name) |
915 |
free(pChannelInfo->engine_name); |
free(pChannelInfo->engine_name); |
916 |
if (pChannelInfo->audio_routing) |
if (pChannelInfo->audio_routing) |
917 |
lscp_szsplit_destroy(pChannelInfo->audio_routing); |
lscp_isplit_destroy(pChannelInfo->audio_routing); |
918 |
if (pChannelInfo->instrument_file) |
if (pChannelInfo->instrument_file) |
919 |
free(pChannelInfo->instrument_file); |
free(pChannelInfo->instrument_file); |
920 |
if (pChannelInfo->instrument_name) |
if (pChannelInfo->instrument_name) |
1068 |
} |
} |
1069 |
|
|
1070 |
|
|
1071 |
|
//------------------------------------------------------------------------- |
1072 |
|
// Effect struct helper functions. |
1073 |
|
|
1074 |
|
void lscp_fxsend_info_init ( lscp_fxsend_info_t *pFxSendInfo ) |
1075 |
|
{ |
1076 |
|
pFxSendInfo->name = NULL; |
1077 |
|
pFxSendInfo->midi_controller = 0; |
1078 |
|
pFxSendInfo->audio_routing = NULL; |
1079 |
|
pFxSendInfo->level = 0.0f; |
1080 |
|
} |
1081 |
|
|
1082 |
|
void lscp_fxsend_info_free ( lscp_fxsend_info_t *pFxSendInfo ) |
1083 |
|
{ |
1084 |
|
if (pFxSendInfo->name) |
1085 |
|
free(pFxSendInfo->name); |
1086 |
|
if (pFxSendInfo->audio_routing) |
1087 |
|
lscp_isplit_destroy(pFxSendInfo->audio_routing); |
1088 |
|
} |
1089 |
|
|
1090 |
|
void lscp_fxsend_info_reset (lscp_fxsend_info_t *pFxSendInfo ) |
1091 |
|
{ |
1092 |
|
lscp_fxsend_info_free(pFxSendInfo); |
1093 |
|
lscp_fxsend_info_init(pFxSendInfo); |
1094 |
|
} |
1095 |
|
|
1096 |
|
|
1097 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
1098 |
// MIDI instrument info struct helper functions. |
// MIDI instrument info struct helper functions. |
1099 |
|
|