| 96 | /*! |
---|
| 97 | @brief Base class for basic enumerated control elements |
---|
| 98 | */ |
---|
| 99 | class Enum |
---|
| 100 | : public Element |
---|
| 101 | { |
---|
| 102 | public: |
---|
| 103 | Enum(); |
---|
| 104 | Enum(std::string n); |
---|
| 105 | virtual ~Enum() {}; |
---|
| 106 | |
---|
| 107 | virtual bool select(int idx); |
---|
| 108 | virtual int selected(); |
---|
| 109 | virtual int count(); |
---|
| 110 | virtual std::string getEnumLabel(int idx); |
---|
| 111 | |
---|
| 112 | virtual void show(); |
---|
| 113 | //private: // HACK |
---|
| 114 | int m_selected; |
---|
| 115 | }; |
---|
| 116 | |
---|
| 117 | /*! |
---|
| 118 | @brief Base class for attribute enumerated control elements |
---|
| 119 | |
---|
| 120 | The idea of this is that one can have a set of config values |
---|
| 121 | available for a certain enum choice. |
---|
| 122 | |
---|
| 123 | Example: for clock source selection: |
---|
| 124 | idx Label signal locked available |
---|
| 125 | 0 WordClock 0 0 1 |
---|
| 126 | 1 S/PDIF 1 0 1 |
---|
| 127 | ... |
---|
| 128 | |
---|
| 129 | Attributes: |
---|
| 130 | 0 signal |
---|
| 131 | 1 locked |
---|
| 132 | 2 available |
---|
| 133 | |
---|
| 134 | */ |
---|
| 135 | class AttributeEnum |
---|
| 136 | : public Enum |
---|
| 137 | { |
---|
| 138 | public: |
---|
| 139 | AttributeEnum(); |
---|
| 140 | AttributeEnum(std::string n); |
---|
| 141 | virtual ~AttributeEnum() {}; |
---|
| 142 | |
---|
| 143 | virtual int attributeCount(); |
---|
| 144 | ///> get a specific attribute value for the selected enum |
---|
| 145 | virtual std::string getAttributeValue(int attridx); |
---|
| 146 | ///> get the name of the attribute with a certain index |
---|
| 147 | virtual std::string getAttributeName(int attridx); |
---|
| 148 | |
---|
| 149 | virtual void show(); |
---|
| 150 | private: |
---|
| 151 | }; |
---|
| 152 | |
---|