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 * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program 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 * |
60 |
//Values could be of different types for now supports String, int and float. |
//Values could be of different types for now supports String, int and float. |
61 |
void LSCPResultSet::Add(String Label, String Value) { |
void LSCPResultSet::Add(String Label, String Value) { |
62 |
if (count == -1) |
if (count == -1) |
63 |
throw LinuxSamplerException("Attempting to change already produced resultset"); |
throw Exception("Attempting to change already produced resultset"); |
64 |
if (result_type != result_type_success) |
if (result_type != result_type_success) |
65 |
throw LinuxSamplerException("Attempting to create illegal resultset"); |
throw Exception("Attempting to create illegal resultset"); |
66 |
storage = storage + Label + ": " + Value + "\r\n"; |
storage = storage + Label + ": " + Value + "\r\n"; |
67 |
count++; |
count++; |
68 |
} |
} |
105 |
//Add a single string to the resultset |
//Add a single string to the resultset |
106 |
void LSCPResultSet::Add(String Value) { |
void LSCPResultSet::Add(String Value) { |
107 |
if (result_type != result_type_success) |
if (result_type != result_type_success) |
108 |
throw LinuxSamplerException("Attempting to create illegal resultset"); |
throw Exception("Attempting to create illegal resultset"); |
109 |
if (count == -1) |
if (count == -1) |
110 |
throw LinuxSamplerException("Attempting to change already produced resultset"); |
throw Exception("Attempting to change already produced resultset"); |
111 |
if (count != 0) |
if (count != 0) |
112 |
throw LinuxSamplerException("Attempting to create illegal resultset"); |
throw Exception("Attempting to create illegal resultset"); |
113 |
storage = Value + "\r\n"; |
storage = Value + "\r\n"; |
114 |
count = 1; |
count = 1; |
115 |
} |
} |
120 |
//This method will be used to generate unknown errors only (code 0) |
//This method will be used to generate unknown errors only (code 0) |
121 |
//To generate errors with other codes as well as warnings use other methods (below). |
//To generate errors with other codes as well as warnings use other methods (below). |
122 |
//Because this is an unknown error, this method will also print message to the stderr. |
//Because this is an unknown error, this method will also print message to the stderr. |
123 |
void LSCPResultSet::Error(LinuxSamplerException e) { |
void LSCPResultSet::Error(Exception e) { |
124 |
e.PrintMessage(); |
e.PrintMessage(); |
125 |
Error(e.Message()); |
Error(e.Message()); |
126 |
} |
} |