/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/analogue_clock.h

  • Committer: Tim Marston
  • Date: 2012-03-21 19:37:33 UTC
  • Revision ID: tim@ed.am-20120321193733-29euxt0t0h9dwsj3
added .dep directories to bzrignore

Show diffs side-by-side

added added

removed removed

1
1
/*
2
 
 * analogue_clock_mode.h
 
2
 * analogue_clock.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 _ANALOGUE_CLOCK_MODE_H_
24
 
#define _ANALOGUE_CLOCK_MODE_H_
25
 
 
26
 
 
27
 
#include "minor_mode.h"
28
 
 
29
 
 
30
 
class AnalogueClockMode
31
 
    :
32
 
    public MinorMode
33
 
{
34
 
public:
35
 
 
36
 
        AnalogueClockMode();
37
 
 
38
 
        /**
39
 
         * Draw an individual segment (column of pixels)
40
 
         *
41
 
         * @param segment the segment number
42
 
         */
43
 
        void draw( int segment );
44
 
 
45
 
        /**
46
 
         * Called before the first segment is drawn, once per "frame".
47
 
         */
48
 
        void draw_reset();
49
 
 
50
 
private:
51
 
 
52
 
        /** the segment that the hour hand should be at */
53
 
        int _hour_segment;
54
 
 
55
 
        /** the segment that the minute hand should be at */
56
 
        int _minute_segment;
57
 
 
58
 
        /** the segment that the second hand should be at */
59
 
        int _second_segment;
60
 
 
61
 
};
62
 
 
63
 
 
64
 
#endif //_ANALOGUE_CLOCK_MODE_H_
 
23
#ifndef _ANALOGUE_CLOCK_H_
 
24
#define _ANALOGUE_CLOCK_H_
 
25
 
 
26
 
 
27
/**
 
28
 * Called to inform the mode that there has been a (short) button press.
 
29
 */
 
30
extern void analogue_clock_press();
 
31
 
 
32
/**
 
33
 * Draw an individual segment (column of pixels)
 
34
 *
 
35
 * @param segment the segment number
 
36
 */
 
37
extern void analogue_clock_draw( int segment );
 
38
 
 
39
/**
 
40
 * Called before the first segment is drawn, once per "frame".
 
41
 */
 
42
extern void analogue_clock_draw_reset();
 
43
 
 
44
/**
 
45
 * Called when this minor mode becomes active
 
46
 */
 
47
extern void analogue_clock_activate();
 
48
 
 
49
 
 
50
#endif //_ANALOGUE_CLOCK_H_