2 Copyright 2004-2005 Chris Tallon
\r
4 This file is part of VOMP.
\r
6 VOMP is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2 of the License, or
\r
9 (at your option) any later version.
\r
11 VOMP is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with VOMP; if not, write to the Free Software
\r
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
21 #include "remotewin.h"
\r
22 #include "vompreswin.h"
\r
25 RemoteWin::RemoteWin()
\r
32 RemoteWin::~RemoteWin()
\r
36 int RemoteWin::init(char* devName)
\r
38 if (initted) return 0;
\r
40 event = CreateEvent(NULL,/*FALSE*/TRUE,FALSE,NULL);
\r
46 int RemoteWin::shutdown()
\r
48 if (!initted) return 0;
\r
54 UCHAR RemoteWin::getButtonPress(int waitType)
\r
57 how = 1 - start new wait
\r
58 how = 2 - continue wait
\r
63 if (curevent!=NA_NONE) {
\r
64 UCHAR temp=curevent;
\r
73 } else { //We do not distingish between 2 and 3
\r
77 WaitForSingleObject(event,wait);
\r
79 if (curevent==NA_NONE) {
\r
82 return NA_SIGNAL; //Since we have no signals on windows, we simulate this
\r
87 UCHAR temp2=curevent;
\r
93 void RemoteWin::clearBuffer()
\r
97 int RemoteWin::ReceiveButtonVK(UINT button) {
\r
99 //should we use a translation table ? No APPCOMMAND iS DWORD!
\r
100 switch (button) { //Processing VK_Messages
\r
144 case 'J'://j for JUMP TO instead of go to
\r
162 }; //All other commands are process via APPCOMMAND_MESSAGES
\r
163 if (pb==NA_NONE) return 0;
\r
165 //PulseEvent(event);
\r
170 int RemoteWin::ReceiveButtonAP(UINT button) {
\r
172 //should we use a translation table ? No APPCOMMAND iS DWORD!
\r
173 switch (button) { //Processing VK_Messages
\r
174 case APPCOMMAND_MEDIA_CHANNEL_DOWN:
\r
175 pb=CHANNELDOWN;break;
\r
176 case APPCOMMAND_MEDIA_CHANNEL_UP:
\r
177 pb=CHANNELUP;break;
\r
178 case APPCOMMAND_MEDIA_FAST_FORWARD:
\r
180 case APPCOMMAND_VOLUME_MUTE:
\r
182 case APPCOMMAND_MEDIA_PAUSE:
\r
184 case APPCOMMAND_MEDIA_PLAY:
\r
186 case APPCOMMAND_MEDIA_RECORD:
\r
188 case APPCOMMAND_MEDIA_PREVIOUSTRACK:
\r
190 case APPCOMMAND_MEDIA_REWIND:
\r
192 case APPCOMMAND_MEDIA_NEXTTRACK:
\r
193 pb=SKIPFORWARD;break;
\r
194 case APPCOMMAND_MEDIA_STOP:
\r
196 case APPCOMMAND_VOLUME_DOWN:
\r
197 pb=VOLUMEDOWN;break;
\r
198 case APPCOMMAND_VOLUME_UP:
\r
201 if (pb==NA_NONE) return 0;
\r
203 //PulseEvent(event);
\r
208 void RemoteWin::Signal() {
\r
210 //PulseEvent(event);
\r
214 void RemoteWin::SendPower()
\r