-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetupHandler.h
55 lines (47 loc) · 1.89 KB
/
SetupHandler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* SetupHandler.h
*
* Created: 4/29/2014 11:38:34 AM
* Author: Ketil Wright
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "MessageHandler.h"
#include "Sketch.h"
class SetupHandler : public IMessageHandler
{
int32_t m_driveAmount;
int32_t m_numFrames;
int32_t m_frameDelaySeconds;
bool m_restoreFocus;
void updateDriveAmountUI(int change = 0);
void updateFramesUI(int change = 0);
void updateFrameDelayUI(int change = 0);
void updateRestoreFocusUI(int change = 0);
void advanceCaret(uint8_t dir); // -1 = left, 1 right. All other values ignored
public:
SetupHandler(MessagePump *_pump, uint32_t driveAmount, uint32_t frames);
uint32_t getDriveAmount() const { return m_driveAmount;}
void setDriveAmount(uint32_t driveAmount) { m_driveAmount = driveAmount;}
uint32_t getNumFrames() const { return m_numFrames; }
void setNumFrames(uint32_t numFrames) { m_numFrames = numFrames;}
uint32_t getFrameDelayMilliseconds() const { return m_frameDelaySeconds * 1000; }
void setFrameDelaySeconds(uint32_t delay) { m_frameDelaySeconds = delay; }
bool getRestoreFocus() const { return m_restoreFocus; }
void setRestoreFocus(bool restore) { m_restoreFocus = restore; }
~SetupHandler();
MsgResp processMessage(Msg& msg);
virtual void show();
};