Dali 3D User Interface Engine
sound-player-impl.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_SOUND_PLAYER_H__
2 #define __DALI_INTERNAL_SOUND_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 <sound-player.h>
28 
29 namespace Dali
30 {
31 
32 namespace Internal
33 {
34 
35 namespace Adaptor
36 {
37 
42 {
43 
44 public:
45 
46  typedef Dali::SoundPlayer::SoundPlayFinishedSignalType SoundPlayFinishedSignalType;
47 
52  static Dali::SoundPlayer New();
53 
58  static Dali::SoundPlayer Get();
59 
63  int PlaySound(const std::string fileName);
64 
68  void Stop(int handle);
69 
74 
84  static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
85 
86 private:
87 
92  SoundPlayer();
93 
97  virtual ~SoundPlayer();
98 
103 
104  // Undefined
105  SoundPlayer(const SoundPlayer&);
106 
107  // Undefined
109 
110 private:
111 
114 };
115 
116 } // namespace Adaptor
117 
118 } // namespace Internal
119 
120 
121 // Helpers for public-api forwarding methods
122 
123 inline Internal::Adaptor::SoundPlayer& GetImplementation(Dali::SoundPlayer& player)
124 {
125  DALI_ASSERT_ALWAYS( player && "SoundPlayer handle is empty" );
126 
127  BaseObject& handle = player.GetBaseObject();
128 
129  return static_cast<Internal::Adaptor::SoundPlayer&>(handle);
130 }
131 
132 inline const Internal::Adaptor::SoundPlayer& GetImplementation(const Dali::SoundPlayer& player)
133 {
134  DALI_ASSERT_ALWAYS( player && "SoundPlayer handle is empty" );
135 
136  const BaseObject& handle = player.GetBaseObject();
137 
138  return static_cast<const Internal::Adaptor::SoundPlayer&>(handle);
139 }
140 
141 } // namespace Dali
142 
143 #endif // __DALI_INTERNAL_SOUND_PLAYER_H__
Dali Docs Home
Read more about Dali