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_assist.h>
24 #define SAMPLE_COUNT 59
26 namespace is { /** name space input selector */
27 namespace ui { /** name space ui */
30 * Interface for external controller
36 virtual ~IMicEffector() = 0;
37 virtual std::vector<int> GetVolume() = 0;
38 virtual void ProcessingAnimationStart() = 0;
39 virtual void ProcessingAnimationStop() = 0;
41 inline IMicEffector::~IMicEffector() { };
44 * Effect & Effect Controller
50 MicEffector(Evas_Object *canvas, Evas_Object *layout, IMicEffector& effect);
56 * It support signaling to edje and start animation.
62 * Equalizer Effect animation.
64 * @param volumes sampled volume values.
65 * @param fake default false. if it set as true, it works using fixed volume values.
68 void Effect(bool fake = false);
73 * It support signaling to edje and stop animation.
75 * @param forced default false. if it set as true, it should go idle state without processing.
78 void Stop(bool forced = false);
81 * Get volumes via ieffect and refresh equalizer effect.
83 * @param fake default false. if it set as true, it works using fixed volume values.
86 void VolumeCheck(bool fake = false);
89 * Draw image to show que animation.
91 * @param idx frame index value
94 void DrawQue(int idx, bool is_start=true);
97 * Draw image to show que animation.
99 * @param idx frame index value
100 * @param amount current volume amount
101 * @param prev_amount previous volume amount
102 * @param opacity opacity value for effect
106 void DrawWave(unsigned int idx, int amount, int prev_amount, double opacity = 1.0f, bool is_lastcmd=false);
109 * Get ratio for tuned volume value.
111 * @param idx volume stick index
112 * @return ratio for each volume stick
115 float GetAmplifyValue(unsigned int idx);
119 * Support idle state actions.
125 * Support listening state actions.
131 * Support processing state actions.
137 * Draw dummy frame to avoid broken frame showing.
138 * It have to be call one time internally.
141 void DrawDummyFrame();
144 * Efl vector canvas handle
147 // ea_vector_canvas_h *canvas;
148 // ea_vector_path_h *path;
149 // ea_vector_paint_h *paint;
155 std::vector<int> prev;
156 std::vector<int> current;
181 IMicEffector& ieffect;
185 }} /** end of is::ui */