import android.widget.EditText;
import android.widget.ProgressBar;
+/**
+ * Main class for HSTempo
+ * @author Hideki Saito
+ * @version 1.0.5
+ * @since 1.0.0
+ */
public class HSTempo extends Activity {
private int beatcount = 0;
private int bpmvalue = 0;
static final private int MARACAS_ID = Menu.FIRST + 4;
- /** Called when the activity is first created. */
+ /** Called when the activity is first created.
+ * Initializes all necessary values here.
+ * @author Hideki Saito
+ * @version 1.0.5
+ * @since 1.0.0
+ * */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean session_active = false;
long starttime = 0;
+ /**
+ * Listen for beat button
+ * @author Hideki Saito
+ * @version 1.0.5
+ * @since 1.0.0
+ */
private OnClickListener onBeatPress = new OnClickListener()
{
public void onClick(View v)
bpmvalue = (int) Math.round(bpmvalue_double);
beatcount++;
}
-
-
+ // Finally, update the display.
UpdateDisplay();
}
}
};
+ /**
+ * Updates display
+ * @author Hideki Saito
+ * @version 1.0.5
+ * @since 1.0.0
+ */
protected void UpdateDisplay() {
EditText beatcountbox = (EditText) findViewById(R.id.BeatCountDisplay);
beatcountbox.setText(String.valueOf(beatcount));
StabilityBar.setProgress(20-stability);
};
+ /**
+ * Listens for reset button.
+ * @author Hideki Saito
+ * @version 1.0.5
+ * @since 1.0.0
+ */
private OnClickListener onResetPress = new OnClickListener()
{
public void onClick(View v)
int start = 0;
+ /**
+ * Resets all the value
+ * @author Hideki Saito
+ * @version 1.0.5
+ * @since 1.0.0
+ */
void resetAll()
{
session_active = false;
StabilityBar.setProgress(0);
}
+
+ /**
+ * Specify contents for popup menu.
+ * @author Hideki Saito
+ * @version 1.0.5
+ * @since 1.0.3
+ */
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);