rework android-rmt display, add a few buttons
authorGood Guy <[email protected]>
Sat, 13 Feb 2016 18:01:50 +0000 (11:01 -0700)
committerGood Guy <[email protected]>
Sat, 13 Feb 2016 18:01:50 +0000 (11:01 -0700)
CineRmt/app-release.apk
CineRmt/src/main/java/com/local/cinermt/MainActivity.java
CineRmt/src/main/res/layout/content_main.xml
cinelerra-5.0/cinelerra/androidcontrol.C
cinelerra-5.0/cinelerra/cwindow.C
cinelerra-5.0/guicast/keys.h

index b2878f244eec8228e4df897c9669199cffb1e747..5f8d52961ec37d6903639860dae921649a8e767b 100644 (file)
Binary files a/CineRmt/app-release.apk and b/CineRmt/app-release.apk differ
index 6b08172c0be465611587dd30eb692efb6c62f182..366a5ab6f25dc4fd3cfe3c72dd8d9ac1659ba9c8 100644 (file)
@@ -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) {
index 7994c27cbf73351d492526c7301e0a95f962d786..18e0bf7eb323a1e75f0e2501dd726f41130a6d4b 100644 (file)
@@ -14,7 +14,7 @@
 
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content" >
+            android:layout_height="wrap_content">
 
             <ImageButton
                 android:id="@+id/button0"
@@ -63,8 +63,8 @@
         </LinearLayout>
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent" >
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
 
             <ImageButton
                 android:id="@+id/button5"
         </LinearLayout>
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent" >
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
 
             <ImageButton
                 android:id="@+id/buttonA"
         </LinearLayout>
 
         <LinearLayout
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent" >
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
 
             <ImageButton
                 android:id="@+id/buttonF"
                 android:cropToPadding="false"
                 android:scaleType="fitXY"
                 android:src="@mipmap/zfigdot" />
-            </LinearLayout>
+
+            <ImageButton
+                android:id="@+id/full_scr"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:adjustViewBounds="true"
+                android:cropToPadding="false"
+                android:scaleType="fitXY"
+                android:src="@mipmap/full_scr" />
+
+            <ImageButton
+                android:id="@+id/power"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:adjustViewBounds="true"
+                android:cropToPadding="false"
+                android:scaleType="fitXY"
+                android:src="@mipmap/power" />
+
+            <ImageButton
+                android:id="@+id/exit"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:adjustViewBounds="true"
+                android:cropToPadding="false"
+                android:scaleType="fitXY"
+                android:src="@mipmap/exit" />
+        </LinearLayout>
 
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content" >
+            android:layout_height="wrap_content"
+            android:gravity="center_horizontal">
 
             <ImageButton
                 android:id="@+id/fast_lt"
 
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content" >
+            android:layout_height="wrap_content"
+            android:gravity="center_horizontal">
 
             <ImageButton
                 android:id="@+id/media_lt"
 
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content" >
+            android:layout_height="wrap_content"
+            android:gravity="center_horizontal">
 
             <ImageButton
                 android:id="@+id/slow_lt"
                 android:cropToPadding="false"
                 android:scaleType="fitXY"
                 android:src="@mipmap/config" />
-            </LinearLayout>
+        </LinearLayout>
 
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content" >
+            android:layout_height="wrap_content"
+            android:gravity="center_horizontal">
 
             <ImageButton
-                android:id="@+id/full_scr"
+                android:id="@+id/rplay"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:adjustViewBounds="true"
                 android:cropToPadding="false"
                 android:scaleType="fitXY"
-                android:src="@mipmap/full_scr" />
+                android:src="@mipmap/rev" />
 
             <ImageButton
                 android:id="@+id/stop"
                 android:cropToPadding="false"
                 android:scaleType="fitXY"
                 android:src="@mipmap/play" />
-
-            <ImageButton
-                android:id="@+id/exit"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:adjustViewBounds="true"
-                android:cropToPadding="false"
-                android:scaleType="fitXY"
-                android:src="@mipmap/exit" />
-
-            <ImageButton
-                android:id="@+id/power"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:adjustViewBounds="true"
-                android:cropToPadding="false"
-                android:scaleType="fitXY"
-                android:src="@mipmap/power" />
         </LinearLayout>
     </LinearLayout>
 
index ac2102f5b82463469ebd3454b4066715ed163f08..784dea2313a5732dc0e74953c037a22f729552a7 100644 (file)
@@ -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);
index 33df752e58e0808fbaa5d17af39cf23e562e870c..cc5a2707cf716e71ee80605f4274d5fdd2cb63b4 100644 (file)
@@ -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;
index 118ee73c3dadbc2c259c20350621e792b33cb9f8..a3b0a5559353edde5bda01d5a8351c80cf523bc4 100644 (file)
@@ -99,6 +99,7 @@
         { 0x28, KEY_STOP },             /* ([]) */
         { 0x29, KEY_PAUSE },            /* ('') */
 #endif
+#define KPREV               284
 #define KPMENU              285
 #define KPTV                286
 #define KPDVD               287