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 |
|
|
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: |
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 |
|
|
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 |
|
|
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; |
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 |
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 |
|
|