2 * Copyright (c) 2014 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 "environment-options.h"
32 const unsigned int DEFAULT_STATISTICS_LOG_FREQUENCY = 2;
34 EnvironmentOptions::EnvironmentOptions()
37 mUpdateStatusFrequency(0),
38 mPerformanceStatsLevel(0),
39 mPerformanceStatsFrequency( DEFAULT_STATISTICS_LOG_FREQUENCY),
40 mPerformanceTimeStampOutput(0),
41 mPanGestureLoggingLevel(0),
42 mPanGesturePredictionMode(-1),
43 mPanGesturePredictionAmount(-1), ///< only sets value in pan gesture if greater than 0
44 mPanGestureMaxPredictionAmount(-1),
45 mPanGestureMinPredictionAmount(-1),
46 mPanGesturePredictionAmountAdjustment(-1),
47 mPanGestureSmoothingMode(-1),
48 mPanGestureSmoothingAmount(-1.0f),
49 mPanMinimumDistance(-1),
50 mPanMinimumEvents(-1),
58 EnvironmentOptions::~EnvironmentOptions()
62 void EnvironmentOptions::SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
63 unsigned int networkControl,
64 unsigned int logFrameRateFrequency,
65 unsigned int logupdateStatusFrequency,
66 unsigned int logPerformanceStats,
67 unsigned int logPerformanceStatsFrequency,
68 unsigned int performanceTimeStampOutput,
69 unsigned int logPanGestureLevel )
71 mLogFunction = logFunction;
72 mNetworkControl = networkControl;
73 mFpsFrequency = logFrameRateFrequency;
74 mUpdateStatusFrequency = logupdateStatusFrequency;
75 mPerformanceStatsLevel = logPerformanceStats;
76 mPerformanceStatsFrequency = logPerformanceStatsFrequency;
77 mPerformanceTimeStampOutput= performanceTimeStampOutput;
78 mPanGestureLoggingLevel = logPanGestureLevel;
81 void EnvironmentOptions::InstallLogFunction() const
83 Dali::Integration::Log::InstallLogFunction( mLogFunction );
86 void EnvironmentOptions::UnInstallLogFunction() const
88 Dali::Integration::Log::UninstallLogFunction();
91 unsigned int EnvironmentOptions::GetNetworkControlMode() const
93 return mNetworkControl;
95 unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
100 unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
102 return mUpdateStatusFrequency;
105 unsigned int EnvironmentOptions::GetPerformanceStatsLoggingOptions() const
107 return mPerformanceStatsLevel;
109 unsigned int EnvironmentOptions::GetPerformanceStatsLoggingFrequency() const
111 return mPerformanceStatsFrequency;
113 unsigned int EnvironmentOptions::GetPerformanceTimeStampOutput() const
115 return mPerformanceTimeStampOutput;
118 unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
120 return mPanGestureLoggingLevel;
123 int EnvironmentOptions::GetPanGesturePredictionMode() const
125 return mPanGesturePredictionMode;
128 int EnvironmentOptions::GetPanGesturePredictionAmount() const
130 return mPanGesturePredictionAmount;
133 int EnvironmentOptions::GetPanGestureMaximumPredictionAmount() const
135 return mPanGestureMaxPredictionAmount;
138 int EnvironmentOptions::GetPanGestureMinimumPredictionAmount() const
140 return mPanGestureMinPredictionAmount;
143 int EnvironmentOptions::GetPanGesturePredictionAmountAdjustment() const
145 return mPanGesturePredictionAmountAdjustment;
148 int EnvironmentOptions::GetPanGestureSmoothingMode() const
150 return mPanGestureSmoothingMode;
153 float EnvironmentOptions::GetPanGestureSmoothingAmount() const
155 return mPanGestureSmoothingAmount;
158 int EnvironmentOptions::GetMinimumPanDistance() const
160 return mPanMinimumDistance;
163 int EnvironmentOptions::GetMinimumPanEvents() const
165 return mPanMinimumEvents;
168 unsigned int EnvironmentOptions::GetWindowWidth() const
173 unsigned int EnvironmentOptions::GetWindowHeight() const
175 return mWindowHeight;
178 void EnvironmentOptions::SetPanGesturePredictionMode( unsigned int mode )
180 mPanGesturePredictionMode = mode;
183 void EnvironmentOptions::SetPanGesturePredictionAmount( unsigned int amount )
185 mPanGesturePredictionAmount = amount;
188 void EnvironmentOptions::SetPanGestureMaximumPredictionAmount( unsigned int amount )
190 mPanGestureMaxPredictionAmount = amount;
193 void EnvironmentOptions::SetPanGestureMinimumPredictionAmount( unsigned int amount )
195 mPanGestureMinPredictionAmount = amount;
198 void EnvironmentOptions::SetPanGesturePredictionAmountAdjustment( unsigned int amount )
200 mPanGesturePredictionAmountAdjustment = amount;
203 void EnvironmentOptions::SetPanGestureSmoothingMode( unsigned int mode )
205 mPanGestureSmoothingMode = mode;
208 void EnvironmentOptions::SetPanGestureSmoothingAmount( float amount )
210 mPanGestureSmoothingAmount = amount;
213 void EnvironmentOptions::SetMinimumPanDistance( int distance )
215 mPanMinimumDistance = distance;
218 void EnvironmentOptions::SetMinimumPanEvents( int events )
220 mPanMinimumEvents = events;
223 void EnvironmentOptions::SetGlesCallTime( int time )
225 mGlesCallTime = time;
228 int EnvironmentOptions::GetGlesCallTime() const
230 return mGlesCallTime;
233 void EnvironmentOptions::SetWindowWidth( int width )
235 mWindowWidth = width;
238 void EnvironmentOptions::SetWindowHeight( int height )
240 mWindowHeight = height;
243 bool EnvironmentOptions::PerformanceServerRequired() const
245 return ( (GetPerformanceStatsLoggingOptions() > 0) ||
246 ( GetPerformanceTimeStampOutput() > 0 ) ||
247 ( GetNetworkControlMode() > 0) );