~mhall119/ubuntu-app-reviews/qtranscribe

« back to all changes in this revision

Viewing changes to Actions.hh

  • Committer: App Bot
  • Author(s): Matt Pharoah (Exüberance)
  • Date: 2012-07-09 20:14:22 UTC
  • Revision ID: appbot@holba.ch-20120709201422-cmbglasydwxlxelx
Tags: upstream-1.0
Import upstream version 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright © 2012 Matt Pharoah (mr.exuberant@gmail.com)
 
3
 *
 
4
 *  This program is free software: you can redistribute it and/or modify
 
5
 *  it under the terms of the GNU General Public License as published by
 
6
 *  the Free Software Foundation, either version 3 of the License, or
 
7
 *  (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *  GNU General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 *
 
17
 */
 
18
 
 
19
#ifndef ACTIONS_H_
 
20
#define ACTIONS_H_
 
21
 
 
22
enum Action {
 
23
        A_NOOP,
 
24
        A_PLAY,
 
25
        A_REWIND,
 
26
        A_FAST_FORWARD,
 
27
        A_SLOW_TOGGLE,
 
28
        A_SLOW_PLAY,
 
29
        A_BACK1,
 
30
        A_BACK5,
 
31
        A_BACK10
 
32
};
 
33
 
 
34
extern const short NUM_ACTIONS = 9;
 
35
 
 
36
Action ACTION_NUM(int num) {
 
37
        switch (num) {
 
38
                case 0: return A_NOOP;
 
39
                case 1: return A_PLAY;
 
40
                case 2: return A_REWIND;
 
41
                case 3: return A_FAST_FORWARD;
 
42
                case 4: return A_SLOW_TOGGLE;
 
43
                case 5: return A_SLOW_PLAY;
 
44
                case 6: return A_BACK1;
 
45
                case 7: return A_BACK5;
 
46
                case 8: return A_BACK10;
 
47
                default: return A_NOOP;
 
48
        }
 
49
}
 
50
 
 
51
const char *ACTION_STRING(Action a) {
 
52
        switch (a) {
 
53
                case A_NOOP: return "(nothing)";
 
54
                case A_PLAY: return "PLAY";
 
55
                case A_REWIND: return "REWIND";
 
56
                case A_FAST_FORWARD: return "FAST FORWARD";
 
57
                case A_SLOW_TOGGLE: return "SLOW (TOGGLE)";
 
58
                case A_SLOW_PLAY: return "SLOW (HOLD)";
 
59
                case A_BACK1: return "BACK 1 SECS";
 
60
                case A_BACK5: return "BACK 5 SECS";
 
61
                case A_BACK10: return "BACK 10 SECS";
 
62
                default: return "(error)";
 
63
        }
 
64
}
 
65
 
 
66
 
 
67
#endif /* ACTIONS_H_ */