LiVES 3.2.0
ldvinterface.c
Go to the documentation of this file.
1// ldvinterface.c
2// LiVES
3// (c) G. Finch 2006-2018 <salsaman+lives@gmail.com>
4// released under the GNU GPL 3 or later
5// see file ../COPYING for licensing details
6
7#include "main.h"
8#include "ldvcallbacks.h"
9#include "ldvinterface.h"
10#include "callbacks.h"
11
12struct _dvgrabw *create_camwindow(s_cam *cam, int type) {
13 LiVESWidget *hbuttonbox1;
14 LiVESWidget *button3;
15 LiVESWidget *button4;
16 LiVESWidget *vbox;
17 LiVESWidget *hbox;
18 LiVESWidget *label;
19
20 char *tmp;
21
22 struct _dvgrabw *dvgrabw = (struct _dvgrabw *)lives_malloc(sizeof(struct _dvgrabw));
23
24 dvgrabw->filename = NULL;
25
26 dvgrabw->dialog = lives_standard_dialog_new(_("DVGrab"), FALSE, -1, -1);
28
29 vbox = lives_dialog_get_content_area(LIVES_DIALOG(dvgrabw->dialog));
30
31 hbox = lives_hbox_new(FALSE, 0);
33
34 dvgrabw->dirname = lives_filename_to_utf8((tmp = lives_get_current_dir()), -1, NULL, NULL, NULL);
36 LIVES_BOX(hbox), NULL);
37 lives_free(tmp);
38
40
41 hbox = lives_hbox_new(FALSE, 0);
43
44 dvgrabw->filent = lives_standard_entry_new(_("File_name:"), type == CAM_FORMAT_DV ? "dvgrab-" : "hdvgrab-", -1, -1,
45 LIVES_BOX(hbox), NULL);
46
47 if (type == CAM_FORMAT_DV) label = lives_standard_label_new("%d.dv");
48 else label = lives_standard_label_new("%d.mpg");
49 lives_box_pack_start(LIVES_BOX(hbox), label, FALSE, FALSE, 0);
50
51 label = lives_standard_label_new(_("(files will not be overwritten)"));
52 lives_box_pack_end(LIVES_BOX(hbox), label, FALSE, FALSE, widget_opts.packing_width);
53
54 hbox = lives_hbox_new(FALSE, 0);
56
57 dvgrabw->split = lives_standard_check_button_new(_("_Split into scenes"), FALSE, LIVES_BOX(hbox), NULL);
58
59 // TODO - widget_opts.editable
61
63 lives_entry_set_text(LIVES_ENTRY(dvgrabw->status_entry), _("Status: Ready"));
65
66 add_hsep_to_box(LIVES_BOX(vbox));
67
68 hbuttonbox1 = lives_hbutton_box_new();
69
70 lives_box_pack_start(LIVES_BOX(vbox), hbuttonbox1, FALSE, FALSE, widget_opts.packing_height);
71
72 // TODO: use lives_dialog_add_button_from_stock()
73
76
77 lives_container_add(LIVES_CONTAINER(hbuttonbox1), button3);
79
82
83 lives_container_add(LIVES_CONTAINER(hbuttonbox1), button4);
85
88
89 lives_container_add(LIVES_CONTAINER(hbuttonbox1), dvgrabw->stop);
92
95
96 lives_container_add(LIVES_CONTAINER(hbuttonbox1), dvgrabw->play);
98
99 dvgrabw->grab = lives_standard_button_new_from_stock(LIVES_STOCK_MEDIA_RECORD, _("_Grab"),
101
102 lives_container_add(LIVES_CONTAINER(hbuttonbox1), dvgrabw->grab);
104
106 _("\nUse this tool to control your camera and grab clips.\n"
107 "After grabbing your clips, you can close this window \nand then load them into LiVES.\n"));
108 lives_box_pack_start(LIVES_BOX(vbox), label, FALSE, FALSE, widget_opts.packing_height * 4);
109
110 dvgrabw->quit =
112 LIVES_STOCK_CLOSE, LIVES_STOCK_LABEL_CLOSE_WINDOW,
113 LIVES_RESPONSE_ACCEPT);
114
116
118
119 lives_signal_sync_connect(button3, LIVES_WIDGET_CLICKED_SIGNAL, LIVES_GUI_CALLBACK(on_camrew_clicked), (livespointer)cam);
120 lives_signal_sync_connect(button4, LIVES_WIDGET_CLICKED_SIGNAL, LIVES_GUI_CALLBACK(on_camff_clicked), (livespointer)cam);
121 lives_signal_sync_connect(dvgrabw->stop, LIVES_WIDGET_CLICKED_SIGNAL,
122 LIVES_GUI_CALLBACK(on_camstop_clicked), (livespointer)cam);
123 lives_signal_sync_connect(dvgrabw->play, LIVES_WIDGET_CLICKED_SIGNAL,
124 LIVES_GUI_CALLBACK(on_camplay_clicked), (livespointer)cam);
125 lives_signal_sync_connect(dvgrabw->grab, LIVES_WIDGET_CLICKED_SIGNAL,
126 LIVES_GUI_CALLBACK(on_camgrab_clicked), (livespointer)cam);
127 lives_signal_sync_connect(dvgrabw->quit, LIVES_WIDGET_CLICKED_SIGNAL,
128 LIVES_GUI_CALLBACK(on_camquit_clicked), (livespointer)cam);
129 return dvgrabw;
130}
131
void on_camrew_clicked(LiVESButton *button, livespointer user_data)
Definition: ldvcallbacks.c:75
void on_camquit_clicked(LiVESButton *button, livespointer user_data)
Definition: ldvcallbacks.c:95
void on_camgrab_clicked(LiVESButton *button, livespointer user_data)
Definition: ldvcallbacks.c:11
void on_camplay_clicked(LiVESButton *button, livespointer user_data)
Definition: ldvcallbacks.c:61
void on_camstop_clicked(LiVESButton *button, livespointer user_data)
Definition: ldvcallbacks.c:40
void on_camff_clicked(LiVESButton *button, livespointer user_data)
Definition: ldvcallbacks.c:82
struct _dvgrabw * dvgrabw
Definition: ldvgrab.h:61
#define CAM_FORMAT_DV
Definition: ldvgrab.h:14
struct _dvgrabw * create_camwindow(s_cam *cam, int type)
Definition: ldvinterface.c:12
#define lives_free
Definition: machinestate.h:52
#define lives_malloc
Definition: machinestate.h:46
#define PATH_MAX
Definition: main.h:255
#define DEF_BUTTON_HEIGHT
Definition: mainwindow.h:183
#define DEF_BUTTON_WIDTH
Definition: mainwindow.h:182
LiVESWidget * filent
Definition: ldvgrab.h:45
LiVESWidget * status_entry
Definition: ldvgrab.h:51
s_cam * cam
Definition: ldvgrab.h:57
LiVESWidget * quit
Definition: ldvgrab.h:50
LiVESWidget * dirent
Definition: ldvgrab.h:46
LiVESWidget * play
Definition: ldvgrab.h:49
char * filename
Definition: ldvgrab.h:56
LiVESWidget * stop
Definition: ldvgrab.h:47
char * dirname
Definition: ldvgrab.h:55
LiVESWidget * split
Definition: ldvgrab.h:52
boolean playing
Definition: ldvgrab.h:54
LiVESWidget * dialog
Definition: ldvgrab.h:44
LiVESWidget * grab
Definition: ldvgrab.h:48
Definition: ldvgrab.h:17
int packing_height
vertical pixels between widgets
int packing_width
horizontal pixels between widgets
#define _(String)
Definition: support.h:44
#define TRUE
Definition: videoplugin.h:59
#define FALSE
Definition: videoplugin.h:60
WIDGET_HELPER_GLOBAL_INLINE LiVESWidget * lives_standard_direntry_new(const char *labeltext, const char *txt, int dispwidth, int maxchars, LiVESBox *box, const char *tooltip)
LiVESWidget * lives_standard_entry_new(const char *labeltext, const char *txt, int dispwidth, int maxchars, LiVESBox *box, const char *tooltip)
WIDGET_HELPER_GLOBAL_INLINE boolean lives_box_pack_start(LiVESBox *box, LiVESWidget *child, boolean expand, boolean fill, uint32_t padding)
LiVESWidget * lives_standard_dialog_new(const char *title, boolean add_std_buttons, int width, int height)
LiVESWidget * lives_standard_button_new_from_stock(const char *stock_id, const char *label, int width, int height)
WIDGET_HELPER_GLOBAL_INLINE boolean lives_widget_set_sensitive(LiVESWidget *widget, boolean state)
WIDGET_HELPER_GLOBAL_INLINE LiVESWidget * lives_dialog_get_content_area(LiVESDialog *dialog)
WIDGET_HELPER_GLOBAL_INLINE LiVESWidget * lives_hbutton_box_new(void)
WIDGET_HELPER_GLOBAL_INLINE LiVESWidget * lives_entry_new(void)
LiVESWidget * add_hsep_to_box(LiVESBox *box)
LiVESWidget * lives_dialog_add_button_from_stock(LiVESDialog *dialog, const char *stock_id, const char *label, int response_id)
WIDGET_HELPER_GLOBAL_INLINE boolean lives_container_add(LiVESContainer *container, LiVESWidget *widget)
WIDGET_HELPER_GLOBAL_INLINE boolean lives_widget_set_can_focus(LiVESWidget *widget, boolean state)
WIDGET_HELPER_GLOBAL_INLINE LiVESWidget * lives_hbox_new(boolean homogeneous, int spacing)
LiVESWidget * lives_standard_label_new(const char *text)
WIDGET_HELPER_GLOBAL_INLINE boolean lives_entry_set_text(LiVESEntry *entry, const char *text)
WIDGET_HELPER_GLOBAL_INLINE boolean lives_editable_set_editable(LiVESEditable *editable, boolean is_editable)
LiVESWidget * lives_standard_check_button_new(const char *labeltext, boolean active, LiVESBox *box, const char *tooltip)
WIDGET_HELPER_GLOBAL_INLINE boolean lives_box_pack_end(LiVESBox *box, LiVESWidget *child, boolean expand, boolean fill, uint32_t padding)
WIDGET_HELPER_GLOBAL_INLINE boolean lives_widget_set_can_focus_and_default(LiVESWidget *widget)
#define LONG_ENTRY_WIDTH
Definition: widget-helper.h:29
char LIVES_STOCK_LABEL_MEDIA_STOP[32]
char LIVES_STOCK_LABEL_MEDIA_FORWARD[32]
char LIVES_STOCK_LABEL_CLOSE_WINDOW[32]
widget_opts_t widget_opts
char LIVES_STOCK_LABEL_MEDIA_PLAY[32]
char LIVES_STOCK_LABEL_MEDIA_REWIND[32]