From: Good Guy Date: Sat, 13 Feb 2016 18:01:50 +0000 (-0700) Subject: rework android-rmt display, add a few buttons X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=d7079fb6d5f3d12bc85f5413113890bc80dd22f2 rework android-rmt display, add a few buttons --- diff --git a/CineRmt/app-release.apk b/CineRmt/app-release.apk index b2878f24..5f8d5296 100644 Binary files a/CineRmt/app-release.apk and b/CineRmt/app-release.apk differ diff --git a/CineRmt/src/main/java/com/local/cinermt/MainActivity.java b/CineRmt/src/main/java/com/local/cinermt/MainActivity.java index 6b08172c..366a5ab6 100644 --- a/CineRmt/src/main/java/com/local/cinermt/MainActivity.java +++ b/CineRmt/src/main/java/com/local/cinermt/MainActivity.java @@ -13,7 +13,6 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; -import android.view.View.OnLongClickListener; import android.widget.ImageButton; import android.widget.Toast; @@ -188,6 +187,8 @@ public class MainActivity extends AppCompatActivity img.setOnClickListener(this); img = (ImageButton)findViewById(R.id.play); img.setOnClickListener(this); + img = (ImageButton)findViewById(R.id.rplay); + img.setOnClickListener(this); img = (ImageButton)findViewById(R.id.suspend); img.setOnClickListener(this); @@ -210,7 +211,10 @@ public class MainActivity extends AppCompatActivity public void onClick(View v) { if (v instanceof ImageButton) { int id = ((ImageButton)v).getId(); - if (id == R.id.button0) { send("key 0"); } + if (id == R.id.stop) { send("stop"); } + else if (id == R.id.play) { send("play"); } + else if (id == R.id.rplay) { send("rplay"); } + else if (id == R.id.button0) { send("key 0"); } else if (id == R.id.button1) { send("key 1"); } else if (id == R.id.button2) { send("key 2"); } else if (id == R.id.button3) { send("key 3"); } @@ -237,8 +241,6 @@ public class MainActivity extends AppCompatActivity else if (id == R.id.media_dn) { send("media_dn"); } else if (id == R.id.slow_rt) { send("slow_rt"); } else if (id == R.id.full_scr) { send("key F"); } - else if (id == R.id.stop) { send("stop"); } - else if (id == R.id.play) { send("play"); } else { save_defaults(); if (id == R.id.config) { diff --git a/CineRmt/src/main/res/layout/content_main.xml b/CineRmt/src/main/res/layout/content_main.xml index 7994c27c..18e0bf7e 100644 --- a/CineRmt/src/main/res/layout/content_main.xml +++ b/CineRmt/src/main/res/layout/content_main.xml @@ -14,7 +14,7 @@ + android:layout_height="wrap_content"> + android:layout_width="match_parent" + android:layout_height="wrap_content"> + android:layout_width="match_parent" + android:layout_height="wrap_content"> + android:layout_width="match_parent" + android:layout_height="wrap_content"> - + + + + + + + + android:layout_height="wrap_content" + android:gravity="center_horizontal"> + android:layout_height="wrap_content" + android:gravity="center_horizontal"> + android:layout_height="wrap_content" + android:gravity="center_horizontal"> - + + android:layout_height="wrap_content" + android:gravity="center_horizontal"> + android:src="@mipmap/rev" /> - - - - diff --git a/cinelerra-5.0/cinelerra/androidcontrol.C b/cinelerra-5.0/cinelerra/androidcontrol.C index ac2102f5..784dea23 100644 --- a/cinelerra-5.0/cinelerra/androidcontrol.C +++ b/cinelerra-5.0/cinelerra/androidcontrol.C @@ -98,6 +98,7 @@ void AndroidControl::run() if( msg_len <= 0 ) continue; if( is_msg("stop") ) press(KPSTOP); else if( is_msg("play") ) press(KPPLAY); + else if( is_msg("rplay") ) press(KPREV); else if( is_msg("pause") ) press(' '); else if( is_msg("fast_lt") ) press(KPBACK); else if( is_msg("media_up") ) press(UP); @@ -127,6 +128,9 @@ void AndroidControl::run() else if( is_msg("suspend") ) { system("sync; sleep 1; pm-suspend"); } + else if( is_msg("power") ) { + system("sync; sleep 1; poweroff"); + } else { printf("AndroidControl::run: unkn msg: %s\n", msg); sleep(1); diff --git a/cinelerra-5.0/cinelerra/cwindow.C b/cinelerra-5.0/cinelerra/cwindow.C index 33df752e..cc5a2707 100644 --- a/cinelerra-5.0/cinelerra/cwindow.C +++ b/cinelerra-5.0/cinelerra/cwindow.C @@ -345,20 +345,21 @@ int CWindowRemoteHandler::remote_process_key(RemoteControl *remote_control, int case '0': case '9': position = length * (key-'0')/10.0; break; - case UP: position += 60.0; break; - case DOWN: position -= 60.0; break; - case LEFT: position -= 10.0; break; - case RIGHT: position += 10.0; break; - case KPPLAY: next_command = NORMAL_FWD; break; - case KPSTOP: next_command = STOP; break; - case KPBACK: next_command = FAST_REWIND; break; - case KPFWRD: next_command = FAST_FWD; break; - case KPRECD: next_command = SLOW_REWIND; break; - case KPAUSE: next_command = SLOW_FWD; break; - case ' ': next_command = NORMAL_FWD; break; - case 'a': gui->tile_windows(0); return 1; - case 'b': gui->tile_windows(1); return 1; - case 'c': gui->tile_windows(2); return 1; + case UP: position += 60.0; break; + case DOWN: position -= 60.0; break; + case LEFT: position -= 10.0; break; + case RIGHT: position += 10.0; break; + case KPSTOP: next_command = STOP; break; + case KPREV: next_command = NORMAL_REWIND; break; + case KPPLAY: next_command = NORMAL_FWD; break; + case KPBACK: next_command = FAST_REWIND; break; + case KPFWRD: next_command = FAST_FWD; break; + case KPRECD: next_command = SLOW_REWIND; break; + case KPAUSE: next_command = SLOW_FWD; break; + case ' ': next_command = NORMAL_FWD; break; + case 'a': gui->tile_windows(0); return 1; + case 'b': gui->tile_windows(1); return 1; + case 'c': gui->tile_windows(2); return 1; case 'd': mwindow_gui->channel_info->toggle_scan(); return 1; diff --git a/cinelerra-5.0/guicast/keys.h b/cinelerra-5.0/guicast/keys.h index 118ee73c..a3b0a555 100644 --- a/cinelerra-5.0/guicast/keys.h +++ b/cinelerra-5.0/guicast/keys.h @@ -99,6 +99,7 @@ { 0x28, KEY_STOP }, /* ([]) */ { 0x29, KEY_PAUSE }, /* ('') */ #endif +#define KPREV 284 #define KPMENU 285 #define KPTV 286 #define KPDVD 287