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 <dali/devel-api/adaptor-framework/tilt-sensor.h>
22 #include <dali/internal/sensor/common/tilt-sensor-factory.h>
23 #include <dali/internal/sensor/common/tilt-sensor-impl.h>
24 #include <dali/internal/adaptor/common/adaptor-impl.h>
29 const float TiltSensor::DEFAULT_UPDATE_FREQUENCY = 60.0f;
31 TiltSensor::TiltSensor()
35 TiltSensor TiltSensor::Get()
37 return Internal::Adaptor::TiltSensorFactory::Get();
40 TiltSensor::~TiltSensor()
44 bool TiltSensor::Start()
46 return GetImplementation(*this).Start();
49 void TiltSensor::Stop()
51 GetImplementation(*this).Stop();
54 bool TiltSensor::IsStarted() const
56 return GetImplementation(*this).IsStarted();
59 float TiltSensor::GetRoll() const
61 return GetImplementation(*this).GetRoll();
64 float TiltSensor::GetPitch() const
66 return GetImplementation(*this).GetPitch();
69 Quaternion TiltSensor::GetRotation() const
71 return GetImplementation(*this).GetRotation();
74 TiltSensor::TiltedSignalType& TiltSensor::TiltedSignal()
76 return GetImplementation(*this).TiltedSignal();
79 void TiltSensor::SetUpdateFrequency( float frequencyHertz )
81 GetImplementation(*this).SetUpdateFrequency( frequencyHertz );
84 float TiltSensor::GetUpdateFrequency() const
86 return GetImplementation(*this).GetUpdateFrequency();
89 void TiltSensor::SetRotationThreshold(Radian rotationThreshold)
91 GetImplementation(*this).SetRotationThreshold( rotationThreshold );
94 Radian TiltSensor::GetRotationThreshold() const
96 return GetImplementation(*this).GetRotationThreshold();
99 TiltSensor::TiltSensor( Internal::Adaptor::TiltSensor* sensor )
100 : BaseHandle( sensor )