Go to the documentation of this file.
20 static LiVESList *fileread;
21 static LiVESList *filewrite;
22 static LiVESList *passwd_widgets;
24 static boolean special_inited =
FALSE;
31 if (special_inited)
return;
33 special_inited =
TRUE;
44 passwd_widgets = NULL;
55 char **array = lives_strsplit(sp_string,
"|", num_widgets + 2);
59 if (!strcmp(array[0],
"aspect")) {
62 }
else if (!strcmp(array[0],
"fontchooser")) {
63 #if GTK_CHECK_VERSION(3, 2, 0)
69 }
else if (!strcmp(array[0],
"mergealign")) {
73 }
else if (!strcmp(array[0],
"framedraw")) {
75 lives_strfreev(array);
79 if (!strcmp(array[1],
"rectdemask")) {
86 }
else if (!strcmp(array[1],
"multirect") || !strcmp(array[1],
"multrect")) {
93 }
else if (!strcmp(array[1],
"singlepoint")) {
98 }
else if (!strcmp(array[1],
"scaledpoint")) {
109 for (
int i = 0; i < num_widgets; i++) {
110 int pnum = atoi(array[i + 2]);
134 else if (!strcmp(array[0],
"fileread")) {
135 int idx = atoi(array[1]);
136 fileread = lives_list_append(fileread, (livespointer)&rfx->
params[idx]);
140 }
else if (!strcmp(array[0],
"filewrite")) {
141 int idx = atoi(array[1]);
142 filewrite = lives_list_append(filewrite, (livespointer)&rfx->
params[idx]);
147 }
else if (!strcmp(array[0],
"password")) {
148 int idx = atoi(array[1]);
149 passwd_widgets = lives_list_append(passwd_widgets, (livespointer)&rfx->
params[idx]);
155 lives_strfreev(array);
177 static void passwd_toggle_vis(LiVESToggleButton * b, livespointer entry) {
181 static void reset_aspect(LiVESButton * button, livespointer user_data) {
186 aspect->
ratio = width / height;
190 #if GTK_CHECK_VERSION(3, 2, 0)
191 static void font_set_cb(LiVESFontButton * button, livespointer data) {
193 char *fname = lives_font_chooser_get_font(LIVES_FONT_CHOOSER(button));
194 LingoFontDescription *lfd = lives_font_chooser_get_font_desc(LIVES_FONT_CHOOSER(button));
195 int size = lingo_font_description_get_size(lfd);
207 lingo_font_description_free(lfd);
210 static void text_size_cb(LiVESSpinButton * button, livespointer data) {
212 LingoFontDescription *lfd =
213 lives_font_chooser_get_font_desc(LIVES_FONT_CHOOSER(fchooser.
font_param->
widgets[1]));
214 lingo_font_description_set_size(lfd, sval * LINGO_SCALE);
215 lives_font_chooser_set_font_desc(LIVES_FONT_CHOOSER(fchooser.
font_param->
widgets[1]), lfd);
216 lingo_font_description_free(lfd);
219 static void font_entry_cb(LiVESEntry * entry, livespointer data) {
223 font_set_cb(button, data);
288 slist = passwd_widgets;
299 LiVESWidget *checkbutton;
300 LiVESWidget *widget = param->
widgets[0];
303 LiVESWidget *buttond;
314 lives_signal_sync_connect_after(LIVES_GUI_OBJECT(widget), LIVES_WIDGET_VALUE_CHANGED_SIGNAL,
322 lives_signal_sync_connect_after(LIVES_GUI_OBJECT(widget), LIVES_WIDGET_VALUE_CHANGED_SIGNAL,
331 lives_signal_sync_connect_after(LIVES_GUI_OBJECT(widget), LIVES_WIDGET_VALUE_CHANGED_SIGNAL,
339 lives_signal_sync_connect_after(LIVES_GUI_OBJECT(widget), LIVES_WIDGET_VALUE_CHANGED_SIGNAL,
363 aspect.
width_func = lives_signal_sync_connect_after(LIVES_GUI_OBJECT(widget), LIVES_WIDGET_VALUE_CHANGED_SIGNAL,
370 aspect.
height_func = lives_signal_sync_connect_after(LIVES_GUI_OBJECT(widget), LIVES_WIDGET_VALUE_CHANGED_SIGNAL,
375 #if GTK_CHECK_VERSION(3, 2, 0)
377 LiVESWidget *tbox = widget;
380 while (box && !LIVES_IS_HBOX(box)) {
387 lives_font_chooser_set_font(LIVES_FONT_CHOOSER(param->
widgets[1]), param->
value);
402 lives_signal_sync_connect(LIVES_GUI_OBJECT(param->
widgets[1]), LIVES_WIDGET_FONT_SET_SIGNAL,
403 LIVES_GUI_CALLBACK(font_set_cb), (livespointer)rfx);
405 fchooser.
entry_func = lives_signal_sync_connect(LIVES_GUI_OBJECT(widget),
406 LIVES_WIDGET_CHANGED_SIGNAL,
407 LIVES_GUI_CALLBACK(font_entry_cb), (livespointer)rfx);
412 font_entry_cb(LIVES_ENTRY(param->
widgets[0]), (livespointer)rfx);
414 text_size_cb(LIVES_SPIN_BUTTON(fchooser.
size_param->
widgets[0]), (livespointer)rfx);
420 fchooser.
size_paramfunc = lives_signal_sync_connect_after(LIVES_GUI_OBJECT(widget),
421 LIVES_WIDGET_VALUE_CHANGED_SIGNAL,
422 LIVES_GUI_CALLBACK(text_size_cb), (livespointer)rfx);
425 text_size_cb(LIVES_SPIN_BUTTON(fchooser.
size_param->
widgets[0]), (livespointer)rfx);
433 char *labeltext = (
_(
"Maintain _Aspect Ratio"));
440 lives_signal_sync_connect(aspect.
lockbutton, LIVES_WIDGET_CLICKED_SIGNAL,
441 LIVES_GUI_CALLBACK(reset_aspect), (livespointer)&aspect);
443 reset_aspect(LIVES_BUTTON(aspect.
lockbutton), &aspect);
448 if (!LIVES_IS_HBOX(pbox)) {
466 if (!widget)
continue;
470 while (box && !LIVES_IS_HBOX(box)) {
476 def_dir = lives_get_current_dir();
478 if (LIVES_IS_ENTRY(widget)) {
484 def_dir = lives_strdup(dirnamex);
493 (livespointer)widget);
499 if (LIVES_IS_ENTRY(widget)) {
502 LIVES_IS_LABEL(param->
widgets[1]) &&
516 if (!widget)
continue;
520 while (box && !LIVES_IS_HBOX(box)) {
531 (livespointer)widget);
537 if (LIVES_IS_ENTRY(widget)) {
540 LIVES_IS_LABEL(param->
widgets[1]) &&
552 for (slist = passwd_widgets; slist; slist = slist->next) {
554 if (!widget)
continue;
560 while (box && !LIVES_IS_BOX(box)) {
566 if (!LIVES_IS_HBOX(box)) {
578 lives_signal_sync_connect_after(LIVES_GUI_OBJECT(checkbutton), LIVES_WIDGET_TOGGLED_SIGNAL,
579 LIVES_GUI_CALLBACK(passwd_toggle_vis), (livespointer)widget);
588 double height = (double)width / aspect.
ratio;
604 double width = (double)height * aspect.
ratio;
622 LiVESList *slist = filewrite;
627 if (LIVES_IS_ENTRY(param->
widgets[0])) {
643 if (special_inited) {
663 if (fileread) lives_list_free(fileread);
666 if (filewrite) lives_list_free(filewrite);
669 if (passwd_widgets) lives_list_free(passwd_widgets);
670 passwd_widgets = NULL;
675 special_inited =
FALSE;
742 LiVESPixbuf *pixbuf = NULL;
744 if (framedraw.
added) {
745 switch (framedraw.
type) {
747 if (mt->track_index == -1) {
#define LIVES_GLOBAL_INLINE
lives_param_special_t special_type
void framedraw_add_reset(LiVESVBox *box, lives_special_framedraw_rect_t *framedraw)
add "reset values" button
lives_param_t * yend_param
LiVESWidgetColor light_red
lives_param_t * height_param
#define LIVES_FILE_SELECTION_SAVE
LIVES_GLOBAL_INLINE void set_aspect_ratio_widgets(lives_param_t *w, lives_param_t *h)
void on_filesel_button_clicked(LiVESButton *button, livespointer user_data)
callback for lives_standard filesel button same callback is used for dierctory buttons object_data in...
void after_aspect_height_changed(LiVESToggleButton *spinbutton, livespointer user_data)
@ LIVES_PARAM_SPECIAL_TYPE_SCALEDPOINT
type may be used in framedraw
lives_rfx_status_t status
int count_resampled_frames(int in_frames, double orig_fps, double resampled_fps)
void get_dirname(char *filename)
void framedraw_connect_spinbutton(lives_special_framedraw_rect_t *framedraw, lives_rfx_t *rfx)
connect spinbutton to preview
void after_framedraw_widget_changed(LiVESWidget *widget, lives_special_framedraw_rect_t *framedraw)
callback for widgets
void invalidate_preview(lives_special_framedraw_rect_t *frame_draw)
boolean set_rfx_param_by_name_string(lives_rfx_t *rfx, const char *name, const char *value, boolean update_visual)
void fd_tweak(lives_rfx_t *rfx)
LiVESWidget * framedraw_maskbox
box for opacity controls
size_t get_token_count(const char *string, int delim)
_fx_dialog * fx_dialog[2]
int get_int_param(void *value)
void check_for_special(lives_rfx_t *rfx, lives_param_t *param, LiVESBox *pbox)
lives_special_mergealign_t mergealign
int dp
decimals, 0 for int and bool
short multi
multivalue type - single value, multi value, or per channel
@ LIVES_PARAM_SPECIAL_TYPE_SINGLEPOINT
type may be used in framedraw
weed_plant_t * fd_layer_orig
original layer uneffected
@ LIVES_PARAM_SPECIAL_TYPE_RECT_DEMASK
type may be used in framedraw
double max
for string this is max characters
@ RFX_STATUS_WEED
indicates an internal RFX, created from a weed instance
@ LIVES_PARAM_SPECIAL_TYPE_FILEREAD
lives_param_t * font_param
lives_param_t * end_param
void reset_framedraw_preview(void)
lives_param_t * scale_param
#define ASPECT_BUTTON_HEIGHT
weed_plant_t * framedraw_redraw(lives_special_framedraw_rect_t *framedraw, weed_layer_t *layer)
redraw when exposed/frame number changes
#define CURRENT_CLIP_HAS_VIDEO
@ LIVES_PARAM_SPECIAL_TYPE_NONE
lives_param_t * xend_param
double get_double_param(void *value)
@ LIVES_PARAM_SPECIAL_TYPE_PASSWORD
LiVESPixbuf * mt_framedraw(lives_mt *mt, weed_layer_t *layer)
@ LIVES_PARAM_SPECIAL_TYPE_RECT_MULTIRECT
type may be used in framedraw
void add_to_special(const char *sp_string, lives_rfx_t *rfx)
@ LIVES_PARAM_SPECIAL_TYPE_FONT_CHOOSER
_palette * palette
interface colour settings
void fd_connect_spinbutton(lives_rfx_t *rfx)
@ LIVES_PARAM_SPECIAL_TYPE_FILEWRITE
lives_param_t * start_param
LiVESWidget * framedraw_preview
the 'redraw' button
void after_param_text_changed(LiVESWidget *textwidget, lives_rfx_t *rfx)
void after_aspect_width_changed(LiVESSpinButton *spinbutton, livespointer user_data)
weed_plant_t weed_layer_t
lives_param_t * width_param
void check_for_special_type(lives_rfx_t *rfx, lives_param_t *param, LiVESBox *pbox)
boolean is_perchannel_multi(lives_rfx_t *rfx, int i)
LiVESWidget * framedraw
for the framedraw special widget - TODO - use a sub-struct
void framedraw_connect(lives_special_framedraw_rect_t *framedraw, int width, int height, lives_rfx_t *rfx)
activate the image for clicks and draws
lives_mt * multitrack
holds a pointer to the entire multitrack environment; NULL in Clip Edit mode
lives_param_t * xstart_param
LiVESWidget * framedraw_spinbutton
the frame number button
#define RFX_PROPS_MAY_RESIZE
is a tool
#define RFX_TEXT_MAGIC
length at which entry turns into textview
#define PVAL_MULTI_PER_CHANNEL
#define ASPECT_BUTTON_WIDTH
LiVESWidget * spinbutton_loops
weed_plant_t * fd_layer
framedraw preview layer
LiVESWidget * widgets[MAX_PARAM_WIDGETS]
TODO - change to LiVESWidget **widgets, terminated with a NULL.
LiVESWidget * framedraw_scale
the slider
LIVES_GLOBAL_INLINE weed_layer_t * weed_layer_free(weed_layer_t *layer)
frees pixel_data for a layer, then the layer itself
lives_param_special_t type
void * value
current value(s)
boolean special_cleanup(boolean is_ok)
boolean check_filewrite_overwrites(void)
lives_param_t * size_param
LiVESWidget * framedraw_reset
the 'redraw' button
@ LIVES_PARAM_SPECIAL_TYPE_ASPECT_RATIO
boolean check_file(const char *file_name, boolean check_exists)
check if file exists
lives_param_t * ystart_param
const lives_special_aspect_t * paramspecial_get_aspect()