author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 11 Jun 2010 13:38:32 +0300 | |
changeset 28 | 075425b8d9a4 |
parent 24 | 6df133bd92e1 |
child 32 | 189d20c34778 |
child 34 | bc10a61bd7d3 |
permissions | -rw-r--r-- |
24 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <xqserviceutil.h> |
|
20 |
||
21 |
// User includes |
|
22 |
#include "radiocontrolservice.h" |
|
23 |
#include "radiouiengine.h" |
|
24 |
#include "radioservicedef.h" |
|
25 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
26 |
// Constants |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
27 |
const int SERVICE_POWEROFF_DELAY = 5000; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
28 |
|
24 | 29 |
/*! |
30 |
* |
|
31 |
*/ |
|
32 |
RadioControlService::RadioControlService( RadioUiEngine& engine ) : |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
33 |
XQServiceProvider( RADIO_CONTROL_SERVICE, &engine ), |
24 | 34 |
mUiEngine( engine ) |
35 |
{ |
|
36 |
publishAll(); |
|
37 |
if ( XQServiceUtil::isService() ) { |
|
38 |
XQServiceUtil::toBackground( true ); |
|
39 |
} |
|
40 |
} |
|
41 |
||
42 |
/*! |
|
43 |
* |
|
44 |
*/ |
|
45 |
RadioControlService::~RadioControlService() |
|
46 |
{ |
|
47 |
} |
|
48 |
||
49 |
/*! |
|
50 |
* Public slot |
|
51 |
*/ |
|
52 |
void RadioControlService::command( int commandId ) |
|
53 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
54 |
//TODO: Uncomment when vendor id can be read from the client |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
55 |
// if ( requestInfo().clientVendorId() != NOKIA_VENDORID ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
56 |
// return; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
57 |
// } |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
58 |
|
24 | 59 |
switch ( commandId ) |
60 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
61 |
case RadioServiceCommand::PowerOn: |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
62 |
mUiEngine.setPowerOn(); |
24 | 63 |
break; |
64 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
65 |
case RadioServiceCommand::PowerOff: |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
66 |
mUiEngine.setPowerOff( SERVICE_POWEROFF_DELAY ); |
24 | 67 |
break; |
68 |
||
69 |
case RadioServiceCommand::Previous: |
|
70 |
mUiEngine.skipStation( StationSkip::PreviousFavorite ); |
|
71 |
break; |
|
72 |
||
73 |
case RadioServiceCommand::Next: |
|
74 |
mUiEngine.skipStation( StationSkip::NextFavorite ); |
|
75 |
break; |
|
76 |
||
77 |
case RadioServiceCommand::SeekUp: |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
78 |
mUiEngine.seekStation( Seek::Up ); |
24 | 79 |
break; |
80 |
||
81 |
case RadioServiceCommand::SeekDown: |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
82 |
mUiEngine.seekStation( Seek::Down ); |
24 | 83 |
break; |
84 |
||
85 |
case RadioServiceCommand::Foreground: |
|
86 |
XQServiceUtil::toBackground( false ); |
|
87 |
break; |
|
88 |
||
89 |
case RadioServiceCommand::Background: |
|
90 |
XQServiceUtil::toBackground( true ); |
|
91 |
break; |
|
92 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
93 |
case RadioServiceCommand::Mute: |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
94 |
mUiEngine.setMute( true ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
95 |
break; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
96 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
97 |
case RadioServiceCommand::UnMute: |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
98 |
mUiEngine.setMute( false ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
99 |
break; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
100 |
|
24 | 101 |
default: |
102 |
break; |
|
103 |
} |
|
104 |
} |