Mercurial > hg > vamp-live-host
annotate host/Rule.h @ 17:3cbd40805795 tip
Remove obsolete stuff from README
author | Chris Cannam |
---|---|
date | Tue, 03 Dec 2013 16:33:08 +0000 |
parents | 10715d2b3069 |
children |
rev | line source |
---|---|
cannam@4 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
cannam@4 | 2 |
cannam@4 | 3 #ifndef _RULE_H_ |
cannam@4 | 4 #define _RULE_H_ |
cannam@4 | 5 |
cannam@7 | 6 #include <vector> |
cannam@7 | 7 |
cannam@7 | 8 #include "Action.h" |
cannam@7 | 9 |
cannam@7 | 10 class Condition |
cannam@4 | 11 { |
cannam@4 | 12 public: |
cannam@7 | 13 enum Type { |
cannam@4 | 14 EqualTo, |
cannam@4 | 15 GreaterThan, |
cannam@4 | 16 LessThan, |
cannam@4 | 17 NotEqualTo, |
cannam@4 | 18 Present, |
cannam@4 | 19 Changed, |
cannam@4 | 20 GapGreaterThan, |
cannam@4 | 21 GapLessThan |
cannam@4 | 22 }; |
cannam@4 | 23 |
cannam@7 | 24 Condition(int pluginIndex, int outputNumber, |
cannam@7 | 25 Type type, float argument = 0.f) : |
cannam@4 | 26 m_pluginIndex(pluginIndex), |
cannam@4 | 27 m_outputNumber(outputNumber), |
cannam@7 | 28 m_type(type), |
cannam@4 | 29 m_argument(argument) |
cannam@4 | 30 { } |
cannam@4 | 31 |
cannam@4 | 32 int getPluginIndex() const { return m_pluginIndex; } |
cannam@4 | 33 int getOutputNumber() const { return m_outputNumber; } |
cannam@7 | 34 Type getType() const { return m_type; } |
cannam@4 | 35 float getArgument() const { return m_argument; } |
cannam@4 | 36 |
cannam@4 | 37 protected: |
cannam@4 | 38 int m_pluginIndex; |
cannam@4 | 39 int m_outputNumber; |
cannam@7 | 40 Type m_type; |
cannam@4 | 41 float m_argument; |
cannam@4 | 42 }; |
cannam@4 | 43 |
cannam@7 | 44 class Rule |
cannam@7 | 45 { |
cannam@7 | 46 public: |
cannam@9 | 47 Rule() { } |
cannam@7 | 48 virtual ~Rule(); |
cannam@7 | 49 |
cannam@7 | 50 void addCondition(Condition condition); |
cannam@9 | 51 void addAction(Action *action); // I take ownership of action |
cannam@7 | 52 |
cannam@7 | 53 typedef std::vector<Condition> ConditionList; |
cannam@7 | 54 const ConditionList &getConditions() const { return m_conditions; } |
cannam@7 | 55 |
cannam@9 | 56 typedef std::vector<Action *> ActionList; |
cannam@9 | 57 const ActionList &getActions() const { return m_actions; } |
cannam@7 | 58 |
cannam@7 | 59 protected: |
cannam@9 | 60 ConditionList m_conditions; |
cannam@9 | 61 ActionList m_actions; |
cannam@7 | 62 }; |
cannam@7 | 63 |
cannam@4 | 64 #endif |