|
1 /* |
|
2 * Copyright (c) 2007,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: Constants used in upnprenderingstatemachine |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_UPNPRENDERINGSTATEMACHINECONSTANTS_H |
|
19 #define C_UPNPRENDERINGSTATEMACHINECONSTANTS_H |
|
20 |
|
21 /** |
|
22 * Constants enumerations for the Upnp API |
|
23 * especially those needed in the rendering engine part. |
|
24 */ |
|
25 namespace Upnp |
|
26 { |
|
27 |
|
28 /** |
|
29 * Commands |
|
30 */ |
|
31 enum TCommand |
|
32 { |
|
33 ENone = 0x0000, // no command |
|
34 ESync = 0x0001, // get in sync with the renderer |
|
35 EPlay = 0x0002, // requests to start playing |
|
36 // (in RenderingStateMachine aMedia indicates the media to play) |
|
37 EStop = 0x0004, // requests to stop playback (fast to play again) |
|
38 EClose = 0x0008, // requests to close playback (a permanent stop) |
|
39 EPause = 0x0010, // request to pause |
|
40 EResume = 0x0020, // request to resume from pause |
|
41 ERestart = 0x0040, // start track from beginning |
|
42 ECalibrate= 0x0080, // request to calibrate the position counter from |
|
43 // renderer |
|
44 ESeek = 0x0100, // seek (aParameter = position in ms) |
|
45 ENext = 0x0200, // skip to next track |
|
46 EPrev = 0x0400, // skip to previous track |
|
47 EBack = 0x0800, // skip to previous track, or track start if |
|
48 // current position is less than 3 seconds |
|
49 EJump = 0x1000, // Start playing given track |
|
50 // (aParameter = track index) |
|
51 ESetUri = 0x2000 // set uri |
|
52 }; |
|
53 |
|
54 /** |
|
55 * Properties |
|
56 */ |
|
57 enum TProperty |
|
58 { |
|
59 EVolume = 0x01, // the volume property |
|
60 EMute = 0x02, // the mute property |
|
61 EMediaDuration = 0x04, // current track duration (ms) - read only |
|
62 EPosition = 0x08, // current track position (ms) - see ESeek command |
|
63 EOptions = 0x10, // rendering options (see TRenderingOptions) |
|
64 ECurrentIndex = 0x20, // Index of item currently playing. |
|
65 // Note: can only be set when NOT playing. |
|
66 // Note2: changes in the value are reported via |
|
67 // CurrentIndexChanged() |
|
68 ECurrentState = 0x40 // the state of the engine (TState) - read only |
|
69 }; |
|
70 |
|
71 /** |
|
72 * Generic rendering state |
|
73 */ |
|
74 enum TState |
|
75 { |
|
76 EOffSync = 0x0001, // not synchronised with renderer yet |
|
77 EBusy = 0x0010, // renderer is busy doing something else |
|
78 EDead = 0x0020, // unrecoverable error state |
|
79 EStopped = 0x0100, // renderer is idle |
|
80 EBuffering = 0x1000, // media playback is being started in the |
|
81 // renderer |
|
82 EPlaying = 0x2000, // renderer is playing media |
|
83 EPaused = 0x4000, // renderer is in pause state |
|
84 // -------- masks --------- |
|
85 EStateMaskInSync = 0xFFF0, // any state where synchronised to |
|
86 // renderer |
|
87 EStateMaskActive = 0xFF00, // any state where can be used |
|
88 EStateMaskRendering = 0XF000, // any state where some kind of output |
|
89 // is going on |
|
90 }; |
|
91 |
|
92 /** |
|
93 * extra information in RenderingStateMachine provided with state indicates |
|
94 * reason for state transition |
|
95 */ |
|
96 enum TStateInfo |
|
97 { |
|
98 ENoMedia = 0, |
|
99 // no media initialised (typically the initial state) |
|
100 EStopRequested = 1, |
|
101 // stop was requested (by this engine or by external party) |
|
102 ETrackCompleted = 2, |
|
103 // track was fully completed |
|
104 EPositionChanged = 3 |
|
105 }; |
|
106 |
|
107 /** |
|
108 * Mode in which the position is changing. |
|
109 * This includes information of trick modes. |
|
110 * this type is internal to rendering engine |
|
111 */ |
|
112 enum TPositionMode |
|
113 { |
|
114 EPlayingNormally = 0, |
|
115 // playback is going on normally |
|
116 ESeekingForward = 1, |
|
117 // fast seeking forward. New position will be ackowledged soon. |
|
118 ESeekingBackward = 2, |
|
119 // fast seeking backward New position will be ackowledged soon. |
|
120 EBufferingData = 3, |
|
121 // renderer is buffering data. Will return to PlayingNormally |
|
122 // soon. |
|
123 }; |
|
124 |
|
125 /** |
|
126 * Rendering options. Use this to optimise the engine to your |
|
127 * specific needs. |
|
128 * this type is internal to rendering engine. |
|
129 * |
|
130 * NOTE: instructions for flag use on the rendering engine API: |
|
131 * to turn on a flag: |
|
132 * engine->SetPropertyL( Upnp::EOptions, |
|
133 * engine->Property( Upnp::EOptions ) | EFlag ); |
|
134 * to turn off a flag: |
|
135 * engine->SetPropertyL( Upnp::EOptions, |
|
136 * engine->Property( Upnp::EOptions ) & ~EFlag ); |
|
137 */ |
|
138 enum TRenderingOptions |
|
139 { |
|
140 EPlaylistMode = 0x0001, |
|
141 // play content in playlist mode, progress automatically. |
|
142 // for images this means a timed slideshow. |
|
143 // if flag disabled, only manual skip is supported. |
|
144 // (this flag is on by default) |
|
145 EAutoCalibratePosition = 0x0002, |
|
146 // calibrate and update track position automatically. |
|
147 // If position changed, sends PropertyChanged callback. |
|
148 // (this flag is on by default) |
|
149 EVolumeSupport = 0x0004, |
|
150 // request support for volume in the renderer |
|
151 // Clear this flag to disable all volume usage and avoid one |
|
152 // unnecessary network operation. Clearing the flag would be |
|
153 // only useful if you only have pure image source. |
|
154 // (this flag is on by default) |
|
155 ESafetyTimer = 0x0008, |
|
156 // attaches a safety timer for all skip commands |
|
157 // (next,prev,back,jump) so that client can safely call them |
|
158 // directly from UI as often as required. Commands are only |
|
159 // executed after the safety period. having a burst of 10 |
|
160 // "Next" commands will be converted internally to a |
|
161 // single "Jump(current+10)" operation. |
|
162 EConvertVolumeZeroToMute = 0x0100, |
|
163 // convert client VOLUME 0 request to MUTE and back |
|
164 // (this flag is on by default) |
|
165 }; |
|
166 } |
|
167 |
|
168 #endif // C_UPNPRENDERINGSTATEMACHINECONSTANTS_H |
|
169 |