author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 09:49:03 +0300 | |
changeset 41 | 3a6b55c6390c |
parent 33 | 11b6825f0862 |
child 50 | c44f9bb56771 |
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 ) : |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
33 |
XQServiceProvider( RADIO_SERVICE +"."+ RADIO_CONTROL_SERVICE, &engine ), |
24 | 34 |
mUiEngine( engine ) |
35 |
{ |
|
36 |
publishAll(); |
|
37 |
} |
|
38 |
||
39 |
/*! |
|
40 |
* |
|
41 |
*/ |
|
42 |
RadioControlService::~RadioControlService() |
|
43 |
{ |
|
44 |
} |
|
45 |
||
46 |
/*! |
|
47 |
* Public slot |
|
48 |
*/ |
|
49 |
void RadioControlService::command( int commandId ) |
|
50 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
51 |
//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
|
52 |
// if ( requestInfo().clientVendorId() != NOKIA_VENDORID ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
53 |
// return; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
54 |
// } |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
55 |
|
24 | 56 |
switch ( commandId ) |
57 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
58 |
case RadioServiceCommand::PowerOn: |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
59 |
mUiEngine.setPowerOn(); |
24 | 60 |
break; |
61 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
62 |
case RadioServiceCommand::PowerOff: |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
63 |
mUiEngine.setPowerOff( SERVICE_POWEROFF_DELAY ); |
24 | 64 |
break; |
65 |
||
66 |
case RadioServiceCommand::Previous: |
|
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
67 |
mUiEngine.skipStation( StationSkip::PreviousFavorite, 0, TuneReason::SkipFromWidget ); |
24 | 68 |
break; |
69 |
||
70 |
case RadioServiceCommand::Next: |
|
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
71 |
mUiEngine.skipStation( StationSkip::NextFavorite, 0, TuneReason::SkipFromWidget ); |
24 | 72 |
break; |
73 |
||
74 |
case RadioServiceCommand::SeekUp: |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
75 |
mUiEngine.seekStation( Seek::Up ); |
24 | 76 |
break; |
77 |
||
78 |
case RadioServiceCommand::SeekDown: |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
79 |
mUiEngine.seekStation( Seek::Down ); |
24 | 80 |
break; |
81 |
||
82 |
case RadioServiceCommand::Foreground: |
|
83 |
XQServiceUtil::toBackground( false ); |
|
84 |
break; |
|
85 |
||
86 |
case RadioServiceCommand::Background: |
|
87 |
XQServiceUtil::toBackground( true ); |
|
88 |
break; |
|
89 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
90 |
case RadioServiceCommand::Mute: |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
91 |
mUiEngine.setMute( true ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
92 |
break; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
93 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
94 |
case RadioServiceCommand::UnMute: |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
95 |
mUiEngine.setMute( false ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
96 |
break; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
97 |
|
24 | 98 |
default: |
99 |
break; |
|
100 |
} |
|
101 |
} |