1 package jp.osdn.gokigen.thetathoughtshutter
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
13 class MainActivity : PluginActivity()
15 private val thetaHardwareControl = ThetaHardwareControl(this)
16 private var applicationStatus : MyApplicationStatus = MyApplicationStatus.Undefined
18 override fun onCreate(savedInstanceState: Bundle?)
20 super.onCreate(savedInstanceState)
21 setContentView(layout.activity_main)
25 setKeyCallback(object : KeyCallback {
26 override fun onKeyDown(keyCode: Int, event: KeyEvent?)
28 if (keyCode == KeyReceiver.KEYCODE_CAMERA)
34 override fun onKeyUp(keyCode: Int, event: KeyEvent?)
36 notificationLedBlink(LedTarget.LED3, LedColor.BLUE, 1000)
37 //notificationLedBlink(LedTarget.LED4, LedColor.CYAN, 1000)
40 override fun onKeyLongPress(keyCode: Int, event: KeyEvent?)
42 if (keyCode == KeyReceiver.KEYCODE_MEDIA_RECORD) // Modeボタン
46 if (keyCode == KeyReceiver.KEYCODE_CAMERA) // Shutterボタン
50 if (keyCode == KeyReceiver.KEYCODE_FUNCTION) // Fnボタン (Z1のみ)
54 if (keyCode == KeyReceiver.KEYCODE_WLAN_ON_OFF) // Wirelessボタン
62 override fun onResume()
71 override fun onPause()
79 // -----------------------------------------------------
81 // LED2 : カメラステータス ランプ(レンズとマイクの間)
82 // LED3 : ワイヤレスマーク ランプ
83 // LED4 : キャプチャーモード (カメラ)
84 // LED5 : キャプチャーモード (ムービー)
85 // LED6 : キャプチャーモード (LIVEストリーミング)
93 // -----------------------------------------------------
96 // - LED3~LED8 : カラー : "blue", "green", "red", "cyan", "magenta", "yellow", "white"
97 // - ブリンク間隔 : 1~2000 msec
100 // - 27 : Shutter Button
101 // - 130 : Mode Button
102 // - 284 : Wireless Button
103 // - 119 : Fn Button (Z1 Only)
106 // http://localhost:8080/