3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005, 2006 Christian Schoenebeck * |
* Copyright (C) 2005 - 2007 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
24 |
#include "lscpserver.h" |
#include "lscpserver.h" |
25 |
#include "lscpresultset.h" |
#include "lscpresultset.h" |
26 |
#include "lscpevent.h" |
#include "lscpevent.h" |
27 |
//#include "../common/global.h" |
#include "../common/global.h" |
28 |
|
|
29 |
#include <fcntl.h> |
#include <fcntl.h> |
30 |
|
|
1502 |
|
|
1503 |
bool oldSolo = pEngineChannel->GetSolo(); |
bool oldSolo = pEngineChannel->GetSolo(); |
1504 |
bool hadSoloChannel = HasSoloChannel(); |
bool hadSoloChannel = HasSoloChannel(); |
1505 |
|
|
1506 |
pEngineChannel->SetSolo(bSolo); |
pEngineChannel->SetSolo(bSolo); |
1507 |
|
|
1508 |
if(!oldSolo && bSolo) { |
if(!oldSolo && bSolo) { |
1509 |
if(pEngineChannel->GetMute() == -1) pEngineChannel->SetMute(0); |
if(pEngineChannel->GetMute() == -1) pEngineChannel->SetMute(0); |
1510 |
if(!hadSoloChannel) MuteNonSoloChannels(); |
if(!hadSoloChannel) MuteNonSoloChannels(); |
1511 |
} |
} |
1512 |
|
|
1513 |
if(oldSolo && !bSolo) { |
if(oldSolo && !bSolo) { |
1514 |
if(!HasSoloChannel()) UnmuteChannels(); |
if(!HasSoloChannel()) UnmuteChannels(); |
1515 |
else if(!pEngineChannel->GetMute()) pEngineChannel->SetMute(-1); |
else if(!pEngineChannel->GetMute()) pEngineChannel->SetMute(-1); |
1698 |
for (; iter != mappings.end(); iter++) { |
for (; iter != mappings.end(); iter++) { |
1699 |
if (s.size()) s += ","; |
if (s.size()) s += ","; |
1700 |
s += "{" + ToString(MidiMapID) + "," |
s += "{" + ToString(MidiMapID) + "," |
1701 |
+ ToString((int(iter->first.midi_bank_msb) << 7) & int(iter->first.midi_bank_lsb)) + "," |
+ ToString((int(iter->first.midi_bank_msb) << 7) | int(iter->first.midi_bank_lsb)) + "," |
1702 |
+ ToString(int(iter->first.midi_prog)) + "}"; |
+ ToString(int(iter->first.midi_prog)) + "}"; |
1703 |
} |
} |
1704 |
result.Add(s); |
result.Add(s); |
1720 |
for (; iter != mappings.end(); iter++) { |
for (; iter != mappings.end(); iter++) { |
1721 |
if (s.size()) s += ","; |
if (s.size()) s += ","; |
1722 |
s += "{" + ToString(maps[i]) + "," |
s += "{" + ToString(maps[i]) + "," |
1723 |
+ ToString((int(iter->first.midi_bank_msb) << 7) & int(iter->first.midi_bank_lsb)) + "," |
+ ToString((int(iter->first.midi_bank_msb) << 7) | int(iter->first.midi_bank_lsb)) + "," |
1724 |
+ ToString(int(iter->first.midi_prog)) + "}"; |
+ ToString(int(iter->first.midi_prog)) + "}"; |
1725 |
} |
} |
1726 |
} |
} |
2074 |
return result.Produce(); |
return result.Produce(); |
2075 |
} |
} |
2076 |
|
|
2077 |
|
String LSCPServer::GetGlobalVolume() { |
2078 |
|
LSCPResultSet result; |
2079 |
|
result.Add(ToString(GLOBAL_VOLUME)); // see common/global.cpp |
2080 |
|
return result.Produce(); |
2081 |
|
} |
2082 |
|
|
2083 |
|
String LSCPServer::SetGlobalVolume(double dVolume) { |
2084 |
|
LSCPResultSet result; |
2085 |
|
try { |
2086 |
|
if (dVolume < 0) throw Exception("Volume may not be negative"); |
2087 |
|
GLOBAL_VOLUME = dVolume; // see common/global.cpp |
2088 |
|
} catch (Exception e) { |
2089 |
|
result.Error(e); |
2090 |
|
} |
2091 |
|
return result.Produce(); |
2092 |
|
} |
2093 |
|
|
2094 |
/** |
/** |
2095 |
* Will be called by the parser to subscribe a client (frontend) on the |
* Will be called by the parser to subscribe a client (frontend) on the |
2096 |
* server for receiving event messages. |
* server for receiving event messages. |