/elec/propeller-clock

To get this branch, use:
bzr branch http://bzr.ed.am/elec/propeller-clock

« back to all changes in this revision

Viewing changes to src/mode_switcher.h

  • Committer: edam
  • Date: 2012-02-25 14:54:33 UTC
  • Revision ID: edam@waxworlds.org-20120225145433-kih8qs45x05cum46
removed Bounce library and updated/fixed new code

Show diffs side-by-side

added added

removed removed

1
1
/*
2
 
 * switcher_major_mode.h
 
2
 * mode_switcher.h
3
3
 *
4
4
 * Copyright (C) 2011 Tim Marston <tim@ed.am> and Dan Marston.
5
5
 *
20
20
 * You should have received a copy of the GNU Lesser General Public License
21
21
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
22
 */
23
 
#ifndef _SWITCHER_MAJOR_MODE_H_
24
 
#define _SWITCHER_MAJOR_MODE_H_
 
23
#ifndef _MODE_SWITCHER_H_
 
24
#define _MODE_SWITCHER_H_
25
25
 
26
26
 
27
27
#include "major_mode.h"
28
 
 
29
 
 
30
 
#define MAX_MINOR_MODES 5
 
28
#include <vector>
31
29
 
32
30
 
33
31
class MinorMode;
34
32
class Drawer;
35
33
 
36
34
 
37
 
class SwitcherMajorMode : public MajorMode
 
35
class ModeSwitcher
 
36
    :
 
37
    public MajorMode
38
38
{
39
39
public:
40
40
 
41
 
        SwitcherMajorMode();
 
41
        ModeSwitcher();
42
42
 
43
43
        /**
44
44
         * Called to inform the major mode that there has been a short press.
45
45
         */
46
 
        void press();
 
46
        void short_press();
47
47
 
48
48
        /**
49
49
         * Called to inform the major mode that there has been a long press.
65
65
private:
66
66
 
67
67
        /* minor modes that this mode switcher switches */
68
 
        MinorMode *_modes[ MAX_MINOR_MODES ];
 
68
        std::vector< MinorMode * > _modes;
69
69
 
70
70
        /* current mode */
71
71
        int _mode;
73
73
};
74
74
 
75
75
 
76
 
#endif //_SWITCHER_MAJOR_MODE_H_
 
76
#endif //_MODE_SWITCHER_H_