2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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.
20 #include <efl_extension.h>
23 #define SAMPLE_COUNT 59
25 namespace is { /** name space input selector */
26 namespace ui { /** name space ui */
29 * Interface for external controller
35 virtual ~IMicEffector() = 0;
36 virtual std::vector<int> GetVolume() = 0;
37 virtual void ProcessingAnimationStart() = 0;
38 virtual void ProcessingAnimationStop() = 0;
40 inline IMicEffector::~IMicEffector() { };
43 * Effect & Effect Controller
49 MicEffector(Evas_Object *canvas, Evas_Object *layout, IMicEffector& effect);
55 * It support signaling to edje and start animation.
61 * Equalizer Effect animation.
63 * @param volumes sampled volume values.
64 * @param fake default false. if it set as true, it works using fixed volume values.
67 void Effect(bool fake = false);
72 * It support signaling to edje and stop animation.
74 * @param forced default false. if it set as true, it should go idle state without processing.
77 void Stop(bool forced = false);
80 * Get volumes via ieffect and refresh equalizer effect.
82 * @param fake default false. if it set as true, it works using fixed volume values.
85 void VolumeCheck(bool fake = false);
88 * Draw image to show que animation.
90 * @param idx frame index value
93 void DrawQue(int idx, bool is_start = true);
96 * Draw image to show que animation.
98 * @param idx frame index value
99 * @param amount current volume amount
100 * @param prev_amount previous volume amount
101 * @param opacity opacity value for effect
105 void DrawWave(unsigned int idx, int amount, int prev_amount, double opacity = 1.0f, bool is_lastcmd = false);
108 * Get ratio for tuned volume value.
110 * @param idx volume stick index
111 * @return ratio for each volume stick
114 float GetAmplifyValue(unsigned int idx);
118 * Support idle state actions.
124 * Support listening state actions.
130 * Support processing state actions.
136 * Draw dummy frame to avoid broken frame showing.
137 * It have to be call one time internally.
140 void DrawDummyFrame();
146 std::vector<int> prev;
147 std::vector<int> current;
175 IMicEffector& ieffect;
178 }} /** end of is::ui */