OSDN Git Service

ちょっと追加。
[gokigen/ThetaThoughtShutter.git] / app / src / main / java / jp / osdn / gokigen / thetathoughtshutter / MainActivity.kt
1 package jp.osdn.gokigen.thetathoughtshutter
2
3 import android.os.Bundle
4 import android.view.KeyEvent
5 import com.theta360.pluginlibrary.activity.PluginActivity
6 import com.theta360.pluginlibrary.callback.KeyCallback
7 import com.theta360.pluginlibrary.receiver.KeyReceiver
8 import com.theta360.pluginlibrary.values.LedColor
9 import com.theta360.pluginlibrary.values.LedTarget
10 import jp.osdn.gokigen.thetathoughtshutter.R.layout
11 import jp.osdn.gokigen.thetathoughtshutter.theta.ThetaHardwareControl
12
13 class MainActivity : PluginActivity()
14 {
15     private val thetaHardwareControl = ThetaHardwareControl(this)
16     private var applicationStatus : MyApplicationStatus = MyApplicationStatus.Undefined
17
18     override fun onCreate(savedInstanceState: Bundle?)
19     {
20         super.onCreate(savedInstanceState)
21         setContentView(layout.activity_main)
22
23         setAutoClose(true)
24
25         setKeyCallback(object : KeyCallback {
26             override fun onKeyDown(keyCode: Int, event: KeyEvent?)
27             {
28                 if (keyCode == KeyReceiver.KEYCODE_CAMERA)
29                 {
30
31                 }
32             }
33
34             override fun onKeyUp(keyCode: Int, event: KeyEvent?)
35             {
36                 notificationLedBlink(LedTarget.LED3, LedColor.BLUE, 1000)
37                 //notificationLedBlink(LedTarget.LED4, LedColor.CYAN, 1000)
38             }
39
40             override fun onKeyLongPress(keyCode: Int, event: KeyEvent?)
41             {
42                 if (keyCode == KeyReceiver.KEYCODE_MEDIA_RECORD) // Modeボタン
43                 {
44
45                 }
46                 if (keyCode == KeyReceiver.KEYCODE_CAMERA)   // Shutterボタン
47                 {
48
49                 }
50                 if (keyCode == KeyReceiver.KEYCODE_FUNCTION)   // Fnボタン (Z1のみ)
51                 {
52
53                 }
54                 if (keyCode == KeyReceiver.KEYCODE_WLAN_ON_OFF) // Wirelessボタン
55                 {
56
57                 }
58             }
59         })
60     }
61
62     override fun onResume()
63     {
64         super.onResume()
65         if (isApConnected)
66         {
67
68         }
69     }
70
71     override fun onPause()
72     {
73         super.onPause()
74     }
75
76 }
77
78 //
79 // -----------------------------------------------------
80 //  LED1 : 電源ランプ
81 //  LED2 : カメラステータス ランプ(レンズとマイクの間)
82 //  LED3 : ワイヤレスマーク ランプ
83 //  LED4 : キャプチャーモード (カメラ)
84 //  LED5 : キャプチャーモード (ムービー)
85 //  LED6 : キャプチャーモード (LIVEストリーミング)
86 //  LED7 : ビデオ録画 ランプ
87 //  LED8 : メモリ警告ランプ
88 //
89 //  BTN1 : 電源ボタン
90 //  BTN2 : ワイヤレスボタン
91 //  BTN3 : モードボタン
92 //  SHUT : シャッターボタン
93 // -----------------------------------------------------
94 //
95 //  [制御可能なLED]
96 //    - LED3~LED8 : カラー : "blue", "green", "red", "cyan", "magenta", "yellow", "white"
97 //    - ブリンク間隔 : 1~2000 msec
98 //
99 //  [KeyCode]
100 //    - 27  : Shutter Button
101 //    - 130 : Mode Button
102 //    - 284 : Wireless Button
103 //    - 119 : Fn Button (Z1 Only)
104 //
105 //
106 //   http://localhost:8080/
107 //