From 81069903611457acb290903934eedaf84d586bb8 Mon Sep 17 00:00:00 2001 From: N2614 Date: Thu, 26 Jan 2012 07:53:56 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=AA=E3=82=A4=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=BC=E3=83=AB=E3=83=80=E3=82=A6=E3=83=B3=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=89=E6=99=82=E3=81=AB=E9=80=B2=E6=8D=97=E3=82=92?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=20=E9=9F=B3=E5=86=8D=E7=94=9F=E3=82=92=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=81=AB=E3=81=BE=E3=81=A8=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@610 385bec56-5757-e545-9c3a-d8741f4650f1 --- .../sources/ConsoleRestore/Controller.cpp | 188 +++++++----------- 1 file changed, 69 insertions(+), 119 deletions(-) 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