const val SEQ_ISO_SENSITIVITY = 32
const val SEQ_SHUTTER_SPEED = 33
+ const val SEQ_IMAGE_SIZE = 34
+ const val SEQ_VIDEO_SIZE = 35
+
const val SEQ_CHANGE_MODE_VIDEO = 40
const val SEQ_CHANGE_MODE = 41
--- /dev/null
+package jp.osdn.gokigen.gokigenassets.camera.vendor.pixpro.wrapper.command.messages.specific
+
+import jp.osdn.gokigen.gokigenassets.camera.vendor.pixpro.wrapper.command.messages.IPixproCommandCallback
+import jp.osdn.gokigen.gokigenassets.camera.vendor.pixpro.wrapper.command.messages.base.IPixproMessages
+import jp.osdn.gokigen.gokigenassets.camera.vendor.pixpro.wrapper.command.messages.base.PixproCommandBase
+
+class PixproChangeImageSize(private val callback: IPixproCommandCallback, value: Int) : PixproCommandBase()
+{
+ private val data00: Byte = (0x000000ff and value).toByte()
+ private val data01: Byte = (0x0000ff00 and value shr 8).toByte()
+ private val data02: Byte = (0x00ff0000 and value shr 16).toByte()
+ private val data03: Byte = (-0x1000000 and value shr 24).toByte()
+
+ override fun getId() : Int
+ {
+ return (IPixproMessages.SEQ_IMAGE_SIZE)
+ }
+
+ override fun commandBody(): ByteArray {
+ return byteArrayOf(
+
+ 0x2e.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x20.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0xed.toByte(), 0x3.toByte(), 0x0.toByte(), 0x0.toByte(), 0x1.toByte(), 0x0.toByte(), 0x0.toByte(), 0x80.toByte(),
+ 0x0a.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x1.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x1.toByte(), 0x0.toByte(), 0x0.toByte(), 0x00.toByte(),
+ 0x00.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x00.toByte(),
+ 0x00.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x00.toByte(),
+ 0x00.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x20.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0a.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x00.toByte(),
+ 0x00.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x2d.toByte(), 0x54.toByte(), 0x1.toByte(), 0x0.toByte(), 0x2d.toByte(), 0x54.toByte(), 0x1.toByte(), 0x00.toByte(),
+ data00, data01, data02, data03, 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x00.toByte(),
+ 0x00.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(),
+
+ 0xff.toByte(), 0xff.toByte(), 0xff.toByte(), 0xff.toByte(),
+ 0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte()
+
+ )
+ }
+
+ override fun responseCallback(): IPixproCommandCallback
+ {
+ return callback
+ }
+}
--- /dev/null
+package jp.osdn.gokigen.gokigenassets.camera.vendor.pixpro.wrapper.command.messages.specific
+
+import jp.osdn.gokigen.gokigenassets.camera.vendor.pixpro.wrapper.command.messages.IPixproCommandCallback
+import jp.osdn.gokigen.gokigenassets.camera.vendor.pixpro.wrapper.command.messages.base.IPixproMessages
+import jp.osdn.gokigen.gokigenassets.camera.vendor.pixpro.wrapper.command.messages.base.PixproCommandBase
+
+class PixproChangeVideoSize(private val callback: IPixproCommandCallback, value: Int) : PixproCommandBase()
+{
+ private val data00: Byte = (0x000000ff and value).toByte()
+ private val data01: Byte = (0x0000ff00 and value shr 8).toByte()
+ private val data02: Byte = (0x00ff0000 and value shr 16).toByte()
+ private val data03: Byte = (-0x1000000 and value shr 24).toByte()
+
+ override fun getId() : Int
+ {
+ return (IPixproMessages.SEQ_VIDEO_SIZE)
+ }
+
+ override fun commandBody(): ByteArray {
+ return byteArrayOf(
+ 0x2e.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x30.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0xed.toByte(), 0x3.toByte(), 0x0.toByte(), 0x0.toByte(), 0x1.toByte(), 0x0.toByte(), 0x0.toByte(), 0x80.toByte(),
+ 0x0b.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x1.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x1.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(),
+ 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(),
+ 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(),
+ 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x30.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0b.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(),
+ 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x40.toByte(), 0x1.toByte(), 0x4c.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(),
+ 0x40.toByte(), 0x1.toByte(), 0x4c.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), data00, data01, data02, data03, 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(),
+ 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(),
+ 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(), 0x0.toByte(),
+
+ 0xff.toByte(), 0xff.toByte(), 0xff.toByte(), 0xff.toByte(),
+ 0x00.toByte(), 0x00.toByte(), 0x00.toByte(), 0x00.toByte()
+
+ )
+ }
+
+ override fun responseCallback(): IPixproCommandCallback
+ {
+ return callback
+ }
+}
return (listOf("AUTO", "Daylight", "Cloudy", "Fluorescent", "Fluorescent CWF", "Incandescent"))
}
- fun getAvailableMeteringMode(): List<String?>
+ fun getAvailableMeteringMode(mode: String): List<String?>
{
- return (ArrayList())
+ return (when (mode) {
+ "Video" -> { listOf("V1", "V2", "V3", "V4", "V5") }
+ else -> { listOf("s1", "s2","s3", "s4", "s5", "s6", "s7", "s8") }
+ })
}
fun getAvailablePictureEffect(): List<String?>
ICameraStatus.CAPTURE_MODE -> statusConvert.getAvailableCaptureMode()
ICameraStatus.ISO_SENSITIVITY -> statusConvert.getAvailableIsoSensitivity()
ICameraStatus.WHITE_BALANCE -> statusConvert.getAvailableWhiteBalance()
- ICameraStatus.AE -> statusConvert.getAvailableMeteringMode()
+ ICameraStatus.AE -> statusConvert.getAvailableMeteringMode(currentTakeMode)
ICameraStatus.EFFECT -> statusConvert.getAvailablePictureEffect()
ICameraStatus.TORCH_MODE -> statusConvert.getAvailableTorchMode()
//ICameraStatus.BATTERY -> statusConvert.getAvailableRemainBattery()
//ICameraStatus.CAPTURE_MODE -> getCaptureMode()
ICameraStatus.ISO_SENSITIVITY -> getIsoSensitivity()
ICameraStatus.WHITE_BALANCE -> getWhiteBalance()
- //ICameraStatus.AE -> getMeteringMode()
+ ICameraStatus.AE -> getMeteringMode()
ICameraStatus.EFFECT -> getPictureEffect()
ICameraStatus.BATTERY -> getRemainBattery()
ICameraStatus.TORCH_MODE -> getTorchMode()
return ("WB: $currentWhiteBalance")
}
+ private fun getMeteringMode() : String
+ {
+ return ("Size")
+ }
+
private fun getPictureEffect() : String
{
return ("Zoom")
//ICameraStatus.CAPTURE_MODE -> setCaptureMode(value)
ICameraStatus.ISO_SENSITIVITY -> setIsoSensitivity(value)
ICameraStatus.WHITE_BALANCE -> setWhiteBalance(value)
- //ICameraStatus.AE -> setMeteringMode(value)
+ ICameraStatus.AE -> setMeteringMode(value)
ICameraStatus.EFFECT -> setPictureEffect(value)
ICameraStatus.TORCH_MODE -> setTorchMode(value)
//ICameraStatus.BATTERY -> setRemainBattery(value)
}
}
+
+ private fun setMeteringMode(value: String)
+ {
+ try
+ {
+ if (!::commandPublisher.isInitialized)
+ {
+ // 未初期化の場合はコマンドを送らない
+ return
+ }
+ Log.v(TAG, " setMeteringMode($value)")
+ when (value)
+ {
+ "s1" -> commandPublisher.enqueueCommand(PixproChangeImageSize(PixproCommandOnlyCallback(), 0x00010000)) // 4608x3456
+ "s2" -> commandPublisher.enqueueCommand(PixproChangeImageSize(PixproCommandOnlyCallback(), 0x00004000)) // 4608x3072
+ "s3" -> commandPublisher.enqueueCommand(PixproChangeImageSize(PixproCommandOnlyCallback(), 0x00001000)) // 4608x2592
+ "s4" -> commandPublisher.enqueueCommand(PixproChangeImageSize(PixproCommandOnlyCallback(), 0x00000400)) // 3648x2736
+ "s5" -> commandPublisher.enqueueCommand(PixproChangeImageSize(PixproCommandOnlyCallback(), 0x00000020)) // 2592x1944
+ "s6" -> commandPublisher.enqueueCommand(PixproChangeImageSize(PixproCommandOnlyCallback(), 0x00000008)) // 2048x1536
+ "s7" -> commandPublisher.enqueueCommand(PixproChangeImageSize(PixproCommandOnlyCallback(), 0x00000004)) // 1920x1080
+ "s8" -> commandPublisher.enqueueCommand(PixproChangeImageSize(PixproCommandOnlyCallback(), 0x00000001)) // 640x480
+ "V1" -> commandPublisher.enqueueCommand(PixproChangeVideoSize(PixproCommandOnlyCallback(), 0x00040000))
+ "V2" -> commandPublisher.enqueueCommand(PixproChangeVideoSize(PixproCommandOnlyCallback(), 0x00000040))
+ "V3" -> commandPublisher.enqueueCommand(PixproChangeVideoSize(PixproCommandOnlyCallback(), 0x00000100))
+ "V4" -> commandPublisher.enqueueCommand(PixproChangeVideoSize(PixproCommandOnlyCallback(), 0x00400000))
+ "V5" -> commandPublisher.enqueueCommand(PixproChangeVideoSize(PixproCommandOnlyCallback(), 0x00080000))
+ else -> { }
+ }
+ }
+ catch (e: Exception)
+ {
+ e.printStackTrace()
+ }
+ }
+
+
private fun setIsoSensitivity(value: String)
{
try