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

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

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

revision 1019 by capela, Thu Jan 11 12:33:05 2007 UTC revision 1412 by capela, Fri Oct 12 22:43:38 2007 UTC
# Line 1089  lscp_channel_info_t *lscp_get_channel_in Line 1089  lscp_channel_info_t *lscp_get_channel_in
1089                                  pszToken = lscp_strtok(NULL, pszCrlf, &(pch));                                  pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
1090                                  if (pszToken) {                                  if (pszToken) {
1091                                          if (pChannelInfo->audio_routing)                                          if (pChannelInfo->audio_routing)
1092                                                  lscp_szsplit_destroy(pChannelInfo->audio_routing);                                                  lscp_isplit_destroy(pChannelInfo->audio_routing);
1093                                          pChannelInfo->audio_routing = lscp_szsplit_create(pszToken, ",");                                          pChannelInfo->audio_routing = lscp_isplit_create(pszToken, ",");
1094                                  }                                  }
1095                          }                          }
1096                          else if (strcasecmp(pszToken, "INSTRUMENT_FILE") == 0) {                          else if (strcasecmp(pszToken, "INSTRUMENT_FILE") == 0) {
# Line 2031  lscp_fxsend_info_t *lscp_get_fxsend_info Line 2031  lscp_fxsend_info_t *lscp_get_fxsend_info
2031                                  pszToken = lscp_strtok(NULL, pszCrlf, &(pch));                                  pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
2032                                  if (pszToken) {                                  if (pszToken) {
2033                                          if (pFxSendInfo->audio_routing)                                          if (pFxSendInfo->audio_routing)
2034                                                  lscp_szsplit_destroy(pFxSendInfo->audio_routing);                                                  lscp_isplit_destroy(pFxSendInfo->audio_routing);
2035                                          pFxSendInfo->audio_routing = lscp_szsplit_create(pszToken, ",");                                          pFxSendInfo->audio_routing = lscp_isplit_create(pszToken, ",");
2036                                  }                                  }
2037                          }                          }
2038                            else if (strcasecmp(pszToken, "LEVEL") == 0) {
2039                                    pszToken = lscp_strtok(NULL, pszCrlf, &(pch));
2040                                    if (pszToken)
2041                                            pFxSendInfo->level = (float) atof(lscp_ltrim(pszToken));
2042                            }
2043                          pszToken = lscp_strtok(NULL, pszSeps, &(pch));                          pszToken = lscp_strtok(NULL, pszSeps, &(pch));
2044                  }                  }
2045          }          }
# Line 2073  lscp_status_t lscp_set_fxsend_audio_chan Line 2078  lscp_status_t lscp_set_fxsend_audio_chan
2078    
2079    
2080  /**  /**
2081     *  Alter effect send's MIDI controller:
2082     *  SET FX_SEND MIDI_CONTROLLER <sampler-chan> <fx-send-id> <midi-ctrl>
2083     *
2084     *  @param pClient          Pointer to client instance structure.
2085     *  @param iSamplerChannel  Sampler channel number.
2086     *  @param iFxSend          Effect send number.
2087     *  @param iMidiController  MIDI controller used to alter the effect,
2088     *                          usually a number between 0 and 127.
2089     *
2090     *  @returns LSCP_OK on success, LSCP_FAILED otherwise.
2091     */
2092    lscp_status_t lscp_set_fxsend_midi_controller ( lscp_client_t *pClient, int iSamplerChannel, int iFxSend, int iMidiController )
2093    {
2094            char szQuery[LSCP_BUFSIZ];
2095    
2096            if (iSamplerChannel < 0 || iFxSend < 0 || iMidiController < 0 || iMidiController > 127)
2097                    return LSCP_FAILED;
2098    
2099            sprintf(szQuery, "SET FX_SEND MIDI_CONTROLLER %d %d %d\r\n", iSamplerChannel, iFxSend, iMidiController);
2100            return lscp_client_query(pClient, szQuery);
2101    }
2102    
2103    
2104    /**
2105     *  Alter effect send's audio level:
2106     *  SET FX_SEND LEVEL <sampler-chan> <fx-send-id> <level>
2107     *
2108     *  @param pClient          Pointer to client instance structure.
2109     *  @param iSamplerChannel  Sampler channel number.
2110     *  @param iFxSend          Effect send number.
2111     *  @param fLevel           Effect send volume level.
2112     *
2113     *  @returns LSCP_OK on success, LSCP_FAILED otherwise.
2114     */
2115    lscp_status_t lscp_set_fxsend_level ( lscp_client_t *pClient, int iSamplerChannel, int iFxSend, float fLevel )
2116    {
2117            char szQuery[LSCP_BUFSIZ];
2118    
2119            if (iSamplerChannel < 0 || iFxSend < 0 || fLevel < 0.0f)
2120                    return LSCP_FAILED;
2121    
2122            sprintf(szQuery, "SET FX_SEND LEVEL %d %d %f\r\n", iSamplerChannel, iFxSend, fLevel);
2123            return lscp_client_query(pClient, szQuery);
2124    }
2125    
2126    
2127    /**
2128   *  Create a new MIDI instrument map:   *  Create a new MIDI instrument map:
2129   *  ADD MIDI_INSTRUMENT_MAP [<name>]   *  ADD MIDI_INSTRUMENT_MAP [<name>]
2130   *   *
# Line 2575  lscp_status_t lscp_clear_midi_instrument Line 2627  lscp_status_t lscp_clear_midi_instrument
2627    
2628          return lscp_client_query(pClient, szQuery);          return lscp_client_query(pClient, szQuery);
2629  }  }
2630    
2631    /**
2632     * Open an instrument editor application for the instrument
2633     * on the given sampler channel:
2634     * EDIT CHANNEL INSTRUMENT <sampler-channel>
2635     *
2636     * @param pClient         Pointer to client instance structure.
2637     * @param iSamplerChannel Sampler Channel.
2638     *
2639     * @returns LSCP_OK on success, LSCP_FAILED otherwise.
2640     */
2641    lscp_status_t lscp_edit_channel_instrument ( lscp_client_t *pClient, int iSamplerChannel )
2642    {
2643            char szQuery[LSCP_BUFSIZ];
2644    
2645            if (iSamplerChannel < 0)
2646                    return LSCP_FAILED;
2647    
2648            sprintf(szQuery, "EDIT CHANNEL INSTRUMENT %d\r\n", iSamplerChannel);
2649    
2650            return lscp_client_query(pClient, szQuery);
2651    }
2652    
2653    
2654  // end of client.c  // end of client.c

Legend:
Removed from v.1019  
changed lines
  Added in v.1412

  ViewVC Help
Powered by ViewVC