@@ -53,6 +53,19 @@ class LottieViewTest
53
53
ecore_animator_frametime_set (1 .0f /120 .0f );
54
54
}
55
55
56
+ void show (const char * filepath) {
57
+ std::unique_ptr<LottieView> view (new LottieView (mApp ->evas (), mStrategy ));
58
+ view->setFilePath (filepath);
59
+ view->setPos (3 , 3 );
60
+ int vw = mApp ->width () - 6 ;
61
+ view->setSize (vw, vw);
62
+ view->show ();
63
+ view->play ();
64
+ view->loop (true );
65
+ mViews .push_back (std::move (view));
66
+ }
67
+
68
+
56
69
void show (int numberOfImage) {
57
70
auto resource = EvasApp::jsonFiles (std::string (DEMO_DIR));
58
71
@@ -92,9 +105,10 @@ class LottieViewTest
92
105
}
93
106
94
107
static int help () {
95
- printf (" Usage ./lottieviewTest [-s] [strategy] [-t] [timeout] [-c] [count]\n " );
108
+ printf (" Usage ./lottieviewTest [-s] [strategy] [-t] [timeout] [-c] [count] [-f] path \n " );
96
109
printf (" \n \t -t : timeout duration in seconds\n " );
97
110
printf (" \n \t -c : number of resource in the grid\n " );
111
+ printf (" \n \t -f : File to play\n " );
98
112
printf (" \n \t -s : Rendering Strategy\n " );
99
113
printf (" \t\t 0 - Test Lottie SYNC Renderer with CPP API\n " );
100
114
printf (" \t\t 1 - Test Lottie ASYNC Renderer with CPP API\n " );
@@ -134,6 +148,7 @@ main(int argc, char **argv)
134
148
auto index = 0 ;
135
149
double timeOut = 0 ;
136
150
size_t itemCount = 250 ;
151
+ std::string filePath;
137
152
while (index < argc) {
138
153
const char * option = argv[index ];
139
154
index ++;
@@ -148,14 +163,18 @@ main(int argc, char **argv)
148
163
} else if (!strcmp (option," -c" )) {
149
164
itemCount = (index < argc) ? atoi (argv[index ]) : 10 ;
150
165
index ++;
166
+ } else if (!strcmp (option," -f" )) {
167
+ filePath = argv[index ];
168
+ index ++;
151
169
}
152
170
}
153
171
154
172
EvasApp *app = new EvasApp (800 , 800 );
155
173
app->setup ();
156
174
157
175
LottieViewTest *view = new LottieViewTest (app, st, timeOut);
158
- view->show (itemCount);
176
+ if (filePath.length ()) view->show (filePath.c_str ());
177
+ else view->show (itemCount);
159
178
160
179
app->addExitCb (onExitCb, view);
161
180
0 commit comments