2 * Copyright (c) 2020 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 <dali/devel-api/adaptor-framework/tilt-sensor.h>
22 #include <dali/internal/adaptor/common/adaptor-impl.h>
23 #include <dali/internal/sensor/common/tilt-sensor-factory.h>
24 #include <dali/internal/sensor/common/tilt-sensor-impl.h>
28 const float TiltSensor::DEFAULT_UPDATE_FREQUENCY = 60.0f;
30 TiltSensor::TiltSensor()
34 TiltSensor TiltSensor::Get()
36 return Internal::Adaptor::TiltSensorFactory::Get();
39 TiltSensor::~TiltSensor()
43 bool TiltSensor::Start()
45 return GetImplementation(*this).Start();
48 void TiltSensor::Stop()
50 GetImplementation(*this).Stop();
53 bool TiltSensor::IsStarted() const
55 return GetImplementation(*this).IsStarted();
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)