├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── CMakeSettings.json ├── CNAME ├── LICENSE ├── README.md ├── _config.yml ├── installer └── installer.nsi ├── messages ├── generate.sh ├── ovr_device.proto └── recording.proto └── src ├── generated ├── ovr_device.pb.cc ├── ovr_device.pb.h ├── recording.pb.cc └── recording.pb.h └── main.cc /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .vs 3 | build -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "thirdparty/openvr"] 2 | path = thirdparty/openvr 3 | url = https://github.com/ValveSoftware/openvr.git 4 | [submodule "thirdparty/protobuf"] 5 | path = thirdparty/protobuf 6 | url = https://github.com/lebek/protobuf.git 7 | [submodule "thirdparty/OpenVR-InputEmulator"] 8 | path = thirdparty/OpenVR-InputEmulator 9 | url = https://github.com/matzman666/OpenVR-InputEmulator.git 10 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.0.2) 2 | project (openvr-input-recorder) 3 | 4 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 /MT") 5 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 /MTd") 6 | 7 | set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 8 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) 9 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 10 | 11 | find_library(INPUT_EMULATOR_LIBRARIES_RELEASE 12 | NAMES 13 | libvrinputemulator 14 | PATHS 15 | ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/OpenVR-InputEmulator 16 | PATH_SUFFIXES 17 | Release/lib/x64 18 | NO_DEFAULT_PATH 19 | NO_CMAKE_FIND_ROOT_PATH 20 | ) 21 | 22 | find_library(INPUT_EMULATOR_LIBRARIES_DEBUG 23 | NAMES 24 | libvrinputemulator 25 | PATHS 26 | ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/OpenVR-InputEmulator 27 | PATH_SUFFIXES 28 | Debug/lib/x64 29 | NO_DEFAULT_PATH 30 | NO_CMAKE_FIND_ROOT_PATH 31 | ) 32 | 33 | set(INPUT_EMULATOR_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/OpenVR-InputEmulator/lib_vrinputemulator/include) 34 | 35 | #add_definitions( -DBOOST_ALL_NO_LIB ) 36 | #set( Boost_USE_STATIC_LIBS ON ) 37 | #set(BOOST_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/OpenVR-InputEmulator/third-party/boost_1_63_0) 38 | #set(BOOST_LIBRARYDIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/OpenVR-InputEmulator/third-party/boost_1_63_0/lib64-msvc-14.0) 39 | set(BOOST_ROOT C:/boost_1_63_0) 40 | find_package(Boost REQUIRED) 41 | 42 | find_library(OPENVR_LIBRARIES 43 | NAMES 44 | openvr_api 45 | PATHS 46 | ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/openvr/bin 47 | ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/openvr/lib 48 | PATH_SUFFIXES 49 | win64 50 | NO_DEFAULT_PATH 51 | NO_CMAKE_FIND_ROOT_PATH 52 | ) 53 | set(OPENVR_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/openvr/headers) 54 | 55 | SET(Protobuf_PROTOC_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/cmake/build/x64-Release/Release/protoc.exe) 56 | SET(Protobuf_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/cmake/build/x64-Release/Release/libprotobuf.lib) 57 | SET(Protobuf_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/src) 58 | SET(Protobuf_LIBRARY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/protobuf/cmake/build/x64-Debug/Debug/libprotobufd.lib) 59 | 60 | find_package(Protobuf REQUIRED) 61 | 62 | file(GLOB_RECURSE openvr_input_recorder_sources "src/*.cc") 63 | MESSAGE( STATUS "LIB: " ${INPUT_EMULATOR_LIBRARIES_RELEASE}) 64 | add_executable(openvr-input-recorder ${openvr_input_recorder_sources} ${PROTO_HEADER} ${PROTO_SRC}) 65 | target_include_directories(openvr-input-recorder SYSTEM PUBLIC 66 | src/ 67 | ${OPENVR_INCLUDE_DIR} 68 | ${PROTOBUF_INCLUDE_DIRS} 69 | ${INPUT_EMULATOR_INCLUDE_DIR} 70 | ${Boost_INCLUDE_DIRS} 71 | ) 72 | target_link_libraries(openvr-input-recorder 73 | ${OPENVR_LIBRARIES} 74 | ) 75 | 76 | target_link_libraries(openvr-input-recorder 77 | debug ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/OpenVR-InputEmulator/third-party/boost_1_63_0/lib64-msvc-14.0/libboost_date_time-vc140-mt-sgd-1_63.lib 78 | optimized ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/OpenVR-InputEmulator/third-party/boost_1_63_0/lib64-msvc-14.0/libboost_date_time-vc140-mt-s-1_63.lib 79 | ) 80 | 81 | target_link_libraries(openvr-input-recorder 82 | debug ${INPUT_EMULATOR_LIBRARIES_DEBUG} 83 | optimized ${INPUT_EMULATOR_LIBRARIES_RELEASE} 84 | ) 85 | 86 | target_link_libraries(openvr-input-recorder 87 | debug ${Protobuf_LIBRARY_DEBUG} 88 | optimized ${Protobuf_LIBRARY} 89 | ) 90 | 91 | add_custom_command(TARGET openvr-input-recorder POST_BUILD 92 | COMMAND ${CMAKE_COMMAND} -E copy_if_different 93 | "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/openvr/bin/win64/openvr_api.dll" 94 | $) -------------------------------------------------------------------------------- /CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com//fwlink//?linkid=834763 for more information about this file. 3 | "configurations": [ 4 | /*{ 5 | "name": "x86-Debug", 6 | "generator": "Visual Studio 15 2017", 7 | "configurationType": "Debug", 8 | "buildRoot": "${projectDir}\\build\\${name}", 9 | "cmakeCommandArgs": "", 10 | "buildCommandArgs": "-m -v:minimal", 11 | "ctestCommandArgs": "" 12 | }, 13 | { 14 | "name": "x86-Release", 15 | "generator": "Visual Studio 15 2017", 16 | "configurationType": "Release", 17 | "buildRoot": "${projectDir}\\build\\${name}", 18 | "cmakeCommandArgs": "", 19 | "buildCommandArgs": "-m -v:minimal", 20 | "ctestCommandArgs": "" 21 | },*/ 22 | { 23 | "name": "x64-Debug", 24 | "generator": "Visual Studio 15 2017 Win64", 25 | "configurationType": "Debug", 26 | "buildRoot": "${projectDir}\\build\\${name}", 27 | "cmakeCommandArgs": "", 28 | "buildCommandArgs": "-m -v:minimal", 29 | "ctestCommandArgs": "" 30 | }, 31 | { 32 | "name": "x64-Release", 33 | "generator": "Visual Studio 15 2017 Win64", 34 | "configurationType": "Release", 35 | "buildRoot": "${projectDir}\\build\\${name}", 36 | "cmakeCommandArgs": "", 37 | "buildCommandArgs": "-m -v:minimal", 38 | "ctestCommandArgs": "" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | vrinputrecorder.com -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Peter Le Bek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # :red_circle: OpenVR Input Recorder 2 | Tired of pulling your headset on everytime you change code? 3 | 4 | * Record VR actions once and replay each time you change code 5 | * Replay at 2x/4x to shorten test cycles 6 | * Test multiplayer VR on your own (and, in theory, without owning multiple headsets, but this isn't working yet) 7 | * Since tracking data is recorded/injected at the OpenVR driver level, it works with any game engine 8 | 9 | Demo: [https://www.youtube.com/watch?v=GaCRjhzMMMg](https://www.youtube.com/watch?v=GaCRjhzMMMg) 10 | 11 | ## Installation 12 | Download the latest binary from the [release section](https://github.com/lebek/openvr-input-recorder/releases). Close SteamVR (important!) and run the installer. 13 | 14 | ## Usage 15 | To record: 16 | ``` 17 | $ openvr-input-recorder.exe record my_recording 18 | ``` 19 | 20 | To replay: 21 | ``` 22 | $ openvr-input-recorder.exe replay my_recording 23 | ``` 24 | 25 | To replay at 2x speed: 26 | ``` 27 | $ openvr-input-recorder.exe replay my_recording 2 28 | ``` 29 | 30 | To loop at 2x speed: 31 | ``` 32 | $ openvr-input-recorder.exe loop my_recording 2 33 | ``` 34 | 35 | By default, `openvr-input-recorder.exe` will be installed at `C:\Program Files\OpenVR-Input-Recorder\openvr-input-recorder.exe`. 36 | 37 | ## Tips 38 | 39 | ### For testing/debugging 40 | * I recommend making recordings that leave your app in the same state at the start and end. Otherwise you'll have to put on the headset to reset the app. 41 | * Input recording/playback doesn't work very well for testing non-deterministic stuff, for obvious reasons 42 | 43 | ### For testing multiplayer 44 | * You'll need 2 or more machines, each with a connected headset. Record to a file accessible by all machines (I use Google Drive). Launch your app on all machines and playback the recording(s) as you see fit. 45 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-tactile 2 | repository: lebek/openvr-input-recorder 3 | -------------------------------------------------------------------------------- /installer/installer.nsi: -------------------------------------------------------------------------------- 1 | ;-------------------------------- 2 | ;Include Modern UI 3 | 4 | !include "MUI2.nsh" 5 | 6 | ;-------------------------------- 7 | ;General 8 | 9 | !define RECORDER_BASEDIR "..\bin\Release" 10 | !define DRIVER_BASEDIR "..\thirdparty\OpenVR-InputEmulator\driver_vrinputemulator" 11 | 12 | ;Name and file 13 | Name "OpenVR Input Recorder" 14 | OutFile "openvr-input-recorder-installer.exe" 15 | 16 | ;Default installation folder 17 | InstallDir "$PROGRAMFILES64\OpenVR-Input-Recorder" 18 | 19 | ;Get installation folder from registry if available 20 | InstallDirRegKey HKLM "Software\OpenVR-Input-Recorder\CommandLine" "" 21 | 22 | ;Request application privileges for Windows Vista 23 | RequestExecutionLevel admin 24 | 25 | ;-------------------------------- 26 | ;Variables 27 | 28 | VAR upgradeInstallation 29 | 30 | ;-------------------------------- 31 | ;Interface Settings 32 | 33 | !define MUI_ABORTWARNING 34 | 35 | ;-------------------------------- 36 | ;Pages 37 | 38 | !insertmacro MUI_PAGE_LICENSE "..\LICENSE" 39 | !define MUI_PAGE_CUSTOMFUNCTION_PRE dirPre 40 | !insertmacro MUI_PAGE_DIRECTORY 41 | !insertmacro MUI_PAGE_INSTFILES 42 | 43 | !insertmacro MUI_UNPAGE_CONFIRM 44 | !insertmacro MUI_UNPAGE_INSTFILES 45 | 46 | ;-------------------------------- 47 | ;Languages 48 | 49 | !insertmacro MUI_LANGUAGE "English" 50 | 51 | ;-------------------------------- 52 | ;Macros 53 | 54 | ;-------------------------------- 55 | ;Functions 56 | 57 | Function dirPre 58 | StrCmp $upgradeInstallation "true" 0 +2 59 | Abort 60 | FunctionEnd 61 | 62 | Function .onInit 63 | StrCpy $upgradeInstallation "false" 64 | 65 | ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVR-Input-Recorder" "UninstallString" 66 | StrCmp $R0 "" done 67 | 68 | 69 | ; If SteamVR is already running, display a warning message and exit 70 | FindWindow $0 "Qt5QWindowIcon" "SteamVR Status" 71 | StrCmp $0 0 +3 72 | MessageBox MB_OK|MB_ICONEXCLAMATION \ 73 | "SteamVR is still running. Cannot install this software.$\nPlease close SteamVR and try again." 74 | Abort 75 | 76 | 77 | MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ 78 | "OpenVR Input Recorder is already installed. $\n$\nClick `OK` to upgrade the \ 79 | existing installation or `Cancel` to cancel this upgrade." \ 80 | IDOK upgrade 81 | Abort 82 | 83 | upgrade: 84 | StrCpy $upgradeInstallation "true" 85 | done: 86 | FunctionEnd 87 | 88 | ;-------------------------------- 89 | ;Installer Sections 90 | 91 | Section "Install" SecInstall 92 | 93 | StrCmp $upgradeInstallation "true" 0 noupgrade 94 | DetailPrint "Uninstall previous version..." 95 | ExecWait '"$INSTDIR\Uninstall.exe" /S _?=$INSTDIR' 96 | Delete $INSTDIR\Uninstall.exe 97 | Goto afterupgrade 98 | 99 | noupgrade: 100 | 101 | afterupgrade: 102 | 103 | SetOutPath "$INSTDIR" 104 | 105 | ;ADD YOUR OWN FILES HERE... 106 | File "${RECORDER_BASEDIR}\*.exe" 107 | File "${RECORDER_BASEDIR}\*.dll" 108 | 109 | ; Install redistributable 110 | ; ExecWait '"$INSTDIR\vcredist_x64.exe" /install /quiet' 111 | 112 | Var /GLOBAL vrRuntimePath 113 | ; nsExec::ExecToStack '"$INSTDIR\OpenVR-InputEmulatorOverlay.exe" -openvrpath' 114 | ; Pop $0 115 | ; Pop $vrRuntimePath 116 | StrCpy $vrRuntimePath "C:\Program Files (x86)\Steam\steamapps\common\SteamVR" 117 | DetailPrint "VR runtime path: $vrRuntimePath" 118 | 119 | SetOutPath "$vrRuntimePath\drivers\00vrinputemulator" 120 | File "${DRIVER_BASEDIR}\driver.vrdrivermanifest" 121 | SetOutPath "$vrRuntimePath\drivers\00vrinputemulator\resources" 122 | File "${DRIVER_BASEDIR}\resources\driver.vrresources" 123 | SetOutPath "$vrRuntimePath\drivers\00vrinputemulator\resources\settings" 124 | File "${DRIVER_BASEDIR}\resources\settings\default.vrsettings" 125 | SetOutPath "$vrRuntimePath\drivers\00vrinputemulator\bin\win64" 126 | File "${DRIVER_BASEDIR}\bin\x64\driver_00vrinputemulator.dll" 127 | 128 | ;Store installation folder 129 | WriteRegStr HKLM "Software\OpenVR-Input-Recorder\CommandLine" "" $INSTDIR 130 | WriteRegStr HKLM "Software\OpenVR-Input-Recorder\Driver" "" $vrRuntimePath 131 | 132 | ;Create uninstaller 133 | WriteUninstaller "$INSTDIR\Uninstall.exe" 134 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVR-Input-Recorder" "DisplayName" "OpenVR Input Recorder" 135 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVR-Input-Recorder" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" 136 | 137 | SectionEnd 138 | 139 | ;-------------------------------- 140 | ;Uninstaller Section 141 | 142 | Section "Uninstall" 143 | ; If SteamVR is already running, display a warning message and exit 144 | FindWindow $0 "Qt5QWindowIcon" "SteamVR Status" 145 | StrCmp $0 0 +3 146 | MessageBox MB_OK|MB_ICONEXCLAMATION \ 147 | "SteamVR is still running. Cannot uninstall this software.$\nPlease close SteamVR and try again." 148 | Abort 149 | 150 | ; Delete installed files 151 | Var /GLOBAL vrRuntimePath2 152 | ReadRegStr $vrRuntimePath2 HKLM "Software\OpenVR-Input-Recorder\Driver" "" 153 | DetailPrint "VR runtime path: $vrRuntimePath2" 154 | Delete "$vrRuntimePath2\drivers\00vrinputemulator\driver.vrdrivermanifest" 155 | Delete "$vrRuntimePath2\drivers\00vrinputemulator\resources\driver.vrresources" 156 | Delete "$vrRuntimePath2\drivers\00vrinputemulator\resources\settings\default.vrsettings" 157 | Delete "$vrRuntimePath2\drivers\00vrinputemulator\bin\win64\driver_00vrinputemulator.dll" 158 | Delete "$vrRuntimePath2\drivers\00vrinputemulator\bin\win64\driver_vrinputemulator.log" 159 | RMdir "$vrRuntimePath2\drivers\00vrinputemulator\resources\settings" 160 | RMdir "$vrRuntimePath2\drivers\00vrinputemulator\resources\" 161 | RMdir "$vrRuntimePath2\drivers\00vrinputemulator\bin\win64\" 162 | RMdir "$vrRuntimePath2\drivers\00vrinputemulator\bin\" 163 | RMdir "$vrRuntimePath2\drivers\00vrinputemulator\" 164 | 165 | Delete "$INSTDIR\openvr_api.dll" 166 | Delete "$INSTDIR\openvr-input-recorder.exe" 167 | Delete "$INSTDIR\Uninstall.exe" 168 | RMdir "$INSTDIR\" 169 | 170 | DeleteRegKey HKLM "Software\OpenVR-Input-Recorder\CommandLine" 171 | DeleteRegKey HKLM "Software\OpenVR-Input-Recorder\Driver" 172 | DeleteRegKey HKLM "Software\OpenVR-Input-Recorder" 173 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenVR-Input-Recorder" 174 | SectionEnd 175 | -------------------------------------------------------------------------------- /messages/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd "${0%/*}" 3 | rm -f ../src/generated/* 4 | ../thirdparty/protobuf/cmake/build/x64-Release/Release/protoc.exe -I. -I../thirdparty/protobuf/src/ --cpp_out=../src/generated ./*.proto -------------------------------------------------------------------------------- /messages/ovr_device.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message OVRDeviceProperty { 4 | int32 identifier = 8; 5 | 6 | enum Type { Int32 = 0; Uint64 = 1; Bool = 2; Float = 3; String = 4; Matrix34 = 5; } 7 | Type type = 1; 8 | 9 | int32 int32_value = 2; 10 | uint64 uint64_value = 3; 11 | bool bool_value = 4; 12 | float float_value = 5; 13 | string string_value = 6; 14 | repeated float matrix34_value = 7; 15 | } 16 | 17 | message OVRDevice { 18 | int32 id = 1; 19 | 20 | int32 device_class = 2; 21 | 22 | /* Only set if this is a controller */ 23 | int32 controller_role = 3; 24 | 25 | repeated OVRDeviceProperty properties = 4; 26 | } 27 | 28 | /* Need a way to tie samples/timelines to devices */ 29 | 30 | message OVRSample { 31 | /* Milliseconds from start */ 32 | uint64 time = 1; 33 | 34 | repeated float position = 2; 35 | repeated float rotation = 3; 36 | repeated float axis = 4; 37 | uint64 button_pressed = 5; 38 | uint64 button_touched = 6; 39 | } 40 | 41 | message OVRTimeline { 42 | int32 device_id = 1; 43 | 44 | repeated OVRSample samples = 2; 45 | } 46 | -------------------------------------------------------------------------------- /messages/recording.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | import "google/protobuf/timestamp.proto"; 3 | import "ovr_device.proto"; 4 | 5 | message Recording { 6 | google.protobuf.Timestamp start = 1; 7 | google.protobuf.Timestamp end = 2; 8 | 9 | repeated OVRDevice devices = 3; 10 | repeated OVRTimeline timeline = 4; 11 | } 12 | -------------------------------------------------------------------------------- /src/generated/ovr_device.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: ovr_device.proto 3 | 4 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION 5 | #include "ovr_device.pb.h" 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | // @@protoc_insertion_point(includes) 19 | class OVRDevicePropertyDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed { 20 | } _OVRDeviceProperty_default_instance_; 21 | class OVRDeviceDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed { 22 | } _OVRDevice_default_instance_; 23 | class OVRSampleDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed { 24 | } _OVRSample_default_instance_; 25 | class OVRTimelineDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed { 26 | } _OVRTimeline_default_instance_; 27 | 28 | namespace protobuf_ovr_5fdevice_2eproto { 29 | 30 | 31 | namespace { 32 | 33 | ::google::protobuf::Metadata file_level_metadata[4]; 34 | const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1]; 35 | 36 | } // namespace 37 | 38 | PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField 39 | const TableStruct::entries[] = { 40 | {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, 41 | }; 42 | 43 | PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField 44 | const TableStruct::aux[] = { 45 | ::google::protobuf::internal::AuxillaryParseTableField(), 46 | }; 47 | PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const 48 | TableStruct::schema[] = { 49 | { NULL, NULL, 0, -1, -1, false }, 50 | { NULL, NULL, 0, -1, -1, false }, 51 | { NULL, NULL, 0, -1, -1, false }, 52 | { NULL, NULL, 0, -1, -1, false }, 53 | }; 54 | 55 | const ::google::protobuf::uint32 TableStruct::offsets[] = { 56 | ~0u, // no _has_bits_ 57 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDeviceProperty, _internal_metadata_), 58 | ~0u, // no _extensions_ 59 | ~0u, // no _oneof_case_ 60 | ~0u, // no _weak_field_map_ 61 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDeviceProperty, identifier_), 62 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDeviceProperty, type_), 63 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDeviceProperty, int32_value_), 64 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDeviceProperty, uint64_value_), 65 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDeviceProperty, bool_value_), 66 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDeviceProperty, float_value_), 67 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDeviceProperty, string_value_), 68 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDeviceProperty, matrix34_value_), 69 | ~0u, // no _has_bits_ 70 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDevice, _internal_metadata_), 71 | ~0u, // no _extensions_ 72 | ~0u, // no _oneof_case_ 73 | ~0u, // no _weak_field_map_ 74 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDevice, id_), 75 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDevice, device_class_), 76 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDevice, controller_role_), 77 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRDevice, properties_), 78 | ~0u, // no _has_bits_ 79 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRSample, _internal_metadata_), 80 | ~0u, // no _extensions_ 81 | ~0u, // no _oneof_case_ 82 | ~0u, // no _weak_field_map_ 83 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRSample, time_), 84 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRSample, position_), 85 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRSample, rotation_), 86 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRSample, axis_), 87 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRSample, button_pressed_), 88 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRSample, button_touched_), 89 | ~0u, // no _has_bits_ 90 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRTimeline, _internal_metadata_), 91 | ~0u, // no _extensions_ 92 | ~0u, // no _oneof_case_ 93 | ~0u, // no _weak_field_map_ 94 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRTimeline, device_id_), 95 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OVRTimeline, samples_), 96 | }; 97 | 98 | static const ::google::protobuf::internal::MigrationSchema schemas[] = { 99 | { 0, -1, sizeof(OVRDeviceProperty)}, 100 | { 13, -1, sizeof(OVRDevice)}, 101 | { 22, -1, sizeof(OVRSample)}, 102 | { 33, -1, sizeof(OVRTimeline)}, 103 | }; 104 | 105 | static ::google::protobuf::Message const * const file_default_instances[] = { 106 | reinterpret_cast(&_OVRDeviceProperty_default_instance_), 107 | reinterpret_cast(&_OVRDevice_default_instance_), 108 | reinterpret_cast(&_OVRSample_default_instance_), 109 | reinterpret_cast(&_OVRTimeline_default_instance_), 110 | }; 111 | 112 | namespace { 113 | 114 | void protobuf_AssignDescriptors() { 115 | AddDescriptors(); 116 | ::google::protobuf::MessageFactory* factory = NULL; 117 | AssignDescriptors( 118 | "ovr_device.proto", schemas, file_default_instances, TableStruct::offsets, factory, 119 | file_level_metadata, file_level_enum_descriptors, NULL); 120 | } 121 | 122 | void protobuf_AssignDescriptorsOnce() { 123 | static GOOGLE_PROTOBUF_DECLARE_ONCE(once); 124 | ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); 125 | } 126 | 127 | void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; 128 | void protobuf_RegisterTypes(const ::std::string&) { 129 | protobuf_AssignDescriptorsOnce(); 130 | ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 4); 131 | } 132 | 133 | } // namespace 134 | 135 | void TableStruct::Shutdown() { 136 | _OVRDeviceProperty_default_instance_.Shutdown(); 137 | delete file_level_metadata[0].reflection; 138 | _OVRDevice_default_instance_.Shutdown(); 139 | delete file_level_metadata[1].reflection; 140 | _OVRSample_default_instance_.Shutdown(); 141 | delete file_level_metadata[2].reflection; 142 | _OVRTimeline_default_instance_.Shutdown(); 143 | delete file_level_metadata[3].reflection; 144 | } 145 | 146 | void TableStruct::InitDefaultsImpl() { 147 | GOOGLE_PROTOBUF_VERIFY_VERSION; 148 | 149 | ::google::protobuf::internal::InitProtobufDefaults(); 150 | _OVRDeviceProperty_default_instance_.DefaultConstruct(); 151 | _OVRDevice_default_instance_.DefaultConstruct(); 152 | _OVRSample_default_instance_.DefaultConstruct(); 153 | _OVRTimeline_default_instance_.DefaultConstruct(); 154 | } 155 | 156 | void InitDefaults() { 157 | static GOOGLE_PROTOBUF_DECLARE_ONCE(once); 158 | ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); 159 | } 160 | void AddDescriptorsImpl() { 161 | InitDefaults(); 162 | static const char descriptor[] = { 163 | "\n\020ovr_device.proto\"\236\002\n\021OVRDeviceProperty" 164 | "\022\022\n\nidentifier\030\010 \001(\005\022%\n\004type\030\001 \001(\0162\027.OVR" 165 | "DeviceProperty.Type\022\023\n\013int32_value\030\002 \001(\005" 166 | "\022\024\n\014uint64_value\030\003 \001(\004\022\022\n\nbool_value\030\004 \001" 167 | "(\010\022\023\n\013float_value\030\005 \001(\002\022\024\n\014string_value\030" 168 | "\006 \001(\t\022\026\n\016matrix34_value\030\007 \003(\002\"L\n\004Type\022\t\n" 169 | "\005Int32\020\000\022\n\n\006Uint64\020\001\022\010\n\004Bool\020\002\022\t\n\005Float\020" 170 | "\003\022\n\n\006String\020\004\022\014\n\010Matrix34\020\005\"n\n\tOVRDevice" 171 | "\022\n\n\002id\030\001 \001(\005\022\024\n\014device_class\030\002 \001(\005\022\027\n\017co" 172 | "ntroller_role\030\003 \001(\005\022&\n\nproperties\030\004 \003(\0132" 173 | "\022.OVRDeviceProperty\"{\n\tOVRSample\022\014\n\004time" 174 | "\030\001 \001(\004\022\020\n\010position\030\002 \003(\002\022\020\n\010rotation\030\003 \003" 175 | "(\002\022\014\n\004axis\030\004 \003(\002\022\026\n\016button_pressed\030\005 \001(\004" 176 | "\022\026\n\016button_touched\030\006 \001(\004\"=\n\013OVRTimeline\022" 177 | "\021\n\tdevice_id\030\001 \001(\005\022\033\n\007samples\030\002 \003(\0132\n.OV" 178 | "RSampleb\006proto3" 179 | }; 180 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( 181 | descriptor, 615); 182 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( 183 | "ovr_device.proto", &protobuf_RegisterTypes); 184 | ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); 185 | } 186 | 187 | void AddDescriptors() { 188 | static GOOGLE_PROTOBUF_DECLARE_ONCE(once); 189 | ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); 190 | } 191 | // Force AddDescriptors() to be called at static initialization time. 192 | struct StaticDescriptorInitializer { 193 | StaticDescriptorInitializer() { 194 | AddDescriptors(); 195 | } 196 | } static_descriptor_initializer; 197 | 198 | } // namespace protobuf_ovr_5fdevice_2eproto 199 | 200 | const ::google::protobuf::EnumDescriptor* OVRDeviceProperty_Type_descriptor() { 201 | protobuf_ovr_5fdevice_2eproto::protobuf_AssignDescriptorsOnce(); 202 | return protobuf_ovr_5fdevice_2eproto::file_level_enum_descriptors[0]; 203 | } 204 | bool OVRDeviceProperty_Type_IsValid(int value) { 205 | switch (value) { 206 | case 0: 207 | case 1: 208 | case 2: 209 | case 3: 210 | case 4: 211 | case 5: 212 | return true; 213 | default: 214 | return false; 215 | } 216 | } 217 | 218 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 219 | const OVRDeviceProperty_Type OVRDeviceProperty::Int32; 220 | const OVRDeviceProperty_Type OVRDeviceProperty::Uint64; 221 | const OVRDeviceProperty_Type OVRDeviceProperty::Bool; 222 | const OVRDeviceProperty_Type OVRDeviceProperty::Float; 223 | const OVRDeviceProperty_Type OVRDeviceProperty::String; 224 | const OVRDeviceProperty_Type OVRDeviceProperty::Matrix34; 225 | const OVRDeviceProperty_Type OVRDeviceProperty::Type_MIN; 226 | const OVRDeviceProperty_Type OVRDeviceProperty::Type_MAX; 227 | const int OVRDeviceProperty::Type_ARRAYSIZE; 228 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 229 | 230 | // =================================================================== 231 | 232 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 233 | const int OVRDeviceProperty::kIdentifierFieldNumber; 234 | const int OVRDeviceProperty::kTypeFieldNumber; 235 | const int OVRDeviceProperty::kInt32ValueFieldNumber; 236 | const int OVRDeviceProperty::kUint64ValueFieldNumber; 237 | const int OVRDeviceProperty::kBoolValueFieldNumber; 238 | const int OVRDeviceProperty::kFloatValueFieldNumber; 239 | const int OVRDeviceProperty::kStringValueFieldNumber; 240 | const int OVRDeviceProperty::kMatrix34ValueFieldNumber; 241 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 242 | 243 | OVRDeviceProperty::OVRDeviceProperty() 244 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 245 | if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { 246 | protobuf_ovr_5fdevice_2eproto::InitDefaults(); 247 | } 248 | SharedCtor(); 249 | // @@protoc_insertion_point(constructor:OVRDeviceProperty) 250 | } 251 | OVRDeviceProperty::OVRDeviceProperty(const OVRDeviceProperty& from) 252 | : ::google::protobuf::Message(), 253 | _internal_metadata_(NULL), 254 | matrix34_value_(from.matrix34_value_), 255 | _cached_size_(0) { 256 | _internal_metadata_.MergeFrom(from._internal_metadata_); 257 | string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 258 | if (from.string_value().size() > 0) { 259 | string_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_value_); 260 | } 261 | ::memcpy(&type_, &from.type_, 262 | reinterpret_cast(&identifier_) - 263 | reinterpret_cast(&type_) + sizeof(identifier_)); 264 | // @@protoc_insertion_point(copy_constructor:OVRDeviceProperty) 265 | } 266 | 267 | void OVRDeviceProperty::SharedCtor() { 268 | string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 269 | ::memset(&type_, 0, reinterpret_cast(&identifier_) - 270 | reinterpret_cast(&type_) + sizeof(identifier_)); 271 | _cached_size_ = 0; 272 | } 273 | 274 | OVRDeviceProperty::~OVRDeviceProperty() { 275 | // @@protoc_insertion_point(destructor:OVRDeviceProperty) 276 | SharedDtor(); 277 | } 278 | 279 | void OVRDeviceProperty::SharedDtor() { 280 | string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 281 | } 282 | 283 | void OVRDeviceProperty::SetCachedSize(int size) const { 284 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 285 | _cached_size_ = size; 286 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 287 | } 288 | const ::google::protobuf::Descriptor* OVRDeviceProperty::descriptor() { 289 | protobuf_ovr_5fdevice_2eproto::protobuf_AssignDescriptorsOnce(); 290 | return protobuf_ovr_5fdevice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 291 | } 292 | 293 | const OVRDeviceProperty& OVRDeviceProperty::default_instance() { 294 | protobuf_ovr_5fdevice_2eproto::InitDefaults(); 295 | return *internal_default_instance(); 296 | } 297 | 298 | OVRDeviceProperty* OVRDeviceProperty::New(::google::protobuf::Arena* arena) const { 299 | OVRDeviceProperty* n = new OVRDeviceProperty; 300 | if (arena != NULL) { 301 | arena->Own(n); 302 | } 303 | return n; 304 | } 305 | 306 | void OVRDeviceProperty::Clear() { 307 | // @@protoc_insertion_point(message_clear_start:OVRDeviceProperty) 308 | matrix34_value_.Clear(); 309 | string_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 310 | ::memset(&type_, 0, reinterpret_cast(&identifier_) - 311 | reinterpret_cast(&type_) + sizeof(identifier_)); 312 | } 313 | 314 | bool OVRDeviceProperty::MergePartialFromCodedStream( 315 | ::google::protobuf::io::CodedInputStream* input) { 316 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 317 | ::google::protobuf::uint32 tag; 318 | // @@protoc_insertion_point(parse_start:OVRDeviceProperty) 319 | for (;;) { 320 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 321 | tag = p.first; 322 | if (!p.second) goto handle_unusual; 323 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 324 | // .OVRDeviceProperty.Type type = 1; 325 | case 1: { 326 | if (static_cast< ::google::protobuf::uint8>(tag) == 327 | static_cast< ::google::protobuf::uint8>(8u)) { 328 | int value; 329 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 330 | int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( 331 | input, &value))); 332 | set_type(static_cast< ::OVRDeviceProperty_Type >(value)); 333 | } else { 334 | goto handle_unusual; 335 | } 336 | break; 337 | } 338 | 339 | // int32 int32_value = 2; 340 | case 2: { 341 | if (static_cast< ::google::protobuf::uint8>(tag) == 342 | static_cast< ::google::protobuf::uint8>(16u)) { 343 | 344 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 345 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 346 | input, &int32_value_))); 347 | } else { 348 | goto handle_unusual; 349 | } 350 | break; 351 | } 352 | 353 | // uint64 uint64_value = 3; 354 | case 3: { 355 | if (static_cast< ::google::protobuf::uint8>(tag) == 356 | static_cast< ::google::protobuf::uint8>(24u)) { 357 | 358 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 359 | ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 360 | input, &uint64_value_))); 361 | } else { 362 | goto handle_unusual; 363 | } 364 | break; 365 | } 366 | 367 | // bool bool_value = 4; 368 | case 4: { 369 | if (static_cast< ::google::protobuf::uint8>(tag) == 370 | static_cast< ::google::protobuf::uint8>(32u)) { 371 | 372 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 373 | bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( 374 | input, &bool_value_))); 375 | } else { 376 | goto handle_unusual; 377 | } 378 | break; 379 | } 380 | 381 | // float float_value = 5; 382 | case 5: { 383 | if (static_cast< ::google::protobuf::uint8>(tag) == 384 | static_cast< ::google::protobuf::uint8>(45u)) { 385 | 386 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 387 | float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 388 | input, &float_value_))); 389 | } else { 390 | goto handle_unusual; 391 | } 392 | break; 393 | } 394 | 395 | // string string_value = 6; 396 | case 6: { 397 | if (static_cast< ::google::protobuf::uint8>(tag) == 398 | static_cast< ::google::protobuf::uint8>(50u)) { 399 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 400 | input, this->mutable_string_value())); 401 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 402 | this->string_value().data(), this->string_value().length(), 403 | ::google::protobuf::internal::WireFormatLite::PARSE, 404 | "OVRDeviceProperty.string_value")); 405 | } else { 406 | goto handle_unusual; 407 | } 408 | break; 409 | } 410 | 411 | // repeated float matrix34_value = 7; 412 | case 7: { 413 | if (static_cast< ::google::protobuf::uint8>(tag) == 414 | static_cast< ::google::protobuf::uint8>(58u)) { 415 | DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< 416 | float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 417 | input, this->mutable_matrix34_value()))); 418 | } else if (static_cast< ::google::protobuf::uint8>(tag) == 419 | static_cast< ::google::protobuf::uint8>(61u)) { 420 | DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< 421 | float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 422 | 1, 58u, input, this->mutable_matrix34_value()))); 423 | } else { 424 | goto handle_unusual; 425 | } 426 | break; 427 | } 428 | 429 | // int32 identifier = 8; 430 | case 8: { 431 | if (static_cast< ::google::protobuf::uint8>(tag) == 432 | static_cast< ::google::protobuf::uint8>(64u)) { 433 | 434 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 435 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 436 | input, &identifier_))); 437 | } else { 438 | goto handle_unusual; 439 | } 440 | break; 441 | } 442 | 443 | default: { 444 | handle_unusual: 445 | if (tag == 0 || 446 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 447 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 448 | goto success; 449 | } 450 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 451 | break; 452 | } 453 | } 454 | } 455 | success: 456 | // @@protoc_insertion_point(parse_success:OVRDeviceProperty) 457 | return true; 458 | failure: 459 | // @@protoc_insertion_point(parse_failure:OVRDeviceProperty) 460 | return false; 461 | #undef DO_ 462 | } 463 | 464 | void OVRDeviceProperty::SerializeWithCachedSizes( 465 | ::google::protobuf::io::CodedOutputStream* output) const { 466 | // @@protoc_insertion_point(serialize_start:OVRDeviceProperty) 467 | ::google::protobuf::uint32 cached_has_bits = 0; 468 | (void) cached_has_bits; 469 | 470 | // .OVRDeviceProperty.Type type = 1; 471 | if (this->type() != 0) { 472 | ::google::protobuf::internal::WireFormatLite::WriteEnum( 473 | 1, this->type(), output); 474 | } 475 | 476 | // int32 int32_value = 2; 477 | if (this->int32_value() != 0) { 478 | ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->int32_value(), output); 479 | } 480 | 481 | // uint64 uint64_value = 3; 482 | if (this->uint64_value() != 0) { 483 | ::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->uint64_value(), output); 484 | } 485 | 486 | // bool bool_value = 4; 487 | if (this->bool_value() != 0) { 488 | ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->bool_value(), output); 489 | } 490 | 491 | // float float_value = 5; 492 | if (this->float_value() != 0) { 493 | ::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->float_value(), output); 494 | } 495 | 496 | // string string_value = 6; 497 | if (this->string_value().size() > 0) { 498 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 499 | this->string_value().data(), this->string_value().length(), 500 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 501 | "OVRDeviceProperty.string_value"); 502 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 503 | 6, this->string_value(), output); 504 | } 505 | 506 | // repeated float matrix34_value = 7; 507 | if (this->matrix34_value_size() > 0) { 508 | ::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); 509 | output->WriteVarint32(_matrix34_value_cached_byte_size_); 510 | ::google::protobuf::internal::WireFormatLite::WriteFloatArray( 511 | this->matrix34_value().data(), this->matrix34_value_size(), output); 512 | } 513 | 514 | // int32 identifier = 8; 515 | if (this->identifier() != 0) { 516 | ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->identifier(), output); 517 | } 518 | 519 | // @@protoc_insertion_point(serialize_end:OVRDeviceProperty) 520 | } 521 | 522 | ::google::protobuf::uint8* OVRDeviceProperty::InternalSerializeWithCachedSizesToArray( 523 | bool deterministic, ::google::protobuf::uint8* target) const { 524 | // @@protoc_insertion_point(serialize_to_array_start:OVRDeviceProperty) 525 | ::google::protobuf::uint32 cached_has_bits = 0; 526 | (void) cached_has_bits; 527 | 528 | // .OVRDeviceProperty.Type type = 1; 529 | if (this->type() != 0) { 530 | target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( 531 | 1, this->type(), target); 532 | } 533 | 534 | // int32 int32_value = 2; 535 | if (this->int32_value() != 0) { 536 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->int32_value(), target); 537 | } 538 | 539 | // uint64 uint64_value = 3; 540 | if (this->uint64_value() != 0) { 541 | target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->uint64_value(), target); 542 | } 543 | 544 | // bool bool_value = 4; 545 | if (this->bool_value() != 0) { 546 | target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->bool_value(), target); 547 | } 548 | 549 | // float float_value = 5; 550 | if (this->float_value() != 0) { 551 | target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->float_value(), target); 552 | } 553 | 554 | // string string_value = 6; 555 | if (this->string_value().size() > 0) { 556 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 557 | this->string_value().data(), this->string_value().length(), 558 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 559 | "OVRDeviceProperty.string_value"); 560 | target = 561 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 562 | 6, this->string_value(), target); 563 | } 564 | 565 | // repeated float matrix34_value = 7; 566 | if (this->matrix34_value_size() > 0) { 567 | target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 568 | 7, 569 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, 570 | target); 571 | target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( 572 | _matrix34_value_cached_byte_size_, target); 573 | target = ::google::protobuf::internal::WireFormatLite:: 574 | WriteFloatNoTagToArray(this->matrix34_value_, target); 575 | } 576 | 577 | // int32 identifier = 8; 578 | if (this->identifier() != 0) { 579 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->identifier(), target); 580 | } 581 | 582 | // @@protoc_insertion_point(serialize_to_array_end:OVRDeviceProperty) 583 | return target; 584 | } 585 | 586 | size_t OVRDeviceProperty::ByteSizeLong() const { 587 | // @@protoc_insertion_point(message_byte_size_start:OVRDeviceProperty) 588 | size_t total_size = 0; 589 | 590 | // repeated float matrix34_value = 7; 591 | { 592 | unsigned int count = this->matrix34_value_size(); 593 | size_t data_size = 4UL * count; 594 | if (data_size > 0) { 595 | total_size += 1 + 596 | ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); 597 | } 598 | int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); 599 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 600 | _matrix34_value_cached_byte_size_ = cached_size; 601 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 602 | total_size += data_size; 603 | } 604 | 605 | // string string_value = 6; 606 | if (this->string_value().size() > 0) { 607 | total_size += 1 + 608 | ::google::protobuf::internal::WireFormatLite::StringSize( 609 | this->string_value()); 610 | } 611 | 612 | // .OVRDeviceProperty.Type type = 1; 613 | if (this->type() != 0) { 614 | total_size += 1 + 615 | ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); 616 | } 617 | 618 | // int32 int32_value = 2; 619 | if (this->int32_value() != 0) { 620 | total_size += 1 + 621 | ::google::protobuf::internal::WireFormatLite::Int32Size( 622 | this->int32_value()); 623 | } 624 | 625 | // uint64 uint64_value = 3; 626 | if (this->uint64_value() != 0) { 627 | total_size += 1 + 628 | ::google::protobuf::internal::WireFormatLite::UInt64Size( 629 | this->uint64_value()); 630 | } 631 | 632 | // bool bool_value = 4; 633 | if (this->bool_value() != 0) { 634 | total_size += 1 + 1; 635 | } 636 | 637 | // float float_value = 5; 638 | if (this->float_value() != 0) { 639 | total_size += 1 + 4; 640 | } 641 | 642 | // int32 identifier = 8; 643 | if (this->identifier() != 0) { 644 | total_size += 1 + 645 | ::google::protobuf::internal::WireFormatLite::Int32Size( 646 | this->identifier()); 647 | } 648 | 649 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 650 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 651 | _cached_size_ = cached_size; 652 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 653 | return total_size; 654 | } 655 | 656 | void OVRDeviceProperty::MergeFrom(const ::google::protobuf::Message& from) { 657 | // @@protoc_insertion_point(generalized_merge_from_start:OVRDeviceProperty) 658 | GOOGLE_DCHECK_NE(&from, this); 659 | const OVRDeviceProperty* source = 660 | ::google::protobuf::internal::DynamicCastToGenerated( 661 | &from); 662 | if (source == NULL) { 663 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:OVRDeviceProperty) 664 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 665 | } else { 666 | // @@protoc_insertion_point(generalized_merge_from_cast_success:OVRDeviceProperty) 667 | MergeFrom(*source); 668 | } 669 | } 670 | 671 | void OVRDeviceProperty::MergeFrom(const OVRDeviceProperty& from) { 672 | // @@protoc_insertion_point(class_specific_merge_from_start:OVRDeviceProperty) 673 | GOOGLE_DCHECK_NE(&from, this); 674 | _internal_metadata_.MergeFrom(from._internal_metadata_); 675 | ::google::protobuf::uint32 cached_has_bits = 0; 676 | (void) cached_has_bits; 677 | 678 | matrix34_value_.MergeFrom(from.matrix34_value_); 679 | if (from.string_value().size() > 0) { 680 | 681 | string_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_value_); 682 | } 683 | if (from.type() != 0) { 684 | set_type(from.type()); 685 | } 686 | if (from.int32_value() != 0) { 687 | set_int32_value(from.int32_value()); 688 | } 689 | if (from.uint64_value() != 0) { 690 | set_uint64_value(from.uint64_value()); 691 | } 692 | if (from.bool_value() != 0) { 693 | set_bool_value(from.bool_value()); 694 | } 695 | if (from.float_value() != 0) { 696 | set_float_value(from.float_value()); 697 | } 698 | if (from.identifier() != 0) { 699 | set_identifier(from.identifier()); 700 | } 701 | } 702 | 703 | void OVRDeviceProperty::CopyFrom(const ::google::protobuf::Message& from) { 704 | // @@protoc_insertion_point(generalized_copy_from_start:OVRDeviceProperty) 705 | if (&from == this) return; 706 | Clear(); 707 | MergeFrom(from); 708 | } 709 | 710 | void OVRDeviceProperty::CopyFrom(const OVRDeviceProperty& from) { 711 | // @@protoc_insertion_point(class_specific_copy_from_start:OVRDeviceProperty) 712 | if (&from == this) return; 713 | Clear(); 714 | MergeFrom(from); 715 | } 716 | 717 | bool OVRDeviceProperty::IsInitialized() const { 718 | return true; 719 | } 720 | 721 | void OVRDeviceProperty::Swap(OVRDeviceProperty* other) { 722 | if (other == this) return; 723 | InternalSwap(other); 724 | } 725 | void OVRDeviceProperty::InternalSwap(OVRDeviceProperty* other) { 726 | matrix34_value_.InternalSwap(&other->matrix34_value_); 727 | string_value_.Swap(&other->string_value_); 728 | std::swap(type_, other->type_); 729 | std::swap(int32_value_, other->int32_value_); 730 | std::swap(uint64_value_, other->uint64_value_); 731 | std::swap(bool_value_, other->bool_value_); 732 | std::swap(float_value_, other->float_value_); 733 | std::swap(identifier_, other->identifier_); 734 | std::swap(_cached_size_, other->_cached_size_); 735 | } 736 | 737 | ::google::protobuf::Metadata OVRDeviceProperty::GetMetadata() const { 738 | protobuf_ovr_5fdevice_2eproto::protobuf_AssignDescriptorsOnce(); 739 | return protobuf_ovr_5fdevice_2eproto::file_level_metadata[kIndexInFileMessages]; 740 | } 741 | 742 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 743 | // OVRDeviceProperty 744 | 745 | // int32 identifier = 8; 746 | void OVRDeviceProperty::clear_identifier() { 747 | identifier_ = 0; 748 | } 749 | ::google::protobuf::int32 OVRDeviceProperty::identifier() const { 750 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.identifier) 751 | return identifier_; 752 | } 753 | void OVRDeviceProperty::set_identifier(::google::protobuf::int32 value) { 754 | 755 | identifier_ = value; 756 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.identifier) 757 | } 758 | 759 | // .OVRDeviceProperty.Type type = 1; 760 | void OVRDeviceProperty::clear_type() { 761 | type_ = 0; 762 | } 763 | ::OVRDeviceProperty_Type OVRDeviceProperty::type() const { 764 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.type) 765 | return static_cast< ::OVRDeviceProperty_Type >(type_); 766 | } 767 | void OVRDeviceProperty::set_type(::OVRDeviceProperty_Type value) { 768 | 769 | type_ = value; 770 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.type) 771 | } 772 | 773 | // int32 int32_value = 2; 774 | void OVRDeviceProperty::clear_int32_value() { 775 | int32_value_ = 0; 776 | } 777 | ::google::protobuf::int32 OVRDeviceProperty::int32_value() const { 778 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.int32_value) 779 | return int32_value_; 780 | } 781 | void OVRDeviceProperty::set_int32_value(::google::protobuf::int32 value) { 782 | 783 | int32_value_ = value; 784 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.int32_value) 785 | } 786 | 787 | // uint64 uint64_value = 3; 788 | void OVRDeviceProperty::clear_uint64_value() { 789 | uint64_value_ = GOOGLE_ULONGLONG(0); 790 | } 791 | ::google::protobuf::uint64 OVRDeviceProperty::uint64_value() const { 792 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.uint64_value) 793 | return uint64_value_; 794 | } 795 | void OVRDeviceProperty::set_uint64_value(::google::protobuf::uint64 value) { 796 | 797 | uint64_value_ = value; 798 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.uint64_value) 799 | } 800 | 801 | // bool bool_value = 4; 802 | void OVRDeviceProperty::clear_bool_value() { 803 | bool_value_ = false; 804 | } 805 | bool OVRDeviceProperty::bool_value() const { 806 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.bool_value) 807 | return bool_value_; 808 | } 809 | void OVRDeviceProperty::set_bool_value(bool value) { 810 | 811 | bool_value_ = value; 812 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.bool_value) 813 | } 814 | 815 | // float float_value = 5; 816 | void OVRDeviceProperty::clear_float_value() { 817 | float_value_ = 0; 818 | } 819 | float OVRDeviceProperty::float_value() const { 820 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.float_value) 821 | return float_value_; 822 | } 823 | void OVRDeviceProperty::set_float_value(float value) { 824 | 825 | float_value_ = value; 826 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.float_value) 827 | } 828 | 829 | // string string_value = 6; 830 | void OVRDeviceProperty::clear_string_value() { 831 | string_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 832 | } 833 | const ::std::string& OVRDeviceProperty::string_value() const { 834 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.string_value) 835 | return string_value_.GetNoArena(); 836 | } 837 | void OVRDeviceProperty::set_string_value(const ::std::string& value) { 838 | 839 | string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 840 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.string_value) 841 | } 842 | #if LANG_CXX11 843 | void OVRDeviceProperty::set_string_value(::std::string&& value) { 844 | 845 | string_value_.SetNoArena( 846 | &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); 847 | // @@protoc_insertion_point(field_set_rvalue:OVRDeviceProperty.string_value) 848 | } 849 | #endif 850 | void OVRDeviceProperty::set_string_value(const char* value) { 851 | GOOGLE_DCHECK(value != NULL); 852 | 853 | string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 854 | // @@protoc_insertion_point(field_set_char:OVRDeviceProperty.string_value) 855 | } 856 | void OVRDeviceProperty::set_string_value(const char* value, size_t size) { 857 | 858 | string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 859 | ::std::string(reinterpret_cast(value), size)); 860 | // @@protoc_insertion_point(field_set_pointer:OVRDeviceProperty.string_value) 861 | } 862 | ::std::string* OVRDeviceProperty::mutable_string_value() { 863 | 864 | // @@protoc_insertion_point(field_mutable:OVRDeviceProperty.string_value) 865 | return string_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 866 | } 867 | ::std::string* OVRDeviceProperty::release_string_value() { 868 | // @@protoc_insertion_point(field_release:OVRDeviceProperty.string_value) 869 | 870 | return string_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 871 | } 872 | void OVRDeviceProperty::set_allocated_string_value(::std::string* string_value) { 873 | if (string_value != NULL) { 874 | 875 | } else { 876 | 877 | } 878 | string_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value); 879 | // @@protoc_insertion_point(field_set_allocated:OVRDeviceProperty.string_value) 880 | } 881 | 882 | // repeated float matrix34_value = 7; 883 | int OVRDeviceProperty::matrix34_value_size() const { 884 | return matrix34_value_.size(); 885 | } 886 | void OVRDeviceProperty::clear_matrix34_value() { 887 | matrix34_value_.Clear(); 888 | } 889 | float OVRDeviceProperty::matrix34_value(int index) const { 890 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.matrix34_value) 891 | return matrix34_value_.Get(index); 892 | } 893 | void OVRDeviceProperty::set_matrix34_value(int index, float value) { 894 | matrix34_value_.Set(index, value); 895 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.matrix34_value) 896 | } 897 | void OVRDeviceProperty::add_matrix34_value(float value) { 898 | matrix34_value_.Add(value); 899 | // @@protoc_insertion_point(field_add:OVRDeviceProperty.matrix34_value) 900 | } 901 | const ::google::protobuf::RepeatedField< float >& 902 | OVRDeviceProperty::matrix34_value() const { 903 | // @@protoc_insertion_point(field_list:OVRDeviceProperty.matrix34_value) 904 | return matrix34_value_; 905 | } 906 | ::google::protobuf::RepeatedField< float >* 907 | OVRDeviceProperty::mutable_matrix34_value() { 908 | // @@protoc_insertion_point(field_mutable_list:OVRDeviceProperty.matrix34_value) 909 | return &matrix34_value_; 910 | } 911 | 912 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 913 | 914 | // =================================================================== 915 | 916 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 917 | const int OVRDevice::kIdFieldNumber; 918 | const int OVRDevice::kDeviceClassFieldNumber; 919 | const int OVRDevice::kControllerRoleFieldNumber; 920 | const int OVRDevice::kPropertiesFieldNumber; 921 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 922 | 923 | OVRDevice::OVRDevice() 924 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 925 | if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { 926 | protobuf_ovr_5fdevice_2eproto::InitDefaults(); 927 | } 928 | SharedCtor(); 929 | // @@protoc_insertion_point(constructor:OVRDevice) 930 | } 931 | OVRDevice::OVRDevice(const OVRDevice& from) 932 | : ::google::protobuf::Message(), 933 | _internal_metadata_(NULL), 934 | properties_(from.properties_), 935 | _cached_size_(0) { 936 | _internal_metadata_.MergeFrom(from._internal_metadata_); 937 | ::memcpy(&id_, &from.id_, 938 | reinterpret_cast(&controller_role_) - 939 | reinterpret_cast(&id_) + sizeof(controller_role_)); 940 | // @@protoc_insertion_point(copy_constructor:OVRDevice) 941 | } 942 | 943 | void OVRDevice::SharedCtor() { 944 | ::memset(&id_, 0, reinterpret_cast(&controller_role_) - 945 | reinterpret_cast(&id_) + sizeof(controller_role_)); 946 | _cached_size_ = 0; 947 | } 948 | 949 | OVRDevice::~OVRDevice() { 950 | // @@protoc_insertion_point(destructor:OVRDevice) 951 | SharedDtor(); 952 | } 953 | 954 | void OVRDevice::SharedDtor() { 955 | } 956 | 957 | void OVRDevice::SetCachedSize(int size) const { 958 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 959 | _cached_size_ = size; 960 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 961 | } 962 | const ::google::protobuf::Descriptor* OVRDevice::descriptor() { 963 | protobuf_ovr_5fdevice_2eproto::protobuf_AssignDescriptorsOnce(); 964 | return protobuf_ovr_5fdevice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 965 | } 966 | 967 | const OVRDevice& OVRDevice::default_instance() { 968 | protobuf_ovr_5fdevice_2eproto::InitDefaults(); 969 | return *internal_default_instance(); 970 | } 971 | 972 | OVRDevice* OVRDevice::New(::google::protobuf::Arena* arena) const { 973 | OVRDevice* n = new OVRDevice; 974 | if (arena != NULL) { 975 | arena->Own(n); 976 | } 977 | return n; 978 | } 979 | 980 | void OVRDevice::Clear() { 981 | // @@protoc_insertion_point(message_clear_start:OVRDevice) 982 | properties_.Clear(); 983 | ::memset(&id_, 0, reinterpret_cast(&controller_role_) - 984 | reinterpret_cast(&id_) + sizeof(controller_role_)); 985 | } 986 | 987 | bool OVRDevice::MergePartialFromCodedStream( 988 | ::google::protobuf::io::CodedInputStream* input) { 989 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 990 | ::google::protobuf::uint32 tag; 991 | // @@protoc_insertion_point(parse_start:OVRDevice) 992 | for (;;) { 993 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 994 | tag = p.first; 995 | if (!p.second) goto handle_unusual; 996 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 997 | // int32 id = 1; 998 | case 1: { 999 | if (static_cast< ::google::protobuf::uint8>(tag) == 1000 | static_cast< ::google::protobuf::uint8>(8u)) { 1001 | 1002 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1003 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1004 | input, &id_))); 1005 | } else { 1006 | goto handle_unusual; 1007 | } 1008 | break; 1009 | } 1010 | 1011 | // int32 device_class = 2; 1012 | case 2: { 1013 | if (static_cast< ::google::protobuf::uint8>(tag) == 1014 | static_cast< ::google::protobuf::uint8>(16u)) { 1015 | 1016 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1017 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1018 | input, &device_class_))); 1019 | } else { 1020 | goto handle_unusual; 1021 | } 1022 | break; 1023 | } 1024 | 1025 | // int32 controller_role = 3; 1026 | case 3: { 1027 | if (static_cast< ::google::protobuf::uint8>(tag) == 1028 | static_cast< ::google::protobuf::uint8>(24u)) { 1029 | 1030 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1031 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 1032 | input, &controller_role_))); 1033 | } else { 1034 | goto handle_unusual; 1035 | } 1036 | break; 1037 | } 1038 | 1039 | // repeated .OVRDeviceProperty properties = 4; 1040 | case 4: { 1041 | if (static_cast< ::google::protobuf::uint8>(tag) == 1042 | static_cast< ::google::protobuf::uint8>(34u)) { 1043 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( 1044 | input, add_properties())); 1045 | } else { 1046 | goto handle_unusual; 1047 | } 1048 | break; 1049 | } 1050 | 1051 | default: { 1052 | handle_unusual: 1053 | if (tag == 0 || 1054 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 1055 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 1056 | goto success; 1057 | } 1058 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 1059 | break; 1060 | } 1061 | } 1062 | } 1063 | success: 1064 | // @@protoc_insertion_point(parse_success:OVRDevice) 1065 | return true; 1066 | failure: 1067 | // @@protoc_insertion_point(parse_failure:OVRDevice) 1068 | return false; 1069 | #undef DO_ 1070 | } 1071 | 1072 | void OVRDevice::SerializeWithCachedSizes( 1073 | ::google::protobuf::io::CodedOutputStream* output) const { 1074 | // @@protoc_insertion_point(serialize_start:OVRDevice) 1075 | ::google::protobuf::uint32 cached_has_bits = 0; 1076 | (void) cached_has_bits; 1077 | 1078 | // int32 id = 1; 1079 | if (this->id() != 0) { 1080 | ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->id(), output); 1081 | } 1082 | 1083 | // int32 device_class = 2; 1084 | if (this->device_class() != 0) { 1085 | ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->device_class(), output); 1086 | } 1087 | 1088 | // int32 controller_role = 3; 1089 | if (this->controller_role() != 0) { 1090 | ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->controller_role(), output); 1091 | } 1092 | 1093 | // repeated .OVRDeviceProperty properties = 4; 1094 | for (unsigned int i = 0, n = this->properties_size(); i < n; i++) { 1095 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 1096 | 4, this->properties(i), output); 1097 | } 1098 | 1099 | // @@protoc_insertion_point(serialize_end:OVRDevice) 1100 | } 1101 | 1102 | ::google::protobuf::uint8* OVRDevice::InternalSerializeWithCachedSizesToArray( 1103 | bool deterministic, ::google::protobuf::uint8* target) const { 1104 | // @@protoc_insertion_point(serialize_to_array_start:OVRDevice) 1105 | ::google::protobuf::uint32 cached_has_bits = 0; 1106 | (void) cached_has_bits; 1107 | 1108 | // int32 id = 1; 1109 | if (this->id() != 0) { 1110 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->id(), target); 1111 | } 1112 | 1113 | // int32 device_class = 2; 1114 | if (this->device_class() != 0) { 1115 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->device_class(), target); 1116 | } 1117 | 1118 | // int32 controller_role = 3; 1119 | if (this->controller_role() != 0) { 1120 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->controller_role(), target); 1121 | } 1122 | 1123 | // repeated .OVRDeviceProperty properties = 4; 1124 | for (unsigned int i = 0, n = this->properties_size(); i < n; i++) { 1125 | target = ::google::protobuf::internal::WireFormatLite:: 1126 | InternalWriteMessageNoVirtualToArray( 1127 | 4, this->properties(i), deterministic, target); 1128 | } 1129 | 1130 | // @@protoc_insertion_point(serialize_to_array_end:OVRDevice) 1131 | return target; 1132 | } 1133 | 1134 | size_t OVRDevice::ByteSizeLong() const { 1135 | // @@protoc_insertion_point(message_byte_size_start:OVRDevice) 1136 | size_t total_size = 0; 1137 | 1138 | // repeated .OVRDeviceProperty properties = 4; 1139 | { 1140 | unsigned int count = this->properties_size(); 1141 | total_size += 1UL * count; 1142 | for (unsigned int i = 0; i < count; i++) { 1143 | total_size += 1144 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( 1145 | this->properties(i)); 1146 | } 1147 | } 1148 | 1149 | // int32 id = 1; 1150 | if (this->id() != 0) { 1151 | total_size += 1 + 1152 | ::google::protobuf::internal::WireFormatLite::Int32Size( 1153 | this->id()); 1154 | } 1155 | 1156 | // int32 device_class = 2; 1157 | if (this->device_class() != 0) { 1158 | total_size += 1 + 1159 | ::google::protobuf::internal::WireFormatLite::Int32Size( 1160 | this->device_class()); 1161 | } 1162 | 1163 | // int32 controller_role = 3; 1164 | if (this->controller_role() != 0) { 1165 | total_size += 1 + 1166 | ::google::protobuf::internal::WireFormatLite::Int32Size( 1167 | this->controller_role()); 1168 | } 1169 | 1170 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 1171 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 1172 | _cached_size_ = cached_size; 1173 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 1174 | return total_size; 1175 | } 1176 | 1177 | void OVRDevice::MergeFrom(const ::google::protobuf::Message& from) { 1178 | // @@protoc_insertion_point(generalized_merge_from_start:OVRDevice) 1179 | GOOGLE_DCHECK_NE(&from, this); 1180 | const OVRDevice* source = 1181 | ::google::protobuf::internal::DynamicCastToGenerated( 1182 | &from); 1183 | if (source == NULL) { 1184 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:OVRDevice) 1185 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 1186 | } else { 1187 | // @@protoc_insertion_point(generalized_merge_from_cast_success:OVRDevice) 1188 | MergeFrom(*source); 1189 | } 1190 | } 1191 | 1192 | void OVRDevice::MergeFrom(const OVRDevice& from) { 1193 | // @@protoc_insertion_point(class_specific_merge_from_start:OVRDevice) 1194 | GOOGLE_DCHECK_NE(&from, this); 1195 | _internal_metadata_.MergeFrom(from._internal_metadata_); 1196 | ::google::protobuf::uint32 cached_has_bits = 0; 1197 | (void) cached_has_bits; 1198 | 1199 | properties_.MergeFrom(from.properties_); 1200 | if (from.id() != 0) { 1201 | set_id(from.id()); 1202 | } 1203 | if (from.device_class() != 0) { 1204 | set_device_class(from.device_class()); 1205 | } 1206 | if (from.controller_role() != 0) { 1207 | set_controller_role(from.controller_role()); 1208 | } 1209 | } 1210 | 1211 | void OVRDevice::CopyFrom(const ::google::protobuf::Message& from) { 1212 | // @@protoc_insertion_point(generalized_copy_from_start:OVRDevice) 1213 | if (&from == this) return; 1214 | Clear(); 1215 | MergeFrom(from); 1216 | } 1217 | 1218 | void OVRDevice::CopyFrom(const OVRDevice& from) { 1219 | // @@protoc_insertion_point(class_specific_copy_from_start:OVRDevice) 1220 | if (&from == this) return; 1221 | Clear(); 1222 | MergeFrom(from); 1223 | } 1224 | 1225 | bool OVRDevice::IsInitialized() const { 1226 | return true; 1227 | } 1228 | 1229 | void OVRDevice::Swap(OVRDevice* other) { 1230 | if (other == this) return; 1231 | InternalSwap(other); 1232 | } 1233 | void OVRDevice::InternalSwap(OVRDevice* other) { 1234 | properties_.InternalSwap(&other->properties_); 1235 | std::swap(id_, other->id_); 1236 | std::swap(device_class_, other->device_class_); 1237 | std::swap(controller_role_, other->controller_role_); 1238 | std::swap(_cached_size_, other->_cached_size_); 1239 | } 1240 | 1241 | ::google::protobuf::Metadata OVRDevice::GetMetadata() const { 1242 | protobuf_ovr_5fdevice_2eproto::protobuf_AssignDescriptorsOnce(); 1243 | return protobuf_ovr_5fdevice_2eproto::file_level_metadata[kIndexInFileMessages]; 1244 | } 1245 | 1246 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 1247 | // OVRDevice 1248 | 1249 | // int32 id = 1; 1250 | void OVRDevice::clear_id() { 1251 | id_ = 0; 1252 | } 1253 | ::google::protobuf::int32 OVRDevice::id() const { 1254 | // @@protoc_insertion_point(field_get:OVRDevice.id) 1255 | return id_; 1256 | } 1257 | void OVRDevice::set_id(::google::protobuf::int32 value) { 1258 | 1259 | id_ = value; 1260 | // @@protoc_insertion_point(field_set:OVRDevice.id) 1261 | } 1262 | 1263 | // int32 device_class = 2; 1264 | void OVRDevice::clear_device_class() { 1265 | device_class_ = 0; 1266 | } 1267 | ::google::protobuf::int32 OVRDevice::device_class() const { 1268 | // @@protoc_insertion_point(field_get:OVRDevice.device_class) 1269 | return device_class_; 1270 | } 1271 | void OVRDevice::set_device_class(::google::protobuf::int32 value) { 1272 | 1273 | device_class_ = value; 1274 | // @@protoc_insertion_point(field_set:OVRDevice.device_class) 1275 | } 1276 | 1277 | // int32 controller_role = 3; 1278 | void OVRDevice::clear_controller_role() { 1279 | controller_role_ = 0; 1280 | } 1281 | ::google::protobuf::int32 OVRDevice::controller_role() const { 1282 | // @@protoc_insertion_point(field_get:OVRDevice.controller_role) 1283 | return controller_role_; 1284 | } 1285 | void OVRDevice::set_controller_role(::google::protobuf::int32 value) { 1286 | 1287 | controller_role_ = value; 1288 | // @@protoc_insertion_point(field_set:OVRDevice.controller_role) 1289 | } 1290 | 1291 | // repeated .OVRDeviceProperty properties = 4; 1292 | int OVRDevice::properties_size() const { 1293 | return properties_.size(); 1294 | } 1295 | void OVRDevice::clear_properties() { 1296 | properties_.Clear(); 1297 | } 1298 | const ::OVRDeviceProperty& OVRDevice::properties(int index) const { 1299 | // @@protoc_insertion_point(field_get:OVRDevice.properties) 1300 | return properties_.Get(index); 1301 | } 1302 | ::OVRDeviceProperty* OVRDevice::mutable_properties(int index) { 1303 | // @@protoc_insertion_point(field_mutable:OVRDevice.properties) 1304 | return properties_.Mutable(index); 1305 | } 1306 | ::OVRDeviceProperty* OVRDevice::add_properties() { 1307 | // @@protoc_insertion_point(field_add:OVRDevice.properties) 1308 | return properties_.Add(); 1309 | } 1310 | ::google::protobuf::RepeatedPtrField< ::OVRDeviceProperty >* 1311 | OVRDevice::mutable_properties() { 1312 | // @@protoc_insertion_point(field_mutable_list:OVRDevice.properties) 1313 | return &properties_; 1314 | } 1315 | const ::google::protobuf::RepeatedPtrField< ::OVRDeviceProperty >& 1316 | OVRDevice::properties() const { 1317 | // @@protoc_insertion_point(field_list:OVRDevice.properties) 1318 | return properties_; 1319 | } 1320 | 1321 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 1322 | 1323 | // =================================================================== 1324 | 1325 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 1326 | const int OVRSample::kTimeFieldNumber; 1327 | const int OVRSample::kPositionFieldNumber; 1328 | const int OVRSample::kRotationFieldNumber; 1329 | const int OVRSample::kAxisFieldNumber; 1330 | const int OVRSample::kButtonPressedFieldNumber; 1331 | const int OVRSample::kButtonTouchedFieldNumber; 1332 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 1333 | 1334 | OVRSample::OVRSample() 1335 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 1336 | if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { 1337 | protobuf_ovr_5fdevice_2eproto::InitDefaults(); 1338 | } 1339 | SharedCtor(); 1340 | // @@protoc_insertion_point(constructor:OVRSample) 1341 | } 1342 | OVRSample::OVRSample(const OVRSample& from) 1343 | : ::google::protobuf::Message(), 1344 | _internal_metadata_(NULL), 1345 | position_(from.position_), 1346 | rotation_(from.rotation_), 1347 | axis_(from.axis_), 1348 | _cached_size_(0) { 1349 | _internal_metadata_.MergeFrom(from._internal_metadata_); 1350 | ::memcpy(&time_, &from.time_, 1351 | reinterpret_cast(&button_touched_) - 1352 | reinterpret_cast(&time_) + sizeof(button_touched_)); 1353 | // @@protoc_insertion_point(copy_constructor:OVRSample) 1354 | } 1355 | 1356 | void OVRSample::SharedCtor() { 1357 | ::memset(&time_, 0, reinterpret_cast(&button_touched_) - 1358 | reinterpret_cast(&time_) + sizeof(button_touched_)); 1359 | _cached_size_ = 0; 1360 | } 1361 | 1362 | OVRSample::~OVRSample() { 1363 | // @@protoc_insertion_point(destructor:OVRSample) 1364 | SharedDtor(); 1365 | } 1366 | 1367 | void OVRSample::SharedDtor() { 1368 | } 1369 | 1370 | void OVRSample::SetCachedSize(int size) const { 1371 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 1372 | _cached_size_ = size; 1373 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 1374 | } 1375 | const ::google::protobuf::Descriptor* OVRSample::descriptor() { 1376 | protobuf_ovr_5fdevice_2eproto::protobuf_AssignDescriptorsOnce(); 1377 | return protobuf_ovr_5fdevice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 1378 | } 1379 | 1380 | const OVRSample& OVRSample::default_instance() { 1381 | protobuf_ovr_5fdevice_2eproto::InitDefaults(); 1382 | return *internal_default_instance(); 1383 | } 1384 | 1385 | OVRSample* OVRSample::New(::google::protobuf::Arena* arena) const { 1386 | OVRSample* n = new OVRSample; 1387 | if (arena != NULL) { 1388 | arena->Own(n); 1389 | } 1390 | return n; 1391 | } 1392 | 1393 | void OVRSample::Clear() { 1394 | // @@protoc_insertion_point(message_clear_start:OVRSample) 1395 | position_.Clear(); 1396 | rotation_.Clear(); 1397 | axis_.Clear(); 1398 | ::memset(&time_, 0, reinterpret_cast(&button_touched_) - 1399 | reinterpret_cast(&time_) + sizeof(button_touched_)); 1400 | } 1401 | 1402 | bool OVRSample::MergePartialFromCodedStream( 1403 | ::google::protobuf::io::CodedInputStream* input) { 1404 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 1405 | ::google::protobuf::uint32 tag; 1406 | // @@protoc_insertion_point(parse_start:OVRSample) 1407 | for (;;) { 1408 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 1409 | tag = p.first; 1410 | if (!p.second) goto handle_unusual; 1411 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 1412 | // uint64 time = 1; 1413 | case 1: { 1414 | if (static_cast< ::google::protobuf::uint8>(tag) == 1415 | static_cast< ::google::protobuf::uint8>(8u)) { 1416 | 1417 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1418 | ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 1419 | input, &time_))); 1420 | } else { 1421 | goto handle_unusual; 1422 | } 1423 | break; 1424 | } 1425 | 1426 | // repeated float position = 2; 1427 | case 2: { 1428 | if (static_cast< ::google::protobuf::uint8>(tag) == 1429 | static_cast< ::google::protobuf::uint8>(18u)) { 1430 | DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< 1431 | float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 1432 | input, this->mutable_position()))); 1433 | } else if (static_cast< ::google::protobuf::uint8>(tag) == 1434 | static_cast< ::google::protobuf::uint8>(21u)) { 1435 | DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< 1436 | float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 1437 | 1, 18u, input, this->mutable_position()))); 1438 | } else { 1439 | goto handle_unusual; 1440 | } 1441 | break; 1442 | } 1443 | 1444 | // repeated float rotation = 3; 1445 | case 3: { 1446 | if (static_cast< ::google::protobuf::uint8>(tag) == 1447 | static_cast< ::google::protobuf::uint8>(26u)) { 1448 | DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< 1449 | float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 1450 | input, this->mutable_rotation()))); 1451 | } else if (static_cast< ::google::protobuf::uint8>(tag) == 1452 | static_cast< ::google::protobuf::uint8>(29u)) { 1453 | DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< 1454 | float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 1455 | 1, 26u, input, this->mutable_rotation()))); 1456 | } else { 1457 | goto handle_unusual; 1458 | } 1459 | break; 1460 | } 1461 | 1462 | // repeated float axis = 4; 1463 | case 4: { 1464 | if (static_cast< ::google::protobuf::uint8>(tag) == 1465 | static_cast< ::google::protobuf::uint8>(34u)) { 1466 | DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< 1467 | float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 1468 | input, this->mutable_axis()))); 1469 | } else if (static_cast< ::google::protobuf::uint8>(tag) == 1470 | static_cast< ::google::protobuf::uint8>(37u)) { 1471 | DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< 1472 | float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 1473 | 1, 34u, input, this->mutable_axis()))); 1474 | } else { 1475 | goto handle_unusual; 1476 | } 1477 | break; 1478 | } 1479 | 1480 | // uint64 button_pressed = 5; 1481 | case 5: { 1482 | if (static_cast< ::google::protobuf::uint8>(tag) == 1483 | static_cast< ::google::protobuf::uint8>(40u)) { 1484 | 1485 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1486 | ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 1487 | input, &button_pressed_))); 1488 | } else { 1489 | goto handle_unusual; 1490 | } 1491 | break; 1492 | } 1493 | 1494 | // uint64 button_touched = 6; 1495 | case 6: { 1496 | if (static_cast< ::google::protobuf::uint8>(tag) == 1497 | static_cast< ::google::protobuf::uint8>(48u)) { 1498 | 1499 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 1500 | ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( 1501 | input, &button_touched_))); 1502 | } else { 1503 | goto handle_unusual; 1504 | } 1505 | break; 1506 | } 1507 | 1508 | default: { 1509 | handle_unusual: 1510 | if (tag == 0 || 1511 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 1512 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 1513 | goto success; 1514 | } 1515 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 1516 | break; 1517 | } 1518 | } 1519 | } 1520 | success: 1521 | // @@protoc_insertion_point(parse_success:OVRSample) 1522 | return true; 1523 | failure: 1524 | // @@protoc_insertion_point(parse_failure:OVRSample) 1525 | return false; 1526 | #undef DO_ 1527 | } 1528 | 1529 | void OVRSample::SerializeWithCachedSizes( 1530 | ::google::protobuf::io::CodedOutputStream* output) const { 1531 | // @@protoc_insertion_point(serialize_start:OVRSample) 1532 | ::google::protobuf::uint32 cached_has_bits = 0; 1533 | (void) cached_has_bits; 1534 | 1535 | // uint64 time = 1; 1536 | if (this->time() != 0) { 1537 | ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->time(), output); 1538 | } 1539 | 1540 | // repeated float position = 2; 1541 | if (this->position_size() > 0) { 1542 | ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); 1543 | output->WriteVarint32(_position_cached_byte_size_); 1544 | ::google::protobuf::internal::WireFormatLite::WriteFloatArray( 1545 | this->position().data(), this->position_size(), output); 1546 | } 1547 | 1548 | // repeated float rotation = 3; 1549 | if (this->rotation_size() > 0) { 1550 | ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); 1551 | output->WriteVarint32(_rotation_cached_byte_size_); 1552 | ::google::protobuf::internal::WireFormatLite::WriteFloatArray( 1553 | this->rotation().data(), this->rotation_size(), output); 1554 | } 1555 | 1556 | // repeated float axis = 4; 1557 | if (this->axis_size() > 0) { 1558 | ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); 1559 | output->WriteVarint32(_axis_cached_byte_size_); 1560 | ::google::protobuf::internal::WireFormatLite::WriteFloatArray( 1561 | this->axis().data(), this->axis_size(), output); 1562 | } 1563 | 1564 | // uint64 button_pressed = 5; 1565 | if (this->button_pressed() != 0) { 1566 | ::google::protobuf::internal::WireFormatLite::WriteUInt64(5, this->button_pressed(), output); 1567 | } 1568 | 1569 | // uint64 button_touched = 6; 1570 | if (this->button_touched() != 0) { 1571 | ::google::protobuf::internal::WireFormatLite::WriteUInt64(6, this->button_touched(), output); 1572 | } 1573 | 1574 | // @@protoc_insertion_point(serialize_end:OVRSample) 1575 | } 1576 | 1577 | ::google::protobuf::uint8* OVRSample::InternalSerializeWithCachedSizesToArray( 1578 | bool deterministic, ::google::protobuf::uint8* target) const { 1579 | // @@protoc_insertion_point(serialize_to_array_start:OVRSample) 1580 | ::google::protobuf::uint32 cached_has_bits = 0; 1581 | (void) cached_has_bits; 1582 | 1583 | // uint64 time = 1; 1584 | if (this->time() != 0) { 1585 | target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->time(), target); 1586 | } 1587 | 1588 | // repeated float position = 2; 1589 | if (this->position_size() > 0) { 1590 | target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 1591 | 2, 1592 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, 1593 | target); 1594 | target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( 1595 | _position_cached_byte_size_, target); 1596 | target = ::google::protobuf::internal::WireFormatLite:: 1597 | WriteFloatNoTagToArray(this->position_, target); 1598 | } 1599 | 1600 | // repeated float rotation = 3; 1601 | if (this->rotation_size() > 0) { 1602 | target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 1603 | 3, 1604 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, 1605 | target); 1606 | target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( 1607 | _rotation_cached_byte_size_, target); 1608 | target = ::google::protobuf::internal::WireFormatLite:: 1609 | WriteFloatNoTagToArray(this->rotation_, target); 1610 | } 1611 | 1612 | // repeated float axis = 4; 1613 | if (this->axis_size() > 0) { 1614 | target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 1615 | 4, 1616 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, 1617 | target); 1618 | target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( 1619 | _axis_cached_byte_size_, target); 1620 | target = ::google::protobuf::internal::WireFormatLite:: 1621 | WriteFloatNoTagToArray(this->axis_, target); 1622 | } 1623 | 1624 | // uint64 button_pressed = 5; 1625 | if (this->button_pressed() != 0) { 1626 | target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(5, this->button_pressed(), target); 1627 | } 1628 | 1629 | // uint64 button_touched = 6; 1630 | if (this->button_touched() != 0) { 1631 | target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(6, this->button_touched(), target); 1632 | } 1633 | 1634 | // @@protoc_insertion_point(serialize_to_array_end:OVRSample) 1635 | return target; 1636 | } 1637 | 1638 | size_t OVRSample::ByteSizeLong() const { 1639 | // @@protoc_insertion_point(message_byte_size_start:OVRSample) 1640 | size_t total_size = 0; 1641 | 1642 | // repeated float position = 2; 1643 | { 1644 | unsigned int count = this->position_size(); 1645 | size_t data_size = 4UL * count; 1646 | if (data_size > 0) { 1647 | total_size += 1 + 1648 | ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); 1649 | } 1650 | int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); 1651 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 1652 | _position_cached_byte_size_ = cached_size; 1653 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 1654 | total_size += data_size; 1655 | } 1656 | 1657 | // repeated float rotation = 3; 1658 | { 1659 | unsigned int count = this->rotation_size(); 1660 | size_t data_size = 4UL * count; 1661 | if (data_size > 0) { 1662 | total_size += 1 + 1663 | ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); 1664 | } 1665 | int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); 1666 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 1667 | _rotation_cached_byte_size_ = cached_size; 1668 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 1669 | total_size += data_size; 1670 | } 1671 | 1672 | // repeated float axis = 4; 1673 | { 1674 | unsigned int count = this->axis_size(); 1675 | size_t data_size = 4UL * count; 1676 | if (data_size > 0) { 1677 | total_size += 1 + 1678 | ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); 1679 | } 1680 | int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); 1681 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 1682 | _axis_cached_byte_size_ = cached_size; 1683 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 1684 | total_size += data_size; 1685 | } 1686 | 1687 | // uint64 time = 1; 1688 | if (this->time() != 0) { 1689 | total_size += 1 + 1690 | ::google::protobuf::internal::WireFormatLite::UInt64Size( 1691 | this->time()); 1692 | } 1693 | 1694 | // uint64 button_pressed = 5; 1695 | if (this->button_pressed() != 0) { 1696 | total_size += 1 + 1697 | ::google::protobuf::internal::WireFormatLite::UInt64Size( 1698 | this->button_pressed()); 1699 | } 1700 | 1701 | // uint64 button_touched = 6; 1702 | if (this->button_touched() != 0) { 1703 | total_size += 1 + 1704 | ::google::protobuf::internal::WireFormatLite::UInt64Size( 1705 | this->button_touched()); 1706 | } 1707 | 1708 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 1709 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 1710 | _cached_size_ = cached_size; 1711 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 1712 | return total_size; 1713 | } 1714 | 1715 | void OVRSample::MergeFrom(const ::google::protobuf::Message& from) { 1716 | // @@protoc_insertion_point(generalized_merge_from_start:OVRSample) 1717 | GOOGLE_DCHECK_NE(&from, this); 1718 | const OVRSample* source = 1719 | ::google::protobuf::internal::DynamicCastToGenerated( 1720 | &from); 1721 | if (source == NULL) { 1722 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:OVRSample) 1723 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 1724 | } else { 1725 | // @@protoc_insertion_point(generalized_merge_from_cast_success:OVRSample) 1726 | MergeFrom(*source); 1727 | } 1728 | } 1729 | 1730 | void OVRSample::MergeFrom(const OVRSample& from) { 1731 | // @@protoc_insertion_point(class_specific_merge_from_start:OVRSample) 1732 | GOOGLE_DCHECK_NE(&from, this); 1733 | _internal_metadata_.MergeFrom(from._internal_metadata_); 1734 | ::google::protobuf::uint32 cached_has_bits = 0; 1735 | (void) cached_has_bits; 1736 | 1737 | position_.MergeFrom(from.position_); 1738 | rotation_.MergeFrom(from.rotation_); 1739 | axis_.MergeFrom(from.axis_); 1740 | if (from.time() != 0) { 1741 | set_time(from.time()); 1742 | } 1743 | if (from.button_pressed() != 0) { 1744 | set_button_pressed(from.button_pressed()); 1745 | } 1746 | if (from.button_touched() != 0) { 1747 | set_button_touched(from.button_touched()); 1748 | } 1749 | } 1750 | 1751 | void OVRSample::CopyFrom(const ::google::protobuf::Message& from) { 1752 | // @@protoc_insertion_point(generalized_copy_from_start:OVRSample) 1753 | if (&from == this) return; 1754 | Clear(); 1755 | MergeFrom(from); 1756 | } 1757 | 1758 | void OVRSample::CopyFrom(const OVRSample& from) { 1759 | // @@protoc_insertion_point(class_specific_copy_from_start:OVRSample) 1760 | if (&from == this) return; 1761 | Clear(); 1762 | MergeFrom(from); 1763 | } 1764 | 1765 | bool OVRSample::IsInitialized() const { 1766 | return true; 1767 | } 1768 | 1769 | void OVRSample::Swap(OVRSample* other) { 1770 | if (other == this) return; 1771 | InternalSwap(other); 1772 | } 1773 | void OVRSample::InternalSwap(OVRSample* other) { 1774 | position_.InternalSwap(&other->position_); 1775 | rotation_.InternalSwap(&other->rotation_); 1776 | axis_.InternalSwap(&other->axis_); 1777 | std::swap(time_, other->time_); 1778 | std::swap(button_pressed_, other->button_pressed_); 1779 | std::swap(button_touched_, other->button_touched_); 1780 | std::swap(_cached_size_, other->_cached_size_); 1781 | } 1782 | 1783 | ::google::protobuf::Metadata OVRSample::GetMetadata() const { 1784 | protobuf_ovr_5fdevice_2eproto::protobuf_AssignDescriptorsOnce(); 1785 | return protobuf_ovr_5fdevice_2eproto::file_level_metadata[kIndexInFileMessages]; 1786 | } 1787 | 1788 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 1789 | // OVRSample 1790 | 1791 | // uint64 time = 1; 1792 | void OVRSample::clear_time() { 1793 | time_ = GOOGLE_ULONGLONG(0); 1794 | } 1795 | ::google::protobuf::uint64 OVRSample::time() const { 1796 | // @@protoc_insertion_point(field_get:OVRSample.time) 1797 | return time_; 1798 | } 1799 | void OVRSample::set_time(::google::protobuf::uint64 value) { 1800 | 1801 | time_ = value; 1802 | // @@protoc_insertion_point(field_set:OVRSample.time) 1803 | } 1804 | 1805 | // repeated float position = 2; 1806 | int OVRSample::position_size() const { 1807 | return position_.size(); 1808 | } 1809 | void OVRSample::clear_position() { 1810 | position_.Clear(); 1811 | } 1812 | float OVRSample::position(int index) const { 1813 | // @@protoc_insertion_point(field_get:OVRSample.position) 1814 | return position_.Get(index); 1815 | } 1816 | void OVRSample::set_position(int index, float value) { 1817 | position_.Set(index, value); 1818 | // @@protoc_insertion_point(field_set:OVRSample.position) 1819 | } 1820 | void OVRSample::add_position(float value) { 1821 | position_.Add(value); 1822 | // @@protoc_insertion_point(field_add:OVRSample.position) 1823 | } 1824 | const ::google::protobuf::RepeatedField< float >& 1825 | OVRSample::position() const { 1826 | // @@protoc_insertion_point(field_list:OVRSample.position) 1827 | return position_; 1828 | } 1829 | ::google::protobuf::RepeatedField< float >* 1830 | OVRSample::mutable_position() { 1831 | // @@protoc_insertion_point(field_mutable_list:OVRSample.position) 1832 | return &position_; 1833 | } 1834 | 1835 | // repeated float rotation = 3; 1836 | int OVRSample::rotation_size() const { 1837 | return rotation_.size(); 1838 | } 1839 | void OVRSample::clear_rotation() { 1840 | rotation_.Clear(); 1841 | } 1842 | float OVRSample::rotation(int index) const { 1843 | // @@protoc_insertion_point(field_get:OVRSample.rotation) 1844 | return rotation_.Get(index); 1845 | } 1846 | void OVRSample::set_rotation(int index, float value) { 1847 | rotation_.Set(index, value); 1848 | // @@protoc_insertion_point(field_set:OVRSample.rotation) 1849 | } 1850 | void OVRSample::add_rotation(float value) { 1851 | rotation_.Add(value); 1852 | // @@protoc_insertion_point(field_add:OVRSample.rotation) 1853 | } 1854 | const ::google::protobuf::RepeatedField< float >& 1855 | OVRSample::rotation() const { 1856 | // @@protoc_insertion_point(field_list:OVRSample.rotation) 1857 | return rotation_; 1858 | } 1859 | ::google::protobuf::RepeatedField< float >* 1860 | OVRSample::mutable_rotation() { 1861 | // @@protoc_insertion_point(field_mutable_list:OVRSample.rotation) 1862 | return &rotation_; 1863 | } 1864 | 1865 | // repeated float axis = 4; 1866 | int OVRSample::axis_size() const { 1867 | return axis_.size(); 1868 | } 1869 | void OVRSample::clear_axis() { 1870 | axis_.Clear(); 1871 | } 1872 | float OVRSample::axis(int index) const { 1873 | // @@protoc_insertion_point(field_get:OVRSample.axis) 1874 | return axis_.Get(index); 1875 | } 1876 | void OVRSample::set_axis(int index, float value) { 1877 | axis_.Set(index, value); 1878 | // @@protoc_insertion_point(field_set:OVRSample.axis) 1879 | } 1880 | void OVRSample::add_axis(float value) { 1881 | axis_.Add(value); 1882 | // @@protoc_insertion_point(field_add:OVRSample.axis) 1883 | } 1884 | const ::google::protobuf::RepeatedField< float >& 1885 | OVRSample::axis() const { 1886 | // @@protoc_insertion_point(field_list:OVRSample.axis) 1887 | return axis_; 1888 | } 1889 | ::google::protobuf::RepeatedField< float >* 1890 | OVRSample::mutable_axis() { 1891 | // @@protoc_insertion_point(field_mutable_list:OVRSample.axis) 1892 | return &axis_; 1893 | } 1894 | 1895 | // uint64 button_pressed = 5; 1896 | void OVRSample::clear_button_pressed() { 1897 | button_pressed_ = GOOGLE_ULONGLONG(0); 1898 | } 1899 | ::google::protobuf::uint64 OVRSample::button_pressed() const { 1900 | // @@protoc_insertion_point(field_get:OVRSample.button_pressed) 1901 | return button_pressed_; 1902 | } 1903 | void OVRSample::set_button_pressed(::google::protobuf::uint64 value) { 1904 | 1905 | button_pressed_ = value; 1906 | // @@protoc_insertion_point(field_set:OVRSample.button_pressed) 1907 | } 1908 | 1909 | // uint64 button_touched = 6; 1910 | void OVRSample::clear_button_touched() { 1911 | button_touched_ = GOOGLE_ULONGLONG(0); 1912 | } 1913 | ::google::protobuf::uint64 OVRSample::button_touched() const { 1914 | // @@protoc_insertion_point(field_get:OVRSample.button_touched) 1915 | return button_touched_; 1916 | } 1917 | void OVRSample::set_button_touched(::google::protobuf::uint64 value) { 1918 | 1919 | button_touched_ = value; 1920 | // @@protoc_insertion_point(field_set:OVRSample.button_touched) 1921 | } 1922 | 1923 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 1924 | 1925 | // =================================================================== 1926 | 1927 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 1928 | const int OVRTimeline::kDeviceIdFieldNumber; 1929 | const int OVRTimeline::kSamplesFieldNumber; 1930 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 1931 | 1932 | OVRTimeline::OVRTimeline() 1933 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 1934 | if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { 1935 | protobuf_ovr_5fdevice_2eproto::InitDefaults(); 1936 | } 1937 | SharedCtor(); 1938 | // @@protoc_insertion_point(constructor:OVRTimeline) 1939 | } 1940 | OVRTimeline::OVRTimeline(const OVRTimeline& from) 1941 | : ::google::protobuf::Message(), 1942 | _internal_metadata_(NULL), 1943 | samples_(from.samples_), 1944 | _cached_size_(0) { 1945 | _internal_metadata_.MergeFrom(from._internal_metadata_); 1946 | device_id_ = from.device_id_; 1947 | // @@protoc_insertion_point(copy_constructor:OVRTimeline) 1948 | } 1949 | 1950 | void OVRTimeline::SharedCtor() { 1951 | device_id_ = 0; 1952 | _cached_size_ = 0; 1953 | } 1954 | 1955 | OVRTimeline::~OVRTimeline() { 1956 | // @@protoc_insertion_point(destructor:OVRTimeline) 1957 | SharedDtor(); 1958 | } 1959 | 1960 | void OVRTimeline::SharedDtor() { 1961 | } 1962 | 1963 | void OVRTimeline::SetCachedSize(int size) const { 1964 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 1965 | _cached_size_ = size; 1966 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 1967 | } 1968 | const ::google::protobuf::Descriptor* OVRTimeline::descriptor() { 1969 | protobuf_ovr_5fdevice_2eproto::protobuf_AssignDescriptorsOnce(); 1970 | return protobuf_ovr_5fdevice_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 1971 | } 1972 | 1973 | const OVRTimeline& OVRTimeline::default_instance() { 1974 | protobuf_ovr_5fdevice_2eproto::InitDefaults(); 1975 | return *internal_default_instance(); 1976 | } 1977 | 1978 | OVRTimeline* OVRTimeline::New(::google::protobuf::Arena* arena) const { 1979 | OVRTimeline* n = new OVRTimeline; 1980 | if (arena != NULL) { 1981 | arena->Own(n); 1982 | } 1983 | return n; 1984 | } 1985 | 1986 | void OVRTimeline::Clear() { 1987 | // @@protoc_insertion_point(message_clear_start:OVRTimeline) 1988 | samples_.Clear(); 1989 | device_id_ = 0; 1990 | } 1991 | 1992 | bool OVRTimeline::MergePartialFromCodedStream( 1993 | ::google::protobuf::io::CodedInputStream* input) { 1994 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 1995 | ::google::protobuf::uint32 tag; 1996 | // @@protoc_insertion_point(parse_start:OVRTimeline) 1997 | for (;;) { 1998 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 1999 | tag = p.first; 2000 | if (!p.second) goto handle_unusual; 2001 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 2002 | // int32 device_id = 1; 2003 | case 1: { 2004 | if (static_cast< ::google::protobuf::uint8>(tag) == 2005 | static_cast< ::google::protobuf::uint8>(8u)) { 2006 | 2007 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 2008 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 2009 | input, &device_id_))); 2010 | } else { 2011 | goto handle_unusual; 2012 | } 2013 | break; 2014 | } 2015 | 2016 | // repeated .OVRSample samples = 2; 2017 | case 2: { 2018 | if (static_cast< ::google::protobuf::uint8>(tag) == 2019 | static_cast< ::google::protobuf::uint8>(18u)) { 2020 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( 2021 | input, add_samples())); 2022 | } else { 2023 | goto handle_unusual; 2024 | } 2025 | break; 2026 | } 2027 | 2028 | default: { 2029 | handle_unusual: 2030 | if (tag == 0 || 2031 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 2032 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 2033 | goto success; 2034 | } 2035 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 2036 | break; 2037 | } 2038 | } 2039 | } 2040 | success: 2041 | // @@protoc_insertion_point(parse_success:OVRTimeline) 2042 | return true; 2043 | failure: 2044 | // @@protoc_insertion_point(parse_failure:OVRTimeline) 2045 | return false; 2046 | #undef DO_ 2047 | } 2048 | 2049 | void OVRTimeline::SerializeWithCachedSizes( 2050 | ::google::protobuf::io::CodedOutputStream* output) const { 2051 | // @@protoc_insertion_point(serialize_start:OVRTimeline) 2052 | ::google::protobuf::uint32 cached_has_bits = 0; 2053 | (void) cached_has_bits; 2054 | 2055 | // int32 device_id = 1; 2056 | if (this->device_id() != 0) { 2057 | ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->device_id(), output); 2058 | } 2059 | 2060 | // repeated .OVRSample samples = 2; 2061 | for (unsigned int i = 0, n = this->samples_size(); i < n; i++) { 2062 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 2063 | 2, this->samples(i), output); 2064 | } 2065 | 2066 | // @@protoc_insertion_point(serialize_end:OVRTimeline) 2067 | } 2068 | 2069 | ::google::protobuf::uint8* OVRTimeline::InternalSerializeWithCachedSizesToArray( 2070 | bool deterministic, ::google::protobuf::uint8* target) const { 2071 | // @@protoc_insertion_point(serialize_to_array_start:OVRTimeline) 2072 | ::google::protobuf::uint32 cached_has_bits = 0; 2073 | (void) cached_has_bits; 2074 | 2075 | // int32 device_id = 1; 2076 | if (this->device_id() != 0) { 2077 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->device_id(), target); 2078 | } 2079 | 2080 | // repeated .OVRSample samples = 2; 2081 | for (unsigned int i = 0, n = this->samples_size(); i < n; i++) { 2082 | target = ::google::protobuf::internal::WireFormatLite:: 2083 | InternalWriteMessageNoVirtualToArray( 2084 | 2, this->samples(i), deterministic, target); 2085 | } 2086 | 2087 | // @@protoc_insertion_point(serialize_to_array_end:OVRTimeline) 2088 | return target; 2089 | } 2090 | 2091 | size_t OVRTimeline::ByteSizeLong() const { 2092 | // @@protoc_insertion_point(message_byte_size_start:OVRTimeline) 2093 | size_t total_size = 0; 2094 | 2095 | // repeated .OVRSample samples = 2; 2096 | { 2097 | unsigned int count = this->samples_size(); 2098 | total_size += 1UL * count; 2099 | for (unsigned int i = 0; i < count; i++) { 2100 | total_size += 2101 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( 2102 | this->samples(i)); 2103 | } 2104 | } 2105 | 2106 | // int32 device_id = 1; 2107 | if (this->device_id() != 0) { 2108 | total_size += 1 + 2109 | ::google::protobuf::internal::WireFormatLite::Int32Size( 2110 | this->device_id()); 2111 | } 2112 | 2113 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 2114 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 2115 | _cached_size_ = cached_size; 2116 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 2117 | return total_size; 2118 | } 2119 | 2120 | void OVRTimeline::MergeFrom(const ::google::protobuf::Message& from) { 2121 | // @@protoc_insertion_point(generalized_merge_from_start:OVRTimeline) 2122 | GOOGLE_DCHECK_NE(&from, this); 2123 | const OVRTimeline* source = 2124 | ::google::protobuf::internal::DynamicCastToGenerated( 2125 | &from); 2126 | if (source == NULL) { 2127 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:OVRTimeline) 2128 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 2129 | } else { 2130 | // @@protoc_insertion_point(generalized_merge_from_cast_success:OVRTimeline) 2131 | MergeFrom(*source); 2132 | } 2133 | } 2134 | 2135 | void OVRTimeline::MergeFrom(const OVRTimeline& from) { 2136 | // @@protoc_insertion_point(class_specific_merge_from_start:OVRTimeline) 2137 | GOOGLE_DCHECK_NE(&from, this); 2138 | _internal_metadata_.MergeFrom(from._internal_metadata_); 2139 | ::google::protobuf::uint32 cached_has_bits = 0; 2140 | (void) cached_has_bits; 2141 | 2142 | samples_.MergeFrom(from.samples_); 2143 | if (from.device_id() != 0) { 2144 | set_device_id(from.device_id()); 2145 | } 2146 | } 2147 | 2148 | void OVRTimeline::CopyFrom(const ::google::protobuf::Message& from) { 2149 | // @@protoc_insertion_point(generalized_copy_from_start:OVRTimeline) 2150 | if (&from == this) return; 2151 | Clear(); 2152 | MergeFrom(from); 2153 | } 2154 | 2155 | void OVRTimeline::CopyFrom(const OVRTimeline& from) { 2156 | // @@protoc_insertion_point(class_specific_copy_from_start:OVRTimeline) 2157 | if (&from == this) return; 2158 | Clear(); 2159 | MergeFrom(from); 2160 | } 2161 | 2162 | bool OVRTimeline::IsInitialized() const { 2163 | return true; 2164 | } 2165 | 2166 | void OVRTimeline::Swap(OVRTimeline* other) { 2167 | if (other == this) return; 2168 | InternalSwap(other); 2169 | } 2170 | void OVRTimeline::InternalSwap(OVRTimeline* other) { 2171 | samples_.InternalSwap(&other->samples_); 2172 | std::swap(device_id_, other->device_id_); 2173 | std::swap(_cached_size_, other->_cached_size_); 2174 | } 2175 | 2176 | ::google::protobuf::Metadata OVRTimeline::GetMetadata() const { 2177 | protobuf_ovr_5fdevice_2eproto::protobuf_AssignDescriptorsOnce(); 2178 | return protobuf_ovr_5fdevice_2eproto::file_level_metadata[kIndexInFileMessages]; 2179 | } 2180 | 2181 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 2182 | // OVRTimeline 2183 | 2184 | // int32 device_id = 1; 2185 | void OVRTimeline::clear_device_id() { 2186 | device_id_ = 0; 2187 | } 2188 | ::google::protobuf::int32 OVRTimeline::device_id() const { 2189 | // @@protoc_insertion_point(field_get:OVRTimeline.device_id) 2190 | return device_id_; 2191 | } 2192 | void OVRTimeline::set_device_id(::google::protobuf::int32 value) { 2193 | 2194 | device_id_ = value; 2195 | // @@protoc_insertion_point(field_set:OVRTimeline.device_id) 2196 | } 2197 | 2198 | // repeated .OVRSample samples = 2; 2199 | int OVRTimeline::samples_size() const { 2200 | return samples_.size(); 2201 | } 2202 | void OVRTimeline::clear_samples() { 2203 | samples_.Clear(); 2204 | } 2205 | const ::OVRSample& OVRTimeline::samples(int index) const { 2206 | // @@protoc_insertion_point(field_get:OVRTimeline.samples) 2207 | return samples_.Get(index); 2208 | } 2209 | ::OVRSample* OVRTimeline::mutable_samples(int index) { 2210 | // @@protoc_insertion_point(field_mutable:OVRTimeline.samples) 2211 | return samples_.Mutable(index); 2212 | } 2213 | ::OVRSample* OVRTimeline::add_samples() { 2214 | // @@protoc_insertion_point(field_add:OVRTimeline.samples) 2215 | return samples_.Add(); 2216 | } 2217 | ::google::protobuf::RepeatedPtrField< ::OVRSample >* 2218 | OVRTimeline::mutable_samples() { 2219 | // @@protoc_insertion_point(field_mutable_list:OVRTimeline.samples) 2220 | return &samples_; 2221 | } 2222 | const ::google::protobuf::RepeatedPtrField< ::OVRSample >& 2223 | OVRTimeline::samples() const { 2224 | // @@protoc_insertion_point(field_list:OVRTimeline.samples) 2225 | return samples_; 2226 | } 2227 | 2228 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 2229 | 2230 | // @@protoc_insertion_point(namespace_scope) 2231 | 2232 | // @@protoc_insertion_point(global_scope) 2233 | -------------------------------------------------------------------------------- /src/generated/ovr_device.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: ovr_device.proto 3 | 4 | #ifndef PROTOBUF_ovr_5fdevice_2eproto__INCLUDED 5 | #define PROTOBUF_ovr_5fdevice_2eproto__INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | 11 | #if GOOGLE_PROTOBUF_VERSION < 3003000 12 | #error This file was generated by a newer version of protoc which is 13 | #error incompatible with your Protocol Buffer headers. Please update 14 | #error your headers. 15 | #endif 16 | #if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 17 | #error This file was generated by an older version of protoc which is 18 | #error incompatible with your Protocol Buffer headers. Please 19 | #error regenerate this file with a newer version of protoc. 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include // IWYU pragma: export 30 | #include // IWYU pragma: export 31 | #include 32 | #include 33 | // @@protoc_insertion_point(includes) 34 | class OVRDevice; 35 | class OVRDeviceDefaultTypeInternal; 36 | extern OVRDeviceDefaultTypeInternal _OVRDevice_default_instance_; 37 | class OVRDeviceProperty; 38 | class OVRDevicePropertyDefaultTypeInternal; 39 | extern OVRDevicePropertyDefaultTypeInternal _OVRDeviceProperty_default_instance_; 40 | class OVRSample; 41 | class OVRSampleDefaultTypeInternal; 42 | extern OVRSampleDefaultTypeInternal _OVRSample_default_instance_; 43 | class OVRTimeline; 44 | class OVRTimelineDefaultTypeInternal; 45 | extern OVRTimelineDefaultTypeInternal _OVRTimeline_default_instance_; 46 | 47 | namespace protobuf_ovr_5fdevice_2eproto { 48 | // Internal implementation detail -- do not call these. 49 | struct TableStruct { 50 | static const ::google::protobuf::internal::ParseTableField entries[]; 51 | static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; 52 | static const ::google::protobuf::internal::ParseTable schema[]; 53 | static const ::google::protobuf::uint32 offsets[]; 54 | static void InitDefaultsImpl(); 55 | static void Shutdown(); 56 | }; 57 | void AddDescriptors(); 58 | void InitDefaults(); 59 | } // namespace protobuf_ovr_5fdevice_2eproto 60 | 61 | enum OVRDeviceProperty_Type { 62 | OVRDeviceProperty_Type_Int32 = 0, 63 | OVRDeviceProperty_Type_Uint64 = 1, 64 | OVRDeviceProperty_Type_Bool = 2, 65 | OVRDeviceProperty_Type_Float = 3, 66 | OVRDeviceProperty_Type_String = 4, 67 | OVRDeviceProperty_Type_Matrix34 = 5, 68 | OVRDeviceProperty_Type_OVRDeviceProperty_Type_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, 69 | OVRDeviceProperty_Type_OVRDeviceProperty_Type_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max 70 | }; 71 | bool OVRDeviceProperty_Type_IsValid(int value); 72 | const OVRDeviceProperty_Type OVRDeviceProperty_Type_Type_MIN = OVRDeviceProperty_Type_Int32; 73 | const OVRDeviceProperty_Type OVRDeviceProperty_Type_Type_MAX = OVRDeviceProperty_Type_Matrix34; 74 | const int OVRDeviceProperty_Type_Type_ARRAYSIZE = OVRDeviceProperty_Type_Type_MAX + 1; 75 | 76 | const ::google::protobuf::EnumDescriptor* OVRDeviceProperty_Type_descriptor(); 77 | inline const ::std::string& OVRDeviceProperty_Type_Name(OVRDeviceProperty_Type value) { 78 | return ::google::protobuf::internal::NameOfEnum( 79 | OVRDeviceProperty_Type_descriptor(), value); 80 | } 81 | inline bool OVRDeviceProperty_Type_Parse( 82 | const ::std::string& name, OVRDeviceProperty_Type* value) { 83 | return ::google::protobuf::internal::ParseNamedEnum( 84 | OVRDeviceProperty_Type_descriptor(), name, value); 85 | } 86 | // =================================================================== 87 | 88 | class OVRDeviceProperty : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:OVRDeviceProperty) */ { 89 | public: 90 | OVRDeviceProperty(); 91 | virtual ~OVRDeviceProperty(); 92 | 93 | OVRDeviceProperty(const OVRDeviceProperty& from); 94 | 95 | inline OVRDeviceProperty& operator=(const OVRDeviceProperty& from) { 96 | CopyFrom(from); 97 | return *this; 98 | } 99 | 100 | static const ::google::protobuf::Descriptor* descriptor(); 101 | static const OVRDeviceProperty& default_instance(); 102 | 103 | static inline const OVRDeviceProperty* internal_default_instance() { 104 | return reinterpret_cast( 105 | &_OVRDeviceProperty_default_instance_); 106 | } 107 | static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 108 | 0; 109 | 110 | void Swap(OVRDeviceProperty* other); 111 | 112 | // implements Message ---------------------------------------------- 113 | 114 | inline OVRDeviceProperty* New() const PROTOBUF_FINAL { return New(NULL); } 115 | 116 | OVRDeviceProperty* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; 117 | void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 118 | void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 119 | void CopyFrom(const OVRDeviceProperty& from); 120 | void MergeFrom(const OVRDeviceProperty& from); 121 | void Clear() PROTOBUF_FINAL; 122 | bool IsInitialized() const PROTOBUF_FINAL; 123 | 124 | size_t ByteSizeLong() const PROTOBUF_FINAL; 125 | bool MergePartialFromCodedStream( 126 | ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; 127 | void SerializeWithCachedSizes( 128 | ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; 129 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 130 | bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; 131 | int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } 132 | private: 133 | void SharedCtor(); 134 | void SharedDtor(); 135 | void SetCachedSize(int size) const PROTOBUF_FINAL; 136 | void InternalSwap(OVRDeviceProperty* other); 137 | private: 138 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 139 | return NULL; 140 | } 141 | inline void* MaybeArenaPtr() const { 142 | return NULL; 143 | } 144 | public: 145 | 146 | ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; 147 | 148 | // nested types ---------------------------------------------------- 149 | 150 | typedef OVRDeviceProperty_Type Type; 151 | static const Type Int32 = 152 | OVRDeviceProperty_Type_Int32; 153 | static const Type Uint64 = 154 | OVRDeviceProperty_Type_Uint64; 155 | static const Type Bool = 156 | OVRDeviceProperty_Type_Bool; 157 | static const Type Float = 158 | OVRDeviceProperty_Type_Float; 159 | static const Type String = 160 | OVRDeviceProperty_Type_String; 161 | static const Type Matrix34 = 162 | OVRDeviceProperty_Type_Matrix34; 163 | static inline bool Type_IsValid(int value) { 164 | return OVRDeviceProperty_Type_IsValid(value); 165 | } 166 | static const Type Type_MIN = 167 | OVRDeviceProperty_Type_Type_MIN; 168 | static const Type Type_MAX = 169 | OVRDeviceProperty_Type_Type_MAX; 170 | static const int Type_ARRAYSIZE = 171 | OVRDeviceProperty_Type_Type_ARRAYSIZE; 172 | static inline const ::google::protobuf::EnumDescriptor* 173 | Type_descriptor() { 174 | return OVRDeviceProperty_Type_descriptor(); 175 | } 176 | static inline const ::std::string& Type_Name(Type value) { 177 | return OVRDeviceProperty_Type_Name(value); 178 | } 179 | static inline bool Type_Parse(const ::std::string& name, 180 | Type* value) { 181 | return OVRDeviceProperty_Type_Parse(name, value); 182 | } 183 | 184 | // accessors ------------------------------------------------------- 185 | 186 | // repeated float matrix34_value = 7; 187 | int matrix34_value_size() const; 188 | void clear_matrix34_value(); 189 | static const int kMatrix34ValueFieldNumber = 7; 190 | float matrix34_value(int index) const; 191 | void set_matrix34_value(int index, float value); 192 | void add_matrix34_value(float value); 193 | const ::google::protobuf::RepeatedField< float >& 194 | matrix34_value() const; 195 | ::google::protobuf::RepeatedField< float >* 196 | mutable_matrix34_value(); 197 | 198 | // string string_value = 6; 199 | void clear_string_value(); 200 | static const int kStringValueFieldNumber = 6; 201 | const ::std::string& string_value() const; 202 | void set_string_value(const ::std::string& value); 203 | #if LANG_CXX11 204 | void set_string_value(::std::string&& value); 205 | #endif 206 | void set_string_value(const char* value); 207 | void set_string_value(const char* value, size_t size); 208 | ::std::string* mutable_string_value(); 209 | ::std::string* release_string_value(); 210 | void set_allocated_string_value(::std::string* string_value); 211 | 212 | // .OVRDeviceProperty.Type type = 1; 213 | void clear_type(); 214 | static const int kTypeFieldNumber = 1; 215 | ::OVRDeviceProperty_Type type() const; 216 | void set_type(::OVRDeviceProperty_Type value); 217 | 218 | // int32 int32_value = 2; 219 | void clear_int32_value(); 220 | static const int kInt32ValueFieldNumber = 2; 221 | ::google::protobuf::int32 int32_value() const; 222 | void set_int32_value(::google::protobuf::int32 value); 223 | 224 | // uint64 uint64_value = 3; 225 | void clear_uint64_value(); 226 | static const int kUint64ValueFieldNumber = 3; 227 | ::google::protobuf::uint64 uint64_value() const; 228 | void set_uint64_value(::google::protobuf::uint64 value); 229 | 230 | // bool bool_value = 4; 231 | void clear_bool_value(); 232 | static const int kBoolValueFieldNumber = 4; 233 | bool bool_value() const; 234 | void set_bool_value(bool value); 235 | 236 | // float float_value = 5; 237 | void clear_float_value(); 238 | static const int kFloatValueFieldNumber = 5; 239 | float float_value() const; 240 | void set_float_value(float value); 241 | 242 | // int32 identifier = 8; 243 | void clear_identifier(); 244 | static const int kIdentifierFieldNumber = 8; 245 | ::google::protobuf::int32 identifier() const; 246 | void set_identifier(::google::protobuf::int32 value); 247 | 248 | // @@protoc_insertion_point(class_scope:OVRDeviceProperty) 249 | private: 250 | 251 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 252 | ::google::protobuf::RepeatedField< float > matrix34_value_; 253 | mutable int _matrix34_value_cached_byte_size_; 254 | ::google::protobuf::internal::ArenaStringPtr string_value_; 255 | int type_; 256 | ::google::protobuf::int32 int32_value_; 257 | ::google::protobuf::uint64 uint64_value_; 258 | bool bool_value_; 259 | float float_value_; 260 | ::google::protobuf::int32 identifier_; 261 | mutable int _cached_size_; 262 | friend struct protobuf_ovr_5fdevice_2eproto::TableStruct; 263 | }; 264 | // ------------------------------------------------------------------- 265 | 266 | class OVRDevice : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:OVRDevice) */ { 267 | public: 268 | OVRDevice(); 269 | virtual ~OVRDevice(); 270 | 271 | OVRDevice(const OVRDevice& from); 272 | 273 | inline OVRDevice& operator=(const OVRDevice& from) { 274 | CopyFrom(from); 275 | return *this; 276 | } 277 | 278 | static const ::google::protobuf::Descriptor* descriptor(); 279 | static const OVRDevice& default_instance(); 280 | 281 | static inline const OVRDevice* internal_default_instance() { 282 | return reinterpret_cast( 283 | &_OVRDevice_default_instance_); 284 | } 285 | static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 286 | 1; 287 | 288 | void Swap(OVRDevice* other); 289 | 290 | // implements Message ---------------------------------------------- 291 | 292 | inline OVRDevice* New() const PROTOBUF_FINAL { return New(NULL); } 293 | 294 | OVRDevice* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; 295 | void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 296 | void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 297 | void CopyFrom(const OVRDevice& from); 298 | void MergeFrom(const OVRDevice& from); 299 | void Clear() PROTOBUF_FINAL; 300 | bool IsInitialized() const PROTOBUF_FINAL; 301 | 302 | size_t ByteSizeLong() const PROTOBUF_FINAL; 303 | bool MergePartialFromCodedStream( 304 | ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; 305 | void SerializeWithCachedSizes( 306 | ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; 307 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 308 | bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; 309 | int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } 310 | private: 311 | void SharedCtor(); 312 | void SharedDtor(); 313 | void SetCachedSize(int size) const PROTOBUF_FINAL; 314 | void InternalSwap(OVRDevice* other); 315 | private: 316 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 317 | return NULL; 318 | } 319 | inline void* MaybeArenaPtr() const { 320 | return NULL; 321 | } 322 | public: 323 | 324 | ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; 325 | 326 | // nested types ---------------------------------------------------- 327 | 328 | // accessors ------------------------------------------------------- 329 | 330 | // repeated .OVRDeviceProperty properties = 4; 331 | int properties_size() const; 332 | void clear_properties(); 333 | static const int kPropertiesFieldNumber = 4; 334 | const ::OVRDeviceProperty& properties(int index) const; 335 | ::OVRDeviceProperty* mutable_properties(int index); 336 | ::OVRDeviceProperty* add_properties(); 337 | ::google::protobuf::RepeatedPtrField< ::OVRDeviceProperty >* 338 | mutable_properties(); 339 | const ::google::protobuf::RepeatedPtrField< ::OVRDeviceProperty >& 340 | properties() const; 341 | 342 | // int32 id = 1; 343 | void clear_id(); 344 | static const int kIdFieldNumber = 1; 345 | ::google::protobuf::int32 id() const; 346 | void set_id(::google::protobuf::int32 value); 347 | 348 | // int32 device_class = 2; 349 | void clear_device_class(); 350 | static const int kDeviceClassFieldNumber = 2; 351 | ::google::protobuf::int32 device_class() const; 352 | void set_device_class(::google::protobuf::int32 value); 353 | 354 | // int32 controller_role = 3; 355 | void clear_controller_role(); 356 | static const int kControllerRoleFieldNumber = 3; 357 | ::google::protobuf::int32 controller_role() const; 358 | void set_controller_role(::google::protobuf::int32 value); 359 | 360 | // @@protoc_insertion_point(class_scope:OVRDevice) 361 | private: 362 | 363 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 364 | ::google::protobuf::RepeatedPtrField< ::OVRDeviceProperty > properties_; 365 | ::google::protobuf::int32 id_; 366 | ::google::protobuf::int32 device_class_; 367 | ::google::protobuf::int32 controller_role_; 368 | mutable int _cached_size_; 369 | friend struct protobuf_ovr_5fdevice_2eproto::TableStruct; 370 | }; 371 | // ------------------------------------------------------------------- 372 | 373 | class OVRSample : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:OVRSample) */ { 374 | public: 375 | OVRSample(); 376 | virtual ~OVRSample(); 377 | 378 | OVRSample(const OVRSample& from); 379 | 380 | inline OVRSample& operator=(const OVRSample& from) { 381 | CopyFrom(from); 382 | return *this; 383 | } 384 | 385 | static const ::google::protobuf::Descriptor* descriptor(); 386 | static const OVRSample& default_instance(); 387 | 388 | static inline const OVRSample* internal_default_instance() { 389 | return reinterpret_cast( 390 | &_OVRSample_default_instance_); 391 | } 392 | static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 393 | 2; 394 | 395 | void Swap(OVRSample* other); 396 | 397 | // implements Message ---------------------------------------------- 398 | 399 | inline OVRSample* New() const PROTOBUF_FINAL { return New(NULL); } 400 | 401 | OVRSample* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; 402 | void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 403 | void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 404 | void CopyFrom(const OVRSample& from); 405 | void MergeFrom(const OVRSample& from); 406 | void Clear() PROTOBUF_FINAL; 407 | bool IsInitialized() const PROTOBUF_FINAL; 408 | 409 | size_t ByteSizeLong() const PROTOBUF_FINAL; 410 | bool MergePartialFromCodedStream( 411 | ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; 412 | void SerializeWithCachedSizes( 413 | ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; 414 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 415 | bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; 416 | int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } 417 | private: 418 | void SharedCtor(); 419 | void SharedDtor(); 420 | void SetCachedSize(int size) const PROTOBUF_FINAL; 421 | void InternalSwap(OVRSample* other); 422 | private: 423 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 424 | return NULL; 425 | } 426 | inline void* MaybeArenaPtr() const { 427 | return NULL; 428 | } 429 | public: 430 | 431 | ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; 432 | 433 | // nested types ---------------------------------------------------- 434 | 435 | // accessors ------------------------------------------------------- 436 | 437 | // repeated float position = 2; 438 | int position_size() const; 439 | void clear_position(); 440 | static const int kPositionFieldNumber = 2; 441 | float position(int index) const; 442 | void set_position(int index, float value); 443 | void add_position(float value); 444 | const ::google::protobuf::RepeatedField< float >& 445 | position() const; 446 | ::google::protobuf::RepeatedField< float >* 447 | mutable_position(); 448 | 449 | // repeated float rotation = 3; 450 | int rotation_size() const; 451 | void clear_rotation(); 452 | static const int kRotationFieldNumber = 3; 453 | float rotation(int index) const; 454 | void set_rotation(int index, float value); 455 | void add_rotation(float value); 456 | const ::google::protobuf::RepeatedField< float >& 457 | rotation() const; 458 | ::google::protobuf::RepeatedField< float >* 459 | mutable_rotation(); 460 | 461 | // repeated float axis = 4; 462 | int axis_size() const; 463 | void clear_axis(); 464 | static const int kAxisFieldNumber = 4; 465 | float axis(int index) const; 466 | void set_axis(int index, float value); 467 | void add_axis(float value); 468 | const ::google::protobuf::RepeatedField< float >& 469 | axis() const; 470 | ::google::protobuf::RepeatedField< float >* 471 | mutable_axis(); 472 | 473 | // uint64 time = 1; 474 | void clear_time(); 475 | static const int kTimeFieldNumber = 1; 476 | ::google::protobuf::uint64 time() const; 477 | void set_time(::google::protobuf::uint64 value); 478 | 479 | // uint64 button_pressed = 5; 480 | void clear_button_pressed(); 481 | static const int kButtonPressedFieldNumber = 5; 482 | ::google::protobuf::uint64 button_pressed() const; 483 | void set_button_pressed(::google::protobuf::uint64 value); 484 | 485 | // uint64 button_touched = 6; 486 | void clear_button_touched(); 487 | static const int kButtonTouchedFieldNumber = 6; 488 | ::google::protobuf::uint64 button_touched() const; 489 | void set_button_touched(::google::protobuf::uint64 value); 490 | 491 | // @@protoc_insertion_point(class_scope:OVRSample) 492 | private: 493 | 494 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 495 | ::google::protobuf::RepeatedField< float > position_; 496 | mutable int _position_cached_byte_size_; 497 | ::google::protobuf::RepeatedField< float > rotation_; 498 | mutable int _rotation_cached_byte_size_; 499 | ::google::protobuf::RepeatedField< float > axis_; 500 | mutable int _axis_cached_byte_size_; 501 | ::google::protobuf::uint64 time_; 502 | ::google::protobuf::uint64 button_pressed_; 503 | ::google::protobuf::uint64 button_touched_; 504 | mutable int _cached_size_; 505 | friend struct protobuf_ovr_5fdevice_2eproto::TableStruct; 506 | }; 507 | // ------------------------------------------------------------------- 508 | 509 | class OVRTimeline : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:OVRTimeline) */ { 510 | public: 511 | OVRTimeline(); 512 | virtual ~OVRTimeline(); 513 | 514 | OVRTimeline(const OVRTimeline& from); 515 | 516 | inline OVRTimeline& operator=(const OVRTimeline& from) { 517 | CopyFrom(from); 518 | return *this; 519 | } 520 | 521 | static const ::google::protobuf::Descriptor* descriptor(); 522 | static const OVRTimeline& default_instance(); 523 | 524 | static inline const OVRTimeline* internal_default_instance() { 525 | return reinterpret_cast( 526 | &_OVRTimeline_default_instance_); 527 | } 528 | static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 529 | 3; 530 | 531 | void Swap(OVRTimeline* other); 532 | 533 | // implements Message ---------------------------------------------- 534 | 535 | inline OVRTimeline* New() const PROTOBUF_FINAL { return New(NULL); } 536 | 537 | OVRTimeline* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; 538 | void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 539 | void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 540 | void CopyFrom(const OVRTimeline& from); 541 | void MergeFrom(const OVRTimeline& from); 542 | void Clear() PROTOBUF_FINAL; 543 | bool IsInitialized() const PROTOBUF_FINAL; 544 | 545 | size_t ByteSizeLong() const PROTOBUF_FINAL; 546 | bool MergePartialFromCodedStream( 547 | ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; 548 | void SerializeWithCachedSizes( 549 | ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; 550 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 551 | bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; 552 | int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } 553 | private: 554 | void SharedCtor(); 555 | void SharedDtor(); 556 | void SetCachedSize(int size) const PROTOBUF_FINAL; 557 | void InternalSwap(OVRTimeline* other); 558 | private: 559 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 560 | return NULL; 561 | } 562 | inline void* MaybeArenaPtr() const { 563 | return NULL; 564 | } 565 | public: 566 | 567 | ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; 568 | 569 | // nested types ---------------------------------------------------- 570 | 571 | // accessors ------------------------------------------------------- 572 | 573 | // repeated .OVRSample samples = 2; 574 | int samples_size() const; 575 | void clear_samples(); 576 | static const int kSamplesFieldNumber = 2; 577 | const ::OVRSample& samples(int index) const; 578 | ::OVRSample* mutable_samples(int index); 579 | ::OVRSample* add_samples(); 580 | ::google::protobuf::RepeatedPtrField< ::OVRSample >* 581 | mutable_samples(); 582 | const ::google::protobuf::RepeatedPtrField< ::OVRSample >& 583 | samples() const; 584 | 585 | // int32 device_id = 1; 586 | void clear_device_id(); 587 | static const int kDeviceIdFieldNumber = 1; 588 | ::google::protobuf::int32 device_id() const; 589 | void set_device_id(::google::protobuf::int32 value); 590 | 591 | // @@protoc_insertion_point(class_scope:OVRTimeline) 592 | private: 593 | 594 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 595 | ::google::protobuf::RepeatedPtrField< ::OVRSample > samples_; 596 | ::google::protobuf::int32 device_id_; 597 | mutable int _cached_size_; 598 | friend struct protobuf_ovr_5fdevice_2eproto::TableStruct; 599 | }; 600 | // =================================================================== 601 | 602 | 603 | // =================================================================== 604 | 605 | #if !PROTOBUF_INLINE_NOT_IN_HEADERS 606 | // OVRDeviceProperty 607 | 608 | // int32 identifier = 8; 609 | inline void OVRDeviceProperty::clear_identifier() { 610 | identifier_ = 0; 611 | } 612 | inline ::google::protobuf::int32 OVRDeviceProperty::identifier() const { 613 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.identifier) 614 | return identifier_; 615 | } 616 | inline void OVRDeviceProperty::set_identifier(::google::protobuf::int32 value) { 617 | 618 | identifier_ = value; 619 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.identifier) 620 | } 621 | 622 | // .OVRDeviceProperty.Type type = 1; 623 | inline void OVRDeviceProperty::clear_type() { 624 | type_ = 0; 625 | } 626 | inline ::OVRDeviceProperty_Type OVRDeviceProperty::type() const { 627 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.type) 628 | return static_cast< ::OVRDeviceProperty_Type >(type_); 629 | } 630 | inline void OVRDeviceProperty::set_type(::OVRDeviceProperty_Type value) { 631 | 632 | type_ = value; 633 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.type) 634 | } 635 | 636 | // int32 int32_value = 2; 637 | inline void OVRDeviceProperty::clear_int32_value() { 638 | int32_value_ = 0; 639 | } 640 | inline ::google::protobuf::int32 OVRDeviceProperty::int32_value() const { 641 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.int32_value) 642 | return int32_value_; 643 | } 644 | inline void OVRDeviceProperty::set_int32_value(::google::protobuf::int32 value) { 645 | 646 | int32_value_ = value; 647 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.int32_value) 648 | } 649 | 650 | // uint64 uint64_value = 3; 651 | inline void OVRDeviceProperty::clear_uint64_value() { 652 | uint64_value_ = GOOGLE_ULONGLONG(0); 653 | } 654 | inline ::google::protobuf::uint64 OVRDeviceProperty::uint64_value() const { 655 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.uint64_value) 656 | return uint64_value_; 657 | } 658 | inline void OVRDeviceProperty::set_uint64_value(::google::protobuf::uint64 value) { 659 | 660 | uint64_value_ = value; 661 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.uint64_value) 662 | } 663 | 664 | // bool bool_value = 4; 665 | inline void OVRDeviceProperty::clear_bool_value() { 666 | bool_value_ = false; 667 | } 668 | inline bool OVRDeviceProperty::bool_value() const { 669 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.bool_value) 670 | return bool_value_; 671 | } 672 | inline void OVRDeviceProperty::set_bool_value(bool value) { 673 | 674 | bool_value_ = value; 675 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.bool_value) 676 | } 677 | 678 | // float float_value = 5; 679 | inline void OVRDeviceProperty::clear_float_value() { 680 | float_value_ = 0; 681 | } 682 | inline float OVRDeviceProperty::float_value() const { 683 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.float_value) 684 | return float_value_; 685 | } 686 | inline void OVRDeviceProperty::set_float_value(float value) { 687 | 688 | float_value_ = value; 689 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.float_value) 690 | } 691 | 692 | // string string_value = 6; 693 | inline void OVRDeviceProperty::clear_string_value() { 694 | string_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 695 | } 696 | inline const ::std::string& OVRDeviceProperty::string_value() const { 697 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.string_value) 698 | return string_value_.GetNoArena(); 699 | } 700 | inline void OVRDeviceProperty::set_string_value(const ::std::string& value) { 701 | 702 | string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 703 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.string_value) 704 | } 705 | #if LANG_CXX11 706 | inline void OVRDeviceProperty::set_string_value(::std::string&& value) { 707 | 708 | string_value_.SetNoArena( 709 | &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); 710 | // @@protoc_insertion_point(field_set_rvalue:OVRDeviceProperty.string_value) 711 | } 712 | #endif 713 | inline void OVRDeviceProperty::set_string_value(const char* value) { 714 | GOOGLE_DCHECK(value != NULL); 715 | 716 | string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 717 | // @@protoc_insertion_point(field_set_char:OVRDeviceProperty.string_value) 718 | } 719 | inline void OVRDeviceProperty::set_string_value(const char* value, size_t size) { 720 | 721 | string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 722 | ::std::string(reinterpret_cast(value), size)); 723 | // @@protoc_insertion_point(field_set_pointer:OVRDeviceProperty.string_value) 724 | } 725 | inline ::std::string* OVRDeviceProperty::mutable_string_value() { 726 | 727 | // @@protoc_insertion_point(field_mutable:OVRDeviceProperty.string_value) 728 | return string_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 729 | } 730 | inline ::std::string* OVRDeviceProperty::release_string_value() { 731 | // @@protoc_insertion_point(field_release:OVRDeviceProperty.string_value) 732 | 733 | return string_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 734 | } 735 | inline void OVRDeviceProperty::set_allocated_string_value(::std::string* string_value) { 736 | if (string_value != NULL) { 737 | 738 | } else { 739 | 740 | } 741 | string_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value); 742 | // @@protoc_insertion_point(field_set_allocated:OVRDeviceProperty.string_value) 743 | } 744 | 745 | // repeated float matrix34_value = 7; 746 | inline int OVRDeviceProperty::matrix34_value_size() const { 747 | return matrix34_value_.size(); 748 | } 749 | inline void OVRDeviceProperty::clear_matrix34_value() { 750 | matrix34_value_.Clear(); 751 | } 752 | inline float OVRDeviceProperty::matrix34_value(int index) const { 753 | // @@protoc_insertion_point(field_get:OVRDeviceProperty.matrix34_value) 754 | return matrix34_value_.Get(index); 755 | } 756 | inline void OVRDeviceProperty::set_matrix34_value(int index, float value) { 757 | matrix34_value_.Set(index, value); 758 | // @@protoc_insertion_point(field_set:OVRDeviceProperty.matrix34_value) 759 | } 760 | inline void OVRDeviceProperty::add_matrix34_value(float value) { 761 | matrix34_value_.Add(value); 762 | // @@protoc_insertion_point(field_add:OVRDeviceProperty.matrix34_value) 763 | } 764 | inline const ::google::protobuf::RepeatedField< float >& 765 | OVRDeviceProperty::matrix34_value() const { 766 | // @@protoc_insertion_point(field_list:OVRDeviceProperty.matrix34_value) 767 | return matrix34_value_; 768 | } 769 | inline ::google::protobuf::RepeatedField< float >* 770 | OVRDeviceProperty::mutable_matrix34_value() { 771 | // @@protoc_insertion_point(field_mutable_list:OVRDeviceProperty.matrix34_value) 772 | return &matrix34_value_; 773 | } 774 | 775 | // ------------------------------------------------------------------- 776 | 777 | // OVRDevice 778 | 779 | // int32 id = 1; 780 | inline void OVRDevice::clear_id() { 781 | id_ = 0; 782 | } 783 | inline ::google::protobuf::int32 OVRDevice::id() const { 784 | // @@protoc_insertion_point(field_get:OVRDevice.id) 785 | return id_; 786 | } 787 | inline void OVRDevice::set_id(::google::protobuf::int32 value) { 788 | 789 | id_ = value; 790 | // @@protoc_insertion_point(field_set:OVRDevice.id) 791 | } 792 | 793 | // int32 device_class = 2; 794 | inline void OVRDevice::clear_device_class() { 795 | device_class_ = 0; 796 | } 797 | inline ::google::protobuf::int32 OVRDevice::device_class() const { 798 | // @@protoc_insertion_point(field_get:OVRDevice.device_class) 799 | return device_class_; 800 | } 801 | inline void OVRDevice::set_device_class(::google::protobuf::int32 value) { 802 | 803 | device_class_ = value; 804 | // @@protoc_insertion_point(field_set:OVRDevice.device_class) 805 | } 806 | 807 | // int32 controller_role = 3; 808 | inline void OVRDevice::clear_controller_role() { 809 | controller_role_ = 0; 810 | } 811 | inline ::google::protobuf::int32 OVRDevice::controller_role() const { 812 | // @@protoc_insertion_point(field_get:OVRDevice.controller_role) 813 | return controller_role_; 814 | } 815 | inline void OVRDevice::set_controller_role(::google::protobuf::int32 value) { 816 | 817 | controller_role_ = value; 818 | // @@protoc_insertion_point(field_set:OVRDevice.controller_role) 819 | } 820 | 821 | // repeated .OVRDeviceProperty properties = 4; 822 | inline int OVRDevice::properties_size() const { 823 | return properties_.size(); 824 | } 825 | inline void OVRDevice::clear_properties() { 826 | properties_.Clear(); 827 | } 828 | inline const ::OVRDeviceProperty& OVRDevice::properties(int index) const { 829 | // @@protoc_insertion_point(field_get:OVRDevice.properties) 830 | return properties_.Get(index); 831 | } 832 | inline ::OVRDeviceProperty* OVRDevice::mutable_properties(int index) { 833 | // @@protoc_insertion_point(field_mutable:OVRDevice.properties) 834 | return properties_.Mutable(index); 835 | } 836 | inline ::OVRDeviceProperty* OVRDevice::add_properties() { 837 | // @@protoc_insertion_point(field_add:OVRDevice.properties) 838 | return properties_.Add(); 839 | } 840 | inline ::google::protobuf::RepeatedPtrField< ::OVRDeviceProperty >* 841 | OVRDevice::mutable_properties() { 842 | // @@protoc_insertion_point(field_mutable_list:OVRDevice.properties) 843 | return &properties_; 844 | } 845 | inline const ::google::protobuf::RepeatedPtrField< ::OVRDeviceProperty >& 846 | OVRDevice::properties() const { 847 | // @@protoc_insertion_point(field_list:OVRDevice.properties) 848 | return properties_; 849 | } 850 | 851 | // ------------------------------------------------------------------- 852 | 853 | // OVRSample 854 | 855 | // uint64 time = 1; 856 | inline void OVRSample::clear_time() { 857 | time_ = GOOGLE_ULONGLONG(0); 858 | } 859 | inline ::google::protobuf::uint64 OVRSample::time() const { 860 | // @@protoc_insertion_point(field_get:OVRSample.time) 861 | return time_; 862 | } 863 | inline void OVRSample::set_time(::google::protobuf::uint64 value) { 864 | 865 | time_ = value; 866 | // @@protoc_insertion_point(field_set:OVRSample.time) 867 | } 868 | 869 | // repeated float position = 2; 870 | inline int OVRSample::position_size() const { 871 | return position_.size(); 872 | } 873 | inline void OVRSample::clear_position() { 874 | position_.Clear(); 875 | } 876 | inline float OVRSample::position(int index) const { 877 | // @@protoc_insertion_point(field_get:OVRSample.position) 878 | return position_.Get(index); 879 | } 880 | inline void OVRSample::set_position(int index, float value) { 881 | position_.Set(index, value); 882 | // @@protoc_insertion_point(field_set:OVRSample.position) 883 | } 884 | inline void OVRSample::add_position(float value) { 885 | position_.Add(value); 886 | // @@protoc_insertion_point(field_add:OVRSample.position) 887 | } 888 | inline const ::google::protobuf::RepeatedField< float >& 889 | OVRSample::position() const { 890 | // @@protoc_insertion_point(field_list:OVRSample.position) 891 | return position_; 892 | } 893 | inline ::google::protobuf::RepeatedField< float >* 894 | OVRSample::mutable_position() { 895 | // @@protoc_insertion_point(field_mutable_list:OVRSample.position) 896 | return &position_; 897 | } 898 | 899 | // repeated float rotation = 3; 900 | inline int OVRSample::rotation_size() const { 901 | return rotation_.size(); 902 | } 903 | inline void OVRSample::clear_rotation() { 904 | rotation_.Clear(); 905 | } 906 | inline float OVRSample::rotation(int index) const { 907 | // @@protoc_insertion_point(field_get:OVRSample.rotation) 908 | return rotation_.Get(index); 909 | } 910 | inline void OVRSample::set_rotation(int index, float value) { 911 | rotation_.Set(index, value); 912 | // @@protoc_insertion_point(field_set:OVRSample.rotation) 913 | } 914 | inline void OVRSample::add_rotation(float value) { 915 | rotation_.Add(value); 916 | // @@protoc_insertion_point(field_add:OVRSample.rotation) 917 | } 918 | inline const ::google::protobuf::RepeatedField< float >& 919 | OVRSample::rotation() const { 920 | // @@protoc_insertion_point(field_list:OVRSample.rotation) 921 | return rotation_; 922 | } 923 | inline ::google::protobuf::RepeatedField< float >* 924 | OVRSample::mutable_rotation() { 925 | // @@protoc_insertion_point(field_mutable_list:OVRSample.rotation) 926 | return &rotation_; 927 | } 928 | 929 | // repeated float axis = 4; 930 | inline int OVRSample::axis_size() const { 931 | return axis_.size(); 932 | } 933 | inline void OVRSample::clear_axis() { 934 | axis_.Clear(); 935 | } 936 | inline float OVRSample::axis(int index) const { 937 | // @@protoc_insertion_point(field_get:OVRSample.axis) 938 | return axis_.Get(index); 939 | } 940 | inline void OVRSample::set_axis(int index, float value) { 941 | axis_.Set(index, value); 942 | // @@protoc_insertion_point(field_set:OVRSample.axis) 943 | } 944 | inline void OVRSample::add_axis(float value) { 945 | axis_.Add(value); 946 | // @@protoc_insertion_point(field_add:OVRSample.axis) 947 | } 948 | inline const ::google::protobuf::RepeatedField< float >& 949 | OVRSample::axis() const { 950 | // @@protoc_insertion_point(field_list:OVRSample.axis) 951 | return axis_; 952 | } 953 | inline ::google::protobuf::RepeatedField< float >* 954 | OVRSample::mutable_axis() { 955 | // @@protoc_insertion_point(field_mutable_list:OVRSample.axis) 956 | return &axis_; 957 | } 958 | 959 | // uint64 button_pressed = 5; 960 | inline void OVRSample::clear_button_pressed() { 961 | button_pressed_ = GOOGLE_ULONGLONG(0); 962 | } 963 | inline ::google::protobuf::uint64 OVRSample::button_pressed() const { 964 | // @@protoc_insertion_point(field_get:OVRSample.button_pressed) 965 | return button_pressed_; 966 | } 967 | inline void OVRSample::set_button_pressed(::google::protobuf::uint64 value) { 968 | 969 | button_pressed_ = value; 970 | // @@protoc_insertion_point(field_set:OVRSample.button_pressed) 971 | } 972 | 973 | // uint64 button_touched = 6; 974 | inline void OVRSample::clear_button_touched() { 975 | button_touched_ = GOOGLE_ULONGLONG(0); 976 | } 977 | inline ::google::protobuf::uint64 OVRSample::button_touched() const { 978 | // @@protoc_insertion_point(field_get:OVRSample.button_touched) 979 | return button_touched_; 980 | } 981 | inline void OVRSample::set_button_touched(::google::protobuf::uint64 value) { 982 | 983 | button_touched_ = value; 984 | // @@protoc_insertion_point(field_set:OVRSample.button_touched) 985 | } 986 | 987 | // ------------------------------------------------------------------- 988 | 989 | // OVRTimeline 990 | 991 | // int32 device_id = 1; 992 | inline void OVRTimeline::clear_device_id() { 993 | device_id_ = 0; 994 | } 995 | inline ::google::protobuf::int32 OVRTimeline::device_id() const { 996 | // @@protoc_insertion_point(field_get:OVRTimeline.device_id) 997 | return device_id_; 998 | } 999 | inline void OVRTimeline::set_device_id(::google::protobuf::int32 value) { 1000 | 1001 | device_id_ = value; 1002 | // @@protoc_insertion_point(field_set:OVRTimeline.device_id) 1003 | } 1004 | 1005 | // repeated .OVRSample samples = 2; 1006 | inline int OVRTimeline::samples_size() const { 1007 | return samples_.size(); 1008 | } 1009 | inline void OVRTimeline::clear_samples() { 1010 | samples_.Clear(); 1011 | } 1012 | inline const ::OVRSample& OVRTimeline::samples(int index) const { 1013 | // @@protoc_insertion_point(field_get:OVRTimeline.samples) 1014 | return samples_.Get(index); 1015 | } 1016 | inline ::OVRSample* OVRTimeline::mutable_samples(int index) { 1017 | // @@protoc_insertion_point(field_mutable:OVRTimeline.samples) 1018 | return samples_.Mutable(index); 1019 | } 1020 | inline ::OVRSample* OVRTimeline::add_samples() { 1021 | // @@protoc_insertion_point(field_add:OVRTimeline.samples) 1022 | return samples_.Add(); 1023 | } 1024 | inline ::google::protobuf::RepeatedPtrField< ::OVRSample >* 1025 | OVRTimeline::mutable_samples() { 1026 | // @@protoc_insertion_point(field_mutable_list:OVRTimeline.samples) 1027 | return &samples_; 1028 | } 1029 | inline const ::google::protobuf::RepeatedPtrField< ::OVRSample >& 1030 | OVRTimeline::samples() const { 1031 | // @@protoc_insertion_point(field_list:OVRTimeline.samples) 1032 | return samples_; 1033 | } 1034 | 1035 | #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS 1036 | // ------------------------------------------------------------------- 1037 | 1038 | // ------------------------------------------------------------------- 1039 | 1040 | // ------------------------------------------------------------------- 1041 | 1042 | 1043 | // @@protoc_insertion_point(namespace_scope) 1044 | 1045 | 1046 | #ifndef SWIG 1047 | namespace google { 1048 | namespace protobuf { 1049 | 1050 | template <> struct is_proto_enum< ::OVRDeviceProperty_Type> : ::google::protobuf::internal::true_type {}; 1051 | template <> 1052 | inline const EnumDescriptor* GetEnumDescriptor< ::OVRDeviceProperty_Type>() { 1053 | return ::OVRDeviceProperty_Type_descriptor(); 1054 | } 1055 | 1056 | } // namespace protobuf 1057 | } // namespace google 1058 | #endif // SWIG 1059 | 1060 | // @@protoc_insertion_point(global_scope) 1061 | 1062 | #endif // PROTOBUF_ovr_5fdevice_2eproto__INCLUDED 1063 | -------------------------------------------------------------------------------- /src/generated/recording.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: recording.proto 3 | 4 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION 5 | #include "recording.pb.h" 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | // @@protoc_insertion_point(includes) 19 | class RecordingDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed { 20 | } _Recording_default_instance_; 21 | 22 | namespace protobuf_recording_2eproto { 23 | 24 | 25 | namespace { 26 | 27 | ::google::protobuf::Metadata file_level_metadata[1]; 28 | 29 | } // namespace 30 | 31 | PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField 32 | const TableStruct::entries[] = { 33 | {0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0}, 34 | }; 35 | 36 | PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField 37 | const TableStruct::aux[] = { 38 | ::google::protobuf::internal::AuxillaryParseTableField(), 39 | }; 40 | PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const 41 | TableStruct::schema[] = { 42 | { NULL, NULL, 0, -1, -1, false }, 43 | }; 44 | 45 | const ::google::protobuf::uint32 TableStruct::offsets[] = { 46 | ~0u, // no _has_bits_ 47 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Recording, _internal_metadata_), 48 | ~0u, // no _extensions_ 49 | ~0u, // no _oneof_case_ 50 | ~0u, // no _weak_field_map_ 51 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Recording, start_), 52 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Recording, end_), 53 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Recording, devices_), 54 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Recording, timeline_), 55 | }; 56 | 57 | static const ::google::protobuf::internal::MigrationSchema schemas[] = { 58 | { 0, -1, sizeof(Recording)}, 59 | }; 60 | 61 | static ::google::protobuf::Message const * const file_default_instances[] = { 62 | reinterpret_cast(&_Recording_default_instance_), 63 | }; 64 | 65 | namespace { 66 | 67 | void protobuf_AssignDescriptors() { 68 | AddDescriptors(); 69 | ::google::protobuf::MessageFactory* factory = NULL; 70 | AssignDescriptors( 71 | "recording.proto", schemas, file_default_instances, TableStruct::offsets, factory, 72 | file_level_metadata, NULL, NULL); 73 | } 74 | 75 | void protobuf_AssignDescriptorsOnce() { 76 | static GOOGLE_PROTOBUF_DECLARE_ONCE(once); 77 | ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors); 78 | } 79 | 80 | void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; 81 | void protobuf_RegisterTypes(const ::std::string&) { 82 | protobuf_AssignDescriptorsOnce(); 83 | ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1); 84 | } 85 | 86 | } // namespace 87 | 88 | void TableStruct::Shutdown() { 89 | _Recording_default_instance_.Shutdown(); 90 | delete file_level_metadata[0].reflection; 91 | } 92 | 93 | void TableStruct::InitDefaultsImpl() { 94 | GOOGLE_PROTOBUF_VERIFY_VERSION; 95 | 96 | ::google::protobuf::internal::InitProtobufDefaults(); 97 | ::google::protobuf::protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaults(); 98 | ::protobuf_ovr_5fdevice_2eproto::InitDefaults(); 99 | _Recording_default_instance_.DefaultConstruct(); 100 | _Recording_default_instance_.get_mutable()->start_ = const_cast< ::google::protobuf::Timestamp*>( 101 | ::google::protobuf::Timestamp::internal_default_instance()); 102 | _Recording_default_instance_.get_mutable()->end_ = const_cast< ::google::protobuf::Timestamp*>( 103 | ::google::protobuf::Timestamp::internal_default_instance()); 104 | } 105 | 106 | void InitDefaults() { 107 | static GOOGLE_PROTOBUF_DECLARE_ONCE(once); 108 | ::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl); 109 | } 110 | void AddDescriptorsImpl() { 111 | InitDefaults(); 112 | static const char descriptor[] = { 113 | "\n\017recording.proto\032\037google/protobuf/times" 114 | "tamp.proto\032\020ovr_device.proto\"\234\001\n\tRecordi" 115 | "ng\022)\n\005start\030\001 \001(\0132\032.google.protobuf.Time" 116 | "stamp\022\'\n\003end\030\002 \001(\0132\032.google.protobuf.Tim" 117 | "estamp\022\033\n\007devices\030\003 \003(\0132\n.OVRDevice\022\036\n\010t" 118 | "imeline\030\004 \003(\0132\014.OVRTimelineb\006proto3" 119 | }; 120 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( 121 | descriptor, 235); 122 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( 123 | "recording.proto", &protobuf_RegisterTypes); 124 | ::google::protobuf::protobuf_google_2fprotobuf_2ftimestamp_2eproto::AddDescriptors(); 125 | ::protobuf_ovr_5fdevice_2eproto::AddDescriptors(); 126 | ::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown); 127 | } 128 | 129 | void AddDescriptors() { 130 | static GOOGLE_PROTOBUF_DECLARE_ONCE(once); 131 | ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl); 132 | } 133 | // Force AddDescriptors() to be called at static initialization time. 134 | struct StaticDescriptorInitializer { 135 | StaticDescriptorInitializer() { 136 | AddDescriptors(); 137 | } 138 | } static_descriptor_initializer; 139 | 140 | } // namespace protobuf_recording_2eproto 141 | 142 | 143 | // =================================================================== 144 | 145 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 146 | const int Recording::kStartFieldNumber; 147 | const int Recording::kEndFieldNumber; 148 | const int Recording::kDevicesFieldNumber; 149 | const int Recording::kTimelineFieldNumber; 150 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 151 | 152 | Recording::Recording() 153 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 154 | if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) { 155 | protobuf_recording_2eproto::InitDefaults(); 156 | } 157 | SharedCtor(); 158 | // @@protoc_insertion_point(constructor:Recording) 159 | } 160 | Recording::Recording(const Recording& from) 161 | : ::google::protobuf::Message(), 162 | _internal_metadata_(NULL), 163 | devices_(from.devices_), 164 | timeline_(from.timeline_), 165 | _cached_size_(0) { 166 | _internal_metadata_.MergeFrom(from._internal_metadata_); 167 | if (from.has_start()) { 168 | start_ = new ::google::protobuf::Timestamp(*from.start_); 169 | } else { 170 | start_ = NULL; 171 | } 172 | if (from.has_end()) { 173 | end_ = new ::google::protobuf::Timestamp(*from.end_); 174 | } else { 175 | end_ = NULL; 176 | } 177 | // @@protoc_insertion_point(copy_constructor:Recording) 178 | } 179 | 180 | void Recording::SharedCtor() { 181 | ::memset(&start_, 0, reinterpret_cast(&end_) - 182 | reinterpret_cast(&start_) + sizeof(end_)); 183 | _cached_size_ = 0; 184 | } 185 | 186 | Recording::~Recording() { 187 | // @@protoc_insertion_point(destructor:Recording) 188 | SharedDtor(); 189 | } 190 | 191 | void Recording::SharedDtor() { 192 | if (this != internal_default_instance()) { 193 | delete start_; 194 | } 195 | if (this != internal_default_instance()) { 196 | delete end_; 197 | } 198 | } 199 | 200 | void Recording::SetCachedSize(int size) const { 201 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 202 | _cached_size_ = size; 203 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 204 | } 205 | const ::google::protobuf::Descriptor* Recording::descriptor() { 206 | protobuf_recording_2eproto::protobuf_AssignDescriptorsOnce(); 207 | return protobuf_recording_2eproto::file_level_metadata[kIndexInFileMessages].descriptor; 208 | } 209 | 210 | const Recording& Recording::default_instance() { 211 | protobuf_recording_2eproto::InitDefaults(); 212 | return *internal_default_instance(); 213 | } 214 | 215 | Recording* Recording::New(::google::protobuf::Arena* arena) const { 216 | Recording* n = new Recording; 217 | if (arena != NULL) { 218 | arena->Own(n); 219 | } 220 | return n; 221 | } 222 | 223 | void Recording::Clear() { 224 | // @@protoc_insertion_point(message_clear_start:Recording) 225 | devices_.Clear(); 226 | timeline_.Clear(); 227 | if (GetArenaNoVirtual() == NULL && start_ != NULL) { 228 | delete start_; 229 | } 230 | start_ = NULL; 231 | if (GetArenaNoVirtual() == NULL && end_ != NULL) { 232 | delete end_; 233 | } 234 | end_ = NULL; 235 | } 236 | 237 | bool Recording::MergePartialFromCodedStream( 238 | ::google::protobuf::io::CodedInputStream* input) { 239 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 240 | ::google::protobuf::uint32 tag; 241 | // @@protoc_insertion_point(parse_start:Recording) 242 | for (;;) { 243 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u); 244 | tag = p.first; 245 | if (!p.second) goto handle_unusual; 246 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 247 | // .google.protobuf.Timestamp start = 1; 248 | case 1: { 249 | if (static_cast< ::google::protobuf::uint8>(tag) == 250 | static_cast< ::google::protobuf::uint8>(10u)) { 251 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( 252 | input, mutable_start())); 253 | } else { 254 | goto handle_unusual; 255 | } 256 | break; 257 | } 258 | 259 | // .google.protobuf.Timestamp end = 2; 260 | case 2: { 261 | if (static_cast< ::google::protobuf::uint8>(tag) == 262 | static_cast< ::google::protobuf::uint8>(18u)) { 263 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( 264 | input, mutable_end())); 265 | } else { 266 | goto handle_unusual; 267 | } 268 | break; 269 | } 270 | 271 | // repeated .OVRDevice devices = 3; 272 | case 3: { 273 | if (static_cast< ::google::protobuf::uint8>(tag) == 274 | static_cast< ::google::protobuf::uint8>(26u)) { 275 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( 276 | input, add_devices())); 277 | } else { 278 | goto handle_unusual; 279 | } 280 | break; 281 | } 282 | 283 | // repeated .OVRTimeline timeline = 4; 284 | case 4: { 285 | if (static_cast< ::google::protobuf::uint8>(tag) == 286 | static_cast< ::google::protobuf::uint8>(34u)) { 287 | DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( 288 | input, add_timeline())); 289 | } else { 290 | goto handle_unusual; 291 | } 292 | break; 293 | } 294 | 295 | default: { 296 | handle_unusual: 297 | if (tag == 0 || 298 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 299 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 300 | goto success; 301 | } 302 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 303 | break; 304 | } 305 | } 306 | } 307 | success: 308 | // @@protoc_insertion_point(parse_success:Recording) 309 | return true; 310 | failure: 311 | // @@protoc_insertion_point(parse_failure:Recording) 312 | return false; 313 | #undef DO_ 314 | } 315 | 316 | void Recording::SerializeWithCachedSizes( 317 | ::google::protobuf::io::CodedOutputStream* output) const { 318 | // @@protoc_insertion_point(serialize_start:Recording) 319 | ::google::protobuf::uint32 cached_has_bits = 0; 320 | (void) cached_has_bits; 321 | 322 | // .google.protobuf.Timestamp start = 1; 323 | if (this->has_start()) { 324 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 325 | 1, *this->start_, output); 326 | } 327 | 328 | // .google.protobuf.Timestamp end = 2; 329 | if (this->has_end()) { 330 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 331 | 2, *this->end_, output); 332 | } 333 | 334 | // repeated .OVRDevice devices = 3; 335 | for (unsigned int i = 0, n = this->devices_size(); i < n; i++) { 336 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 337 | 3, this->devices(i), output); 338 | } 339 | 340 | // repeated .OVRTimeline timeline = 4; 341 | for (unsigned int i = 0, n = this->timeline_size(); i < n; i++) { 342 | ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( 343 | 4, this->timeline(i), output); 344 | } 345 | 346 | // @@protoc_insertion_point(serialize_end:Recording) 347 | } 348 | 349 | ::google::protobuf::uint8* Recording::InternalSerializeWithCachedSizesToArray( 350 | bool deterministic, ::google::protobuf::uint8* target) const { 351 | // @@protoc_insertion_point(serialize_to_array_start:Recording) 352 | ::google::protobuf::uint32 cached_has_bits = 0; 353 | (void) cached_has_bits; 354 | 355 | // .google.protobuf.Timestamp start = 1; 356 | if (this->has_start()) { 357 | target = ::google::protobuf::internal::WireFormatLite:: 358 | InternalWriteMessageNoVirtualToArray( 359 | 1, *this->start_, deterministic, target); 360 | } 361 | 362 | // .google.protobuf.Timestamp end = 2; 363 | if (this->has_end()) { 364 | target = ::google::protobuf::internal::WireFormatLite:: 365 | InternalWriteMessageNoVirtualToArray( 366 | 2, *this->end_, deterministic, target); 367 | } 368 | 369 | // repeated .OVRDevice devices = 3; 370 | for (unsigned int i = 0, n = this->devices_size(); i < n; i++) { 371 | target = ::google::protobuf::internal::WireFormatLite:: 372 | InternalWriteMessageNoVirtualToArray( 373 | 3, this->devices(i), deterministic, target); 374 | } 375 | 376 | // repeated .OVRTimeline timeline = 4; 377 | for (unsigned int i = 0, n = this->timeline_size(); i < n; i++) { 378 | target = ::google::protobuf::internal::WireFormatLite:: 379 | InternalWriteMessageNoVirtualToArray( 380 | 4, this->timeline(i), deterministic, target); 381 | } 382 | 383 | // @@protoc_insertion_point(serialize_to_array_end:Recording) 384 | return target; 385 | } 386 | 387 | size_t Recording::ByteSizeLong() const { 388 | // @@protoc_insertion_point(message_byte_size_start:Recording) 389 | size_t total_size = 0; 390 | 391 | // repeated .OVRDevice devices = 3; 392 | { 393 | unsigned int count = this->devices_size(); 394 | total_size += 1UL * count; 395 | for (unsigned int i = 0; i < count; i++) { 396 | total_size += 397 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( 398 | this->devices(i)); 399 | } 400 | } 401 | 402 | // repeated .OVRTimeline timeline = 4; 403 | { 404 | unsigned int count = this->timeline_size(); 405 | total_size += 1UL * count; 406 | for (unsigned int i = 0; i < count; i++) { 407 | total_size += 408 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( 409 | this->timeline(i)); 410 | } 411 | } 412 | 413 | // .google.protobuf.Timestamp start = 1; 414 | if (this->has_start()) { 415 | total_size += 1 + 416 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( 417 | *this->start_); 418 | } 419 | 420 | // .google.protobuf.Timestamp end = 2; 421 | if (this->has_end()) { 422 | total_size += 1 + 423 | ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( 424 | *this->end_); 425 | } 426 | 427 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 428 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 429 | _cached_size_ = cached_size; 430 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 431 | return total_size; 432 | } 433 | 434 | void Recording::MergeFrom(const ::google::protobuf::Message& from) { 435 | // @@protoc_insertion_point(generalized_merge_from_start:Recording) 436 | GOOGLE_DCHECK_NE(&from, this); 437 | const Recording* source = 438 | ::google::protobuf::internal::DynamicCastToGenerated( 439 | &from); 440 | if (source == NULL) { 441 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:Recording) 442 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 443 | } else { 444 | // @@protoc_insertion_point(generalized_merge_from_cast_success:Recording) 445 | MergeFrom(*source); 446 | } 447 | } 448 | 449 | void Recording::MergeFrom(const Recording& from) { 450 | // @@protoc_insertion_point(class_specific_merge_from_start:Recording) 451 | GOOGLE_DCHECK_NE(&from, this); 452 | _internal_metadata_.MergeFrom(from._internal_metadata_); 453 | ::google::protobuf::uint32 cached_has_bits = 0; 454 | (void) cached_has_bits; 455 | 456 | devices_.MergeFrom(from.devices_); 457 | timeline_.MergeFrom(from.timeline_); 458 | if (from.has_start()) { 459 | mutable_start()->::google::protobuf::Timestamp::MergeFrom(from.start()); 460 | } 461 | if (from.has_end()) { 462 | mutable_end()->::google::protobuf::Timestamp::MergeFrom(from.end()); 463 | } 464 | } 465 | 466 | void Recording::CopyFrom(const ::google::protobuf::Message& from) { 467 | // @@protoc_insertion_point(generalized_copy_from_start:Recording) 468 | if (&from == this) return; 469 | Clear(); 470 | MergeFrom(from); 471 | } 472 | 473 | void Recording::CopyFrom(const Recording& from) { 474 | // @@protoc_insertion_point(class_specific_copy_from_start:Recording) 475 | if (&from == this) return; 476 | Clear(); 477 | MergeFrom(from); 478 | } 479 | 480 | bool Recording::IsInitialized() const { 481 | return true; 482 | } 483 | 484 | void Recording::Swap(Recording* other) { 485 | if (other == this) return; 486 | InternalSwap(other); 487 | } 488 | void Recording::InternalSwap(Recording* other) { 489 | devices_.InternalSwap(&other->devices_); 490 | timeline_.InternalSwap(&other->timeline_); 491 | std::swap(start_, other->start_); 492 | std::swap(end_, other->end_); 493 | std::swap(_cached_size_, other->_cached_size_); 494 | } 495 | 496 | ::google::protobuf::Metadata Recording::GetMetadata() const { 497 | protobuf_recording_2eproto::protobuf_AssignDescriptorsOnce(); 498 | return protobuf_recording_2eproto::file_level_metadata[kIndexInFileMessages]; 499 | } 500 | 501 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 502 | // Recording 503 | 504 | // .google.protobuf.Timestamp start = 1; 505 | bool Recording::has_start() const { 506 | return this != internal_default_instance() && start_ != NULL; 507 | } 508 | void Recording::clear_start() { 509 | if (GetArenaNoVirtual() == NULL && start_ != NULL) delete start_; 510 | start_ = NULL; 511 | } 512 | const ::google::protobuf::Timestamp& Recording::start() const { 513 | // @@protoc_insertion_point(field_get:Recording.start) 514 | return start_ != NULL ? *start_ 515 | : *::google::protobuf::Timestamp::internal_default_instance(); 516 | } 517 | ::google::protobuf::Timestamp* Recording::mutable_start() { 518 | 519 | if (start_ == NULL) { 520 | start_ = new ::google::protobuf::Timestamp; 521 | } 522 | // @@protoc_insertion_point(field_mutable:Recording.start) 523 | return start_; 524 | } 525 | ::google::protobuf::Timestamp* Recording::release_start() { 526 | // @@protoc_insertion_point(field_release:Recording.start) 527 | 528 | ::google::protobuf::Timestamp* temp = start_; 529 | start_ = NULL; 530 | return temp; 531 | } 532 | void Recording::set_allocated_start(::google::protobuf::Timestamp* start) { 533 | delete start_; 534 | if (start != NULL && start->GetArena() != NULL) { 535 | ::google::protobuf::Timestamp* new_start = new ::google::protobuf::Timestamp; 536 | new_start->CopyFrom(*start); 537 | start = new_start; 538 | } 539 | start_ = start; 540 | if (start) { 541 | 542 | } else { 543 | 544 | } 545 | // @@protoc_insertion_point(field_set_allocated:Recording.start) 546 | } 547 | 548 | // .google.protobuf.Timestamp end = 2; 549 | bool Recording::has_end() const { 550 | return this != internal_default_instance() && end_ != NULL; 551 | } 552 | void Recording::clear_end() { 553 | if (GetArenaNoVirtual() == NULL && end_ != NULL) delete end_; 554 | end_ = NULL; 555 | } 556 | const ::google::protobuf::Timestamp& Recording::end() const { 557 | // @@protoc_insertion_point(field_get:Recording.end) 558 | return end_ != NULL ? *end_ 559 | : *::google::protobuf::Timestamp::internal_default_instance(); 560 | } 561 | ::google::protobuf::Timestamp* Recording::mutable_end() { 562 | 563 | if (end_ == NULL) { 564 | end_ = new ::google::protobuf::Timestamp; 565 | } 566 | // @@protoc_insertion_point(field_mutable:Recording.end) 567 | return end_; 568 | } 569 | ::google::protobuf::Timestamp* Recording::release_end() { 570 | // @@protoc_insertion_point(field_release:Recording.end) 571 | 572 | ::google::protobuf::Timestamp* temp = end_; 573 | end_ = NULL; 574 | return temp; 575 | } 576 | void Recording::set_allocated_end(::google::protobuf::Timestamp* end) { 577 | delete end_; 578 | if (end != NULL && end->GetArena() != NULL) { 579 | ::google::protobuf::Timestamp* new_end = new ::google::protobuf::Timestamp; 580 | new_end->CopyFrom(*end); 581 | end = new_end; 582 | } 583 | end_ = end; 584 | if (end) { 585 | 586 | } else { 587 | 588 | } 589 | // @@protoc_insertion_point(field_set_allocated:Recording.end) 590 | } 591 | 592 | // repeated .OVRDevice devices = 3; 593 | int Recording::devices_size() const { 594 | return devices_.size(); 595 | } 596 | void Recording::clear_devices() { 597 | devices_.Clear(); 598 | } 599 | const ::OVRDevice& Recording::devices(int index) const { 600 | // @@protoc_insertion_point(field_get:Recording.devices) 601 | return devices_.Get(index); 602 | } 603 | ::OVRDevice* Recording::mutable_devices(int index) { 604 | // @@protoc_insertion_point(field_mutable:Recording.devices) 605 | return devices_.Mutable(index); 606 | } 607 | ::OVRDevice* Recording::add_devices() { 608 | // @@protoc_insertion_point(field_add:Recording.devices) 609 | return devices_.Add(); 610 | } 611 | ::google::protobuf::RepeatedPtrField< ::OVRDevice >* 612 | Recording::mutable_devices() { 613 | // @@protoc_insertion_point(field_mutable_list:Recording.devices) 614 | return &devices_; 615 | } 616 | const ::google::protobuf::RepeatedPtrField< ::OVRDevice >& 617 | Recording::devices() const { 618 | // @@protoc_insertion_point(field_list:Recording.devices) 619 | return devices_; 620 | } 621 | 622 | // repeated .OVRTimeline timeline = 4; 623 | int Recording::timeline_size() const { 624 | return timeline_.size(); 625 | } 626 | void Recording::clear_timeline() { 627 | timeline_.Clear(); 628 | } 629 | const ::OVRTimeline& Recording::timeline(int index) const { 630 | // @@protoc_insertion_point(field_get:Recording.timeline) 631 | return timeline_.Get(index); 632 | } 633 | ::OVRTimeline* Recording::mutable_timeline(int index) { 634 | // @@protoc_insertion_point(field_mutable:Recording.timeline) 635 | return timeline_.Mutable(index); 636 | } 637 | ::OVRTimeline* Recording::add_timeline() { 638 | // @@protoc_insertion_point(field_add:Recording.timeline) 639 | return timeline_.Add(); 640 | } 641 | ::google::protobuf::RepeatedPtrField< ::OVRTimeline >* 642 | Recording::mutable_timeline() { 643 | // @@protoc_insertion_point(field_mutable_list:Recording.timeline) 644 | return &timeline_; 645 | } 646 | const ::google::protobuf::RepeatedPtrField< ::OVRTimeline >& 647 | Recording::timeline() const { 648 | // @@protoc_insertion_point(field_list:Recording.timeline) 649 | return timeline_; 650 | } 651 | 652 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 653 | 654 | // @@protoc_insertion_point(namespace_scope) 655 | 656 | // @@protoc_insertion_point(global_scope) 657 | -------------------------------------------------------------------------------- /src/generated/recording.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: recording.proto 3 | 4 | #ifndef PROTOBUF_recording_2eproto__INCLUDED 5 | #define PROTOBUF_recording_2eproto__INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | 11 | #if GOOGLE_PROTOBUF_VERSION < 3003000 12 | #error This file was generated by a newer version of protoc which is 13 | #error incompatible with your Protocol Buffer headers. Please update 14 | #error your headers. 15 | #endif 16 | #if 3003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 17 | #error This file was generated by an older version of protoc which is 18 | #error incompatible with your Protocol Buffer headers. Please 19 | #error regenerate this file with a newer version of protoc. 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include // IWYU pragma: export 30 | #include // IWYU pragma: export 31 | #include 32 | #include 33 | #include "ovr_device.pb.h" 34 | // @@protoc_insertion_point(includes) 35 | class OVRDevice; 36 | class OVRDeviceDefaultTypeInternal; 37 | extern OVRDeviceDefaultTypeInternal _OVRDevice_default_instance_; 38 | class OVRDeviceProperty; 39 | class OVRDevicePropertyDefaultTypeInternal; 40 | extern OVRDevicePropertyDefaultTypeInternal _OVRDeviceProperty_default_instance_; 41 | class OVRSample; 42 | class OVRSampleDefaultTypeInternal; 43 | extern OVRSampleDefaultTypeInternal _OVRSample_default_instance_; 44 | class OVRTimeline; 45 | class OVRTimelineDefaultTypeInternal; 46 | extern OVRTimelineDefaultTypeInternal _OVRTimeline_default_instance_; 47 | class Recording; 48 | class RecordingDefaultTypeInternal; 49 | extern RecordingDefaultTypeInternal _Recording_default_instance_; 50 | namespace google { 51 | namespace protobuf { 52 | class Timestamp; 53 | class TimestampDefaultTypeInternal; 54 | extern TimestampDefaultTypeInternal _Timestamp_default_instance_; 55 | } // namespace protobuf 56 | } // namespace google 57 | 58 | namespace protobuf_recording_2eproto { 59 | // Internal implementation detail -- do not call these. 60 | struct TableStruct { 61 | static const ::google::protobuf::internal::ParseTableField entries[]; 62 | static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; 63 | static const ::google::protobuf::internal::ParseTable schema[]; 64 | static const ::google::protobuf::uint32 offsets[]; 65 | static void InitDefaultsImpl(); 66 | static void Shutdown(); 67 | }; 68 | void AddDescriptors(); 69 | void InitDefaults(); 70 | } // namespace protobuf_recording_2eproto 71 | 72 | // =================================================================== 73 | 74 | class Recording : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:Recording) */ { 75 | public: 76 | Recording(); 77 | virtual ~Recording(); 78 | 79 | Recording(const Recording& from); 80 | 81 | inline Recording& operator=(const Recording& from) { 82 | CopyFrom(from); 83 | return *this; 84 | } 85 | 86 | static const ::google::protobuf::Descriptor* descriptor(); 87 | static const Recording& default_instance(); 88 | 89 | static inline const Recording* internal_default_instance() { 90 | return reinterpret_cast( 91 | &_Recording_default_instance_); 92 | } 93 | static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 94 | 0; 95 | 96 | void Swap(Recording* other); 97 | 98 | // implements Message ---------------------------------------------- 99 | 100 | inline Recording* New() const PROTOBUF_FINAL { return New(NULL); } 101 | 102 | Recording* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; 103 | void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 104 | void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; 105 | void CopyFrom(const Recording& from); 106 | void MergeFrom(const Recording& from); 107 | void Clear() PROTOBUF_FINAL; 108 | bool IsInitialized() const PROTOBUF_FINAL; 109 | 110 | size_t ByteSizeLong() const PROTOBUF_FINAL; 111 | bool MergePartialFromCodedStream( 112 | ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; 113 | void SerializeWithCachedSizes( 114 | ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; 115 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 116 | bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; 117 | int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } 118 | private: 119 | void SharedCtor(); 120 | void SharedDtor(); 121 | void SetCachedSize(int size) const PROTOBUF_FINAL; 122 | void InternalSwap(Recording* other); 123 | private: 124 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 125 | return NULL; 126 | } 127 | inline void* MaybeArenaPtr() const { 128 | return NULL; 129 | } 130 | public: 131 | 132 | ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; 133 | 134 | // nested types ---------------------------------------------------- 135 | 136 | // accessors ------------------------------------------------------- 137 | 138 | // repeated .OVRDevice devices = 3; 139 | int devices_size() const; 140 | void clear_devices(); 141 | static const int kDevicesFieldNumber = 3; 142 | const ::OVRDevice& devices(int index) const; 143 | ::OVRDevice* mutable_devices(int index); 144 | ::OVRDevice* add_devices(); 145 | ::google::protobuf::RepeatedPtrField< ::OVRDevice >* 146 | mutable_devices(); 147 | const ::google::protobuf::RepeatedPtrField< ::OVRDevice >& 148 | devices() const; 149 | 150 | // repeated .OVRTimeline timeline = 4; 151 | int timeline_size() const; 152 | void clear_timeline(); 153 | static const int kTimelineFieldNumber = 4; 154 | const ::OVRTimeline& timeline(int index) const; 155 | ::OVRTimeline* mutable_timeline(int index); 156 | ::OVRTimeline* add_timeline(); 157 | ::google::protobuf::RepeatedPtrField< ::OVRTimeline >* 158 | mutable_timeline(); 159 | const ::google::protobuf::RepeatedPtrField< ::OVRTimeline >& 160 | timeline() const; 161 | 162 | // .google.protobuf.Timestamp start = 1; 163 | bool has_start() const; 164 | void clear_start(); 165 | static const int kStartFieldNumber = 1; 166 | const ::google::protobuf::Timestamp& start() const; 167 | ::google::protobuf::Timestamp* mutable_start(); 168 | ::google::protobuf::Timestamp* release_start(); 169 | void set_allocated_start(::google::protobuf::Timestamp* start); 170 | 171 | // .google.protobuf.Timestamp end = 2; 172 | bool has_end() const; 173 | void clear_end(); 174 | static const int kEndFieldNumber = 2; 175 | const ::google::protobuf::Timestamp& end() const; 176 | ::google::protobuf::Timestamp* mutable_end(); 177 | ::google::protobuf::Timestamp* release_end(); 178 | void set_allocated_end(::google::protobuf::Timestamp* end); 179 | 180 | // @@protoc_insertion_point(class_scope:Recording) 181 | private: 182 | 183 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 184 | ::google::protobuf::RepeatedPtrField< ::OVRDevice > devices_; 185 | ::google::protobuf::RepeatedPtrField< ::OVRTimeline > timeline_; 186 | ::google::protobuf::Timestamp* start_; 187 | ::google::protobuf::Timestamp* end_; 188 | mutable int _cached_size_; 189 | friend struct protobuf_recording_2eproto::TableStruct; 190 | }; 191 | // =================================================================== 192 | 193 | 194 | // =================================================================== 195 | 196 | #if !PROTOBUF_INLINE_NOT_IN_HEADERS 197 | // Recording 198 | 199 | // .google.protobuf.Timestamp start = 1; 200 | inline bool Recording::has_start() const { 201 | return this != internal_default_instance() && start_ != NULL; 202 | } 203 | inline void Recording::clear_start() { 204 | if (GetArenaNoVirtual() == NULL && start_ != NULL) delete start_; 205 | start_ = NULL; 206 | } 207 | inline const ::google::protobuf::Timestamp& Recording::start() const { 208 | // @@protoc_insertion_point(field_get:Recording.start) 209 | return start_ != NULL ? *start_ 210 | : *::google::protobuf::Timestamp::internal_default_instance(); 211 | } 212 | inline ::google::protobuf::Timestamp* Recording::mutable_start() { 213 | 214 | if (start_ == NULL) { 215 | start_ = new ::google::protobuf::Timestamp; 216 | } 217 | // @@protoc_insertion_point(field_mutable:Recording.start) 218 | return start_; 219 | } 220 | inline ::google::protobuf::Timestamp* Recording::release_start() { 221 | // @@protoc_insertion_point(field_release:Recording.start) 222 | 223 | ::google::protobuf::Timestamp* temp = start_; 224 | start_ = NULL; 225 | return temp; 226 | } 227 | inline void Recording::set_allocated_start(::google::protobuf::Timestamp* start) { 228 | delete start_; 229 | if (start != NULL && start->GetArena() != NULL) { 230 | ::google::protobuf::Timestamp* new_start = new ::google::protobuf::Timestamp; 231 | new_start->CopyFrom(*start); 232 | start = new_start; 233 | } 234 | start_ = start; 235 | if (start) { 236 | 237 | } else { 238 | 239 | } 240 | // @@protoc_insertion_point(field_set_allocated:Recording.start) 241 | } 242 | 243 | // .google.protobuf.Timestamp end = 2; 244 | inline bool Recording::has_end() const { 245 | return this != internal_default_instance() && end_ != NULL; 246 | } 247 | inline void Recording::clear_end() { 248 | if (GetArenaNoVirtual() == NULL && end_ != NULL) delete end_; 249 | end_ = NULL; 250 | } 251 | inline const ::google::protobuf::Timestamp& Recording::end() const { 252 | // @@protoc_insertion_point(field_get:Recording.end) 253 | return end_ != NULL ? *end_ 254 | : *::google::protobuf::Timestamp::internal_default_instance(); 255 | } 256 | inline ::google::protobuf::Timestamp* Recording::mutable_end() { 257 | 258 | if (end_ == NULL) { 259 | end_ = new ::google::protobuf::Timestamp; 260 | } 261 | // @@protoc_insertion_point(field_mutable:Recording.end) 262 | return end_; 263 | } 264 | inline ::google::protobuf::Timestamp* Recording::release_end() { 265 | // @@protoc_insertion_point(field_release:Recording.end) 266 | 267 | ::google::protobuf::Timestamp* temp = end_; 268 | end_ = NULL; 269 | return temp; 270 | } 271 | inline void Recording::set_allocated_end(::google::protobuf::Timestamp* end) { 272 | delete end_; 273 | if (end != NULL && end->GetArena() != NULL) { 274 | ::google::protobuf::Timestamp* new_end = new ::google::protobuf::Timestamp; 275 | new_end->CopyFrom(*end); 276 | end = new_end; 277 | } 278 | end_ = end; 279 | if (end) { 280 | 281 | } else { 282 | 283 | } 284 | // @@protoc_insertion_point(field_set_allocated:Recording.end) 285 | } 286 | 287 | // repeated .OVRDevice devices = 3; 288 | inline int Recording::devices_size() const { 289 | return devices_.size(); 290 | } 291 | inline void Recording::clear_devices() { 292 | devices_.Clear(); 293 | } 294 | inline const ::OVRDevice& Recording::devices(int index) const { 295 | // @@protoc_insertion_point(field_get:Recording.devices) 296 | return devices_.Get(index); 297 | } 298 | inline ::OVRDevice* Recording::mutable_devices(int index) { 299 | // @@protoc_insertion_point(field_mutable:Recording.devices) 300 | return devices_.Mutable(index); 301 | } 302 | inline ::OVRDevice* Recording::add_devices() { 303 | // @@protoc_insertion_point(field_add:Recording.devices) 304 | return devices_.Add(); 305 | } 306 | inline ::google::protobuf::RepeatedPtrField< ::OVRDevice >* 307 | Recording::mutable_devices() { 308 | // @@protoc_insertion_point(field_mutable_list:Recording.devices) 309 | return &devices_; 310 | } 311 | inline const ::google::protobuf::RepeatedPtrField< ::OVRDevice >& 312 | Recording::devices() const { 313 | // @@protoc_insertion_point(field_list:Recording.devices) 314 | return devices_; 315 | } 316 | 317 | // repeated .OVRTimeline timeline = 4; 318 | inline int Recording::timeline_size() const { 319 | return timeline_.size(); 320 | } 321 | inline void Recording::clear_timeline() { 322 | timeline_.Clear(); 323 | } 324 | inline const ::OVRTimeline& Recording::timeline(int index) const { 325 | // @@protoc_insertion_point(field_get:Recording.timeline) 326 | return timeline_.Get(index); 327 | } 328 | inline ::OVRTimeline* Recording::mutable_timeline(int index) { 329 | // @@protoc_insertion_point(field_mutable:Recording.timeline) 330 | return timeline_.Mutable(index); 331 | } 332 | inline ::OVRTimeline* Recording::add_timeline() { 333 | // @@protoc_insertion_point(field_add:Recording.timeline) 334 | return timeline_.Add(); 335 | } 336 | inline ::google::protobuf::RepeatedPtrField< ::OVRTimeline >* 337 | Recording::mutable_timeline() { 338 | // @@protoc_insertion_point(field_mutable_list:Recording.timeline) 339 | return &timeline_; 340 | } 341 | inline const ::google::protobuf::RepeatedPtrField< ::OVRTimeline >& 342 | Recording::timeline() const { 343 | // @@protoc_insertion_point(field_list:Recording.timeline) 344 | return timeline_; 345 | } 346 | 347 | #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS 348 | 349 | // @@protoc_insertion_point(namespace_scope) 350 | 351 | 352 | // @@protoc_insertion_point(global_scope) 353 | 354 | #endif // PROTOBUF_recording_2eproto__INCLUDED 355 | -------------------------------------------------------------------------------- /src/main.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "generated/ovr_device.pb.h" 8 | #include "generated/recording.pb.h" 9 | #include 10 | #include 11 | 12 | float lerp(float a, float b, float alpha) { 13 | return (1 - alpha)*a + alpha*b; 14 | } 15 | 16 | vr::HmdQuaternion_t get_rotation(vr::HmdMatrix34_t matrix) { 17 | vr::HmdQuaternion_t q; 18 | 19 | q.w = sqrt(fmax(0, 1 + matrix.m[0][0] + matrix.m[1][1] + matrix.m[2][2])) / 2; 20 | q.x = sqrt(fmax(0, 1 + matrix.m[0][0] - matrix.m[1][1] - matrix.m[2][2])) / 2; 21 | q.y = sqrt(fmax(0, 1 - matrix.m[0][0] + matrix.m[1][1] - matrix.m[2][2])) / 2; 22 | q.z = sqrt(fmax(0, 1 - matrix.m[0][0] - matrix.m[1][1] + matrix.m[2][2])) / 2; 23 | q.x = copysign(q.x, matrix.m[2][1] - matrix.m[1][2]); 24 | q.y = copysign(q.y, matrix.m[0][2] - matrix.m[2][0]); 25 | q.z = copysign(q.z, matrix.m[1][0] - matrix.m[0][1]); 26 | return q; 27 | } 28 | 29 | vr::HmdVector3_t get_position(vr::HmdMatrix34_t matrix) { 30 | vr::HmdVector3_t vector; 31 | 32 | vector.v[0] = matrix.m[0][3]; 33 | vector.v[1] = matrix.m[1][3]; 34 | vector.v[2] = matrix.m[2][3]; 35 | 36 | return vector; 37 | } 38 | 39 | void record(int argc, char *argv[]) { 40 | vrinputemulator::VRInputEmulator inputEmulator; 41 | inputEmulator.connect(); 42 | 43 | vr::HmdError err; 44 | vr::IVRSystem *p = vr::VR_Init(&err, vr::VRApplication_Background); 45 | if (err != vr::HmdError::VRInitError_None) { 46 | throw std::runtime_error("HmdError"); 47 | } 48 | 49 | /**** Find devices to record ****/ 50 | 51 | Recording recording; 52 | std::map device_to_timeline; 53 | for (int i = 0; i < vr::k_unMaxTrackedDeviceCount; ++i) { 54 | auto deviceClass = vr::VRSystem()->GetTrackedDeviceClass(i); 55 | if (deviceClass == vr::TrackedDeviceClass_Invalid) continue; 56 | 57 | /* Ignore virtual devices */ 58 | std::string prefix = "virtual-"; 59 | char buffer[1024] = { '\0' }; 60 | vr::ETrackedPropertyError error; 61 | vr::VRSystem()->GetStringTrackedDeviceProperty(i, (vr::ETrackedDeviceProperty)1002, buffer, 1024, &error); 62 | if (error != vr::TrackedProp_Success || ((std::string)buffer).compare(0, prefix.length(), prefix) == 0) { 63 | std::cout << "Skipping device: " << i << std::endl; 64 | continue; 65 | } 66 | 67 | std::cout << "Serial: " << buffer << std::endl; 68 | 69 | auto device = recording.add_devices(); 70 | device->set_id(i); 71 | device->set_device_class(deviceClass); 72 | auto timeline = recording.add_timeline(); 73 | timeline->set_device_id(i); 74 | device_to_timeline.insert(std::pair(i, timeline)); 75 | 76 | if (deviceClass == vr::TrackedDeviceClass_Controller) { 77 | device->set_controller_role(vr::VRSystem()->GetControllerRoleForTrackedDeviceIndex(i)); 78 | } 79 | 80 | for (int p = 1; p < 20000; p++) { 81 | vr::ETrackedPropertyError error; 82 | vr::TrackedDeviceIndex_t deviceId = i; 83 | 84 | char buffer[1024] = { '\0' }; 85 | vr::VRSystem()->GetStringTrackedDeviceProperty(deviceId, (vr::ETrackedDeviceProperty)p, buffer, 1024, &error); 86 | if (error == vr::TrackedProp_Success) { 87 | auto prop = device->add_properties(); 88 | prop->set_type(OVRDeviceProperty_Type::OVRDeviceProperty_Type_String); 89 | prop->set_string_value(buffer); 90 | prop->set_identifier(p); 91 | continue; 92 | } 93 | 94 | auto valueInt32 = vr::VRSystem()->GetInt32TrackedDeviceProperty(deviceId, (vr::ETrackedDeviceProperty)p, &error); 95 | if (error == vr::TrackedProp_Success) { 96 | auto prop = device->add_properties(); 97 | prop->set_type(OVRDeviceProperty_Type::OVRDeviceProperty_Type_Int32); 98 | prop->set_int32_value(valueInt32); 99 | prop->set_identifier(p); 100 | continue; 101 | } 102 | 103 | auto valueUint64 = vr::VRSystem()->GetUint64TrackedDeviceProperty(deviceId, (vr::ETrackedDeviceProperty)p, &error); 104 | if (error == vr::TrackedProp_Success) { 105 | auto prop = device->add_properties(); 106 | prop->set_type(OVRDeviceProperty_Type::OVRDeviceProperty_Type_Uint64); 107 | prop->set_uint64_value(valueUint64); 108 | prop->set_identifier(p); 109 | continue; 110 | } 111 | 112 | auto valueBool = vr::VRSystem()->GetBoolTrackedDeviceProperty(deviceId, (vr::ETrackedDeviceProperty)p, &error); 113 | if (error == vr::TrackedProp_Success) { 114 | auto prop = device->add_properties(); 115 | prop->set_type(OVRDeviceProperty_Type::OVRDeviceProperty_Type_Bool); 116 | prop->set_bool_value(valueBool); 117 | prop->set_identifier(p); 118 | continue; 119 | } 120 | 121 | auto valueFloat = vr::VRSystem()->GetFloatTrackedDeviceProperty(deviceId, (vr::ETrackedDeviceProperty)p, &error); 122 | if (error == vr::TrackedProp_Success) { 123 | auto prop = device->add_properties(); 124 | prop->set_type(OVRDeviceProperty_Type::OVRDeviceProperty_Type_Float); 125 | prop->set_float_value(valueFloat); 126 | prop->set_identifier(p); 127 | continue; 128 | } 129 | 130 | auto valueMatrix34 = vr::VRSystem()->GetMatrix34TrackedDeviceProperty(deviceId, (vr::ETrackedDeviceProperty)p, &error); 131 | if (error == vr::TrackedProp_Success) { 132 | auto prop = device->add_properties(); 133 | prop->set_type(OVRDeviceProperty_Type::OVRDeviceProperty_Type_Matrix34); 134 | 135 | for (int i = 0; i < 3; ++i) { 136 | for (int j = 0; j < 4; ++j) { 137 | prop->add_matrix34_value(valueMatrix34.m[i][j]); 138 | } 139 | } 140 | 141 | prop->set_identifier(p); 142 | continue; 143 | } 144 | } 145 | } 146 | auto devices = recording.devices(); 147 | 148 | std::cout << "Press S to stop recording (max 120 seconds)" << std::endl; 149 | 150 | /**** Record ****/ 151 | auto startTime = std::chrono::system_clock::now(); 152 | vr::TrackedDevicePose_t m_rTrackedDevicePose[vr::k_unMaxTrackedDeviceCount]; 153 | while (1) { 154 | std::this_thread::sleep_for(std::chrono::milliseconds(5)); 155 | auto now = std::chrono::system_clock::now(); 156 | auto timeMillis = std::chrono::duration_cast (now - startTime).count(); 157 | if (GetAsyncKeyState('S') & 0x8000 || timeMillis > 120 * 1000) break; 158 | 159 | std::map::iterator it; 160 | for (it = device_to_timeline.begin(); it != device_to_timeline.end(); ++it) { 161 | auto device = devices.Get(it->first); 162 | auto timeline = it->second; 163 | 164 | vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(vr::TrackingUniverseRawAndUncalibrated, 0, m_rTrackedDevicePose, vr::k_unMaxTrackedDeviceCount); 165 | 166 | auto sample = timeline->add_samples(); 167 | sample->set_time(timeMillis); 168 | auto position = get_position(m_rTrackedDevicePose[it->first].mDeviceToAbsoluteTracking); 169 | auto quaternion = get_rotation(m_rTrackedDevicePose[it->first].mDeviceToAbsoluteTracking); 170 | 171 | sample->add_position(position.v[0]); 172 | sample->add_position(position.v[1]); 173 | sample->add_position(position.v[2]); 174 | 175 | sample->add_rotation((float)quaternion.w); 176 | sample->add_rotation((float)quaternion.x); 177 | sample->add_rotation((float)quaternion.y); 178 | sample->add_rotation((float)quaternion.z); 179 | 180 | if (device.device_class() == vr::TrackedDeviceClass_Controller) { 181 | vr::VRControllerState_t controllerState; 182 | vr::VRSystem()->GetControllerState(it->first, &controllerState, sizeof(controllerState)); 183 | sample->add_axis(controllerState.rAxis[0].x); 184 | sample->add_axis(controllerState.rAxis[0].y); 185 | sample->add_axis(controllerState.rAxis[1].x); 186 | sample->add_axis(controllerState.rAxis[1].y); 187 | sample->add_axis(controllerState.rAxis[2].x); 188 | sample->add_axis(controllerState.rAxis[2].y); 189 | sample->add_axis(controllerState.rAxis[3].x); 190 | sample->add_axis(controllerState.rAxis[3].y); 191 | sample->add_axis(controllerState.rAxis[4].x); 192 | sample->add_axis(controllerState.rAxis[4].y); 193 | 194 | sample->set_button_pressed(controllerState.ulButtonPressed); 195 | sample->set_button_touched(controllerState.ulButtonTouched); 196 | } 197 | } 198 | } 199 | 200 | inputEmulator.disconnect(); 201 | 202 | std::fstream output(argv[2], std::ios::out | std::ios::trunc | std::ios::binary); 203 | if (!recording.SerializeToOstream(&output)) { 204 | throw std::runtime_error("Error: Failed to write recording."); 205 | } 206 | } 207 | 208 | bool get_serial_number(OVRDevice device, std::string &serial) { 209 | auto properties = device.properties(); 210 | 211 | for (auto it = properties.begin(); it != properties.end(); ++it) { 212 | if (it->identifier() == 1002) { 213 | serial = it->string_value(); 214 | return false; 215 | } 216 | } 217 | 218 | return true; 219 | } 220 | 221 | int get_connected_device(std::string serial_number) { 222 | vr::ETrackedPropertyError error; 223 | for (int i = 0; i < vr::k_unMaxTrackedDeviceCount; ++i) { 224 | char buffer[1024] = { '\0' }; 225 | vr::VRSystem()->GetStringTrackedDeviceProperty(i, (vr::ETrackedDeviceProperty)1002, buffer, 1024, &error); 226 | if (error == vr::TrackedProp_Success && serial_number == buffer) { 227 | return i; 228 | } 229 | } 230 | 231 | return -1; 232 | } 233 | 234 | /* Get or create a virtual device for the given serial, returns the virtual id */ 235 | int get_virtual_device(vrinputemulator::VRInputEmulator& inputEmulator, std::string serial) { 236 | for (int i = 0; i < (int)inputEmulator.getVirtualDeviceCount(); i++) { 237 | auto info = inputEmulator.getVirtualDeviceInfo(i); 238 | if (info.deviceSerial == serial) return info.virtualDeviceId; 239 | } 240 | 241 | return inputEmulator.addVirtualDevice(vrinputemulator::VirtualDeviceType::TrackedController, serial, true); 242 | } 243 | 244 | int get_interval(long long t, OVRTimeline& timeline) { 245 | if (t < (long long)timeline.samples(0).time()) return 0; 246 | 247 | for (int i = 0; i < timeline.samples().size() - 1; i++) { 248 | auto sample = timeline.samples(i); 249 | if ((long long)sample.time() > t) { 250 | return i - 1; 251 | } 252 | } 253 | 254 | return timeline.samples().size() - 2; 255 | } 256 | 257 | void replay(int argc, char *argv[]) { 258 | Recording recording; 259 | std::fstream input(argv[2], std::ios::in | std::ios::binary); 260 | 261 | if (!input) { 262 | throw std::runtime_error("Error: File not found."); 263 | } 264 | else if (!recording.ParseFromIstream(&input)) { 265 | throw std::runtime_error("Error: Failed to parse recording."); 266 | } 267 | 268 | bool loop = std::strcmp(argv[1], "loop") == 0; 269 | 270 | int speed = 1; 271 | if (argc > 3) speed = atoi(argv[3]); 272 | 273 | vr::HmdError err; 274 | vr::IVRSystem *p = vr::VR_Init(&err, vr::VRApplication_Background); 275 | if (err != vr::HmdError::VRInitError_None) { 276 | throw std::runtime_error("HmdError"); 277 | } 278 | 279 | /* Setup virtual devices for each recorded device, and redirect them to original device (if present) */ 280 | auto devices = recording.devices(); 281 | vrinputemulator::VRInputEmulator inputEmulator; 282 | inputEmulator.connect(); 283 | std::map device_to_virtual; 284 | for (auto it = devices.begin(); it != devices.end(); ++it) { 285 | if (it->device_class() != vr::TrackedDeviceClass_Controller && it->device_class() != vr::TrackedDeviceClass_HMD) { 286 | std::cout << "Not controller or HMD" << std::endl; 287 | continue; 288 | } 289 | 290 | std::string serial = ""; 291 | if (get_serial_number(*it, serial)) { 292 | std::cout << "No serial" << std::endl; 293 | continue; 294 | } 295 | 296 | // find connected device 297 | int ovr_id = get_connected_device(serial); 298 | if (ovr_id == -1) { 299 | std::cout << serial << " not connected" << std::endl; 300 | continue; 301 | } 302 | 303 | std::cout << "Found " << serial << " @ " << ovr_id << std::endl; 304 | 305 | char buffer[256]; 306 | sprintf_s(buffer, sizeof(buffer), "virtual-%s", serial.c_str()); 307 | auto virtual_id = get_virtual_device(inputEmulator, buffer); 308 | 309 | auto properties = it->properties(); 310 | for (auto it2 = properties.begin(); it2 != properties.end(); ++it2) { 311 | /* Skip serial */ 312 | if (it2->identifier() == 1002) continue; 313 | 314 | if (it2->type() == OVRDeviceProperty_Type::OVRDeviceProperty_Type_String) { 315 | inputEmulator.setVirtualDeviceProperty(virtual_id, (vr::ETrackedDeviceProperty)it2->identifier(), it2->string_value()); 316 | } 317 | else if (it2->type() == OVRDeviceProperty_Type::OVRDeviceProperty_Type_Bool) { 318 | inputEmulator.setVirtualDeviceProperty(virtual_id, (vr::ETrackedDeviceProperty)it2->identifier(), it2->bool_value()); 319 | } 320 | else if (it2->type() == OVRDeviceProperty_Type::OVRDeviceProperty_Type_Int32) { 321 | if (it2->identifier() == 1029) { 322 | inputEmulator.setVirtualDeviceProperty(virtual_id, (vr::ETrackedDeviceProperty)it2->identifier(), vr::TrackedDeviceClass_Controller); 323 | } 324 | else { 325 | inputEmulator.setVirtualDeviceProperty(virtual_id, (vr::ETrackedDeviceProperty)it2->identifier(), it2->int32_value()); 326 | } 327 | } 328 | else if (it2->type() == OVRDeviceProperty_Type::OVRDeviceProperty_Type_Uint64) { 329 | inputEmulator.setVirtualDeviceProperty(virtual_id, (vr::ETrackedDeviceProperty)it2->identifier(), it2->uint64_value()); 330 | } 331 | else if (it2->type() == OVRDeviceProperty_Type::OVRDeviceProperty_Type_Float) { 332 | inputEmulator.setVirtualDeviceProperty(virtual_id, (vr::ETrackedDeviceProperty)it2->identifier(), it2->float_value()); 333 | } 334 | else if (it2->type() == OVRDeviceProperty_Type::OVRDeviceProperty_Type_Matrix34) { 335 | vr::HmdMatrix34_t matrix34; 336 | for (int i = 0; i < 3; ++i) { 337 | for (int j = 0; j < 4; ++j) { 338 | matrix34.m[i][j] = it2->matrix34_value(i * 4 + j); 339 | } 340 | } 341 | inputEmulator.setVirtualDeviceProperty(virtual_id, (vr::ETrackedDeviceProperty)it2->identifier(), matrix34); 342 | } 343 | } 344 | inputEmulator.publishVirtualDevice(virtual_id); 345 | 346 | auto info = inputEmulator.getVirtualDeviceInfo(virtual_id); 347 | 348 | // Sometimes takes a few ticks for OVR to register the new device... we wait 349 | while (info.openvrDeviceId > vr::k_unMaxTrackedDeviceCount) { 350 | std::this_thread::sleep_for(std::chrono::milliseconds(1000)); 351 | info = inputEmulator.getVirtualDeviceInfo(virtual_id); 352 | } 353 | 354 | std::cout << "Forwarding: " << info.openvrDeviceId << " -> " << ovr_id << std::endl; 355 | inputEmulator.setDeviceNormalMode(info.openvrDeviceId); 356 | inputEmulator.setDeviceNormalMode(ovr_id); 357 | inputEmulator.setDeviceRedictMode(info.openvrDeviceId, ovr_id); 358 | device_to_virtual.insert(std::pair(it->id(), virtual_id)); 359 | } 360 | 361 | std::cout << "Press S to stop playback" << std::endl; 362 | 363 | /* Replay */ 364 | auto timelines = recording.timeline(); 365 | auto startTime = std::chrono::system_clock::now(); 366 | auto last = std::chrono::system_clock::now(); 367 | while (1) { 368 | if (GetAsyncKeyState('S') & 0x8000) break; 369 | auto now = std::chrono::system_clock::now(); 370 | auto deltaMillis = std::chrono::duration_cast (now - last).count(); 371 | auto t = std::chrono::duration_cast (now - startTime).count() * speed; 372 | //std::cout << "Delta millis: " << deltaMillis << std::endl; 373 | last = now; 374 | 375 | /*if (deltaMillis < 5) { 376 | std::this_thread::sleep_for(std::chrono::milliseconds(5 - (int)deltaMillis)); 377 | }*/ 378 | 379 | //std::cout << t << std::endl; 380 | for (auto it = timelines.begin(); it != timelines.end(); ++it) { 381 | auto it_virtual_id = device_to_virtual.find(it->device_id()); 382 | if (it_virtual_id == device_to_virtual.end()) continue; 383 | auto virtual_id = it_virtual_id->second; 384 | 385 | // pop sample 386 | 387 | int sample_idx = get_interval(t, *it); 388 | if (sample_idx == it->samples_size() - 2) { 389 | if (loop) { 390 | startTime = std::chrono::system_clock::now(); 391 | continue; 392 | } 393 | else { 394 | goto theEnd; 395 | } 396 | } 397 | //auto a = std::chrono::system_clock::now(); 398 | auto sample = it->samples(sample_idx); 399 | auto sample2 = it->samples(sample_idx+1); 400 | float alpha = (float)(t - sample.time()) / (float)(sample2.time() - sample.time()); 401 | //std::cout << sample.time() << " " << alpha << " " << sample2.time() << std::endl; 402 | //std::cout << sample.position(0) << sample.position(1) << sample.position(2) << std::endl; 403 | auto pose = inputEmulator.getVirtualDevicePose(virtual_id); 404 | pose.vecPosition[0] = lerp(sample.position(0), sample2.position(0), alpha); 405 | pose.vecPosition[1] = lerp(sample.position(1), sample2.position(1), alpha); 406 | pose.vecPosition[2] = lerp(sample.position(2), sample2.position(2), alpha); 407 | pose.qRotation.w = lerp(sample.rotation(0), sample2.rotation(0), alpha); 408 | pose.qRotation.x = lerp(sample.rotation(1), sample2.rotation(1), alpha); 409 | pose.qRotation.y = lerp(sample.rotation(2), sample2.rotation(2), alpha); 410 | pose.qRotation.z = lerp(sample.rotation(3), sample2.rotation(3), alpha); 411 | pose.poseIsValid = true; 412 | pose.deviceIsConnected = true; 413 | pose.result = vr::TrackingResult_Running_OK; 414 | inputEmulator.setVirtualDevicePose(virtual_id, pose, false); 415 | if (sample.axis_size() > 0) { 416 | //auto state = inputEmulator.getVirtualControllerState(virtual_id); 417 | vr::VRControllerState_t state; 418 | state.ulButtonPressed = sample.button_pressed(); 419 | state.ulButtonTouched = sample.button_touched(); 420 | state.rAxis[0].x = sample.axis(0); 421 | state.rAxis[0].y = sample.axis(1); 422 | state.rAxis[1].x = sample.axis(2); 423 | state.rAxis[1].y = sample.axis(3); 424 | state.rAxis[2].x = sample.axis(4); 425 | state.rAxis[2].y = sample.axis(5); 426 | state.rAxis[3].x = sample.axis(6); 427 | state.rAxis[3].y = sample.axis(7); 428 | state.rAxis[4].x = sample.axis(8); 429 | state.rAxis[4].y = sample.axis(9); 430 | inputEmulator.setVirtualControllerState(virtual_id, state, false); 431 | } 432 | //auto b = std::chrono::system_clock::now(); 433 | //std::cout << std::chrono::duration_cast (b - a).count() << std::endl; 434 | } 435 | } 436 | theEnd: 437 | 438 | for (auto it = device_to_virtual.begin(); it != device_to_virtual.end(); ++it) { 439 | inputEmulator.setDeviceNormalMode(it->first); 440 | auto info = inputEmulator.getVirtualDeviceInfo(it->second); 441 | inputEmulator.setDeviceFakeDisconnectedMode(info.openvrDeviceId); 442 | } 443 | 444 | inputEmulator.disconnect(); 445 | 446 | return; 447 | } 448 | 449 | int main (int argc, char *argv[]) 450 | { 451 | GOOGLE_PROTOBUF_VERIFY_VERSION; 452 | 453 | int retval = 0; 454 | 455 | if (argc <= 1) { 456 | std::cout << "Error: No Arguments given." << std::endl; 457 | exit(1); 458 | } 459 | 460 | try { 461 | if (std::strcmp(argv[1], "record") == 0) { 462 | record(argc, argv); 463 | } else if (std::strcmp(argv[1], "replay") == 0 || std::strcmp(argv[1], "loop") == 0) { 464 | replay(argc, argv); 465 | } 466 | else { 467 | throw std::runtime_error("Error: Unknown command."); 468 | } 469 | } 470 | catch (const std::exception& e) { 471 | std::cout << e.what() << std::endl; 472 | retval = 3; 473 | } 474 | 475 | return retval; 476 | } 477 | --------------------------------------------------------------------------------