/[svn]/linuxsampler/trunk/src/effects/EffectControl.cpp
ViewVC logotype

Contents of /linuxsampler/trunk/src/effects/EffectControl.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2135 - (show annotations) (download)
Thu Sep 30 20:00:43 2010 UTC (13 years, 6 months ago) by schoenebeck
File size: 1790 byte(s)
* added and implemented a set of 19 new LSCP commands for controlling
  internal effects:
  - added LSCP command "GET AVAILABLE_EFFECTS"
  - added LSCP command "LIST AVAILABLE_EFFECTS"
  - added LSCP command "GET EFFECT INFO <effect-index>"
  - added LSCP command "CREATE EFFECT_INSTANCE <effect-index>"
  - added LSCP command
    "CREATE EFFECT_INSTANCE <effect-system> <module> <effect-name>"
  - added LSCP command "DESTROY EFFECT_INSTANCE <effect-instance>"
  - added LSCP command "GET EFFECT_INSTANCES"
  - added LSCP command "LIST EFFECT_INSTANCES"
  - added LSCP command "GET EFFECT_INSTANCE INFO <effect-instance>"
  - added LSCP command "GET EFFECT_INSTANCE_INPUT_CONTROL INFO
    <effect-instance> <input-control>"
  - added LSCP command "SET EFFECT_INSTANCE_INPUT_CONTROL <effect-instance>
    <input-control> <value>"
  - added LSCP command "GET MASTER_EFFECT_CHAINS <audio-device>"
  - added LSCP command "LIST MASTER_EFFECT_CHAINS <audio-device>"
  - added LSCP command "ADD MASTER_EFFECT_CHAIN <audio-device>"
  - added LSCP command
    "REMOVE MASTER_EFFECT_CHAIN <audio-device> <effect-chain>"
  - added LSCP command
    "GET MASTER_EFFECT_CHAIN INFO <audio-device> <effect-chain>"
  - added LSCP command "APPEND MASTER_EFFECT_CHAIN EFFECT <audio-device>
    <effect-chain> <effect-instance>"
  - added LSCP command "INSERT MASTER_EFFECT_CHAIN EFFECT <audio-device>
    <effect-chain> <effect-instance> <effect-chain-pos>"
  - added LSCP command "REMOVE MASTER_EFFECT_CHAIN EFFECT <audio-device>
    <effect-chain> <effect-instance>"
* bumped version to 1.0.0.cvs7

1 /*
2 Copyright (C) 2010 Christian Schoenebeck
3 */
4
5 #include "EffectControl.h"
6
7 namespace LinuxSampler {
8
9 EffectControl::EffectControl() {
10 value = 0.0f;
11 type = TYPE_BOOL;
12 }
13
14 EffectControl::~EffectControl() {
15 }
16
17 void EffectControl::SetValue(float val) throw (Exception) {
18 if (minValue && val < *minValue)
19 throw Exception("Effect control value smaller than minimum allowed value");
20 if (maxValue && val > *maxValue)
21 throw Exception("Effect control value greater than maximum allowed value");
22 value = val;
23 }
24
25 float& EffectControl::Value() {
26 return value;
27 }
28
29 EffectControl::Type_t EffectControl::Type() const {
30 return type;
31 }
32
33 String EffectControl::TypeAsString() const {
34 switch (type) {
35 case TYPE_FLOAT:
36 return "FLOAT";
37 case TYPE_INT:
38 return "INT";
39 case TYPE_BOOL:
40 return "BOOL";
41 default:
42 return "INVALID";
43 }
44 }
45
46 String EffectControl::Description() const {
47 return description;
48 }
49
50 optional<float> EffectControl::DefaultValue() const {
51 return defaultValue;
52 }
53
54 optional<float> EffectControl::MinValue() const {
55 return minValue;
56 }
57
58 optional<float> EffectControl::MaxValue() const {
59 return maxValue;
60 }
61
62 std::vector<float> EffectControl::Possibilities() const {
63 return possibilities;
64 }
65
66 void EffectControl::SetDefaultValue(float val) {
67 defaultValue = val;
68 }
69
70 void EffectControl::SetMinValue(float val) {
71 minValue = val;
72 }
73
74 void EffectControl::SetMaxValue(float val) {
75 maxValue = val;
76 }
77
78 void EffectControl::SetPossibilities(const std::vector<float>& v) {
79 possibilities = v;
80 }
81
82 void EffectControl::SetType(Type_t t) {
83 type = t;
84 }
85
86 void EffectControl::SetDescription(String s) {
87 description = s;
88 }
89
90 } // namespace LinuxSampler

  ViewVC Help
Powered by ViewVC