summaryrefslogtreecommitdiff
path: root/uisimulator/buttonmap/iriver-h100_h300.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/buttonmap/iriver-h100_h300.c')
-rw-r--r--uisimulator/buttonmap/iriver-h100_h300.c124
1 files changed, 124 insertions, 0 deletions
diff --git a/uisimulator/buttonmap/iriver-h100_h300.c b/uisimulator/buttonmap/iriver-h100_h300.c
new file mode 100644
index 0000000000..5e4ad3bafc
--- /dev/null
+++ b/uisimulator/buttonmap/iriver-h100_h300.c
@@ -0,0 +1,124 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Dan Everton
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <SDL.h>
23#include "config.h"
24#include "button.h"
25#include "buttonmap.h"
26
27int key_to_button(int keyboard_button)
28{
29 int new_btn = BUTTON_NONE;
30 switch (keyboard_button)
31 {
32 case SDLK_t:
33 if(pressed)
34 switch(_remote_type)
35 {
36 case REMOTETYPE_UNPLUGGED:
37 _remote_type=REMOTETYPE_H100_LCD;
38 DEBUGF("Changed remote type to H100\n");
39 break;
40 case REMOTETYPE_H100_LCD:
41 _remote_type=REMOTETYPE_H300_LCD;
42 DEBUGF("Changed remote type to H300\n");
43 break;
44 case REMOTETYPE_H300_LCD:
45 _remote_type=REMOTETYPE_H300_NONLCD;
46 DEBUGF("Changed remote type to H300 NON-LCD\n");
47 break;
48 case REMOTETYPE_H300_NONLCD:
49 _remote_type=REMOTETYPE_UNPLUGGED;
50 DEBUGF("Changed remote type to none\n");
51 break;
52 }
53 break;
54 case SDLK_KP4:
55 case SDLK_LEFT:
56 new_btn = BUTTON_LEFT;
57 break;
58 case SDLK_KP6:
59 case SDLK_RIGHT:
60 new_btn = BUTTON_RIGHT;
61 break;
62 case SDLK_KP8:
63 case SDLK_UP:
64 new_btn = BUTTON_UP;
65 break;
66 case SDLK_KP2:
67 case SDLK_DOWN:
68 new_btn = BUTTON_DOWN;
69 break;
70 case SDLK_KP_PLUS:
71 case SDLK_F8:
72 new_btn = BUTTON_ON;
73 break;
74 case SDLK_KP_ENTER:
75 case SDLK_RETURN:
76 case SDLK_a:
77 new_btn = BUTTON_OFF;
78 break;
79 case SDLK_KP_DIVIDE:
80 case SDLK_F1:
81 new_btn = BUTTON_REC;
82 break;
83 case SDLK_KP5:
84 case SDLK_SPACE:
85 new_btn = BUTTON_SELECT;
86 break;
87 case SDLK_KP_PERIOD:
88 case SDLK_INSERT:
89 new_btn = BUTTON_MODE;
90 break;
91 }
92 return new_btn;
93}
94
95struct button_map bm[] = {
96#if defined (IRIVER_H120) || defined (IRIVER_H100)
97 { SDLK_KP_DIVIDE, 46, 162, 13, "Record" },
98 { SDLK_KP_PLUS, 327, 36, 16, "Play" },
99 { SDLK_KP_ENTER, 330, 99, 18, "Stop" },
100 { SDLK_KP_PERIOD, 330, 163, 18, "AB" },
101 { SDLK_KP5, 186, 227, 27, "5" },
102 { SDLK_KP8, 187, 185, 19, "8" },
103 { SDLK_KP4, 142, 229, 23, "4" },
104 { SDLK_KP6, 231, 229, 22, "6" },
105 { SDLK_KP2, 189, 272, 28, "2" },
106/* Remote Buttons */
107 { SDLK_KP_ENTER, 250, 404, 20, "Stop" },
108 { SDLK_SPACE, 285, 439, 29, "Space" },
109 { SDLK_h, 336, 291, 24, "Hold" },
110#elif defined (IRIVER_H300)
111 { SDLK_KP_PLUS, 56, 335, 20, "Play" },
112 { SDLK_KP8, 140, 304, 29, "Up" },
113 { SDLK_KP_DIVIDE, 233, 331, 23, "Record" },
114 { SDLK_KP_ENTER, 54, 381, 24, "Stop" },
115 { SDLK_KP4, 100, 353, 17, "Left" },
116 { SDLK_KP5, 140, 351, 19, "Navi" },
117 { SDLK_KP6, 185, 356, 19, "Right" },
118 { SDLK_KP_PERIOD, 230, 380, 20, "AB" },
119 { SDLK_KP2, 142, 402, 24, "Down" },
120 { SDLK_KP_ENTER, 211, 479, 21, "Stop" },
121 { SDLK_KP_PLUS, 248, 513, 29, "Play" },
122#endif
123 { 0, 0, 0, 0, "None" }
124};