Dali 3D User Interface Engine
feedback-player-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_FEEDBACK_PLAYER_H__
2 #define __DALI_INTERNAL_FEEDBACK_PLAYER_H__
3 
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
21 // EXTERNAL INCLUDES
22 #include <string>
24 
25 // INTERNAL INCLUDES
26 #include <feedback-player.h>
28 
29 namespace Dali
30 {
31 
32 namespace Internal
33 {
34 
35 namespace Adaptor
36 {
37 
38 class FeedbackPluginProxy;
39 
44 {
45 
46 public:
47 
53  static Dali::FeedbackPlayer New();
54 
59  static Dali::FeedbackPlayer Get();
60 
64  void PlayMonotone(unsigned int duration);
65 
69  void PlayFile( const std::string& filePath );
70 
74  void Stop();
75 
79  int PlaySound( const std::string& fileName );
80 
84  void StopSound( int handle );
85 
89  void PlayFeedbackPattern( int type, int pattern );
90 
94  bool LoadFile(const std::string& filename, std::string& data);
95 
96 private:
97 
101  FeedbackPlayer();
102 
106  virtual ~FeedbackPlayer();
107 
108  // Undefined
110 
111  // Undefined
113 
114 private:
115 
117 };
118 
119 } // namespace Adaptor
120 
121 } // namespace Internal
122 
123 // Helpers for public-api forwarding methods
124 
125 inline Internal::Adaptor::FeedbackPlayer& GetImplementation(Dali::FeedbackPlayer& player)
126 {
127  DALI_ASSERT_ALWAYS( player && "FeedbackPlayer handle is empty" );
128 
129  BaseObject& handle = player.GetBaseObject();
130 
131  return static_cast<Internal::Adaptor::FeedbackPlayer&>(handle);
132 }
133 
134 inline const Internal::Adaptor::FeedbackPlayer& GetImplementation(const Dali::FeedbackPlayer& player)
135 {
136  DALI_ASSERT_ALWAYS( player && "FeedbackPlayer handle is empty" );
137 
138  const BaseObject& handle = player.GetBaseObject();
139 
140  return static_cast<const Internal::Adaptor::FeedbackPlayer&>(handle);
141 }
142 
143 } // namespace Dali
144 
145 #endif // __DALI_INTERNAL_FEEDBACK_PLAYER_H__
Dali Docs Home
Read more about Dali