improved update rate menu

This commit is contained in:
Ahmet Inan 2015-02-25 11:49:03 +01:00
parent 6f096419c1
commit bb2cfdfce6
5 changed files with 33 additions and 12 deletions

View file

@ -182,8 +182,7 @@ public class Decoder {
void pd290_mode() { rsDecoder.invoke_pd290_mode(); }
int freeRunReserve(int height) { return (height * 3) / 2; }
void increaseUpdateRate() { updateRate = Math.min(4, updateRate + 1); }
void decreaseUpdateRate() { updateRate = Math.max(0, updateRate - 1); }
void setUpdateRate(int rate) { updateRate = Math.max(0, Math.min(4, rate)); }
void updateTitle(int id) { activity.updateTitle(activity.getString(id)); }
void switch_mode(int mode)

View file

@ -261,11 +261,20 @@ public class MainActivity extends Activity {
decoder.enable_analyzer(enableAnalyzer ^= true);
changeLayoutOrientation(getResources().getConfiguration());
return true;
case R.id.action_increase_update_rate:
decoder.increaseUpdateRate();
case R.id.action_slow_update_rate:
decoder.setUpdateRate(0);
return true;
case R.id.action_decrease_update_rate:
decoder.decreaseUpdateRate();
case R.id.action_normal_update_rate:
decoder.setUpdateRate(1);
return true;
case R.id.action_fast_update_rate:
decoder.setUpdateRate(2);
return true;
case R.id.action_faster_update_rate:
decoder.setUpdateRate(3);
return true;
case R.id.action_fastest_update_rate:
decoder.setUpdateRate(4);
return true;
case R.id.action_raw_mode:
decoder.raw_mode();

View file

@ -42,8 +42,13 @@
<item android:id="@+id/action_toggle_auto" android:title="@string/action_toggle_auto" />
<item android:id="@+id/action_toggle_analyzer" android:title="@string/action_toggle_analyzer" />
<item android:id="@+id/action_increase_update_rate" android:title="@string/action_increase_update_rate" />
<item android:id="@+id/action_decrease_update_rate" android:title="@string/action_decrease_update_rate" />
<item android:title="@string/update_rate"><menu>
<item android:id="@+id/action_slow_update_rate" android:title="@string/action_slow_update_rate" />
<item android:id="@+id/action_normal_update_rate" android:title="@string/action_normal_update_rate" />
<item android:id="@+id/action_fast_update_rate" android:title="@string/action_fast_update_rate" />
<item android:id="@+id/action_faster_update_rate" android:title="@string/action_faster_update_rate" />
<item android:id="@+id/action_fastest_update_rate" android:title="@string/action_fastest_update_rate" />
</menu></item>
<item android:id="@+id/action_raw_mode" android:title="@string/action_raw_mode" />

View file

@ -8,8 +8,12 @@
<string name="action_toggle_auto">Automatik umschalten</string>
<string name="action_toggle_debug">Bildanalyse umschalten</string>
<string name="action_toggle_analyzer">Analysator umschalten</string>
<string name="action_increase_update_rate">Bildwiederholrate erhöhen</string>
<string name="action_decrease_update_rate">Bildwiederholrate verringern</string>
<string name="update_rate">Bildwiederholrate</string>
<string name="action_slow_update_rate">langsam</string>
<string name="action_normal_update_rate">normal</string>
<string name="action_fast_update_rate">schnell</string>
<string name="action_faster_update_rate">schneller</string>
<string name="action_fastest_update_rate">am schnellsten</string>
<string name="action_raw_mode">Roh Modus</string>
<string name="action_robot36_mode">Robot36 Modus</string>
<string name="action_robot72_mode">Robot72 Modus</string>

View file

@ -8,8 +8,12 @@
<string name="action_toggle_auto">Toggle Auto Mode</string>
<string name="action_toggle_debug">Toggle Debug Mode</string>
<string name="action_toggle_analyzer">Toggle Analyzer</string>
<string name="action_increase_update_rate">Increase Update Rate</string>
<string name="action_decrease_update_rate">Decrease Update Rate</string>
<string name="update_rate">Update Rate</string>
<string name="action_slow_update_rate">slow</string>
<string name="action_normal_update_rate">normal</string>
<string name="action_fast_update_rate">fast</string>
<string name="action_faster_update_rate">faster</string>
<string name="action_fastest_update_rate">fastest</string>
<string name="action_raw_mode">Raw Mode</string>
<string name="action_robot36_mode">Robot36 Mode</string>
<string name="action_robot72_mode">Robot72 Mode</string>