2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #ifndef WRTDEVICEAPIS_MMPLAYER_IMANAGER_H_
17 #define WRTDEVICEAPIS_MMPLAYER_IMANAGER_H_
19 #include <dpl/noncopyable.h>
20 #include <MMPlayer/EventOpen.h>
21 #include <MMPlayer/EventPlay.h>
22 #include <MMPlayer/EventPause.h>
23 #include <MMPlayer/EventResume.h>
24 #include <MMPlayer/EventStop.h>
25 #include <MMPlayer/EventIsPlaying.h>
26 #include <MMPlayer/EventSetWindow.h>
27 #include <MMPlayer/EventGetVolume.h>
29 namespace WrtDeviceApis {
34 public Commons::EventRequestReceiver<EventOpen>,
35 public Commons::EventRequestReceiver<EventPlay>,
36 public Commons::EventRequestReceiver<EventPause>,
37 public Commons::EventRequestReceiver<EventResume>,
38 public Commons::EventRequestReceiver<EventStop>,
39 public Commons::EventRequestReceiver<EventIsPlaying>,
40 public Commons::EventRequestReceiver<EventSetWindow>,
41 public Commons::EventRequestReceiver<EventGetVolume>
44 static IManager &getInstance();
49 * @param event @see WrtDeviceApis::Api::MMPlayer::EventOpen.
50 * @exception Commons::PlatformException when platform error occurs
52 virtual void openFile(const EventOpenPtr& event) = 0;
54 * Plays current file. If file is already playing player starts from the beginning
55 * @param event @see WrtDeviceApis::Api::MMPlayer::EventPlay.
56 * @exception Commons::PlatformException when platform error occurs
58 virtual void play(const EventPlayPtr& event) = 0;
60 * Pauses current playing file. If no file is currently playing noting happens
61 * @param event @see WrtDeviceApis::Api::MMPlayer::EventPause.
62 * @exception Commons::PlatformException when platform error occurs
63 * @exception Commons::InvalidArgumentException when fileName is empty
65 virtual void pause(const EventPausePtr& event) = 0;
67 * Resumes after pause. If file is not paused nothing happens
68 * @param event @see WrtDeviceApis::Api::MMPlayer::EventResume.
69 * @exception Commons::PlatformException when platform error occurs
71 virtual void resume(const EventResumePtr& event) = 0;
73 * Stops current playing file. If file is not playing nothing happens
74 * @param event @see WrtDeviceApis::Api::MMPlayer::EventStop.
75 * @exception Commons::PlatformException when platform error occurs
77 virtual void stop(const EventStopPtr& event) = 0;
79 * Sets window for video files
80 * @param event @see WrtDeviceApis::Api::MMPlayer::EventSetWindow.
81 * @exception Commons::PlatformException when platform error occurs
83 virtual void setWindow(const EventSetWindowPtr& event) = 0;
85 * Returns current playing state
86 * @param event @see WrtDeviceApis::Api::MMPlayer::EventIsPlaying.
87 * @return True if player is in playing state
88 * @exception Commons::PlatformException when platform error occurs
90 virtual void isPlaying(const EventIsPlayingPtr& event) = 0;
92 * Returns current playing state
93 * @param [out] event @see WrtDeviceApis::Api::MMPlayer::EventIsPlaying.
94 * @exception Commons::PlatformException when platform error occurs
96 virtual void getVolume(const EventGetVolumePtr& event) = 0;
101 virtual void OnRequestReceived(const EventOpenPtr& event) = 0;
102 virtual void OnRequestReceived(const EventPlayPtr& event) = 0;
103 virtual void OnRequestReceived(const EventPausePtr& event) = 0;
104 virtual void OnRequestReceived(const EventResumePtr& event) = 0;
105 virtual void OnRequestReceived(const EventStopPtr& event) = 0;
106 virtual void OnRequestReceived(const EventIsPlayingPtr& event) = 0;
107 virtual void OnRequestReceived(const EventSetWindowPtr& event) = 0;
108 virtual void OnRequestReceived(const EventGetVolumePtr& event) = 0;
114 #endif // WRTDEVICEAPIS_MMPLAYER_IMANAGER_H_