| 1 | /* |
| 2 | Copyright (C) 2009 Andres Cabrera |
| 3 | [email protected] |
| 4 | |
| 5 | This file is part of CsoundQt. |
| 6 | |
| 7 | CsoundQt is free software; you can redistribute it |
| 8 | and/or modify it under the terms of the GNU Lesser General Public |
| 9 | License as published by the Free Software Foundation; either |
| 10 | version 2.1 of the License, or (at your option) any later version. |
| 11 | |
| 12 | CsoundQt is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU Lesser General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU Lesser General Public |
| 18 | License along with Csound; if not, write to the Free Software |
| 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 20 | 02111-1307 USA |
| 21 | */ |
| 22 | |
| 23 | #ifndef WIDGETPRESET_H |
| 24 | #define WIDGETPRESET_H |
| 25 | |
| 26 | #include <QtCore> |
| 27 | |
| 28 | class PresetData |
| 29 | { |
| 30 | public: |
| 31 | QString id; |
| 32 | int mode; // 1=1 value 2=value2 4=stringValue OR combination of these |
| 33 | float value; |
| 34 | float value2; |
| 35 | QString stringValue; |
| 36 | }; |
| 37 | |
| 38 | class WidgetPreset |
| 39 | { |
| 40 | public: |
| 41 | WidgetPreset(); |
| 42 | |
| 43 | QString getXmlText(); |
| 44 | QString getName(); |
| 45 | int getNumber(); |
| 46 | QStringList getWidgetIds(); |
| 47 | // int getMode(QString id); |
| 48 | // double getValue(QString id); |
| 49 | // double getValue2(QString id); |
| 50 | // QString getStringValue(QString id); |
| 51 | int getMode(int index); |
| 52 | double getValue(int index); |
| 53 | double getValue2(int index); |
| 54 | QString getStringValue(int index); |
| 55 | |
| 56 | void setName(QString name); |
| 57 | void setNumber(int number); |
| 58 | void addValue(QString id, double value); |
| 59 | void addValue2(QString id, double value); |
| 60 | void addStringValue(QString id, QString value); |
| 61 | |
| 62 | int idIndex(QString id); // index of id data -1 if not exists |
| 63 | |
| 64 | void clear(); |
| 65 | // void purge(); |
| 66 | |
| 67 | private: |
| 68 | QString m_name; |
| 69 | int m_number; |
| 70 | QVector<PresetData> m_data; |
| 71 | }; |
| 72 | |
| 73 | #endif // WIDGETPRESET_H |