2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "tilt-sensor.h"
22 #include <tilt-sensor-impl.h>
23 #include <adaptor-impl.h>
28 const float TiltSensor::DEFAULT_UPDATE_FREQUENCY = 60.0f;
30 TiltSensor::TiltSensor()
34 TiltSensor TiltSensor::Get()
36 return Internal::Adaptor::TiltSensor::Get();
39 TiltSensor::~TiltSensor()
43 bool TiltSensor::Enable()
45 return GetImplementation(*this).Enable();
48 void TiltSensor::Disable()
50 GetImplementation(*this).Disable();
53 bool TiltSensor::IsEnabled() const
55 return GetImplementation(*this).IsEnabled();
58 float TiltSensor::GetRoll() const
60 return GetImplementation(*this).GetRoll();
63 float TiltSensor::GetPitch() const
65 return GetImplementation(*this).GetPitch();
68 Quaternion TiltSensor::GetRotation() const
70 return GetImplementation(*this).GetRotation();
73 TiltSensor::TiltedSignalType& TiltSensor::TiltedSignal()
75 return GetImplementation(*this).TiltedSignal();
78 void TiltSensor::SetUpdateFrequency( float frequencyHertz )
80 GetImplementation(*this).SetUpdateFrequency( frequencyHertz );
83 float TiltSensor::GetUpdateFrequency() const
85 return GetImplementation(*this).GetUpdateFrequency();
88 void TiltSensor::SetRotationThreshold(Radian rotationThreshold)
90 GetImplementation(*this).SetRotationThreshold( rotationThreshold );
93 Radian TiltSensor::GetRotationThreshold() const
95 return GetImplementation(*this).GetRotationThreshold();
98 TiltSensor::TiltSensor( Internal::Adaptor::TiltSensor* sensor )
99 : BaseHandle( sensor )