1 #ifndef __DALI_INTERNAL_FEEDBACK_PLAYER_H__
2 #define __DALI_INTERNAL_FEEDBACK_PLAYER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
23 #include <dali/public-api/object/base-object.h>
26 #include <feedback-player.h>
27 #include <feedback/feedback-plugin-proxy.h>
38 class FeedbackPluginProxy;
41 * Plays haptic effects.
43 class FeedbackPlayer : public Dali::BaseObject
49 * Create a FeedbackPlayer.
50 * This should only be called once by the Adaptor class.
51 * @return A newly created FeedbackPlayer.
53 static Dali::FeedbackPlayer New();
56 * Retrieve a handle to the FeedbackPlayer. This creates an instance if none has been created.
57 * @return A handle to the FeedbackPlayer.
59 static Dali::FeedbackPlayer Get();
62 * @copydoc Dali::FeedbackPlayer::PlayMonotone()
64 void PlayMonotone(unsigned int duration);
67 * @copydoc Dali::FeedbackPlayer::PlayFile()
69 void PlayFile( const std::string& filePath );
72 * @copydoc Dali::FeedbackPlayer::Stop()
77 * @copydoc Dali::FeedbackPlayer::PlaySound()
79 int PlaySound( const std::string& fileName );
82 * @copydoc Dali::FeedbackPlayer::StopSound()
84 void StopSound( int handle );
87 * @copydoc Dali::FeedbackPlayer::PlayFeedbackPattern()
89 void PlayFeedbackPattern( int type, int pattern );
92 * @copydoc Dali::FeedbackPlayer::LoadFile()
94 bool LoadFile(const std::string& filename, std::string& data);
99 * Private Constructor; see also FeedbackPlayer::New()
106 virtual ~FeedbackPlayer();
109 FeedbackPlayer(const FeedbackPlayer&);
112 FeedbackPlayer& operator=(FeedbackPlayer&);
116 FeedbackPluginProxy mPlugin;
119 } // namespace Adaptor
121 } // namespace Internal
123 // Helpers for public-api forwarding methods
125 inline Internal::Adaptor::FeedbackPlayer& GetImplementation(Dali::FeedbackPlayer& player)
127 DALI_ASSERT_ALWAYS( player && "FeedbackPlayer handle is empty" );
129 BaseObject& handle = player.GetBaseObject();
131 return static_cast<Internal::Adaptor::FeedbackPlayer&>(handle);
134 inline const Internal::Adaptor::FeedbackPlayer& GetImplementation(const Dali::FeedbackPlayer& player)
136 DALI_ASSERT_ALWAYS( player && "FeedbackPlayer handle is empty" );
138 const BaseObject& handle = player.GetBaseObject();
140 return static_cast<const Internal::Adaptor::FeedbackPlayer&>(handle);
145 #endif // __DALI_INTERNAL_FEEDBACK_PLAYER_H__