/[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 1801 by schoenebeck, Sat Feb 16 19:31:32 2008 UTC revision 1802 by schoenebeck, Sun Dec 7 13:50:08 2008 UTC
# Line 1726  lscp_status_t lscp_reset_channel ( lscp_ Line 1726  lscp_status_t lscp_reset_channel ( lscp_
1726   */   */
1727  lscp_status_t lscp_reset_sampler ( lscp_client_t *pClient )  lscp_status_t lscp_reset_sampler ( lscp_client_t *pClient )
1728  {  {
1729          // Do actual whole sampler reset...          // Do actual whole sampler reset...
1730          return lscp_client_query(pClient, "RESET\r\n");          return lscp_client_query(pClient, "RESET\r\n");
1731  }  }
1732    
# Line 1898  lscp_status_t lscp_set_volume ( lscp_cli Line 1898  lscp_status_t lscp_set_volume ( lscp_cli
1898          return lscp_client_query(pClient, szQuery);          return lscp_client_query(pClient, szQuery);
1899  }  }
1900    
1901    /**
1902     *  Get global voice limit setting:
1903     *  @code
1904     *  GET VOICES
1905     *  @endcode
1906     *  This value reflects the maximum amount of voices a sampler engine
1907     *  processes simultaniously before voice stealing kicks in.
1908     *
1909     *  @param pClient  Pointer to client instance structure.
1910     *
1911     *  @returns The current global maximum amount of voices limit or a
1912     *           negative value on error (e.g. if sampler doesn't support
1913     *           this command).
1914     */
1915    int lscp_get_voices(lscp_client_t *pClient)
1916    {
1917            int iVoices = -1;
1918    
1919            if (pClient == NULL)
1920                    return -1;
1921    
1922            // Lock this section up.
1923            lscp_mutex_lock(pClient->mutex);
1924    
1925            if (lscp_client_call(pClient, "GET VOICES\r\n", 0) == LSCP_OK)
1926                    iVoices = atoi(lscp_client_get_result(pClient));
1927    
1928            // Unlock this section down.
1929            lscp_mutex_unlock(pClient->mutex);
1930    
1931            return iVoices;
1932    }
1933    
1934    /**
1935     *  Setting global voice limit setting:
1936     *  @code
1937     *  SET VOICES <max-voices>
1938     *  @endcode
1939     *  This value reflects the maximum amount of voices a sampler engine
1940     *  processes simultaniously before voice stealing kicks in. Note that
1941     *  this value will be passed to all sampler engine instances, that is
1942     *  the total amount of maximum voices on the running system is thus
1943     *  @param iMaxVoices multiplied with the current amount of sampler
1944     *  engine instances.
1945     *
1946     *  @param pClient     Pointer to client instance structure.
1947     *  @param iMaxVoices  Global voice limit setting as integer value larger
1948     *                     or equal to 1.
1949     *
1950     *  @returns LSCP_OK on success, LSCP_FAILED otherwise.
1951     */
1952    lscp_status_t lscp_set_voices(lscp_client_t *pClient, int iMaxVoices)
1953    {
1954            char szQuery[LSCP_BUFSIZ];
1955    
1956            if (iMaxVoices < 1)
1957                    return LSCP_FAILED;
1958    
1959            sprintf(szQuery, "SET VOICES %d\r\n", iMaxVoices);
1960            return lscp_client_query(pClient, szQuery);
1961    }
1962    
1963    /**
1964     *  Get global disk streams limit setting:
1965     *  @code
1966     *  GET STREAMS
1967     *  @endcode
1968     *  This value reflects the maximum amount of disk streams a sampler
1969     *  engine processes simultaniously.
1970     *
1971     *  @param pClient  Pointer to client instance structure.
1972     *
1973     *  @returns The current global maximum amount of disk streams limit
1974     *           or a negative value on error (e.g. if sampler doesn't
1975     *           support this command).
1976     */
1977    int lscp_get_streams(lscp_client_t *pClient)
1978    {
1979            int iStreams = -1;
1980    
1981            if (pClient == NULL)
1982                    return -1;
1983    
1984            // Lock this section up.
1985            lscp_mutex_lock(pClient->mutex);
1986    
1987            if (lscp_client_call(pClient, "GET STREAMS\r\n", 0) == LSCP_OK)
1988                    iStreams = atoi(lscp_client_get_result(pClient));
1989    
1990            // Unlock this section down.
1991            lscp_mutex_unlock(pClient->mutex);
1992    
1993            return iStreams;
1994    }
1995    
1996    /**
1997     *  Setting global disk streams limit setting:
1998     *  @code
1999     *  SET STREAMS <max-streams>
2000     *  @endcode
2001     *  This value reflects the maximum amount of dist streams a sampler
2002     *  engine instance processes simultaniously. Note that this value will
2003     *  be passed to all sampler engine instances, that is the total amount
2004     *  of maximum disk streams on the running system is thus
2005     *  @param iMaxStreams multiplied with the current amount of sampler
2006     *  engine instances.
2007     *
2008     *  @param pClient      Pointer to client instance structure.
2009     *  @param iMaxStreams  Global streams limit setting as positive integer
2010     *                      value (larger or equal to 0).
2011     *
2012     *  @returns LSCP_OK on success, LSCP_FAILED otherwise.
2013     */
2014    lscp_status_t lscp_set_streams(lscp_client_t *pClient, int iMaxStreams)
2015    {
2016            char szQuery[LSCP_BUFSIZ];
2017    
2018            if (iMaxStreams < 0)
2019                    return LSCP_FAILED;
2020    
2021            sprintf(szQuery, "SET STREAMS %d\r\n", iMaxStreams);
2022            return lscp_client_query(pClient, szQuery);
2023    }
2024    
2025  /**  /**
2026   *  Add an effect send to a sampler channel:   *  Add an effect send to a sampler channel:
# Line 1926  int lscp_create_fxsend ( lscp_client_t * Line 2049  int lscp_create_fxsend ( lscp_client_t *
2049          lscp_mutex_lock(pClient->mutex);          lscp_mutex_lock(pClient->mutex);
2050    
2051          sprintf(szQuery, "CREATE FX_SEND %d %d", iSamplerChannel, iMidiController);          sprintf(szQuery, "CREATE FX_SEND %d %d", iSamplerChannel, iMidiController);
2052            
2053          if (pszFxName)          if (pszFxName)
2054                  sprintf(szQuery + strlen(szQuery), " '%s'", pszFxName);                  sprintf(szQuery + strlen(szQuery), " '%s'", pszFxName);
2055    
# Line 2227  int lscp_add_midi_instrument_map ( lscp_ Line 2350  int lscp_add_midi_instrument_map ( lscp_
2350          lscp_mutex_lock(pClient->mutex);          lscp_mutex_lock(pClient->mutex);
2351    
2352          strcpy(szQuery, "ADD MIDI_INSTRUMENT_MAP");          strcpy(szQuery, "ADD MIDI_INSTRUMENT_MAP");
2353            
2354          if (pszMapName)          if (pszMapName)
2355                  sprintf(szQuery + strlen(szQuery), " '%s'", pszMapName);                  sprintf(szQuery + strlen(szQuery), " '%s'", pszMapName);
2356    
# Line 2353  const char *lscp_get_midi_instrument_map Line 2476  const char *lscp_get_midi_instrument_map
2476    
2477          // Lock this section up.          // Lock this section up.
2478          lscp_mutex_lock(pClient->mutex);          lscp_mutex_lock(pClient->mutex);
2479            
2480          if (pClient->midi_map_name) {          if (pClient->midi_map_name) {
2481                  free(pClient->midi_map_name);                  free(pClient->midi_map_name);
2482                  pClient->midi_map_name = NULL;                  pClient->midi_map_name = NULL;
# Line 2417  lscp_status_t lscp_set_midi_instrument_m Line 2540  lscp_status_t lscp_set_midi_instrument_m
2540   *  @param pszFileName      Instrument file name.   *  @param pszFileName      Instrument file name.
2541   *  @param iInstrIndex      Instrument index number.   *  @param iInstrIndex      Instrument index number.
2542   *  @param fVolume          Reflects the master volume of the instrument as   *  @param fVolume          Reflects the master volume of the instrument as
2543   *                          a positive floating point number, where a value   *                          a positive floating point number, where a value
2544   *                          less than 1.0 for attenuation, and greater than   *                          less than 1.0 for attenuation, and greater than
2545   *                          1.0 for amplification.   *                          1.0 for amplification.
2546   *  @param load_mode        Instrument load life-time strategy, either   *  @param load_mode        Instrument load life-time strategy, either
# Line 2616  lscp_midi_instrument_info_t *lscp_get_mi Line 2739  lscp_midi_instrument_info_t *lscp_get_mi
2739    
2740          // Lock this section up.          // Lock this section up.
2741          lscp_mutex_lock(pClient->mutex);          lscp_mutex_lock(pClient->mutex);
2742            
2743          pInstrInfo = &(pClient->midi_instrument_info);          pInstrInfo = &(pClient->midi_instrument_info);
2744          lscp_midi_instrument_info_reset(pInstrInfo);          lscp_midi_instrument_info_reset(pInstrInfo);
2745    

Legend:
Removed from v.1801  
changed lines
  Added in v.1802

  ViewVC Help
Powered by ViewVC