/[svn]/liblscp/trunk/src/common.c
ViewVC logotype

Diff of /liblscp/trunk/src/common.c

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

revision 623 by capela, Thu Jun 9 10:37:19 2005 UTC revision 946 by capela, Mon Nov 27 18:33:02 2006 UTC
# Line 2  Line 2 
2  //  //
3  /****************************************************************************  /****************************************************************************
4     liblscp - LinuxSampler Control Protocol API     liblscp - LinuxSampler Control Protocol API
5     Copyright (C) 2004-2005, 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 72  lscp_status_t lscp_client_recv ( lscp_cl Line 72  lscp_status_t lscp_client_recv ( lscp_cl
72      // Use the timeout select feature...      // Use the timeout select feature...
73      if (iTimeout < 1)      if (iTimeout < 1)
74          iTimeout = pClient->iTimeout;          iTimeout = pClient->iTimeout;
75      if (iTimeout > 1000) {      if (iTimeout >= 1000) {
76          tv.tv_sec = iTimeout / 1000;          tv.tv_sec = iTimeout / 1000;
77          iTimeout -= tv.tv_sec * 1000;          iTimeout -= tv.tv_sec * 1000;
78      }      }
# Line 206  lscp_status_t lscp_client_call ( lscp_cl Line 206  lscp_status_t lscp_client_call ( lscp_cl
206    
207        case LSCP_TIMEOUT:        case LSCP_TIMEOUT:
208                  // We have trouble...                  // We have trouble...
209          pClient->iTimeoutCount++;                  pClient->iTimeoutCount++;
210          // Fake a result message.          // Fake a result message.
211          pszResult = "Timeout during receive operation";          pszResult = "Timeout during receive operation";
212          iErrno = (int) ret;          iErrno = (int) ret;
# Line 743  void lscp_channel_info_init ( lscp_chann Line 743  void lscp_channel_info_init ( lscp_chann
743      pChannelInfo->midi_port         = 0;      pChannelInfo->midi_port         = 0;
744      pChannelInfo->midi_channel      = 0;      pChannelInfo->midi_channel      = 0;
745      pChannelInfo->volume            = 0.0;      pChannelInfo->volume            = 0.0;
746        pChannelInfo->mute              = 0;
747        pChannelInfo->solo              = 0;
748  }  }
749    
750  void lscp_channel_info_free ( lscp_channel_info_t *pChannelInfo )  void lscp_channel_info_free ( lscp_channel_info_t *pChannelInfo )
# Line 904  int lscp_param_concat ( char *pszBuffer, Line 906  int lscp_param_concat ( char *pszBuffer,
906  }  }
907    
908    
909    //-------------------------------------------------------------------------
910    // MIDI instrument info struct helper functions.
911    
912    void lscp_midi_instrument_info_init ( lscp_midi_instrument_info_t *pInstrInfo )
913    {
914        pInstrInfo->name              = NULL;
915        pInstrInfo->engine_name       = NULL;
916        pInstrInfo->instrument_file   = NULL;
917        pInstrInfo->instrument_nr     = 0;
918        pInstrInfo->instrument_name   = NULL;
919        pInstrInfo->load_mode         = LSCP_LOAD_DEFAULT;
920        pInstrInfo->volume            = 0.0;
921    }
922    
923    void lscp_midi_instrument_info_free ( lscp_midi_instrument_info_t *pInstrInfo )
924    {
925        if (pInstrInfo->name)
926            free(pInstrInfo->name);
927        if (pInstrInfo->engine_name)
928            free(pInstrInfo->engine_name);
929        if (pInstrInfo->instrument_file)
930            free(pInstrInfo->instrument_file);
931        if (pInstrInfo->instrument_name)
932            free(pInstrInfo->instrument_name);
933    }
934    
935    void lscp_midi_instrument_info_reset ( lscp_midi_instrument_info_t *pInstrInfo )
936    {
937        lscp_midi_instrument_info_free(pInstrInfo);
938        lscp_midi_instrument_info_init(pInstrInfo);
939    }
940    
941    
942  // end of common.c  // end of common.c

Legend:
Removed from v.623  
changed lines
  Added in v.946

  ViewVC Help
Powered by ViewVC