/[svn]/linuxsampler/trunk/src/drivers/DeviceParameter.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/DeviceParameter.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 123 by schoenebeck, Mon Jun 14 19:33:16 2004 UTC revision 207 by schoenebeck, Thu Jul 15 21:51:15 2004 UTC
# Line 25  Line 25 
25    
26  #include <map>  #include <map>
27  #include <vector>  #include <vector>
 #include <sstream>  
28    
29  #include "../common/global.h"  #include "../common/global.h"
30  #include "../common/optional.h"  #include "../common/optional.h"
31  #include "../common/LinuxSamplerException.h"  #include "../common/LinuxSamplerException.h"
32    #include "Device.h"
33    
34  namespace LinuxSampler {  namespace LinuxSampler {
35    
# Line 152  namespace LinuxSampler { Line 152  namespace LinuxSampler {
152    
153      class DeviceCreationParameter : public DeviceRuntimeParameter {      class DeviceCreationParameter : public DeviceRuntimeParameter {
154          public:          public:
155                DeviceCreationParameter ( void )                  { pDevice = NULL; }
156              virtual bool                                      Mandatory() = 0;              virtual bool                                      Mandatory() = 0;
157              virtual optional<String>                          Depends();              virtual optional<String>                          Depends();
158              virtual std::map<String,DeviceCreationParameter*> DependsAsParameters() = 0;              virtual std::map<String,DeviceCreationParameter*> DependsAsParameters() = 0;
# Line 163  namespace LinuxSampler { Line 164  namespace LinuxSampler {
164              virtual optional<String>                          RangeMax(std::map<String,String> Parameters) = 0;              virtual optional<String>                          RangeMax(std::map<String,String> Parameters) = 0;
165              virtual optional<String>                          Possibilities();              virtual optional<String>                          Possibilities();
166              virtual optional<String>                          Possibilities(std::map<String,String> Parameters) = 0;              virtual optional<String>                          Possibilities(std::map<String,String> Parameters) = 0;
167                void                                              Attach(Device* pDevice) { this->pDevice = pDevice; }
168            protected:
169                Device* pDevice;
170      };      };
171    
172      class DeviceCreationParameterBool : public DeviceCreationParameter {      class DeviceCreationParameterBool : public DeviceCreationParameter {
173          public:          public:
174              DeviceCreationParameterBool();              DeviceCreationParameterBool(bool bVal = false);
             DeviceCreationParameterBool(bool bVal);  
175              DeviceCreationParameterBool(String val) throw (LinuxSamplerException);              DeviceCreationParameterBool(String val) throw (LinuxSamplerException);
176              virtual String Type();              virtual String Type();
177              virtual bool   Multiplicity();              virtual bool   Multiplicity();
# Line 186  namespace LinuxSampler { Line 189  namespace LinuxSampler {
189              virtual void OnSetValue(bool b) throw (LinuxSamplerException)  = 0;              virtual void OnSetValue(bool b) throw (LinuxSamplerException)  = 0;
190          protected:          protected:
191              bool bVal;              bool bVal;
         private:  
192              void InitWithDefault();              void InitWithDefault();
193            private:
194      };      };
195    
196      class DeviceCreationParameterInt : public DeviceCreationParameter {      class DeviceCreationParameterInt : public DeviceCreationParameter {
197          public:          public:
198              DeviceCreationParameterInt();              DeviceCreationParameterInt(int iVal = 0);
             DeviceCreationParameterInt(int iVal);  
199              DeviceCreationParameterInt(String val) throw (LinuxSamplerException);              DeviceCreationParameterInt(String val) throw (LinuxSamplerException);
200              virtual String Type();              virtual String Type();
201              virtual bool   Multiplicity();              virtual bool   Multiplicity();
# Line 214  namespace LinuxSampler { Line 216  namespace LinuxSampler {
216              virtual void             OnSetValue(int i) throw (LinuxSamplerException)  = 0;              virtual void             OnSetValue(int i) throw (LinuxSamplerException)  = 0;
217          protected:          protected:
218              int iVal;              int iVal;
         private:  
219              void InitWithDefault();              void InitWithDefault();
220            private:
221      };      };
222    
223      class DeviceCreationParameterFloat : public DeviceCreationParameter {      class DeviceCreationParameterFloat : public DeviceCreationParameter {
224          public:          public:
225              DeviceCreationParameterFloat();              DeviceCreationParameterFloat(float fVal = 0.0);
             DeviceCreationParameterFloat(float fVal);  
226              DeviceCreationParameterFloat(String val) throw (LinuxSamplerException);              DeviceCreationParameterFloat(String val) throw (LinuxSamplerException);
227              virtual String Type();              virtual String Type();
228              virtual bool   Multiplicity();              virtual bool   Multiplicity();
# Line 242  namespace LinuxSampler { Line 243  namespace LinuxSampler {
243              virtual void OnSetValue(float f) throw (LinuxSamplerException)  = 0;              virtual void OnSetValue(float f) throw (LinuxSamplerException)  = 0;
244          protected:          protected:
245              float fVal;              float fVal;
         private:  
246              void InitWithDefault();              void InitWithDefault();
247            private:
248      };      };
249    
250      class DeviceCreationParameterString : public DeviceCreationParameter {      class DeviceCreationParameterString : public DeviceCreationParameter {
251          public:          public:
252              DeviceCreationParameterString();              DeviceCreationParameterString(String sVal = String());
             DeviceCreationParameterString(String sVal);  
253              virtual String Type();              virtual String Type();
254              virtual bool   Multiplicity();              virtual bool   Multiplicity();
255              virtual optional<String> RangeMin(std::map<String,String> Parameters);              virtual optional<String> RangeMin(std::map<String,String> Parameters);
# Line 262  namespace LinuxSampler { Line 262  namespace LinuxSampler {
262              virtual void OnSetValue(String s) throw (LinuxSamplerException) = 0;              virtual void OnSetValue(String s) throw (LinuxSamplerException) = 0;
263          protected:          protected:
264              String sVal;              String sVal;
         private:  
265              void InitWithDefault();              void InitWithDefault();
266            private:
267      };      };
268    
269      class DeviceCreationParameterStrings : public DeviceCreationParameter {      class DeviceCreationParameterStrings : public DeviceCreationParameter {
# Line 287  namespace LinuxSampler { Line 287  namespace LinuxSampler {
287              virtual void OnSetValue(std::vector<String> vS) throw (LinuxSamplerException) = 0;              virtual void OnSetValue(std::vector<String> vS) throw (LinuxSamplerException) = 0;
288          protected:          protected:
289              std::vector<String> sVals;              std::vector<String> sVals;
         private:  
290              void InitWithDefault();              void InitWithDefault();
291            private:
292      };      };
293    
     template <class T>  
     inline String ToString(T o) {  
         std::stringstream ss;  
         ss << o;  
         return ss.str();  
     }  
   
294  } // namespace LinuxSampler  } // namespace LinuxSampler
295    
296  #endif // __LS_DEVICE_PARAMETER_H__  #endif // __LS_DEVICE_PARAMETER_H__

Legend:
Removed from v.123  
changed lines
  Added in v.207

  ViewVC Help
Powered by ViewVC