37 #define BOOST_NO_TYPEID
40 #include <media/LunaConnector.h>
41 #include <media/MediaClient.h>
42 #include <media/MediaPlayer.h>
46 using namespace media;
47 using namespace boost;
63 SoundPlayerMediaPlayerChangeListener(
SoundPlayer * player) : m_soundPlayer(player) {}
65 void disconnect() { m_soundPlayer = 0; }
67 virtual void currentTimeChanged() {
if (m_soundPlayer) m_soundPlayer->currentTimeChanged(); }
68 virtual void eosChanged() {
if (m_soundPlayer) m_soundPlayer->eosChanged(); }
69 virtual void sourceChanged() {
if (m_soundPlayer) m_soundPlayer->sourceChanged(); }
70 virtual void errorChanged() {
if (m_soundPlayer) m_soundPlayer->errorChanged(); }
71 virtual void extendedErrorChanged() {
if (m_soundPlayer) m_soundPlayer->extendedErrorChanged(); }
112 void play(
const std::string& filePath,
const std::string& streamClass,
bool repeat,
int duration);
115 bool dead()
const {
return m_state == eState_Dead; }
125 virtual LSPalmService * connectToBus();
126 virtual void connected();
132 void currentTimeChanged();
134 void sourceChanged();
136 void extendedErrorChanged();
143 void checkForNextStep();
144 void setState(EState state);
145 const char * getStateName();
146 guint64 currentTime();
151 LSHandle * getServiceHandle();
154 shared_ptr<MediaPlayer> m_player;
155 LSPalmService* m_serviceHandle;
157 string m_streamClass;
158 AudioStreamClass m_audioStreamClass;
163 guint64 m_lastPlayingTime;
164 int m_fakeBackupRingtoneCount;
165 boost::shared_ptr<MediaPlayerChangeListener> m_mediaPlayerChangeListener;
167 Timer<SoundPlayer> m_timer;
170 static int m_activityCount;