#include <dali/public-api/object/type-registry.h>
// INTERNAL INCLUDES
-#include <adaptor-impl.h>
+#include <singleton-service-impl.h>
namespace Dali
{
namespace // unnamed namespace
{
+const char* const SIGNAL_SOUND_PLAY_FINISHED = "soundPlayFinished";
+
// Type Registration
-Dali::BaseHandle Create()
+Dali::BaseHandle GetInstance()
{
return SoundPlayer::Get();
}
-Dali::TypeRegistration SOUND_PLAYER_TYPE( typeid(Dali::SoundPlayer), typeid(Dali::BaseHandle), Create );
+Dali::TypeRegistration SOUND_PLAYER_TYPE( typeid(Dali::SoundPlayer), typeid(Dali::BaseHandle), GetInstance );
-Dali::SignalConnectorType SIGNAL_CONNECTOR_1( SOUND_PLAYER_TYPE, Dali::SoundPlayer::SIGNAL_SOUND_PLAY_FINISHED, Dali::Internal::Adaptor::SoundPlayer::DoConnectSignal );
+Dali::SignalConnectorType SIGNAL_CONNECTOR_1( SOUND_PLAYER_TYPE, SIGNAL_SOUND_PLAY_FINISHED, Dali::Internal::Adaptor::SoundPlayer::DoConnectSignal );
} // unnamed namespace
{
Dali::SoundPlayer player;
- if ( Adaptor::IsAvailable() )
+ Dali::SingletonService service( SingletonService::Get() );
+ if ( service )
{
// Check whether the singleton is already created
- Dali::BaseHandle handle = Adaptor::Get().GetSingleton( typeid( Dali::SoundPlayer ) );
+ Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::SoundPlayer ) );
if ( handle )
{
// If so, downcast the handle
}
else
{
- Adaptor& adaptorImpl( Adaptor::GetImplementation( Adaptor::Get() ) );
player = Dali::SoundPlayer( New() );
- adaptorImpl.RegisterSingleton( typeid( player ), player );
+ service.Register( typeid( player ), player );
}
}
mPlugin.StopSound( handle );
}
-SoundPlayer::SoundPlayFinishedSignalV2& SoundPlayer::SoundPlayFinishedSignal()
+SoundPlayer::SoundPlayFinishedSignalType& SoundPlayer::SoundPlayFinishedSignal()
{
- return mSoundPlayFinishedSignalV2;
+ return mSoundPlayFinishedSignal;
}
bool SoundPlayer::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
bool connected( true );
SoundPlayer* player = dynamic_cast<SoundPlayer*>( object );
- if( player &&
- Dali::SoundPlayer::SIGNAL_SOUND_PLAY_FINISHED == signalName )
+ if( player && ( SIGNAL_SOUND_PLAY_FINISHED == signalName ) )
{
player->SoundPlayFinishedSignal().Connect( tracker, functor );
}
{
// Emit SoundPlayFinished signal
- if ( !mSoundPlayFinishedSignalV2.Empty() )
+ if ( !mSoundPlayFinishedSignal.Empty() )
{
Dali::SoundPlayer handle( this );
- mSoundPlayFinishedSignalV2.Emit( handle );
+ mSoundPlayFinishedSignal.Emit( handle );
}
}