@@ -27,6 +27,8 @@ import {
2727 LineInput ,
2828 ConfirmBtn ,
2929 RadioBtn ,
30+ Select ,
31+ GainFocus ,
3032} from "../../../../base/widgets.slint" ;
3133
3234component TaskItem inherits Rectangle {
@@ -196,26 +198,10 @@ component ExportDetailVideo inherits SettingDetail {
196198 text : Logic.tr("Resolution" );
197199 }
198200
199- HorizontalLayout {
200- spacing : Theme.spacing * 2 ;
201-
202- width-lineedit := LineInput {
203- horizontal-stretch : 1 ;
204- input-type : number;
205- placeholder-text : Logic.tr("width" );
206- text : cache-config.width;
207- }
208-
209- Label {
210- text : "X" ;
211- }
212-
213- height-lineedit := LineInput {
214- horizontal-stretch : 1 ;
215- input-type : number;
216- placeholder-text : Logic.tr("height" );
217- text : cache-config.height;
218- }
201+ resolution-select := Select {
202+ border-width : 0 ;
203+ values : ["Original" , "480P" , "720P" , "1080P" , "2K" , "4K" ];
204+ current-value : Logic.resolution-to-string(cache-config.resolution);
219205 }
220206 }
221207
@@ -224,10 +210,10 @@ component ExportDetailVideo inherits SettingDetail {
224210 text : Logic.tr("FPS" );
225211 }
226212
227- fps-lineedit := LineInput {
228- input-type : number ;
229- placeholder-text : 25 ;
230- text : cache-config.fps;
213+ fps-select := Select {
214+ border-width : 0 ;
215+ values : [ 24 , 25 , 30 , 60 ] ;
216+ current-value : Logic.fps-to-int( cache-config.fps) ;
231217 }
232218 }
233219
@@ -236,10 +222,10 @@ component ExportDetailVideo inherits SettingDetail {
236222 text : Logic.tr("Audio channels" );
237223 }
238224
239- channels-lineedit := LineInput {
240- input-type : number ;
241- placeholder-text : 2 ;
242- text : cache-config.channels;
225+ channels-select := Select {
226+ border-width : 0 ;
227+ values : [ 1 , 2 ] ;
228+ current-value : Logic.audio-channels-to-int( cache-config.channels) ;
243229 }
244230 }
245231
@@ -248,10 +234,10 @@ component ExportDetailVideo inherits SettingDetail {
248234 text : Logic.tr("Audio sample rate" );
249235 }
250236
251- sample-rate-lineedit := LineInput {
252- input-type : number ;
253- placeholder-text : 44100 ;
254- text : cache-config.sample-rate;
237+ audio- sample-select := Select {
238+ border-width : 0 ;
239+ values : [ 8000 , 16000 , 24000 , 32000 , 44100 , 48000 , 96000 , 192000 ] ;
240+ current-value : Logic.audio-sample-rate-to-int( cache-config.sample-rate) ;
255241 }
256242 }
257243
@@ -266,11 +252,10 @@ component ExportDetailVideo inherits SettingDetail {
266252 text : Logic.tr("Export" );
267253
268254 clicked => {
269- cache-config.width = width-lineedit.text.to-float ();
270- cache-config.height = height-lineedit.text.to-float ();
271- cache-config.fps = fps-lineedit.text.to-float ();
272- cache-config.channels = channels-lineedit.text.to-float ();
273- cache-config.sample-rate = sample-rate-lineedit.text.to-float ();
255+ cache-config.resolution = Logic.resolution-from-string (resolution-select.current-value);
256+ cache-config.fps = Logic.fps-from-int (fps-select.current-value.to-float());
257+ cache-config.channels = Logic.audio-channels-from-int (channels-select.current-value.to-float());
258+ cache-config.sample-rate = Logic.audio-sample-rate-from-int ( audio-sample-select.current-value.to-float());
274259 Logic.video-editor-export-video (cache-config);
275260 }
276261 }
@@ -286,13 +271,13 @@ component ExportDetailAudio inherits SettingDetail {
286271 SettingDetailInner {
287272 SettingDetailInnerVbox {
288273 SettingDetailLabel {
289- text : Logic.tr("Channels " );
274+ text : Logic.tr("channels " );
290275 }
291276
292- channels-lineedit := LineInput {
293- input-type : number ;
294- placeholder-text : 2 ;
295- text : cache-config.channels;
277+ channels-select := Select {
278+ border-width : 0 ;
279+ values : [ 1 , 2 ] ;
280+ current-value : Logic.audio-channels-to-int( cache-config.channels) ;
296281 }
297282 }
298283
@@ -301,10 +286,10 @@ component ExportDetailAudio inherits SettingDetail {
301286 text : Logic.tr("Sample rate" );
302287 }
303288
304- sample-rate-lineedit := LineInput {
305- input-type : number ;
306- placeholder-text : 44100 ;
307- text : cache-config.sample-rate;
289+ audio- sample-select := Select {
290+ border-width : 0 ;
291+ values : [ 8000 , 16000 , 24000 , 32000 , 44100 , 48000 , 96000 , 192000 ] ;
292+ current-value : Logic.audio-sample-rate-to-int( cache-config.sample-rate) ;
308293 }
309294 }
310295
@@ -319,8 +304,8 @@ component ExportDetailAudio inherits SettingDetail {
319304 text : Logic.tr("Export" );
320305
321306 clicked => {
322- cache-config.channels = channels-lineedit.text .to-float ();
323- cache-config.sample-rate = sample-rate-lineedit.text .to-float ();
307+ cache-config.channels = Logic.audio- channels-from-int (channels-select.current-value .to-float() );
308+ cache-config.sample-rate = Logic.audio- sample-rate-from-int ( audio-sample-select.current-value .to-float() );
324309 Logic.video-editor-export-audio (cache-config);
325310 }
326311 }
0 commit comments