|
1 /* |
|
2 * Copyright (c) 2005 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 package com.nokia.amms; |
|
19 |
|
20 import javax.microedition.amms.EffectModule; |
|
21 import javax.microedition.media.Control; |
|
22 |
|
23 /** |
|
24 * EffectModuleImpl provides functionality defined in EffectModule. |
|
25 * This class is used through EffectModule interface which implements the |
|
26 * Module interface and does not define any new methods. Methods defined in |
|
27 * Module are implemented in ModuleBase class. |
|
28 * Can be accessed only from com.nokia.amms package. |
|
29 */ |
|
30 class EffectModuleImpl extends ModuleBase |
|
31 implements EffectModule |
|
32 { |
|
33 /** |
|
34 * Constructs new EffectModuleImpl instance. |
|
35 * Package private. |
|
36 * @param aEventSourceHandle Handle to event source. |
|
37 * @param aNativeHandle Handle to corresponding native object. |
|
38 * @param aManagerHandle Handle to native global manager. |
|
39 */ |
|
40 EffectModuleImpl(int aEventSourceHandle, |
|
41 int aNativeHandle, |
|
42 int aManagerHandle) |
|
43 { |
|
44 super(aEventSourceHandle, |
|
45 aNativeHandle, |
|
46 aManagerHandle); |
|
47 } |
|
48 |
|
49 /** |
|
50 * Obtain the object that implements the specified Control interface. |
|
51 * |
|
52 * @see javax.microedition.media.Controllable |
|
53 * @param aControlType the class name of the Control. The class name should |
|
54 * be given either as the fully-qualified name of the class; or if the |
|
55 * package of the class is not given, the package |
|
56 * javax.microedition.media.control is assumed. |
|
57 * @return the object that implements the control, or null if no objects |
|
58 * implement the control or if there is no players in the module. |
|
59 */ |
|
60 public Control getControl(String aControlType) |
|
61 { |
|
62 if (iPlayers.size() > 0) |
|
63 { |
|
64 // Delegate to ControlContainer |
|
65 return iControls.getControl(aControlType); |
|
66 } |
|
67 // An EffectModule, that has no Players attached to it, does not |
|
68 // provide any Controls. |
|
69 else |
|
70 { |
|
71 return null; |
|
72 } |
|
73 } |
|
74 |
|
75 /** |
|
76 * Obtain the collection of Controls. |
|
77 * |
|
78 * @see javax.microedition.media.Controllable |
|
79 * @return the collection of Control objects or a zero length array if |
|
80 * there is no controls or players in the module. |
|
81 */ |
|
82 public Control[] getControls() |
|
83 { |
|
84 if (iPlayers.size() > 0) |
|
85 { |
|
86 // Delegate to ControlContainer |
|
87 return iControls.getControls(); |
|
88 } |
|
89 // An EffectModule, that has no Players attached to it, does not |
|
90 // provide any Controls. |
|
91 else |
|
92 { |
|
93 return new Control[ 0 ]; |
|
94 } |
|
95 |
|
96 |
|
97 } |
|
98 } |