5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef _CUSTOMFUNCTIONS_H_
22 #define _CUSTOMFUNCTIONS_H_
24 #include <QMediaPlayer>
25 #include "modeledit.h"
26 #include "eeprominterface.h"
28 class RawSwitchFilterItemModel
;
31 class RepeatComboBox
: public QComboBox
36 RepeatComboBox(QWidget
* parent
, int & repeatParam
);
43 void onIndexChanged(int);
49 class CustomFunctionsPanel
: public GenericPanel
54 CustomFunctionsPanel(QWidget
*parent
, ModelData
* mode
, GeneralSettings
& generalSettings
, Firmware
* firmware
);
55 ~CustomFunctionsPanel();
57 virtual void update();
60 CustomFunctionData
* functions
;
64 void customFunctionEdited();
65 void functionEdited();
66 void fsw_customContextMenuRequested(QPoint pos
);
67 void refreshCustomFunction(int index
, bool modified
=false);
68 void onChildModified();
70 void onMediaPlayerStateChanged(QMediaPlayer::State state
);
71 void onMediaPlayerError(QMediaPlayer::Error error
);
78 void populateFuncCB(QComboBox
*b
, unsigned int value
);
79 void populateGVmodeCB(QComboBox
*b
, unsigned int value
);
80 void populateFuncParamCB(QComboBox
*b
, uint function
, unsigned int value
, unsigned int adjustmode
=0);
81 RawSwitchFilterItemModel
* rawSwitchItemModel
;
82 QStandardItemModel
* rawSrcInputsItemModel
;
83 QStandardItemModel
* rawSrcAllItemModel
;
85 QSet
<QString
> tracksSet
;
86 QSet
<QString
> scriptsSet
;
87 int mediaPlayerCurrent
;
88 QComboBox
* fswtchSwtch
[CPN_MAX_SPECIAL_FUNCTIONS
];
89 QComboBox
* fswtchFunc
[CPN_MAX_SPECIAL_FUNCTIONS
];
90 QCheckBox
* fswtchParamGV
[CPN_MAX_SPECIAL_FUNCTIONS
];
91 QDoubleSpinBox
* fswtchParam
[CPN_MAX_SPECIAL_FUNCTIONS
];
92 TimerEdit
* fswtchParamTime
[CPN_MAX_SPECIAL_FUNCTIONS
];
93 QPushButton
* playBT
[CPN_MAX_SPECIAL_FUNCTIONS
];
94 QComboBox
* fswtchParamT
[CPN_MAX_SPECIAL_FUNCTIONS
];
95 QComboBox
* fswtchParamArmT
[CPN_MAX_SPECIAL_FUNCTIONS
];
96 QCheckBox
* fswtchEnable
[CPN_MAX_SPECIAL_FUNCTIONS
];
97 RepeatComboBox
* fswtchRepeat
[CPN_MAX_SPECIAL_FUNCTIONS
];
98 QComboBox
* fswtchGVmode
[CPN_MAX_SPECIAL_FUNCTIONS
];
99 QSlider
* fswtchBLcolor
[CPN_MAX_SPECIAL_FUNCTIONS
];
100 QMediaPlayer
* mediaPlayer
;
102 int selectedFunction
;
106 #endif // _CUSTOMFUNCTIONS_H_