Revert "[Tizen] Add DALi Autofill implementation"
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / video-player.cpp
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/devel-api/adaptor-framework/video-player.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/any.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/internal/video/common/video-player-impl.h>
26
27 namespace Dali
28 {
29
30 VideoPlayer::VideoPlayer()
31 {
32 }
33
34 VideoPlayer::VideoPlayer( Internal::Adaptor::VideoPlayer* internal )
35 : BaseHandle( internal )
36 {
37 }
38
39 VideoPlayer::~VideoPlayer()
40 {
41 }
42
43 VideoPlayer VideoPlayer::New()
44 {
45   Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
46
47   if( player )
48   {
49     Dali::Actor actor;
50     player->Initialize( actor, VideoSyncMode::DISABLED );
51   }
52
53   return VideoPlayer( player.Get() );
54 }
55
56 VideoPlayer VideoPlayer::New( Dali::Actor actor, VideoSyncMode syncMode )
57 {
58   Internal::Adaptor::VideoPlayerPtr player = Internal::Adaptor::VideoPlayer::New();
59
60   if( player )
61   {
62     player->Initialize( actor, syncMode );
63   }
64
65   return VideoPlayer( player.Get() );
66 }
67
68 VideoPlayer::VideoPlayer( const VideoPlayer& player )
69 : BaseHandle( player )
70 {
71 }
72
73 VideoPlayer& VideoPlayer::operator=( const VideoPlayer& player )
74 {
75   if( *this != player )
76   {
77     BaseHandle::operator=( player );
78   }
79   return *this;
80 }
81
82 VideoPlayer VideoPlayer::DownCast( BaseHandle handle )
83 {
84   return VideoPlayer( dynamic_cast< Internal::Adaptor::VideoPlayer* >( handle.GetObjectPtr() ) );
85 }
86
87 void VideoPlayer::SetUrl( const std::string& url )
88 {
89   GetImplementation( *this ).SetUrl( url );
90 }
91
92 std::string VideoPlayer::GetUrl()
93 {
94   return GetImplementation( *this ).GetUrl();
95 }
96
97 void VideoPlayer::SetLooping(bool looping)
98 {
99   GetImplementation( *this ).SetLooping( looping );
100 }
101
102 bool VideoPlayer::IsLooping()
103 {
104   return GetImplementation( *this ).IsLooping();
105 }
106
107 void VideoPlayer::Play()
108 {
109   GetImplementation( *this ).Play();
110 }
111
112 void VideoPlayer::Pause()
113 {
114   GetImplementation( *this ).Pause();
115 }
116
117 void VideoPlayer::Stop()
118 {
119   GetImplementation( *this ).Stop();
120 }
121
122 void VideoPlayer::SetMute( bool mute )
123 {
124   GetImplementation( *this ).SetMute( mute );
125 }
126
127 bool VideoPlayer::IsMuted()
128 {
129   return GetImplementation( *this ).IsMuted();
130 }
131
132 void VideoPlayer::SetVolume( float left, float right )
133 {
134   GetImplementation( *this ).SetVolume( left, right );
135 }
136
137 void VideoPlayer::GetVolume( float& left, float& right )
138 {
139   GetImplementation( *this ).GetVolume( left, right );
140 }
141
142 void VideoPlayer::SetRenderingTarget( Any target )
143 {
144   GetImplementation( *this ).SetRenderingTarget( target );
145 }
146
147 void VideoPlayer::SetPlayPosition( int millisecond )
148 {
149   GetImplementation( *this ).SetPlayPosition( millisecond );
150 }
151
152 int VideoPlayer::GetPlayPosition()
153 {
154   return GetImplementation( *this ).GetPlayPosition();
155 }
156
157 void VideoPlayer::SetDisplayArea( DisplayArea area )
158 {
159   GetImplementation( *this ).SetDisplayArea( area );
160 }
161
162 void VideoPlayer::SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation )
163 {
164   GetImplementation( *this ).SetDisplayRotation( rotation );
165 }
166
167 Dali::VideoPlayerPlugin::DisplayRotation VideoPlayer::GetDisplayRotation()
168 {
169   return GetImplementation( *this ).GetDisplayRotation();
170 }
171
172 Dali::VideoPlayerPlugin::VideoPlayerSignalType& VideoPlayer::FinishedSignal()
173 {
174   return GetImplementation( *this ).FinishedSignal();
175 }
176
177 void VideoPlayer::Forward( int millisecond )
178 {
179   GetImplementation( *this ).Forward( millisecond );
180 }
181
182 void VideoPlayer::Backward( int millisecond )
183 {
184   GetImplementation( *this ).Backward( millisecond );
185 }
186
187 bool VideoPlayer::IsVideoTextureSupported()
188 {
189   return GetImplementation( *this ).IsVideoTextureSupported();
190 }
191
192 void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
193 {
194   GetImplementation( *this ).SetCodecType( type );
195 }
196
197 Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
198 {
199   return GetImplementation( *this ).GetCodecType();
200 }
201
202 void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
203 {
204   GetImplementation( *this ).SetDisplayMode( mode );
205 }
206
207 Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
208 {
209   return GetImplementation( *this ).GetDisplayMode();
210 }
211
212 Any VideoPlayer::GetMediaPlayer()
213 {
214   return GetImplementation( *this ).GetMediaPlayer();
215 }
216
217 void VideoPlayer::StartSynchronization()
218 {
219   GetImplementation( *this ).StartSynchronization();
220 }
221
222 void VideoPlayer::FinishSynchronization()
223 {
224   GetImplementation( *this ).FinishSynchronization();
225 }
226
227 } // namespace Dali;
228