From b7042f7c9102e557074621d1bf0e3813bd23ab0e Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Tue, 10 Feb 2009 20:19:12 -0800 Subject: [PATCH] Updaed the code structure for efficiency. Staging for 1.0.6. --- AndroidManifest.xml | 2 +- res/values/strings.xml | 4 +-- src/hsware/HSTempo/HSTempo.java | 57 ++++++++++++++++++++--------------------- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 3147cb6..b37e48f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionName="@string/VersionSimple" android:versionCode="10"> diff --git a/res/values/strings.xml b/res/values/strings.xml index 5ff1834..bc32dbc 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -16,11 +16,11 @@ -1.0.6 Beta (February 9th, 2009) +1.0.6 (February 10th, 2009) HSTempo is an application that let you measure BPM of various beat by tapping to the beat. New in this version:\n- Stability Bar\n- Menu that enables you to quit this application. About HSTempo Close Interval -1.0.6 Beta +1.0.6 diff --git a/src/hsware/HSTempo/HSTempo.java b/src/hsware/HSTempo/HSTempo.java index 225db74..659dd97 100644 --- a/src/hsware/HSTempo/HSTempo.java +++ b/src/hsware/HSTempo/HSTempo.java @@ -92,33 +92,7 @@ public class HSTempo extends Activity { EditText bpmcountbox = (EditText) findViewById(R.id.BeatMonitorDisplay); bpmcountbox.setText(String.valueOf(bpmvalue)); - bpmhistory10 = new int[10]; - for(int i = 0; i < 10; i++) - bpmhistory10[i] = 0; - bpmhistory15 = new int[15]; - for(int i = 0; i < 15; i++) - bpmhistory15[i] = 0; - bpmhistory20 = new int[20]; - for(int i = 0; i < 20; i++) - bpmhistory20[i] = 0; - bpmhistory10_pt = 0; - bpmhistory15_pt = 0; - bpmhistory20_pt = 0; - - EditText elapsed = (EditText) findViewById(R.id.ElapsedBox); - elapsed.setText("0"); -// EditText fromlast = (EditText) findViewById(R.id.LastBeatBox); -// fromlast.setText("0"); - EditText bpm10 = (EditText) findViewById(R.id.Avg10); - EditText bpm15 = (EditText) findViewById(R.id.Avg15); - EditText bpm20 = (EditText) findViewById(R.id.Avg20); - bpm10.setText("X"); - bpm15.setText("X"); - bpm20.setText("X"); - - ProgressBar StabilityBar = (ProgressBar) findViewById(R.id.ProgressBar01); - StabilityBar.setProgress(0); - + resetAll(); } @@ -289,6 +263,33 @@ public class HSTempo extends Activity { beatcount = 0; bpmvalue = 0; starttime = 0; + + bpmhistory10 = new int[10]; + for(int i = 0; i < 10; i++) + bpmhistory10[i] = 0; + bpmhistory15 = new int[15]; + for(int i = 0; i < 15; i++) + bpmhistory15[i] = 0; + bpmhistory20 = new int[20]; + for(int i = 0; i < 20; i++) + bpmhistory20[i] = 0; + bpmhistory10_pt = 0; + bpmhistory15_pt = 0; + bpmhistory20_pt = 0; + +// EditText fromlast = (EditText) findViewById(R.id.LastBeatBox); +// fromlast.setText("0"); + EditText bpm10 = (EditText) findViewById(R.id.Avg10); + EditText bpm15 = (EditText) findViewById(R.id.Avg15); + EditText bpm20 = (EditText) findViewById(R.id.Avg20); + bpm10.setText("X"); + bpm15.setText("X"); + bpm20.setText("X"); + + ProgressBar StabilityBar = (ProgressBar) findViewById(R.id.ProgressBar01); + StabilityBar.setProgress(0); + + Button resetbutton = (Button)findViewById(R.id.ResetButton); resetbutton.setEnabled(false); @@ -312,8 +313,6 @@ public class HSTempo extends Activity { bpmhistory20_pt = 0; UpdateDisplay(); - ProgressBar StabilityBar = (ProgressBar) findViewById(R.id.ProgressBar01); - StabilityBar.setProgress(0); } -- 2.11.0