static TonePlayerForm* _pTonePlayerForm = null;
-bool TonePlayerForm::__isToneEndLater = false;
-
TonePlayerForm*
TonePlayerForm::CreateFormN(const Tizen::Ui::Scenes::SceneId &sceneId)
{
TonePlayerForm::OnTonePlayerEndOfTone(Tizen::Media::TonePlayer& src)
{
result r = E_SUCCESS;
- if(__isToneEndLater == true)
- {
- EnableButton(__pButtonPlay);
- DisableButton(__pButtonPause);
- EnableButton(__pButtonStop);
- __isToneEndLater = false;
- return;
- }
+ AppLog("Enter");
if (__pTonePlayerSeq == &src && __pTonePlayerSeq->GetState() == TONE_PLAYER_STATE_END_OF_TONE)
{
r = __pTonePlayerSeq->Close();
AppLog("Failed with %s", GetErrorMessage(r));
return;
}
- r = PlaySequenceTones();
+ r = PlaySequenceTones(true);
if (IsFailed(r))
{
AppLog("Failed with %s", GetErrorMessage(r));
r = __pTonePlayerDTMF->Play();
if (IsFailed(r))
{
- ShowMessageBox("Error", "Play failed\n(%s)", GetErrorMessage(r));
+ char pMessage[100];
+ snprintf(pMessage, 100, " Play Failed \n (%s)", GetErrorMessage(r));
+ ShowMessagePopup(pMessage, ID_POPUP_CLEAR);
return;
}
}
//Play tones in a Sequence
result
-TonePlayerForm::PlaySequenceTones()
+TonePlayerForm::PlaySequenceTones(bool isCalledByEndOfTone)
{
result r = E_SUCCESS;
r = __pTonePlayerSeq->Play();
if (IsFailed(r))
{
- String errorSt("Error\n: Play Failed \n");
- char pMessage[1000];
- sprintf(pMessage, "Error\n: Play Failed \n (%s)", GetErrorMessage(r));
- ShowMessagePopup(pMessage, ID_POPUP_CLEAR);
+ if(isCalledByEndOfTone != true)
+ {
+ char pMessage[100];
+ snprintf(pMessage, 100, " Play Failed \n (%s)", GetErrorMessage(r));
+ ShowMessagePopup(pMessage, ID_POPUP_CLEAR);
+ }
return r;
}
}
}
if(__pTonePlayerSeq->GetState() == TONE_PLAYER_STATE_PAUSED)
{
- __isToneEndLater = true;
AppLog("TonePlayer ::OnTonePlayerAudioFocusChanged Paused");
EnableButton(__pButtonPlay);
DisableButton(__pButtonPause);
EnableButton(__pButtonStop);
- __isToneEndLater = false;
}
}
private:
void PlayDTMF(Tizen::Media::DtmfPreset preset, long duration);
- result PlaySequenceTones(void);
+ result PlaySequenceTones(bool isCalledByEndOfTone = false);
void DisableButton(Tizen::Ui::Controls::Button* pButton);
void EnableButton(Tizen::Ui::Controls::Button* pButton);
result SetHeaderText(const Tizen::Base::String& title);
bool __isTimerRunning;
bool __isButtonInPressedState;
int __tonePlayerVolume;
-
-public:
- static bool __isToneEndLater;
};
#endif //_TONE_PLAYER_FORM_H_