Merge branch 'devel/master' into sandbox/dkdk/tizen
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / feedback-player.cpp
1 /*
2  * Copyright (c) 2020 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/feedback-player.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/haptics/common/feedback-player-impl.h>
23
24 namespace Dali
25 {
26 FeedbackPlayer::FeedbackPlayer()
27 {
28 }
29
30 FeedbackPlayer FeedbackPlayer::Get()
31 {
32   return Internal::Adaptor::FeedbackPlayer::Get();
33 }
34
35 FeedbackPlayer::~FeedbackPlayer()
36 {
37 }
38
39 void FeedbackPlayer::PlayMonotone(unsigned int duration)
40 {
41   GetImplementation(*this).PlayMonotone(duration);
42 }
43
44 void FeedbackPlayer::PlayFile(const std::string filePath)
45 {
46   GetImplementation(*this).PlayFile(filePath);
47 }
48
49 void FeedbackPlayer::Stop()
50 {
51   GetImplementation(*this).Stop();
52 }
53
54 int FeedbackPlayer::PlaySound(const std::string& fileName)
55 {
56   return GetImplementation(*this).PlaySound(fileName);
57 }
58
59 void FeedbackPlayer::StopSound(int handle)
60 {
61   GetImplementation(*this).StopSound(handle);
62 }
63
64 void FeedbackPlayer::PlayFeedbackPattern(int type, int pattern)
65 {
66   GetImplementation(*this).PlayFeedbackPattern(type, pattern);
67 }
68
69 bool FeedbackPlayer::LoadFile(const std::string& filename, std::string& data)
70 {
71   return GetImplementation(*this).LoadFile(filename, data);
72 }
73
74 FeedbackPlayer::FeedbackPlayer(Internal::Adaptor::FeedbackPlayer* player)
75 : BaseHandle(player)
76 {
77 }
78
79 } // namespace Dali