Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem_Warning_Fixed
Diff: SD_PlayerSkeleton.cpp
- Revision:
- 14:284093250bab
- Parent:
- 13:3df6a1f66b1c
- Child:
- 15:4ac0f4715454
--- a/SD_PlayerSkeleton.cpp Fri Mar 17 16:47:54 2017 +0000
+++ b/SD_PlayerSkeleton.cpp Mon Mar 20 02:34:49 2017 +0000
@@ -1,7 +1,7 @@
//--------------------------------------------------------------
// SD プレーヤー用抽象基底クラス
//
-// 2017/03/18, Copyright (c) 2017 MIKAMI, Naoki
+// 2017/03/20, Copyright (c) 2017 MIKAMI, Naoki
//--------------------------------------------------------------
#include "SD_PlayerSkeleton.hpp"
@@ -16,14 +16,15 @@
title_(214, 4, str, Label::CENTER, Font16),
selector_(0, 22, 256, 37, sdReader_),
menu_(BG_LEFT_, 2, BG_WIDTH_, BG_HEIGHT_, 5,
- (string[]){"OPEN", "PLAY", "PAUSE", "RESUME", "STOP"},
+ (string[]){"SELECT", "PLAY", "PAUSE", "RESUME", "STOP"},
0, 2, 1)
{
+ menu_.InactivateAll();
+ menu_.Activate(0);
+
if (!selector_.CreateTable())
BlinkLabel errLabel(240, 100, "SD CARD ERROR", Label::CENTER);
- menu_.InactivateAll();
- menu_.Activate(0);
if (resetButton) reset_ = new ResetButton();
else reset_ = NULL;
}
@@ -34,8 +35,6 @@
bool playOk = false;
int32_t loopCount;
- WaitTouched(0); // OPEN がタッチされるまで待つ
-
while (true)
{
if (playOk) // PAUSE 後の PLAY の場合
@@ -50,7 +49,7 @@
Display(); // アプリ固有の表示処理(仮想関数)
if (reset_ != NULL) reset_->Draw();
- menu_.Inactivate(0); // OPEN ボタン無効
+ menu_.Inactivate(0); // SELECT ボタン無効
menu_.Activate(2); // PAUSE ボタン有効
menu_.Activate(4); // STOP ボタン有効
@@ -94,9 +93,9 @@
SignalProcessing();
}
mySai_.StopOut();
- menu_.Activate(0); // OPEN ボタン有効
- menu_.Draw(1); // PLAY ボタンの色を初期状態にする
- for (int n=2; n<5; n++) // その他のボタンは無効
+ if (!playOk) menu_.Activate(0); // SELECT ボタン有効
+ menu_.Draw(1); // PLAY ボタンの色を初期状態にする
+ for (int n=2; n<5; n++) // その他のボタンは無効
menu_.Inactivate(n);
sdReader_.Close(); // SD のファイルのクローズ
@@ -128,11 +127,12 @@
{
selector_.DisplayFileList();
title_.Draw("Select file");
- menu_.Inactivate(1); // PLAY ボタン無効
+ menu_.Inactivate(0); // SELECT ボタン無効
+ menu_.Inactivate(1); // PLAY ボタン無効
do
if (selector_.Select(fileName_))
- menu_.Activate(1); // PLAY ボタン有効
- while (!menu_.Touched(1)); // PLAY ボタンがタッチされるまで繰り返す
+ menu_.Activate(1); // PLAY ボタン有効
+ while (!menu_.Touched(1)); // PLAY ボタンがタッチされるまで繰り返す
selector_.Erase(0, 0, BG_LEFT_-4, 272);
title_.Draw();
@@ -145,7 +145,7 @@
Modefy(); // アプリ固有のパラメータ変更(仮想関数)
}
- // メニューのボタンがタッチされるまで DoIfHandled() を実行しながら待つ
+ // メニューのいずれかのボタンがタッチされるまで DoIfHandled() を実行しながら待つ
int SD_PlayerSkeleton::WaitTouched()
{
int touchNum;
@@ -153,4 +153,3 @@
return touchNum;
}
}
-