LiVES 3.2.0
interface.h
Go to the documentation of this file.
1// interface.h
2// LiVES
3// (c) G. Finch 2003 - 2020 <salsaman+lives@gmail.com>
4// Released under the GNU GPL 3 or later
5// see file ../COPYING for licensing details
6
7#ifndef HAS_LIVES_INTERFACE_H
8#define HAS_LIVES_INTERFACE_H
9
10// CE timeline bars
11#define OVERDRAW_MARGIN 16
12
14#define CE_HRULE_HEIGHT ((int)(20. * widget_opts.scale))
15
17#define CE_VIDBAR_HEIGHT ((int)(4. * widget_opts.scale))
18
20#define CE_AUDBAR_HEIGHT ((int)(48. * widget_opts.scale))
21
22#define MSG_AREA_VMARGIN 0
23#define LAYOUT_SIZE_MIN 0
24
25#define SCRN_BRDR 2.
26
27boolean update_dsu(void *lab);
28
29void draw_little_bars(double ptrtime, int which);
30double lives_ce_update_timeline(frames_t frame, double x);
31void update_timer_bars(int posx, int posy, int width, int height, int which);
32void redraw_timer_bars(double oldx, double newx, int which);
33void show_playbar_labels(int clipno);
34void redraw_timeline(int clipno);
35
36void msg_area_scroll(LiVESAdjustment *, livespointer userdata);
37void msg_area_scroll_to_end(LiVESWidget *, LiVESAdjustment *);
38boolean on_msg_area_scroll(LiVESWidget *, LiVESXEventScroll *, livespointer user_data);
39boolean expose_msg_area(LiVESWidget *, lives_painter_t *, livespointer user_data);
40boolean msg_area_config(LiVESWidget *);
41boolean reshow_msg_area(LiVESWidget *, lives_painter_t *, livespointer user_data);
42
43boolean expose_vid_draw(LiVESWidget *, lives_painter_t *, livespointer psurf);
44boolean expose_laud_draw(LiVESWidget *, lives_painter_t *, livespointer psurf);
45boolean expose_raud_draw(LiVESWidget *, lives_painter_t *, livespointer psurf);
46
47boolean config_vid_draw(LiVESWidget *, LiVESXEventConfigure *, livespointer user_data);
48boolean config_laud_draw(LiVESWidget *, LiVESXEventConfigure *, livespointer user_data);
49boolean config_raud_draw(LiVESWidget *, LiVESXEventConfigure *, livespointer user_data);
50
51void clear_tbar_bgs(int posx, int posy, int width, int height, int which);
52
53boolean redraw_tl_idle(void *data);
54
55LiVESWidget *create_opensel_dialog(int frames, double fps);
56
57LiVESWidget *create_encoder_prep_dialog(const char *text1, const char *text2, boolean opt_resize);
58
59void widget_add_preview(LiVESWidget *, LiVESBox *for_preview, LiVESBox *for_button,
60 LiVESBox *for_deinterlace, int preview_type);
61
63void create_new_pb_speed(short type);
64
65boolean do_audio_choice_dialog(short startup_phase);
66
67void do_keys_window(void);
68
69void do_mt_keys_window(void);
70
71LiVESWidget *create_cleardisk_advanced_dialog(void);
72
73LiVESWidget *make_autoreload_check(LiVESHBox *parent, boolean is_active);
74
75LiVESWidget *add_list_expander(LiVESBox *, const char *title, int width, int height, LiVESList *xlist);
76
77typedef struct {
78 LiVESWidget *dialog;
79 LiVESWidget *textview_type;
80 LiVESWidget *textview_fps;
81 LiVESWidget *textview_size;
82 LiVESWidget *textview_frames;
83 LiVESWidget *textview_vtime;
84 LiVESWidget *textview_fsize;
85 LiVESWidget *textview_ltime;
86 LiVESWidget *textview_rtime;
87 LiVESWidget *textview_lrate;
88 LiVESWidget *textview_rrate;
90
91lives_clipinfo_t *create_clip_info_window(int audio_channels, boolean is_mt);
92
93typedef struct {
94 LiVESWidget *dialog;
95 LiVESWidget *entry;
96 LiVESWidget *dir_entry;
97 LiVESWidget *name_entry;
98 LiVESWidget *warn_checkbutton;
99 LiVESWidget *okbutton;
100 LiVESWidget *cancelbutton;
101 LiVESWidget *expander;
102 LiVESWidget *exp_label;
103 LiVESWidget *exp_vbox;
104 LiVESWidget *layouts_layout;
105 LiVESWidget *clips_layout;
106 LiVESWidget *parent;
107} _entryw;
108
111_entryw *create_cds_dialog(int type);
112
113typedef struct __insertw {
114 LiVESWidget *insert_dialog;
115 LiVESWidget *with_sound;
116 LiVESWidget *without_sound;
117 LiVESWidget *spinbutton_times;
118 LiVESWidget *fit_checkbutton;
119} _insertw;
120
122
123typedef struct __commentsw {
124 LiVESWidget *comments_dialog;
125 LiVESWidget *title_entry;
126 LiVESWidget *author_entry;
127 LiVESWidget *comment_entry;
128 LiVESWidget *subt_checkbutton;
129 LiVESWidget *subt_entry;
130} _commentsw;
131
133
134typedef struct {
135 LiVESWidget *dialog;
136 LiVESWidget *clear_button;
137 LiVESWidget *delete_button;
138 LiVESWidget *textview;
139 LiVESWidget *table;
140 LiVESWidget *button;
141 LiVESWidget *vbox;
142 LiVESWidget *scrolledwindow;
144
145
146text_window *create_text_window(const char *title_part, const char *text, LiVESTextBuffer *,
147 boolean add_buttons);
148
149LiVESWidget *scrolled_textview(const char *text, LiVESTextBuffer *, int window_width,
150 LiVESWidget **ptextview);
151typedef struct {
152 LiVESWidget *dialog;
153 LiVESWidget *time_spin;
154 boolean is_sel;
156
157typedef struct {
159 LiVESWidget *advbutton;
160 LiVESWidget *adv_vbox;
161 LiVESWidget *combod;
162 LiVESWidget *comboo;
163 LiVESWidget *spinbuttoni;
164 LiVESWidget *spinbuttonw;
165 LiVESWidget *spinbuttonh;
166 LiVESWidget *spinbuttonf;
167 LiVESWidget *radiobuttond;
169
170#define LIVES_PREVIEW_TYPE_VIDEO_AUDIO 1
171#define LIVES_PREVIEW_TYPE_VIDEO_ONLY 2
172#define LIVES_PREVIEW_TYPE_AUDIO_ONLY 3
173#define LIVES_PREVIEW_TYPE_RANGE 4
174#define LIVES_PREVIEW_TYPE_IMAGE_ONLY 5
175
176#define LIVES_FILE_SELECTION_UNDEFINED 0
177#define LIVES_FILE_SELECTION_VIDEO_AUDIO 1
178#define LIVES_FILE_SELECTION_AUDIO_ONLY 2
179#define LIVES_FILE_SELECTION_VIDEO_AUDIO_MULTI 3
180#define LIVES_FILE_SELECTION_VIDEO_RANGE 4
181#define LIVES_FILE_SELECTION_IMAGE_ONLY 5
182#define LIVES_FILE_SELECTION_SAVE 6
183#define LIVES_FILE_SELECTION_OPEN 7
184
185#define LIVES_DIR_SELECTION_CREATE_FOLDER 1024
186#define LIVES_DIR_SELECTION_SELECT_FOLDER 1025
187#define LIVES_DIR_SELECTION_WORKDIR 1026
188#define LIVES_DIR_SELECTION_DEVICES 1027
189
191LiVESWidget *create_combo_dialog(int type, LiVESList *list);
192
193xprocess *create_processing(const char *text);
194xprocess *create_threaded_dialog(char *text, boolean has_cancel, boolean *td_had_focus);
195void add_to_clipmenu(void);
196void remove_from_clipmenu(void);
197
198boolean get_play_screen_size(int *opwidth, int *opheight);
199void make_play_window(void);
200void resize_play_window(void);
201void kill_play_window(void);
202void make_preview_box(void);
203void play_window_set_title(void);
204void add_to_playframe(void);
205LiVESWidget *create_cdtrack_dialog(int type, livespointer user_data);
206
207typedef struct {
208 LiVESWidget *dialog;
209 LiVESWidget *atrigger_button;
210 LiVESWidget *atrigger_spin;
211 LiVESWidget *apb_button;
212 LiVESWidget *mute_button;
213 LiVESWidget *debug_button;
215
217
218LiVESTextView *create_output_textview(void);
219
220void on_filesel_button_clicked(LiVESButton *, livespointer);
221
222char *choose_file(const char *dir, const char *fname, char **const filt, LiVESFileChooserAction act, const char *title,
223 LiVESWidget *extra);
224char *choose_file_bg(const char *dir, const char *fname, char **const filt, LiVESFileChooserAction act, const char *title,
225 LiVESWidget *extra);
226LiVESWidget *choose_file_with_preview(const char *dir, const char *title, char **const filt, int preview_type);
227
228void add_suffix_check(LiVESBox *, const char *ext);
229
230const lives_special_aspect_t *add_aspect_ratio_button(LiVESSpinButton *sp_width, LiVESSpinButton *sp_height,
231 LiVESBox *container);
232
233#define DEF_AUD_FADE_SECS 10.
234
235#define MIN_MSGBOX_WIDTH ((int)(620. * widget_opts.scale))
236
237// textboxes for clip info
238#define TB_WIDTH ((int)(300. * widget_opts.scale))
239#define TB_HEIGHT_VID ((int)(80. * widget_opts.scale))
240#define TB_HEIGHT_AUD ((int)(50. * widget_opts.scale))
241
242typedef enum {
252
253typedef struct {
254 char URI[8192];
255 char save_dir[PATH_MAX];
256 char fname[PATH_MAX];
257 char format[256];
258 char ext[16];
261 float desired_fps; // unused for now
263 boolean do_update;
264 boolean allownf;
265 boolean debug;
266 char vidchoice[512];
267 char audchoice[512];
268 // TODO: add audio bitrate ?, audio_lang, get_sub, sub_format, sub_language, etc.
270
273
274typedef struct {
275 boolean scanning;
276 LiVESWidget *top_label;
277 LiVESWidget *dsu_label;
278 LiVESWidget *used_label;
279 LiVESWidget *inst_label;
280 LiVESWidget *note_label;
281 LiVESWidget *checkbutton;
282 LiVESWidget *vlabel;
283 LiVESWidget *vvlabel;
284 LiVESWidget *pculabel;
285 LiVESWidget *slider;
286 LiVESWidget *button;
287 LiVESWidget *abort_button;
288 LiVESWidget *resbutton;
289 LiVESWidget *expander;
290 LiVESWidget *exp_vbox;
291 LiVESWidget *exp_layout;
292 boolean setting, visible;
293 uint64_t sliderfunc, checkfunc;
294 lives_painter_surface_t *dsu_surface;
295 boolean crit_dism;
296 char *ext;
297} _dsquotaw;
298
299void run_diskspace_dialog(void);
300void run_diskspace_dialog_cb(LiVESWidget *, livespointer data);
301boolean run_diskspace_dialog_idle(livespointer data);
302
303LiVESResponseType filter_cleanup(const char *trashdir, LiVESList **rec_list, LiVESList **rem_list,
304 LiVESList **left_list);
305
306LiVESWidget *trash_rb(LiVESButtonBox *parent);
307
308void draw_dsu_widget(LiVESWidget *dsu_widget);
309
315
316#endif
LiVESWidget * create_cdtrack_dialog(int type, livespointer user_data)
Definition: interface.c:3138
void draw_dsu_widget(LiVESWidget *dsu_widget)
Definition: interface.c:5910
autolives_window * autolives_pre_dialog(void)
Definition: interface.c:4846
LiVESWidget * create_cleardisk_advanced_dialog(void)
Definition: interface.c:4481
boolean msg_area_config(LiVESWidget *)
Definition: interface.c:6938
boolean redraw_tl_idle(void *data)
Definition: interface.c:3457
lives_clipinfo_t * create_clip_info_window(int audio_channels, boolean is_mt)
Definition: interface.c:1048
boolean expose_raud_draw(LiVESWidget *, lives_painter_t *, livespointer psurf)
Definition: callbacks.c:10010
void run_diskspace_dialog_cb(LiVESWidget *, livespointer data)
Definition: interface.c:5748
LiVESWidget * choose_file_with_preview(const char *dir, const char *title, char **const filt, int preview_type)
Definition: interface.c:4228
void draw_little_bars(double ptrtime, int which)
boolean youtube_select_format(lives_remote_clip_request_t *)
Definition: interface.c:5495
void do_keys_window(void)
Definition: interface.c:4733
aud_dialog_t * create_audfade_dialog(int type)
Definition: interface.c:3660
boolean update_dsu(void *lab)
LiVESWidget * create_combo_dialog(int type, LiVESList *list)
Definition: interface.c:3088
LiVESWidget * trash_rb(LiVESButtonBox *parent)
Definition: interface.c:1622
double lives_ce_update_timeline(frames_t frame, double x)
pointer position in timeline
Definition: interface.c:207
boolean get_play_screen_size(int *opwidth, int *opheight)
Definition: gui.c:3937
void on_filesel_button_clicked(LiVESButton *, livespointer)
callback for lives_standard filesel button same callback is used for dierctory buttons object_data in...
Definition: interface.c:3930
void create_new_pb_speed(short type)
window change speed from Tools menu
Definition: interface.c:3464
_insertw * insertw
Definition: interface.h:313
void add_to_playframe(void)
Definition: gui.c:4451
void make_preview_box(void)
Definition: gui.c:3515
boolean reshow_msg_area(LiVESWidget *, lives_painter_t *, livespointer user_data)
Definition: interface.c:7242
_entryw * create_rename_dialog(int type)
Definition: interface.c:2792
void msg_area_scroll_to_end(LiVESWidget *, LiVESAdjustment *)
Definition: interface.c:7277
lives_size_match_t
Definition: interface.h:242
@ LIVES_MATCH_AT_MOST
Definition: interface.h:246
@ LIVES_MATCH_CHOICE
Definition: interface.h:249
@ LIVES_MATCH_LOWEST
Definition: interface.h:248
@ LIVES_MATCH_AT_LEAST
Definition: interface.h:245
@ LIVES_MATCH_NEAREST
Definition: interface.h:244
@ LIVES_MATCH_SPECIFIED
Definition: interface.h:250
@ LIVES_MATCH_UNDEFINED
Definition: interface.h:243
@ LIVES_MATCH_HIGHEST
Definition: interface.h:247
void play_window_set_title(void)
Definition: gui.c:3722
void update_timer_bars(int posx, int posy, int width, int height, int which)
draw the timer bars
Definition: interface.c:288
lives_remote_clip_request_t * run_youtube_dialog(lives_remote_clip_request_t *)
Definition: interface.c:5071
void resize_play_window(void)
Definition: gui.c:4349
boolean expose_laud_draw(LiVESWidget *, lives_painter_t *, livespointer psurf)
Definition: callbacks.c:9984
boolean expose_vid_draw(LiVESWidget *, lives_painter_t *, livespointer psurf)
Definition: callbacks.c:9968
LiVESResponseType filter_cleanup(const char *trashdir, LiVESList **rec_list, LiVESList **rem_list, LiVESList **left_list)
Definition: interface.c:1981
void show_playbar_labels(int clipno)
Definition: interface.c:77
void redraw_timeline(int clipno)
Definition: interface.c:3412
_commentsw * commentsw
Definition: interface.h:310
_entryw * create_cds_dialog(int type)
Definition: interface.c:4348
boolean expose_msg_area(LiVESWidget *, lives_painter_t *, livespointer user_data)
LiVESWidget * create_encoder_prep_dialog(const char *text1, const char *text2, boolean opt_resize)
Definition: interface.c:1292
_entryw * create_location_dialog(void)
Definition: interface.c:2350
boolean config_laud_draw(LiVESWidget *, LiVESXEventConfigure *, livespointer user_data)
Definition: callbacks.c:9992
LiVESWidget * add_list_expander(LiVESBox *, const char *title, int width, int height, LiVESList *xlist)
Definition: interface.c:4983
void make_play_window(void)
actually in gui.c
Definition: gui.c:3932
void kill_play_window(void)
Definition: gui.c:4386
void run_diskspace_dialog(void)
Definition: interface.c:6445
_entryw * locw
Definition: interface.h:312
boolean config_raud_draw(LiVESWidget *, LiVESXEventConfigure *, livespointer user_data)
Definition: callbacks.c:10018
void do_mt_keys_window(void)
Definition: interface.c:4813
text_window * textwindow
Definition: interface.h:314
void clear_tbar_bgs(int posx, int posy, int width, int height, int which)
Definition: interface.c:181
_commentsw * create_comments_dialog(lives_clip_t *, char *filename)
Definition: interface.c:3745
void add_suffix_check(LiVESBox *, const char *ext)
Definition: interface.c:23
void add_to_clipmenu(void)
Definition: gui.c:4512
_insertw * create_insert_dialog(void)
Definition: interface.c:1458
void redraw_timer_bars(double oldx, double newx, int which)
paint a damage region
Definition: interface.c:623
void remove_from_clipmenu(void)
Definition: gui.c:4560
const lives_special_aspect_t * add_aspect_ratio_button(LiVESSpinButton *sp_width, LiVESSpinButton *sp_height, LiVESBox *container)
Definition: interface.c:4963
LiVESWidget * scrolled_textview(const char *text, LiVESTextBuffer *, int window_width, LiVESWidget **ptextview)
Definition: interface.c:1368
boolean run_diskspace_dialog_idle(livespointer data)
Definition: interface.c:5752
void widget_add_preview(LiVESWidget *, LiVESBox *for_preview, LiVESBox *for_button, LiVESBox *for_deinterlace, int preview_type)
for fileselector preview
Definition: interface.c:652
boolean on_msg_area_scroll(LiVESWidget *, LiVESXEventScroll *, livespointer user_data)
Definition: interface.c:7298
xprocess * create_processing(const char *text)
Definition: interface.c:853
boolean do_audio_choice_dialog(short startup_phase)
Definition: startup.c:500
LiVESWidget * make_autoreload_check(LiVESHBox *parent, boolean is_active)
Definition: interface.c:4342
xprocess * create_threaded_dialog(char *text, boolean has_cancel, boolean *td_had_focus)
Definition: interface.c:752
_entryw * renamew
Definition: interface.h:311
void msg_area_scroll(LiVESAdjustment *, livespointer userdata)
Definition: interface.c:7284
LiVESWidget * create_opensel_dialog(int frames, double fps)
Definition: interface.c:2228
boolean config_vid_draw(LiVESWidget *, LiVESXEventConfigure *, livespointer user_data)
Definition: callbacks.c:9976
char * choose_file_bg(const char *dir, const char *fname, char **const filt, LiVESFileChooserAction act, const char *title, LiVESWidget *extra)
Definition: interface.c:4221
text_window * create_text_window(const char *title_part, const char *text, LiVESTextBuffer *, boolean add_buttons)
Definition: interface.c:1390
char * choose_file(const char *dir, const char *fname, char **const filt, LiVESFileChooserAction act, const char *title, LiVESWidget *extra)
Definition: interface.c:4080
LiVESTextView * create_output_textview(void)
Definition: interface.c:4630
int frames_t
Definition: main.h:99
#define PATH_MAX
Definition: main.h:255
LiVESWidget * comments_dialog
Definition: interface.h:124
LiVESWidget * author_entry
Definition: interface.h:126
LiVESWidget * title_entry
Definition: interface.h:125
LiVESWidget * subt_entry
Definition: interface.h:129
LiVESWidget * comment_entry
Definition: interface.h:127
LiVESWidget * subt_checkbutton
Definition: interface.h:128
LiVESWidget * top_label
Definition: interface.h:276
LiVESWidget * slider
Definition: interface.h:285
LiVESWidget * exp_vbox
Definition: interface.h:290
char * ext
Definition: interface.h:296
LiVESWidget * note_label
Definition: interface.h:280
LiVESWidget * abort_button
Definition: interface.h:287
LiVESWidget * resbutton
Definition: interface.h:288
lives_painter_surface_t * dsu_surface
Definition: interface.h:294
LiVESWidget * vlabel
Definition: interface.h:282
LiVESWidget * expander
Definition: interface.h:289
LiVESWidget * checkbutton
Definition: interface.h:281
LiVESWidget * vvlabel
Definition: interface.h:283
boolean scanning
Definition: interface.h:275
LiVESWidget * button
Definition: interface.h:286
LiVESWidget * exp_layout
Definition: interface.h:291
LiVESWidget * inst_label
Definition: interface.h:279
boolean setting
Definition: interface.h:292
LiVESWidget * dsu_label
Definition: interface.h:277
LiVESWidget * used_label
Definition: interface.h:278
uint64_t checkfunc
Definition: interface.h:293
LiVESWidget * pculabel
Definition: interface.h:284
boolean crit_dism
Definition: interface.h:295
LiVESWidget * clips_layout
Definition: interface.h:105
LiVESWidget * expander
Definition: interface.h:101
LiVESWidget * entry
Definition: interface.h:95
LiVESWidget * name_entry
Definition: interface.h:97
LiVESWidget * warn_checkbutton
Definition: interface.h:98
LiVESWidget * layouts_layout
Definition: interface.h:104
LiVESWidget * parent
Definition: interface.h:106
LiVESWidget * dialog
Definition: interface.h:94
LiVESWidget * exp_vbox
Definition: interface.h:103
LiVESWidget * okbutton
Definition: interface.h:99
LiVESWidget * exp_label
Definition: interface.h:102
LiVESWidget * cancelbutton
Definition: interface.h:100
LiVESWidget * dir_entry
Definition: interface.h:96
LiVESWidget * fit_checkbutton
Definition: interface.h:118
LiVESWidget * spinbutton_times
Definition: interface.h:117
LiVESWidget * without_sound
Definition: interface.h:116
LiVESWidget * with_sound
Definition: interface.h:115
LiVESWidget * insert_dialog
Definition: interface.h:114
LiVESWidget * time_spin
Definition: interface.h:153
boolean is_sel
Definition: interface.h:154
LiVESWidget * dialog
Definition: interface.h:152
LiVESWidget * apb_button
Definition: interface.h:211
LiVESWidget * mute_button
Definition: interface.h:212
LiVESWidget * atrigger_spin
Definition: interface.h:210
LiVESWidget * atrigger_button
Definition: interface.h:209
LiVESWidget * debug_button
Definition: interface.h:213
LiVESWidget * dialog
Definition: interface.h:208
corresponds to one clip in the GUI
Definition: main.h:877
LiVESWidget * dialog
Definition: interface.h:78
LiVESWidget * textview_ltime
Definition: interface.h:85
LiVESWidget * textview_lrate
Definition: interface.h:87
LiVESWidget * textview_fsize
Definition: interface.h:84
LiVESWidget * textview_rrate
Definition: interface.h:88
LiVESWidget * textview_rtime
Definition: interface.h:86
LiVESWidget * textview_type
Definition: interface.h:79
LiVESWidget * textview_fps
Definition: interface.h:80
LiVESWidget * textview_frames
Definition: interface.h:82
LiVESWidget * textview_vtime
Definition: interface.h:83
LiVESWidget * textview_size
Definition: interface.h:81
lives_size_match_t matchsize
Definition: interface.h:262
boolean use_advanced
Definition: interface.h:158
LiVESWidget * spinbuttonw
Definition: interface.h:164
LiVESWidget * spinbuttonh
Definition: interface.h:165
LiVESWidget * comboo
Definition: interface.h:162
LiVESWidget * radiobuttond
Definition: interface.h:167
LiVESWidget * combod
Definition: interface.h:161
LiVESWidget * spinbuttoni
Definition: interface.h:163
LiVESWidget * spinbuttonf
Definition: interface.h:166
LiVESWidget * advbutton
Definition: interface.h:159
LiVESWidget * adv_vbox
Definition: interface.h:160
LiVESWidget * table
Definition: interface.h:139
LiVESWidget * vbox
Definition: interface.h:141
LiVESWidget * button
Definition: interface.h:140
LiVESWidget * scrolledwindow
Definition: interface.h:142
LiVESWidget * textview
Definition: interface.h:138
LiVESWidget * dialog
Definition: interface.h:135
LiVESWidget * delete_button
Definition: interface.h:137
LiVESWidget * clear_button
Definition: interface.h:136