diff --git a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp index 8a9a204..7f30714 100644 --- a/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp +++ b/trunk/ConsoleDataMigration/sources/ConsoleRestore/Controller.cpp @@ -56,24 +56,8 @@ bool s_SkipNupMode = false; // プリインストール書き込みモードかどうか bool s_DownloadPreinstallMode = false; -// APSettingの書式が無い警告サウンドを鳴らしたかどうか -bool s_ExistAPSettingAnnotation = false; -// APSettingの書式が違っている警告サウンドを鳴らしたかどうか -bool s_APSettingAnnotation = false; -// シリアルナンバーがない警告サウンドを鳴らしたかどうか -bool s_SerialNumberAnnotation = false; // 失敗サウンドを鳴らしたかどうか bool s_PlayedFailSound = false; -// 操作開始サウンドを鳴らしたかどうか -bool s_PlayedStartCursor = false; -// リブート開始前サウンドを鳴らしたかどうか -bool s_PlayedRebootCursor = false; -// SD抜き出し前サウンドを鳴らしたかどうか -bool s_PlayedSdPullOutCursor = false; -// SDに書き込みできない警告サウンドを鳴らしたかどうか -bool s_SdWriteProetctAnnotation = false; -// WiFiがOFFである警告サウンドを鳴らしたかどうか -bool s_WifiStatusOffAnnotation = false; // ネットワークアップデートを開始したかどうか bool s_ExecuteFgNup = false; @@ -172,9 +156,43 @@ typedef enum RestoreState PREINSTALL_DOWNLOAD_APP, // アプリダウンロード PREINSTALL_DOWNLOAD_APP_NOT_ENOUGH_SPACE, // アプリダウンロード失敗、空き容量不足 PREINSTALL_WAIT_USER_SD_EJECT, // ユーザSD抜き出し待ち - PREINSTALL_CHECK_REPAIR_SD // 修理用SDのチェック + PREINSTALL_CHECK_REPAIR_SD, // 修理用SDのチェック + + RESTORE_STATE_MAX } RestoreState; +enum AnnotationSound +{ + ANNOTATION_SD_WRITE_PROTECT, + ANNOTATION_WIFI_OFF, + ANNOTATION_SETTING_NOT_FOUND, + ANNOTATION_INVALID_SETTING, + ANNOTATION_SERIAL_NUMBER_NOT_IN_SD, + + ANNOTATION_MAX +}; + +bool s_PlayedCursorSound[RESTORE_STATE_MAX]; +bool s_PlayedAnnotationSound[ANNOTATION_MAX]; + +void PlayCursorSound(RestoreState state) +{ + if(!s_PlayedCursorSound[state]) + { + common::PlaySound(common::SOUND_CURSOR); + s_PlayedCursorSound[state] = true; + } +} + +void PlayAnnotationSound(AnnotationSound index) +{ + if(!s_PlayedAnnotationSound[index]) + { + common::PlaySound(common::SOUND_ANNOTATION); + s_PlayedAnnotationSound[index] = true; + } +} + #define BREAK_IF_STATE_CHANGED(saved, current) \ if(saved != current) \ {\ @@ -188,6 +206,7 @@ void ChangeState(RestoreState saved, RestoreState& current, RestoreState next) if(saved == current) { current = next; + s_PlayedCursorSound[next] = false; } } @@ -250,11 +269,7 @@ void CheckSdWritable(common::HardwareStateManager& manager, ::std::vector& operationMessage) if (!ExistsAPSetting()) { - if(!s_ExistAPSettingAnnotation) - { - s_ExistAPSettingAnnotation = true; - common::PlaySound(common::SOUND_ANNOTATION); - } + PlayAnnotationSound(ANNOTATION_SETTING_NOT_FOUND); operationMessage.push_back(::std::string("Accsess_Point_Setting does not exist!")); return false; } @@ -771,11 +773,7 @@ bool CheckAndReadAPSetting(::std::vector& operationMessage) if (!s_ReadSettingIsSuccess) { operationMessage.push_back(::std::string("Invalid Accsess_Point_Setting format!")); - if(!s_APSettingAnnotation) - { - s_APSettingAnnotation = true; - common::PlaySound(common::SOUND_ANNOTATION); - } + PlayAnnotationSound(ANNOTATION_INVALID_SETTING); } return s_ReadSettingIsSuccess; @@ -862,11 +860,7 @@ void ControlState(common::HardwareStateManager& manager, ::std::vector