1866 |
return result.Produce(); |
return result.Produce(); |
1867 |
} |
} |
1868 |
|
|
1869 |
|
String LSCPServer::CreateFxSend(uint uiSamplerChannel, uint MidiCtrl, String Name) { |
1870 |
|
dmsg(2,("LSCPServer: CreateFxSend()\n")); |
1871 |
|
LSCPResultSet result; |
1872 |
|
try { |
1873 |
|
SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); |
1874 |
|
if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
1875 |
|
|
1876 |
|
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
1877 |
|
if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet"); |
1878 |
|
|
1879 |
|
FxSend* pFxSend = pEngineChannel->AddFxSend(MidiCtrl, Name); |
1880 |
|
if (!pFxSend) throw Exception("Could not add FxSend, don't ask, I don't know why (probably a bug)"); |
1881 |
|
|
1882 |
|
result = LSCPResultSet(pFxSend->Id()); // success |
1883 |
|
} catch (Exception e) { |
1884 |
|
result.Error(e); |
1885 |
|
} |
1886 |
|
return result.Produce(); |
1887 |
|
} |
1888 |
|
|
1889 |
|
String LSCPServer::DestroyFxSend(uint uiSamplerChannel, uint FxSendID) { |
1890 |
|
dmsg(2,("LSCPServer: DestroyFxSend()\n")); |
1891 |
|
LSCPResultSet result; |
1892 |
|
try { |
1893 |
|
SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); |
1894 |
|
if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
1895 |
|
|
1896 |
|
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
1897 |
|
if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet"); |
1898 |
|
|
1899 |
|
FxSend* pFxSend = NULL; |
1900 |
|
for (int i = 0; i < pEngineChannel->GetFxSendCount(); i++) { |
1901 |
|
if (pEngineChannel->GetFxSend(i)->Id() == FxSendID) { |
1902 |
|
pFxSend = pEngineChannel->GetFxSend(i); |
1903 |
|
break; |
1904 |
|
} |
1905 |
|
} |
1906 |
|
if (!pFxSend) throw Exception("There is no FxSend with that ID on the given sampler channel"); |
1907 |
|
pEngineChannel->RemoveFxSend(pFxSend); |
1908 |
|
} catch (Exception e) { |
1909 |
|
result.Error(e); |
1910 |
|
} |
1911 |
|
return result.Produce(); |
1912 |
|
} |
1913 |
|
|
1914 |
|
String LSCPServer::GetFxSends(uint uiSamplerChannel) { |
1915 |
|
dmsg(2,("LSCPServer: GetFxSends()\n")); |
1916 |
|
LSCPResultSet result; |
1917 |
|
try { |
1918 |
|
SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); |
1919 |
|
if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
1920 |
|
|
1921 |
|
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
1922 |
|
if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet"); |
1923 |
|
|
1924 |
|
result.Add(pEngineChannel->GetFxSendCount()); |
1925 |
|
} catch (Exception e) { |
1926 |
|
result.Error(e); |
1927 |
|
} |
1928 |
|
return result.Produce(); |
1929 |
|
} |
1930 |
|
|
1931 |
|
String LSCPServer::ListFxSends(uint uiSamplerChannel) { |
1932 |
|
dmsg(2,("LSCPServer: ListFxSends()\n")); |
1933 |
|
LSCPResultSet result; |
1934 |
|
String list; |
1935 |
|
try { |
1936 |
|
SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); |
1937 |
|
if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
1938 |
|
|
1939 |
|
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
1940 |
|
if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet"); |
1941 |
|
|
1942 |
|
for (int i = 0; i < pEngineChannel->GetFxSendCount(); i++) { |
1943 |
|
FxSend* pFxSend = pEngineChannel->GetFxSend(i); |
1944 |
|
if (list != "") list += ","; |
1945 |
|
list += ToString(pFxSend->Id()); |
1946 |
|
} |
1947 |
|
result.Add(list); |
1948 |
|
} catch (Exception e) { |
1949 |
|
result.Error(e); |
1950 |
|
} |
1951 |
|
return result.Produce(); |
1952 |
|
} |
1953 |
|
|
1954 |
|
String LSCPServer::GetFxSendInfo(uint uiSamplerChannel, uint FxSendID) { |
1955 |
|
dmsg(2,("LSCPServer: GetFxSendInfo()\n")); |
1956 |
|
LSCPResultSet result; |
1957 |
|
try { |
1958 |
|
SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); |
1959 |
|
if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
1960 |
|
|
1961 |
|
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
1962 |
|
if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet"); |
1963 |
|
|
1964 |
|
FxSend* pFxSend = NULL; |
1965 |
|
for (int i = 0; i < pEngineChannel->GetFxSendCount(); i++) { |
1966 |
|
if (pEngineChannel->GetFxSend(i)->Id() == FxSendID) { |
1967 |
|
pFxSend = pEngineChannel->GetFxSend(i); |
1968 |
|
break; |
1969 |
|
} |
1970 |
|
} |
1971 |
|
if (!pFxSend) throw Exception("There is no FxSend with that ID on the given sampler channel"); |
1972 |
|
|
1973 |
|
// gather audio routing informations |
1974 |
|
String AudioRouting; |
1975 |
|
for (int chan = 0; chan < pEngineChannel->Channels(); chan++) { |
1976 |
|
if (AudioRouting != "") AudioRouting += ","; |
1977 |
|
AudioRouting += ToString(pFxSend->DestinationChannel(chan)); |
1978 |
|
} |
1979 |
|
|
1980 |
|
// success |
1981 |
|
result.Add("NAME", pFxSend->Name()); |
1982 |
|
result.Add("AUDIO_OUTPUT_ROUTING", AudioRouting); |
1983 |
|
} catch (Exception e) { |
1984 |
|
result.Error(e); |
1985 |
|
} |
1986 |
|
return result.Produce(); |
1987 |
|
} |
1988 |
|
|
1989 |
|
String LSCPServer::SetFxSendAudioOutputChannel(uint uiSamplerChannel, uint FxSendID, uint FxSendChannel, uint DeviceChannel) { |
1990 |
|
dmsg(2,("LSCPServer: SetFxSendAudioOutputChannel()\n")); |
1991 |
|
LSCPResultSet result; |
1992 |
|
try { |
1993 |
|
SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); |
1994 |
|
if (!pSamplerChannel) throw Exception("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
1995 |
|
|
1996 |
|
EngineChannel* pEngineChannel = pSamplerChannel->GetEngineChannel(); |
1997 |
|
if (!pEngineChannel) throw Exception("There is no engine deployed on this sampler channel yet"); |
1998 |
|
|
1999 |
|
FxSend* pFxSend = NULL; |
2000 |
|
for (int i = 0; i < pEngineChannel->GetFxSendCount(); i++) { |
2001 |
|
if (pEngineChannel->GetFxSend(i)->Id() == FxSendID) { |
2002 |
|
pFxSend = pEngineChannel->GetFxSend(i); |
2003 |
|
break; |
2004 |
|
} |
2005 |
|
} |
2006 |
|
if (!pFxSend) throw Exception("There is no FxSend with that ID on the given sampler channel"); |
2007 |
|
|
2008 |
|
pFxSend->SetDestinationChannel(FxSendChannel, DeviceChannel); |
2009 |
|
} catch (Exception e) { |
2010 |
|
result.Error(e); |
2011 |
|
} |
2012 |
|
return result.Produce(); |
2013 |
|
} |
2014 |
|
|
2015 |
/** |
/** |
2016 |
* Will be called by the parser to reset a particular sampler channel. |
* Will be called by the parser to reset a particular sampler channel. |
2017 |
*/ |
*/ |