4
* Copyright (C) 2003,04 Karl H. Beckers, Frankfurt
5
* EMail: khb@jarre-de-the.net
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
#include "../config.h" //autoconf output
28
#include <ctype.h> /* isdigit() */
29
#include <X11/Intrinsic.h>
30
#include <X11/StringDefs.h>
31
#include <X11/Shell.h>
32
#include <X11/cursorfont.h>
33
#include <X11/Xmu/WinUtil.h>
37
#include <sys/types.h>
41
#include <gdk/gdkkeysyms.h>
44
#include <pango/pango-layout.h>
45
#include <gdk-pixbuf/gdk-pixdata.h>
46
#include "led_meter.h"
48
#ifdef HAVE_LIBAVCODEC
49
#ifdef HAVE_LIBAVFORMAT
50
#include <ffmpeg/avcodec.h>
51
#include <ffmpeg/avformat.h>
52
#endif // HAVE_AVCODEC
53
#endif // HAVE_AVFORMAT
60
#include "gtk2_support.h"
61
#include "gtk2_options.h"
63
#include "gtk2_frame.h"
65
#define GLADE_HOOKUP_OBJECT(component, widget, name) \
66
g_object_set_data_full(G_OBJECT(component), name, \
67
gtk_widget_ref(widget), (GDestroyNotify) gtk_widget_unref)
69
#define GLADE_HOOKUP_OBJECT_NO_REF(component, widget, name) \
70
g_object_set_data(G_OBJECT(component), name, widget)
73
/* GdkPixbuf RGBA C-Source image dump */
75
static const guint8 animate_icon[] =
77
/* Pixbuf magic (0x47646b50) */
79
/* length: header (24) + pixel_data (1040) */
81
/* pixdata_type (0x1010002) */
90
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
91
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
92
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
93
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
94
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
95
"\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
96
"\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377"
97
"\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377"
98
"\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377"
99
"\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0"
100
"\0\377\0\0\0\377\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
101
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
102
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
103
"\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
104
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
105
"\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377"
106
"\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377"
107
"\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
108
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
109
"\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
110
"\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0"
111
"\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
112
"\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
113
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
114
"\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377"
115
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
116
"\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
117
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
118
"\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377"
119
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0"
120
"\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
121
"\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
122
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
123
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
124
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377"
125
"\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0"
126
"\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
127
"\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0"
128
"\377\0\0\0\377\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
129
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
130
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
131
"\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
132
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
133
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
134
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
135
"\377\0\377\377\377\0"
139
/* GdkPixbuf RGBA C-Source image dump */
141
static const guint8 edit_icon[] =
143
/* Pixbuf magic (0x47646b50) */
145
/* length: header (24) + pixel_data (624) */
147
/* pixdata_type (0x1010002) */
156
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
157
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
158
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
159
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
160
"\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
161
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
162
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377"
163
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
164
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
165
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
166
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
167
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
168
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
169
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
170
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
171
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
172
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
173
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
174
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
175
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
176
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
177
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
178
"\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
179
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
180
"\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
181
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
182
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
183
"\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
184
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
189
/* GdkPixbuf RGBA C-Source image dump */
191
static const guint8 move_icon[] =
193
/* Pixbuf magic (0x47646b50) */
195
/* length: header (24) + pixel_data (676) */
197
/* pixdata_type (0x1010002) */
206
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
207
"\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
208
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
209
"\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
210
"\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
211
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0"
212
"\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
213
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
214
"\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0"
215
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
216
"\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0"
217
"\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0"
218
"\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377"
219
"\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377"
220
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377"
221
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
222
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\0\0"
223
"\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377"
224
"\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377"
225
"\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377"
226
"\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
227
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
228
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377"
229
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
230
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0"
231
"\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
232
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
233
"\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\377\377"
234
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
235
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
236
"\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
237
"\0\377\377\377\0\377\377\377\0"
241
/* GdkPixbuf RGBA C-Source image dump */
243
static const guint8 next_icon[] =
245
/* Pixbuf magic (0x47646b50) */
247
/* length: header (24) + pixel_data (468) */
249
/* pixdata_type (0x1010002) */
258
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
259
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
260
"\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377"
261
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
262
"\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
263
"\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
264
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
265
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377"
266
"\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
267
"\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
268
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
269
"\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
270
"\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0"
271
"\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377"
272
"\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
273
"\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
274
"\377\0\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
275
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
276
"\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
277
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
278
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
283
/* GdkPixbuf RGBA C-Source image dump */
285
static const guint8 pause_icon[] =
287
/* Pixbuf magic (0x47646b50) */
289
/* length: header (24) + pixel_data (728) */
291
/* pixdata_type (0x1010002) */
300
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
301
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
302
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
303
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
304
"\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
305
"\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
306
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0"
307
"\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0"
308
"\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
309
"\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
310
"\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
311
"\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
312
"\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
313
"\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
314
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
315
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
316
"\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
317
"\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
318
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0"
319
"\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0"
320
"\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
321
"\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
322
"\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
323
"\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
324
"\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
325
"\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
326
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
327
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
328
"\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
329
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
330
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
331
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
336
/* GdkPixbuf RGBA C-Source image dump */
338
static const guint8 prev_icon[] =
340
/* Pixbuf magic (0x47646b50) */
342
/* length: header (24) + pixel_data (468) */
344
/* pixdata_type (0x1010002) */
353
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
354
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
355
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
356
"\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377"
357
"\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
358
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
359
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
360
"\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
361
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
362
"\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
363
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
364
"\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0"
365
"\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
366
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
367
"\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
368
"\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377"
369
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0"
370
"\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377"
371
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
372
"\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
373
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
378
/* GdkPixbuf RGBA C-Source image dump */
380
static const guint8 record_on_icon[] =
382
/* Pixbuf magic (0x47646b50) */
384
/* length: header (24) + pixel_data (676) */
386
/* pixdata_type (0x1010002) */
395
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
396
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
397
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
398
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377\377\0\0\377"
399
"\377\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
400
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377"
401
"\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0"
402
"\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
403
"\377\0\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377"
404
"\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\377\377\0\377\377\377"
405
"\0\377\377\377\0\377\377\377\0\377\0\0\377\377\0\0\377\377\0\0\377\377"
406
"\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377"
407
"\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377\377\0\0\377\377"
408
"\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377"
409
"\377\0\0\377\377\0\0\377\377\0\0\377\377\377\377\0\377\377\377\0\377"
410
"\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377"
411
"\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\377"
412
"\377\0\377\377\377\0\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377"
413
"\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0"
414
"\377\377\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377"
415
"\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0"
416
"\377\377\0\0\377\377\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
417
"\0\377\377\377\0\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377"
418
"\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\377\377"
419
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377"
420
"\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0\377\377\0\0"
421
"\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
422
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\0\0\377\377\0\0"
423
"\377\377\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
424
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
425
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
426
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0"
430
/* GdkPixbuf RGBA C-Source image dump */
432
static const guint8 select_icon[] =
434
/* Pixbuf magic (0x47646b50) */
436
/* length: header (24) + pixel_data (676) */
438
/* pixdata_type (0x1010002) */
447
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
448
"\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
449
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
450
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377"
451
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
452
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
453
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377"
454
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
455
"\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\377\377\377\0"
456
"\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
457
"\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0"
458
"\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377"
459
"\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0"
460
"\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377"
461
"\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377"
462
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
463
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0"
464
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377"
465
"\377\0\377\377\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377"
466
"\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377"
467
"\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377"
468
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
469
"\0\0\0\0\377\0\0\0\377\377\377\377\0\0\0\0\377\377\377\377\0\0\0\0\377"
470
"\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
471
"\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
472
"\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
473
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
474
"\377\0\377\377\377\0\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
475
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
476
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377"
477
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
482
/* GdkPixbuf RGBA C-Source image dump */
484
static const guint8 step_icon[] =
486
/* Pixbuf magic (0x47646b50) */
488
/* length: header (24) + pixel_data (780) */
490
/* pixdata_type (0x1010002) */
499
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
500
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
501
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
502
"\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\377\377"
503
"\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
504
"\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
505
"\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0"
506
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0"
507
"\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0"
508
"\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377"
509
"\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0"
510
"\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0"
511
"\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377"
512
"\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0"
513
"\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
514
"\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377"
515
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
516
"\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377"
517
"\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
518
"\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
519
"\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377"
520
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
521
"\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
522
"\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
523
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
524
"\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0"
525
"\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
526
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377"
527
"\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377"
528
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
529
"\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
530
"\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\377\377\377\0\377"
531
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
532
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
533
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377"
538
/* GdkPixbuf RGBA C-Source image dump */
540
static const guint8 stop_icon[] =
542
/* Pixbuf magic (0x47646b50) */
544
/* length: header (24) + pixel_data (728) */
546
/* pixdata_type (0x1010002) */
555
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
556
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
557
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
558
"\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
559
"\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377"
560
"\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
561
"\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377"
562
"\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0"
563
"\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
564
"\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
565
"\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
566
"\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377"
567
"\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
568
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377"
569
"\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377"
570
"\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
571
"\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0"
572
"\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
573
"\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
574
"\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
575
"\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377"
576
"\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0"
577
"\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\377\377\377"
578
"\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0\0\377\0\0\0\377\0\0"
579
"\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
580
"\0\0\377\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\0\0"
581
"\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0"
582
"\0\0\377\0\0\0\377\0\0\0\377\377\377\377\0\377\377\377\0\377\377\377"
583
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
584
"\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377\0\377\377\377"
585
"\0\377\377\377\0\377\377\377\0\377\377\377\0"
590
// need to define this here, because we're calling it from
594
GtkWidget *handlebox1;
596
//GtkWidget *menubar1;
597
//GtkWidget *MI_file;
598
GtkWidget *MI_file_menu;
599
GtkWidget *MI_preferences;
601
GtkWidget *MI_prefs_save;
603
GtkWidget *MI_make_video;
604
GtkWidget *MI_continue;
608
GtkWidget *separatormenuitem1, *separatormenuitem2;
614
GtkWidget *tmp_toolbar_icon;
622
GtkWidget *select_tb;
623
GtkWidget *MI_animate;
625
GtkWidget *frame_drop_meter;
626
GtkTooltips *tooltips;
630
static guint stop_timer_id, start_timer_id;
631
struct timeval curr_time;
632
long start_time, pause_time, time_captured;
634
void start_recording(Job *job);
635
GtkWidget* create_window1(char *param_animate_cmd, char *param_mkvideo_cmd,
636
char *param_edit_cmd, char *param_help_cmd);
637
void InitGTKControl(AppData *app);
638
gboolean stop_recording_gui_stuff(Job *jobp);
639
gboolean stop_recording_nongui_stuff(Job *jobp);
640
gboolean timer_start_recording (Job *job);
641
void GtkChangeLabel(int pic_no);
646
* XVIDCAP GUI API ( IF THAT WORD IS ALLOWED HERE ;) )
648
* XVC_PREINIT IS FOR GUI PREINITIALIZATION LIKE SETTING FALLBACK OPTIONS
649
* XVC_CREATEGUI IS FOR GUI CREATION
650
* XVC_CREATEFRAME SHOULD CREATE THE SELECTION FRAME
651
* XVC_INITGUI IS FOR MISCELLANEOUS INITIALIZATION STUFF
652
* XVC_RUNGUI IS A WRAPPER AROUND THE UI'S MAIN LOOP
654
* XVC_ADDTIMEOUT IS A WRAPPER AROUND THE GUI'S FUNCTIONALITY FOR TRIGGERING ACTIONS AT A
656
* XVC_CHANGEGUILABEL IS A WRAPPER AROUND A FUNCTION TO CHANGE THE DISPLAY
657
* OF THE CURRENT FRAME NUMBER (NOT NECESSARY IN A LABEL)
658
* XVC_STOPCAPTURE IS A HOOK FOR RESETTING THE GUI TO A STOPPED STATE
659
* XVC_STARTCAPTURE IS A HOOK FOR STARTING A CAPTURE SESSION
662
Boolean XVC_PreInit( int argc, char **argv, AppData *app ) {
663
// the gtk gui doesn't recognize the Xt ressources as fallback values
664
// one effect is that here cap_width and cap_height will be zerio if
665
// not explicitly set
666
// FIXME: research other side-effects .....
667
if ( app->cap_width == 0 || app->cap_height == 0 ) {
668
app->cap_width = 192;
669
app->cap_height = 144;
671
//other defaults from fallback.h
672
// FIXME: this should be user-definable
673
app->play_cmd = "animate \"%s\" -delay %d &";
674
app->video_cmd = "ppm2mpeg \"%s\" %d %d %d %d %f %d &";
675
app->edit_cmd = "display \"%s\" &";
676
app->help_cmd = "xterm -e man xvidcap &";
678
//still other defaults
679
app->file = "test.mpeg";
684
gtk_init(&argc, &argv);
690
Boolean XVC_CreateGUI(AppData *app) {
695
bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
696
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
697
textdomain(GETTEXT_PACKAGE);
700
//add_pixmap_directory("/usr/local/share/project2/pixmaps");
702
window1 = create_window1(app->play_cmd, app->video_cmd, app->edit_cmd, app->help_cmd);
703
if ( ! ( app->flags & FLG_NOGUI ) ) {
704
gtk_widget_show(window1);
705
gtk_window_get_position( GTK_WINDOW(window1), &pos_x, &pos_y);
706
gtk_window_move( GTK_WINDOW(window1), (pos_x + FRAME_WIDTH), pos_y);
708
dpy = GDK_DRAWABLE_XDISPLAY( GTK_WIDGET(window1)->window );
710
dpy = XOpenDisplay(NULL);
713
if (!XF86DGAQueryExtension(dpy, &dga_evb, &dga_errb))
714
app->flags &= ~FLG_USE_DGA;
717
XF86DGAQueryDirectVideo(dpy, XDefaultScreen(dpy), &flag);
718
if ((flag & XF86DGADirectPresent) == 0) {
719
app->flags &= ~FLG_USE_DGA;
721
printf("xfdga: no direct present\n");
728
if (!XShmQueryExtension(dpy))
729
app->flags &= ~FLG_USE_SHM;
732
if (app->flags & FLG_NOGUI ) {
739
Boolean XVC_CreateFrame(AppData *app) {
740
if ( app->cap_width == 0 ) app->cap_width = 10;
741
if ( app->cap_height == 0 ) app->cap_height = 10;
742
GtkCreateFrame( GTK_WINDOW(window1), app->cap_width, app->cap_height, app->flags );
747
Boolean XVC_InitGUI(AppData *app) {
759
void XVC_AddTimeout(int ms, void *func, Job *job) {
760
gtk_timeout_add((guint32) ms, (GtkFunction) func, job);
764
void XVC_ChangeGUILabel( int pic_no ) {
765
GtkChangeLabel( pic_no );
769
void XVC_StopCapture(Job *job) {
772
rc = stop_recording_nongui_stuff(job);
773
rc = stop_recording_gui_stuff(job);
777
void XVC_StartCapture(Job *job) {
780
rc = start_recording_nongui_stuff(job);
781
rc = start_recording_gui_stuff(job);
785
void XVC_ChangeFrame(int x, int y, int width, int height, Boolean reposition_control ) {
786
GtkChangeFrame(x, y, width, height, reposition_control );
790
void XVC_FrameMonitor(Job *job, int measured_time) {
791
int percent, diff, n;
793
if ( measured_time == 0 ) {
796
else if ( measured_time <= job->time_per_frame ) percent = 30;
797
else if ( measured_time >= (job->time_per_frame * 2)) percent = 100;
799
diff = measured_time - job->time_per_frame;
800
percent = diff * 70 / job->time_per_frame;
803
// printf("percent: %i\n", percent);
804
led_meter_set_percent (LED_METER(frame_drop_meter), percent);
806
if ( percent == 0 ) LED_METER(frame_drop_meter)->old_max_da = 0;
811
* HELPER FUNCTIONS ...
816
gint keySnooper (GtkWidget *grab_widget, GdkEventKey *event, gpointer func_data) {
817
printf("keyval: %i - mods: %i\n", event->keyval, event->state);
822
* change value of frame/filename display
825
GtkChangeLabel(int pic_no) {
827
gint width, height, old_handlebox_width, old_filename_width;
830
static char file[PATH_MAX+1], tmp_buf[PATH_MAX+1];
832
gboolean ignore = TRUE;
836
if (jobp->flags & FLG_MULTI_IMAGE) {
837
sprintf(tmp_buf, jobp->file, jobp->movie_no);
838
sprintf(file, "%s[%04d]", tmp_buf, pic_no);
839
// sprintf(file, "%s[%04d]", jobp->file, pic_no);
841
sprintf(file, jobp->file, pic_no);
843
filename_length = strlen(file);
844
if (filename_length > 60) {
845
char tmp_file[PATH_MAX+1];
846
char *tmp_file2, *ptr, *ptr2;
849
strncpy(tmp_file, file, 20);
851
n = filename_length - 20;
852
ptr = (char*) &file + n;
853
tmp_file2 = strncat(tmp_file, "...", 4);
854
tmp_file2 = strncat(tmp_file, ptr, 45);
855
strncpy(file, tmp_file2, 45);
858
gtk_button_set_label(GTK_BUTTON(filename), file);
860
layout = gtk_widget_create_pango_layout(filename, file);
861
pango_layout_get_pixel_size(layout, &width, &height);
862
g_object_unref(layout);
864
gtk_widget_set_size_request(GTK_WIDGET(filename), (width + 30), -1);
870
// first callbacks here ....
874
//on_window1_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data)
876
on_window1_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) {
877
if ((jobp->state & VC_STOP) == 0 ) XVC_StopCapture(jobp);
883
on_window1_destroy(GtkWidget *widget, GdkEvent *event, gpointer user_data) {
888
on_MI_preferences_activate(GtkMenuItem *menuitem, gpointer user_data) {
889
dialog1 = create_dialog1(jobp);
890
gtk_widget_show(dialog1);
894
on_MI_prefs_save_activate(GtkMenuItem *menuitem, gpointer user_data) {
895
XVC_WriteOptionsFile(jobp);
899
on_MI_continue_activate(GtkMenuItem *menuitem, gpointer user_data) {
900
if ( gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menuitem)) ) {
901
if ( (! is_filename_mutable(jobp->file)) || (! jobp->flags & FLG_MULTI_IMAGE) ) {
902
printf("Output not a video file or no counter in filename\nDisabling autocontinue!\n");
903
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), FALSE);
905
jobp->flags |= FLG_AUTO_CONTINUE;
908
jobp->flags &= ~FLG_AUTO_CONTINUE;
913
on_MI_make_video_activate(GtkMenuItem *menuitem, gpointer user_data) {
914
char *fmt = (char *)user_data;
915
char cmd[PATH_MAX*2+2];
916
sprintf(cmd, fmt, jobp->file, jobp->start_no, jobp->pic_no-1,
917
jobp->area->width, jobp->area->height, jobp->fps, jobp->time_per_frame);
918
if (jobp->flags & FLG_RUN_VERBOSE)
919
printf("calling: '%s'\n", cmd);
925
on_MI_help_activate(GtkMenuItem *menuitem, gpointer user_data) {
926
if (jobp->flags & FLG_RUN_VERBOSE)
927
printf("calling '%s'\n", (char*) user_data);
928
system((char*)user_data);
932
on_MI_quit1_activate(GtkMenuItem *menuitem, gpointer user_data) {
934
g_signal_emit_by_name((GtkObject*) window1, "destroy", &ignore);
938
gboolean stop_recording_nongui_stuff(Job *job) {
940
job->state = VC_STOP;
945
gboolean stop_recording_gui_stuff(Job *job) {
947
// gtk_widget_set_sensitive(GTK_WIDGET(MI_file), TRUE);
948
gtk_widget_set_sensitive(GTK_WIDGET(select_tb), TRUE);
949
gtk_widget_set_sensitive(GTK_WIDGET(record), TRUE);
951
gtk_widget_set_sensitive(GTK_WIDGET(MI_file_menu), TRUE);
952
gtk_widget_set_sensitive(GTK_WIDGET(edit), TRUE);
954
if (! ((jobp->flags & FLG_MULTI_IMAGE) != 0 && is_filename_mutable(jobp->file) != TRUE )) {
955
gtk_widget_set_sensitive(GTK_WIDGET(next), TRUE);
956
if ((jobp->flags & FLG_MULTI_IMAGE) == 0) {
957
if (jobp->pic_no >= jobp->step) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
959
if (jobp->movie_no > 0) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
963
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pause_tb), FALSE);
964
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(record), FALSE);
965
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), TRUE);
967
// if (!(jobp->flags & FLG_RUN_VERBOSE))
968
GtkChangeLabel(jobp->pic_no);
974
gboolean timer_stop_recording(Job *job) {
975
if ( job->flags & FLG_AUTO_CONTINUE) {
976
stop_recording_nongui_stuff(job);
977
job->state |= VC_CONTINUE;
979
stop_recording_nongui_stuff(job);
980
stop_recording_gui_stuff(job);
987
on_stop_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
988
if (gtk_toggle_button_get_active(togglebutton)) {
989
if (stop_timer_id) gtk_timeout_remove(stop_timer_id);
990
stop_recording_nongui_stuff(jobp);
991
stop_recording_gui_stuff(jobp);
998
gboolean start_recording_gui_stuff(Job *job) {
1000
gtk_widget_set_sensitive(record, FALSE);
1001
// gtk_widget_set_sensitive(MI_file, FALSE);
1002
if ((jobp->state & VC_PAUSE) == 0) gtk_widget_set_sensitive(stop, TRUE);
1003
gtk_widget_set_sensitive(select_tb, FALSE);
1004
gtk_widget_set_sensitive(pause_tb, TRUE);
1006
gtk_widget_set_sensitive(MI_file_menu, FALSE);
1007
gtk_widget_set_sensitive(edit, FALSE);
1009
if (jobp->state & VC_PAUSE) {
1010
if ( (jobp->flags & FLG_MULTI_IMAGE) == 0 ) {
1011
gtk_widget_set_sensitive(step, TRUE);
1012
gtk_widget_set_sensitive(next, TRUE);
1013
if (jobp->pic_no >= jobp->step ) gtk_widget_set_sensitive(previous, TRUE);
1015
gtk_widget_set_sensitive(step, FALSE);
1016
if ( ! is_filename_mutable(jobp->file) ) {
1017
gtk_widget_set_sensitive(next, FALSE);
1018
gtk_widget_set_sensitive(previous, FALSE);
1022
gtk_widget_set_sensitive(next, FALSE);
1023
gtk_widget_set_sensitive(previous, FALSE);
1026
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), FALSE);
1031
gboolean start_recording_nongui_stuff(Job *job) {
1033
// hiermit wird auch VC_READY zur�ckgesetzt ...
1034
job->state = (VC_REC | VC_START) | (job->state & VC_PAUSE);
1036
if (job->flags & FLG_MULTI_IMAGE) {
1037
job->pic_no = jobp->start_no;
1038
GtkChangeLabel(jobp->pic_no);
1042
if (job->max_time && (job->state & VC_PAUSE) == 0 ) {
1043
/* install a timer which stops recording
1044
* we need milli secs ..
1046
gettimeofday(&curr_time, NULL);
1048
start_time = curr_time.tv_sec * 1000 + curr_time.tv_usec / 1000;
1049
stop_timer_id = gtk_timeout_add((guint32)(jobp->max_time * 1000), (GtkFunction) timer_stop_recording, jobp);
1052
job->capture(jobp, NULL);
1059
on_record_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
1060
if (gtk_toggle_button_get_active(togglebutton)) {
1061
start_recording_gui_stuff(jobp);
1062
start_recording_nongui_stuff(jobp);
1070
on_pause_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
1072
printf("on_pause_toggled(%d)\n", (int) gtk_toggle_button_get_active(togglebutton));
1074
if (gtk_toggle_button_get_active(togglebutton)) {
1075
// stop timer handling only if max_time is configured
1076
if (jobp->max_time ) {
1077
gettimeofday(&curr_time, NULL);
1078
pause_time = curr_time.tv_sec * 1000 + curr_time.tv_usec / 1000;
1079
if (( jobp->state & VC_REC ) != 0 ) {
1080
time_captured = ( pause_time - start_time ) + time_captured;
1084
if (stop_timer_id) gtk_timeout_remove(stop_timer_id);
1087
jobp->state |= VC_PAUSE;
1088
jobp->state &= ~VC_STOP;
1091
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), FALSE);
1092
// gtk_widget_set_sensitive(GTK_WIDGET(stop), TRUE);
1093
if ((jobp->flags & FLG_MULTI_IMAGE) == 0 && jobp->state & VC_REC) {
1094
gtk_widget_set_sensitive(GTK_WIDGET(step), TRUE);
1095
gtk_widget_set_sensitive(GTK_WIDGET(next), TRUE);
1096
if (jobp->pic_no >= jobp->step) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
1097
gtk_widget_set_sensitive(GTK_WIDGET(edit), TRUE);
1100
jobp->state &= ~VC_PAUSE;
1101
jobp->state &= ~VC_STEP;
1102
// step is always only active if a running recording session is paused
1103
// so releasing pause can always deactivate it
1104
gtk_widget_set_sensitive(GTK_WIDGET(step), FALSE);
1105
// the following only when recording is going on (not when just pressing and
1107
if (jobp->state & VC_REC) {
1108
gtk_widget_set_sensitive(GTK_WIDGET(next), FALSE);
1109
gtk_widget_set_sensitive(GTK_WIDGET(previous), FALSE);
1110
gtk_widget_set_sensitive(GTK_WIDGET(edit), FALSE);
1112
/* if (jobp->state & VC_REC) {
1113
gtk_widget_set_sensitive(GTK_WIDGET(stop), TRUE);
1114
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), FALSE);
1117
// restart timer handling only if max_time is configured
1118
if (jobp->max_time) {
1119
/* install a timer which stops recording
1120
* we need milli secs ..
1122
gettimeofday(&curr_time, NULL);
1123
start_time = curr_time.tv_sec * 1000 + curr_time.tv_usec / 1000;
1124
stop_timer_id = gtk_timeout_add((guint32)(jobp->max_time * 1000 - time_captured), (GtkFunction) timer_stop_recording, jobp);
1132
on_step_clicked(GtkButton *button, gpointer user_data) {
1133
if (( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
1134
if (!(jobp->state & (VC_PAUSE | VC_REC)))
1136
jobp->state |= VC_STEP;
1137
jobp->capture(jobp, NULL);
1138
if (jobp->pic_no == jobp->step ) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
1143
on_filename_clicked(GtkButton *button, gpointer user_data) {
1144
if ( ( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
1145
if ( jobp->pic_no != jobp->start_no && ( jobp->state & VC_STOP ) > 0
1146
|| ( jobp->state & VC_PAUSE ) > 0 ) {
1147
jobp->pic_no = jobp->start_no;
1148
GtkChangeLabel(jobp->pic_no);
1151
if ( jobp->movie_no != 0 && ( jobp->state & VC_STOP ) > 0) {
1153
jobp->pic_no = jobp->start_no;
1154
GtkChangeLabel(jobp->pic_no);
1160
on_previous_clicked(GtkButton *button, gpointer user_data) {
1161
if (( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
1162
if ( jobp->pic_no >= jobp->step) {
1163
jobp->pic_no -= jobp->step;
1164
GtkChangeLabel(jobp->pic_no);
1166
fprintf(stderr, "previous button active although picture number < step. this should never happen\n");
1168
if ( jobp->pic_no < jobp->step ) gtk_widget_set_sensitive(GTK_WIDGET(previous), FALSE);
1170
if ( jobp->movie_no > 0) {
1171
jobp->movie_no -= 1;
1172
GtkChangeLabel(jobp->pic_no);
1174
fprintf(stderr, "previous button active although movie number == 0. this should never happen\n");
1176
if ( jobp->movie_no == 0 ) gtk_widget_set_sensitive(GTK_WIDGET(previous), FALSE);
1181
on_next_clicked(GtkButton *button, gpointer user_data) {
1182
if (( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
1183
jobp->pic_no += jobp->step;
1184
GtkChangeLabel(jobp->pic_no);
1185
if (jobp->pic_no == jobp->step ) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
1187
jobp->movie_no += 1;
1188
GtkChangeLabel(jobp->pic_no);
1189
if (jobp->movie_no == 1) gtk_widget_set_sensitive(GTK_WIDGET(previous), TRUE);
1194
void on_move_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
1195
GtkTooltips *tooltips;
1196
XRectangle *frame_rectangle;
1197
int x, y, pheight, pwidth;
1199
tooltips = gtk_tooltips_new ();
1201
if (gtk_toggle_button_get_active(togglebutton)) {
1202
XVC_frame_lock = 1; // button pressed = move frame with control
1203
gtk_tooltips_set_tip (tooltips, GTK_WIDGET (togglebutton), _ ("Detach selection frame"), NULL);
1205
gtk_window_set_gravity( GTK_WINDOW(window1), GDK_GRAVITY_NORTH_WEST );
1206
gtk_window_get_position( GTK_WINDOW(window1), &x, &y);
1207
gtk_window_get_size( GTK_WINDOW(window1), &pwidth, &pheight);
1208
gtk_window_set_gravity( GTK_WINDOW(window1), GDK_GRAVITY_STATIC );
1209
gtk_window_get_position( GTK_WINDOW(window1), &x, &y);
1210
gtk_window_get_size( GTK_WINDOW(window1), &pwidth, &pheight);
1213
y += pheight + FRAME_OFFSET;
1216
frame_rectangle = GetArea();
1217
XVC_ChangeFrame(x, y, frame_rectangle->width, frame_rectangle->height, FALSE);
1220
gtk_tooltips_set_tip (tooltips, GTK_WIDGET (togglebutton), _ ("Attach selection frame"), NULL);
1226
on_select_toggled(GtkToggleButton *togglebutton, gpointer user_data) {
1227
if (gtk_toggle_button_get_active(togglebutton)) {
1228
Display *display = GDK_DRAWABLE_XDISPLAY( GTK_WIDGET(window1)->window );
1230
Window root, target = None, temp = None;
1233
int x_down, y_down, x_up, y_up, x, y, pheight = 0, pwidth = 0;
1238
root = RootWindow(display, DefaultScreen(display));
1239
cursor = XCreateFontCursor(display, XC_crosshair);
1241
gcv.background = XBlackPixel(display, XDefaultScreen(display));
1242
gcv.foreground = XWhitePixel(display, XDefaultScreen(display));
1243
gcv.function = GXinvert;
1244
gcv.plane_mask = gcv.background ^ gcv.foreground;
1245
gcv.subwindow_mode = IncludeInferiors;
1246
gc = XCreateGC(display, root,
1247
GCBackground | GCForeground | GCFunction | GCPlaneMask | GCSubwindowMode, &gcv);
1250
if (XGrabPointer(display, root, False,
1251
PointerMotionMask|ButtonPressMask|ButtonReleaseMask,
1252
GrabModeSync, GrabModeAsync, root, cursor, CurrentTime)
1254
printf("Can't grab mouse!\n");
1257
x_down = y_down = x_up = y_up = width = height = 0;
1259
while (buttons < 2) {
1260
/* allow pointer events */
1261
XAllowEvents(display, SyncPointer, CurrentTime);
1262
/* search in the queue for button events */
1263
XWindowEvent(display, root,
1264
PointerMotionMask|ButtonPressMask|ButtonReleaseMask, &event);
1265
switch (event.type) {
1267
x_down = event.xbutton.x;
1268
y_down = event.xbutton.y;
1269
target = event.xbutton.subwindow; /* window selected */
1270
if (target == None) {
1276
x_up = event.xbutton.x;
1277
y_up = event.xbutton.y;
1284
/* remove old frame */
1285
XDrawRectangle(display, root, gc, x, y, width, height);
1287
/* button is pressed */
1288
if (x_down > event.xbutton.x) {
1289
width = x_down - event.xbutton.x + 1;
1290
x = event.xbutton.x;
1292
width = event.xbutton.x - x_down + 1;
1295
if (y_down > event.xbutton.y) {
1296
height = y_down - event.xbutton.y + 1;
1297
y = event.xbutton.y;
1299
height = event.xbutton.y - y_down + 1;
1302
XDrawRectangle(display, root, gc, x, y, width, height);
1307
if (width) /* remove old frame */
1308
XDrawRectangle(display, root, gc, x, y, width, height);
1309
XUngrabPointer(display, CurrentTime); /* Done with pointer */
1310
XFreeCursor(display, cursor);
1311
XFreeGC(display, gc);
1313
if ((x_down != x_up) && (y_down != y_up)) {
1314
/* an individual frame was selected
1316
if (x_up < x_down) {
1317
width = x_down - x_up + 2;
1320
width = x_up - x_down + 2;
1323
if (y_up < y_down) {
1324
height = y_down - y_up + 2;
1327
height = y_up - y_down + 2;
1331
target = XmuClientWindow(display, target);
1332
XGetWindowAttributes(display, target, &jobp->win_attr);
1333
jobp->win_attr.width = width;
1334
jobp->win_attr.height = height;
1336
/* if (target == root) {
1337
printf ("Drag your mouse to select an area on the root window.\n");
1340
if (target != root) {
1341
/* get the real window */
1342
target = XmuClientWindow(display, target);
1344
XGetWindowAttributes(display, target, &jobp->win_attr);
1345
XTranslateCoordinates(display, target, root, 0, 0, &x, &y, &temp);
1348
jobp->win_attr.x = x;
1349
jobp->win_attr.y = y;
1351
/* we must move the panel a little bit, so get the height of
1352
the panel to adjust the y value */
1353
gtk_window_set_gravity( GTK_WINDOW(window1), GDK_GRAVITY_STATIC );
1354
// gtk_window_get_position ( GTK_WINDOW (window1), &x, &y);
1355
gtk_window_get_size( GTK_WINDOW(window1), &pwidth, &pheight);
1357
/* add the space between the panel and the frame */
1358
// FIXME: find out how to determine real title bar height, if possible
1359
// this is just to get the main control out of the way, because
1360
// if we have the frame locked, the move will trigger the move callback
1361
// however, this will not leave the selection at the right coordinates
1362
// because we're not moving the control enough, because we don*t know
1363
// the height of the title bar ...
1365
pheight = pheight + FRAME_OFFSET;
1366
if (IsFrameLocked()) {
1367
gtk_window_move(GTK_WINDOW(window1), x, y - pheight);
1370
if (jobp->flags & FLG_RUN_VERBOSE) {
1371
printf("Original Selection geometry: %dx%d+%d+%d\n",
1372
jobp->win_attr.width, jobp->win_attr.height, x, y);
1374
#ifdef HAVE_LIBAVCODEC
1375
#ifdef HAVE_LIBAVFORMAT
1377
* make sure we have even width and height for ffmpeg
1379
if (jobp->target >= CAP_FFM) {
1380
Boolean changed = FALSE;
1383
if ((jobp->win_attr.width % 2) > 0 ) {
1384
jobp->win_attr.width--;
1387
if ((jobp->win_attr.height % 2) > 0) {
1388
jobp->win_attr.height--;
1391
if ( jobp->win_attr.width < 20 ) {
1392
jobp->win_attr.width = 20;
1395
if ( jobp->win_attr.height < 20 ) {
1396
jobp->win_attr.height = 20;
1401
if (jobp->flags & FLG_RUN_VERBOSE) {
1402
printf("Modified Selection geometry: %dx%d+%d+%d\n",
1403
jobp->win_attr.width, jobp->win_attr.height, x, y);
1409
GtkChangeFrame(x, y, jobp->win_attr.width, jobp->win_attr.height, FALSE);
1411
jobp->ncolors = GetColors(display, &jobp->win_attr, &jobp->colors);
1412
if (jobp->get_colors) {
1413
if (jobp->color_table)
1414
free(jobp->color_table);
1415
jobp->color_table = (*jobp->get_colors)(jobp->colors, jobp->ncolors);
1417
if (jobp->flags & FLG_RUN_VERBOSE) {
1418
fprintf(stderr, "color_table first entry: 0x%.8X\n", *(u_int32_t*)jobp->color_table);
1420
job_set_save_function(jobp->win_attr.visual, jobp->target, jobp);
1422
printf("new visual: %d\n", jobp->win_attr.visual->class);
1425
gtk_toggle_button_set_active(togglebutton, FALSE);
1429
on_MI_animate_activate(GtkButton *button, gpointer user_data) {
1430
char file[PATH_MAX+1], buff[PATH_MAX*2+1], *p;
1431
char *cmd = (char *) user_data;
1438
sscanf(p, "%dd", &n);
1453
sprintf(buff, cmd, file, jobp->time_per_frame);
1454
if (jobp->flags & FLG_RUN_VERBOSE);
1455
printf("calling: '%s'\n", buff);
1461
on_edit_clicked(GtkButton *button, gpointer user_data) {
1462
char cmd[PATH_MAX*2+4];
1463
char buf[PATH_MAX+1];
1466
if (jobp->pic_no < 1)
1469
n = jobp->pic_no - 1;
1471
sprintf(buf, jobp->file, n);
1472
sprintf(cmd, (char*)user_data, buf);
1473
if (jobp->flags & FLG_RUN_VERBOSE)
1474
printf("calling: '%s'\n", cmd);
1480
void position_popup_menu (GtkMenu *menu, gint *x, gint *y,
1481
gboolean *push_in, gpointer user_data) {
1483
int pwidth = 0, pheight = 0, px = 0, py = 0, tx = 0, ty = 0;
1486
w = GTK_WIDGET(filename);
1487
pheight = w->allocation.height;
1489
while ( ( GTK_WIDGET_FLAGS(w) & GTK_TOPLEVEL ) == 0 ) {
1490
// printf("widget name: %s\n", gtk_widget_get_name(w) );
1491
px = w->allocation.x;
1492
py = w->allocation.y;
1495
w = gtk_widget_get_parent(w);
1498
gtk_window_get_position( GTK_WINDOW(w), &px, &py);
1506
// this pops up the menu on right click on filename button
1507
static gint menu_popup( GtkWidget *widget,
1510
gboolean is_sensitive;
1512
GdkEventButton *bevent = (GdkEventButton *) event;
1513
g_object_get((gpointer) MI_file_menu, (gchar*) "sensitive", &is_sensitive, NULL);
1514
if (bevent->button == (guint) 3 && is_sensitive == TRUE ) {
1515
gtk_menu_popup (GTK_MENU (widget), NULL, NULL, position_popup_menu, NULL,
1516
bevent->button, bevent->time);
1517
/* Tell calling code that we have handled this event; the buck
1521
/* Tell calling code that we have not handled this event; pass it on. */
1525
// this handles the shortcut keybindings for the menu
1526
static gint window_key_pressed( GtkWidget *widget,
1529
gboolean is_sensitive;
1531
GdkEventKey *kevent = (GdkEventKey *) event;
1532
// printf("keyval: %i - mods: %i\n", kevent->keyval, kevent->state);
1534
g_object_get((gpointer) MI_file_menu, (gchar*) "sensitive", &is_sensitive, NULL);
1536
if (kevent->keyval == 112 && kevent->state == 4 && is_sensitive == TRUE ) {
1537
gtk_menu_item_activate(GTK_MENU_ITEM(MI_preferences));
1539
} else if (kevent->keyval == 113 && kevent->state == 4 && is_sensitive == TRUE ) {
1540
gtk_menu_item_activate(GTK_MENU_ITEM(MI_quit1));
1543
/* Tell calling code that we have not handled this event; pass it on. */
1553
create_window1(char *param_animate_cmd, char *param_mkvideo_cmd,
1554
char *param_edit_cmd, char *param_help_cmd) {
1556
GtkAccelGroup *accel_group;
1558
tooltips = gtk_tooltips_new ();
1559
accel_group = gtk_accel_group_new ();
1561
window1 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1562
gtk_window_set_title(GTK_WINDOW(window1), _("video capture"));
1563
gtk_window_set_resizable(GTK_WINDOW(window1), FALSE);
1565
hbox1 = gtk_hbox_new(FALSE, 0);
1566
gtk_widget_show(hbox1);
1567
gtk_container_add(GTK_CONTAINER(window1), hbox1);
1569
menubar1 = gtk_menu_bar_new();
1570
gtk_widget_show(menubar1);
1571
gtk_box_pack_start(GTK_BOX(hbox1), menubar1, FALSE, FALSE, 0);
1573
MI_file = gtk_menu_item_new_with_mnemonic(_("_File"));
1574
gtk_widget_show(MI_file);
1575
gtk_container_add(GTK_CONTAINER(menubar1), MI_file);
1577
MI_file_menu = gtk_menu_new();
1578
// gtk_menu_item_set_submenu(GTK_MENU_ITEM(MI_file), MI_file_menu);
1580
MI_preferences = gtk_image_menu_item_new_with_mnemonic(_("_Preferences"));
1581
gtk_widget_show(MI_preferences);
1582
gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_preferences);
1583
gtk_widget_add_accelerator (MI_preferences, "activate", accel_group,
1584
GDK_p, GDK_CONTROL_MASK,
1587
image32 = gtk_image_new_from_stock("gtk-preferences", GTK_ICON_SIZE_MENU);
1588
gtk_widget_show(image32);
1589
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_preferences), image32);
1591
MI_prefs_save = gtk_image_menu_item_new_with_mnemonic(_("_Save Preferences"));
1592
gtk_widget_show(MI_prefs_save);
1593
gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_prefs_save);
1595
image36 = gtk_image_new_from_stock("gtk-floppy", GTK_ICON_SIZE_MENU);
1596
gtk_widget_show(image36);
1597
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_prefs_save), image36);
1599
MI_continue = gtk_check_menu_item_new_with_mnemonic(_("Auto_continue (y/n)"));
1600
gtk_widget_show(MI_continue);
1601
gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_continue);
1603
separatormenuitem2 = gtk_menu_item_new();
1604
gtk_widget_show(separatormenuitem2);
1605
gtk_container_add(GTK_CONTAINER(MI_file_menu), separatormenuitem2);
1606
gtk_widget_set_sensitive(separatormenuitem2, FALSE);
1608
MI_make_video = gtk_image_menu_item_new_with_mnemonic(_("_Make Video"));
1609
gtk_widget_show(MI_make_video);
1610
gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_make_video);
1612
image33 = gtk_image_new_from_stock("gtk-execute", GTK_ICON_SIZE_MENU);
1613
gtk_widget_show(image33);
1614
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_make_video), image33);
1616
MI_animate = gtk_image_menu_item_new_with_mnemonic(_("_Animate"));
1617
gtk_widget_show(MI_animate);
1618
gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_animate);
1619
// gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_animate), image33);
1621
/* tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, animate_icon, FALSE, NULL) );
1622
animate = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1623
GTK_TOOLBAR_CHILD_BUTTON,
1626
_("Make animated GIF of captured individual frames"), NULL,
1627
tmp_toolbar_icon, NULL, NULL);
1628
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1629
gtk_widget_show(animate); */
1631
MI_help = gtk_image_menu_item_new_with_mnemonic(_("_Help"));
1632
gtk_widget_show(MI_help);
1633
gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_help);
1635
image34 = gtk_image_new_from_stock("gtk-help", GTK_ICON_SIZE_MENU);
1636
gtk_widget_show(image34);
1637
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_help), image34);
1639
separatormenuitem1 = gtk_menu_item_new();
1640
gtk_widget_show(separatormenuitem1);
1641
gtk_container_add(GTK_CONTAINER(MI_file_menu), separatormenuitem1);
1642
gtk_widget_set_sensitive(separatormenuitem1, FALSE);
1644
MI_quit1 = gtk_image_menu_item_new_with_mnemonic(_("_Quit"));
1645
gtk_widget_show(MI_quit1);
1646
gtk_container_add(GTK_CONTAINER(MI_file_menu), MI_quit1);
1647
gtk_widget_add_accelerator (MI_quit1, "activate", accel_group,
1648
GDK_q, GDK_CONTROL_MASK,
1651
image35 = gtk_image_new_from_stock("gtk-quit", GTK_ICON_SIZE_MENU);
1652
gtk_widget_show(image35);
1653
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(MI_quit1), image35);
1655
toolbar2 = gtk_toolbar_new();
1656
gtk_widget_show(toolbar2);
1657
gtk_box_pack_start(GTK_BOX(hbox1), toolbar2, FALSE, FALSE, 0);
1658
gtk_toolbar_set_style(GTK_TOOLBAR(toolbar2), GTK_TOOLBAR_TEXT);
1660
filename = gtk_button_new_with_label(_("filename"));
1661
gtk_button_set_use_underline(GTK_BUTTON(filename), FALSE);
1662
g_object_set((gpointer) filename, (gchar*) "can-focus", (gboolean) FALSE, NULL);
1663
gtk_widget_show(filename);
1664
// gtk_box_pack_start(GTK_BOX(hbox1), filename, FALSE, FALSE, 0);
1665
gtk_widget_set_size_request(filename, 130, -1);
1666
gtk_tooltips_set_tip (tooltips, filename, _ ("Reset frame counter and filename"), NULL);
1667
gtk_toolbar_insert_widget (GTK_TOOLBAR (toolbar2), filename,
1668
"Reset frame counter and filename", "Reset frame counter and filename", 0);
1670
frame_drop_meter = led_meter_new ();
1671
gtk_widget_show(frame_drop_meter);
1672
gtk_box_pack_start(GTK_BOX(hbox1), frame_drop_meter, FALSE, FALSE, 0);
1673
led_meter_set_tip(LED_METER(frame_drop_meter), "Monitor current frame rate\nyellow = 10-50 % too slow\nred = 50+ % too slow");
1675
toolbar3 = gtk_toolbar_new();
1676
gtk_widget_show(toolbar3);
1677
gtk_box_pack_start(GTK_BOX(hbox1), toolbar3, FALSE, FALSE, 0);
1678
gtk_toolbar_set_style(GTK_TOOLBAR(toolbar3), GTK_TOOLBAR_ICONS);
1680
//tmp_toolbar_icon = create_pixmap(window1, "stop.png");
1681
tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, stop_icon, FALSE, NULL) );
1682
stop = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1683
GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1686
_("Stop recording"), NULL,
1687
tmp_toolbar_icon, NULL, NULL);
1688
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1689
// gtk_widget_set_sensitive(stop, FALSE);
1690
gtk_widget_show(stop);
1691
// gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(stop), TRUE);
1693
//tmp_toolbar_icon = create_pixmap(window1, "pause.png");
1694
tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, pause_icon, FALSE, NULL) );
1695
pause_tb = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1696
GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1699
_("Pause recording"), NULL,
1700
tmp_toolbar_icon, NULL, NULL);
1701
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1702
gtk_widget_show(pause_tb);
1703
// gtk_widget_set_sensitive(pause_tb, FALSE);
1705
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar3));
1707
//tmp_toolbar_icon = create_pixmap(window1, "record_on.png");
1708
tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, record_on_icon, FALSE, NULL) );
1709
record = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1710
GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1713
_("Start recording"), NULL,
1714
tmp_toolbar_icon, NULL, NULL);
1715
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1716
gtk_widget_show(record);
1718
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar3));
1720
//tmp_toolbar_icon = create_pixmap(window1, "step.png");
1721
tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, step_icon, FALSE, NULL) );
1722
step = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1723
GTK_TOOLBAR_CHILD_BUTTON,
1725
_("Capture single frame"),
1726
_("Capture single frame"), NULL,
1727
tmp_toolbar_icon, NULL, NULL);
1728
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1729
gtk_widget_show(step);
1730
gtk_widget_set_sensitive(step, FALSE);
1732
//tmp_toolbar_icon = create_pixmap(window1, "prev.png");
1733
tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, prev_icon, FALSE, NULL) );
1734
previous = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1735
GTK_TOOLBAR_CHILD_BUTTON,
1737
_("Move cursor back one frame"),
1738
_("Move cursor back one frame"), NULL,
1739
tmp_toolbar_icon, NULL, NULL);
1740
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1741
gtk_widget_show(previous);
1743
//tmp_toolbar_icon = create_pixmap(window1, "next.png");
1744
tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, next_icon, FALSE, NULL) );
1745
next = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1746
GTK_TOOLBAR_CHILD_BUTTON,
1748
_("Move cursor to next frame"),
1749
_("Move cursor to next frame"), NULL,
1750
tmp_toolbar_icon, NULL, NULL);
1751
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1752
gtk_widget_show(next);
1754
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar3));
1756
//tmp_toolbar_icon = create_pixmap(window1, "move.png");
1757
tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, move_icon, FALSE, NULL) );
1758
move = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1759
GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1761
_("Sticky Selection"),
1762
_("Detach selection frame"), NULL,
1763
tmp_toolbar_icon, NULL, NULL);
1764
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1765
gtk_widget_show(move);
1766
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(move), TRUE);
1768
//tmp_toolbar_icon = create_pixmap(window1, "select.png");
1769
tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, select_icon, FALSE, NULL) );
1770
select_tb = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1771
GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
1773
_("Modify Selection"),
1774
_("Select rectangular area to capture"), NULL,
1775
tmp_toolbar_icon, NULL, NULL);
1776
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1777
gtk_widget_show(select_tb);
1779
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar3));
1781
//tmp_toolbar_icon = create_pixmap(window1, "animate.png");
1782
/* tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, animate_icon, FALSE, NULL) );
1783
animate = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1784
GTK_TOOLBAR_CHILD_BUTTON,
1787
_("Make animated GIF of captured individual frames"), NULL,
1788
tmp_toolbar_icon, NULL, NULL);
1789
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1790
gtk_widget_show(animate); */
1792
//tmp_toolbar_icon = create_pixmap(window1, "edit.png");
1793
tmp_toolbar_icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_inline(-1, edit_icon, FALSE, NULL) );
1794
edit = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar3),
1795
GTK_TOOLBAR_CHILD_BUTTON,
1798
_("Edit current individual frame"), NULL,
1799
tmp_toolbar_icon, NULL, NULL);
1800
gtk_label_set_use_underline(GTK_LABEL(((GtkToolbarChild*) (g_list_last(GTK_TOOLBAR(toolbar3)->children)->data))->label), TRUE);
1801
gtk_widget_show(edit);
1803
g_signal_connect((gpointer) window1, "delete_event",
1804
G_CALLBACK(on_window1_delete_event),
1806
g_signal_connect((gpointer) window1, "destroy",
1807
G_CALLBACK(on_window1_destroy),
1809
g_signal_connect_swapped (G_OBJECT (window1), "key_press_event",
1810
G_CALLBACK (window_key_pressed),
1812
g_signal_connect((gpointer) MI_preferences, "activate",
1813
G_CALLBACK(on_MI_preferences_activate),
1815
g_signal_connect((gpointer) MI_prefs_save, "activate",
1816
G_CALLBACK(on_MI_prefs_save_activate),
1818
g_signal_connect((gpointer) MI_continue, "activate",
1819
G_CALLBACK(on_MI_continue_activate),
1821
g_signal_connect((gpointer) MI_make_video, "activate",
1822
G_CALLBACK(on_MI_make_video_activate),
1824
g_signal_connect((gpointer) MI_animate, "activate",
1825
G_CALLBACK(on_MI_animate_activate),
1827
g_signal_connect((gpointer) MI_help, "activate",
1828
G_CALLBACK(on_MI_help_activate),
1830
g_signal_connect((gpointer) MI_quit1, "activate",
1831
G_CALLBACK(on_MI_quit1_activate),
1833
g_signal_connect((gpointer) stop, "toggled",
1834
G_CALLBACK(on_stop_toggled),
1836
g_signal_connect((gpointer) pause_tb, "toggled",
1837
G_CALLBACK(on_pause_toggled),
1839
g_signal_connect((gpointer) record, "toggled",
1840
G_CALLBACK(on_record_toggled),
1842
g_signal_connect((gpointer) record, "activate",
1843
G_CALLBACK(on_record_toggled),
1845
g_signal_connect((gpointer) step, "clicked",
1846
G_CALLBACK(on_step_clicked),
1848
g_signal_connect((gpointer) filename, "clicked",
1849
G_CALLBACK(on_filename_clicked),
1851
g_signal_connect_swapped (G_OBJECT (filename), "button_press_event",
1852
G_CALLBACK (menu_popup),
1853
G_OBJECT (MI_file_menu));
1854
g_signal_connect((gpointer) previous, "clicked",
1855
G_CALLBACK(on_previous_clicked),
1857
g_signal_connect((gpointer) next, "clicked",
1858
G_CALLBACK(on_next_clicked),
1860
g_signal_connect((gpointer) move, "toggled",
1861
G_CALLBACK(on_move_toggled),
1863
g_signal_connect((gpointer) select_tb, "toggled",
1864
G_CALLBACK(on_select_toggled),
1866
/* g_signal_connect((gpointer) animate, "clicked",
1867
G_CALLBACK(on_animate_clicked),
1868
param_animate_cmd); */
1869
g_signal_connect((gpointer) edit, "clicked",
1870
G_CALLBACK(on_edit_clicked),
1873
/* Store pointers to all widgets, for use by lookup_widget(). */
1874
GLADE_HOOKUP_OBJECT_NO_REF(window1, window1, "window1");
1875
GLADE_HOOKUP_OBJECT(window1, hbox1, "hbox1");
1876
/* GLADE_HOOKUP_OBJECT(window1, menubar1, "menubar1");
1877
GLADE_HOOKUP_OBJECT(window1, MI_file, "MI_file"); */
1878
GLADE_HOOKUP_OBJECT(window1, MI_file_menu, "MI_file_menu");
1879
GLADE_HOOKUP_OBJECT(window1, MI_preferences, "MI_preferences");
1880
GLADE_HOOKUP_OBJECT(window1, image32, "image32");
1881
GLADE_HOOKUP_OBJECT(window1, MI_prefs_save, "MI_prefs_save");
1882
GLADE_HOOKUP_OBJECT(window1, MI_continue, "MI_continue");
1883
GLADE_HOOKUP_OBJECT(window1, image36, "image36");
1884
GLADE_HOOKUP_OBJECT(window1, MI_make_video, "MI_make_video");
1885
GLADE_HOOKUP_OBJECT(window1, MI_animate, "MI_animate");
1886
GLADE_HOOKUP_OBJECT(window1, image33, "image33");
1887
GLADE_HOOKUP_OBJECT(window1, MI_help, "MI_help");
1888
GLADE_HOOKUP_OBJECT(window1, image34, "image34");
1889
GLADE_HOOKUP_OBJECT(window1, separatormenuitem1, "separatormenuitem1");
1890
GLADE_HOOKUP_OBJECT(window1, separatormenuitem2, "separatormenuitem2");
1891
GLADE_HOOKUP_OBJECT(window1, MI_quit1, "MI_quit1");
1892
GLADE_HOOKUP_OBJECT(window1, image35, "image35");
1893
GLADE_HOOKUP_OBJECT(window1, filename, "filename");
1894
GLADE_HOOKUP_OBJECT(window1, toolbar3, "toolbar3");
1895
GLADE_HOOKUP_OBJECT(window1, stop, "stop");
1896
GLADE_HOOKUP_OBJECT(window1, pause_tb, "pause");
1897
GLADE_HOOKUP_OBJECT(window1, record, "record");
1898
GLADE_HOOKUP_OBJECT(window1, step, "step");
1899
GLADE_HOOKUP_OBJECT(window1, previous, "previous");
1900
GLADE_HOOKUP_OBJECT(window1, next, "next");
1901
GLADE_HOOKUP_OBJECT(window1, move, "move");
1902
GLADE_HOOKUP_OBJECT(window1, select_tb, "select");
1903
GLADE_HOOKUP_OBJECT(window1, frame_drop_meter, "frame_drop_meter");
1904
// GLADE_HOOKUP_OBJECT(window1, animate, "animate");
1905
GLADE_HOOKUP_OBJECT(window1, edit, "edit");
1911
InitGTKControl(AppData *app) {
1913
Window root, topwin;
1916
int param_codec, compress;
1917
float param_fps, param_max_time;
1918
int param_max_frames, start_at_no, step, param_quality, mouseWanted;
1920
int rate, size, channels, flags, bpp;
1921
char *param_animate_cmd, *param_mkvideo_cmd, *param_edit_cmd, *param_help_cmd;
1922
extern XVC_frame_lock;
1925
param_file = app->file;
1926
param_codec = app->targetCodec;
1927
compress = app->compress;
1928
param_fps = app->fps;
1929
param_max_time = app->time;
1930
param_max_frames = app->frames;
1931
start_at_no = app->start_no;
1933
param_quality = app->quality;
1934
mouseWanted = app->mouseWanted;
1937
rate = app->sndrate;
1938
size = app->sndsize;
1939
channels = app->sndchannels;
1942
param_animate_cmd = app->play_cmd;
1943
param_mkvideo_cmd = app->video_cmd;
1944
param_edit_cmd = app->edit_cmd;
1945
param_help_cmd = app->help_cmd;
1947
// xvidcap specific initialization
1948
// this is taken from control.c's CreateControl, but I don't want this
1949
// stuff in create_window (for parts can't put it there)
1951
if ( app->cap_pos_x >= 0 || app->cap_pos_y >=0 ) {
1952
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(move), FALSE);
1956
if (! ( flags & FLG_NOGUI ) ) {
1957
mydisplay = GDK_DRAWABLE_XDISPLAY( GTK_WIDGET(window1)->window );
1959
mydisplay = XOpenDisplay(NULL);
1961
root = RootWindow(mydisplay, DefaultScreen(mydisplay));
1963
jobp = job_init(flags);
1965
jobp->area = GetArea();
1968
if (!XGetWindowAttributes(mydisplay, root, &jobp->win_attr))
1969
perror("Can't get window attributes!\n");
1970
// the default is to use the colormap of the root window
1971
jobp->ncolors = GetColors(mydisplay, &jobp->win_attr, &jobp->colors);
1973
/* find capture function */
1976
/* set frames per second */
1977
job_set_fps(param_fps);
1979
/* jpeg quality parameter */
1980
job_set_quality(param_quality);
1982
/* png compression */
1983
job_set_compression(compress);
1985
#ifdef HAVE_FFMPEG_AUDIO
1986
/* initialize sound recording parameters */
1987
job_set_sound_dev(snd, rate, size, channels);
1988
#endif // HAVE_FFMPEG_AUDIO
1990
jobp->targetCodec = param_codec;
1991
jobp->mouseWanted = mouseWanted;
1993
jobp->max_time = param_max_time;
1994
jobp->max_frames = param_max_frames;
1995
jobp->start_no = start_at_no;
1996
jobp->pic_no = start_at_no;
1998
jobp->video_dev = dev;
2001
if (jobp->get_colors)
2002
jobp->color_table = (*jobp->get_colors)(jobp->colors, jobp->ncolors);
2005
job_set_file(param_file);
2006
// unset autocontinue unless we capture to movie and file is mutable
2007
if ( jobp->flags & FLG_AUTO_CONTINUE && ( (! is_filename_mutable(jobp->file)) ||
2008
(jobp->flags & FLG_MULTI_IMAGE) == 0 ) ) {
2009
jobp->flags &= ~FLG_AUTO_CONTINUE;
2010
printf("Output not a video file or no counter in filename\nDisabling autocontinue!\n");
2012
if ( jobp->flags & FLG_MULTI_IMAGE ) {
2013
if ( jobp->flags & FLG_AUTO_CONTINUE ) {
2014
gtk_widget_set_sensitive(GTK_WIDGET(MI_continue), TRUE);
2015
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(MI_continue), TRUE);
2017
if ( is_filename_mutable(jobp->file)) {
2018
gtk_widget_set_sensitive(GTK_WIDGET(MI_continue), TRUE);
2019
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(MI_continue), FALSE);
2021
gtk_widget_set_sensitive(GTK_WIDGET(MI_continue), FALSE);
2022
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(MI_continue), FALSE);
2026
gtk_widget_set_sensitive(GTK_WIDGET(MI_continue), FALSE);
2027
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(MI_continue), FALSE);
2031
// set output handler (xto... .c)
2032
job_set_save_function(jobp->win_attr.visual, jobp->target, jobp);
2033
GtkChangeLabel(jobp->pic_no);
2035
#ifdef HAVE_LIBAVCODEC
2036
#ifdef HAVE_LIBAVFORMAT
2038
* make sure we have even width and height for ffmpeg
2040
if (jobp->target >= CAP_FFM) {
2041
Boolean changed = FALSE;
2043
if (jobp->flags & FLG_RUN_VERBOSE) {
2044
fprintf(stderr, "control.InitControl(): Original dimensions: %i * %i\n", jobp->area->width, jobp->area->height);
2046
if ((jobp->area->width % 2) > 0 ) {
2047
jobp->area->width--;
2050
if ((jobp->area->height % 2) > 0) {
2051
jobp->area->height--;
2054
if ( jobp->win_attr.width < 26 ) {
2055
jobp->win_attr.width = 26;
2058
if ( jobp->win_attr.height < 26 ) {
2059
jobp->win_attr.height = 26;
2064
GtkChangeFrame(jobp->area->x, jobp->area->y, jobp->area->width, jobp->area->height, FALSE);
2065
if (jobp->flags & FLG_RUN_VERBOSE) {
2066
fprintf(stderr, "control.InitControl(): Modified dimensions: %i * %i\n", jobp->area->width, jobp->area->height);
2073
/* previous and next buttons have different meanings for on-the-fly encoding
2074
* and individual frame capture ... this sets the tooltips accordingly */
2075
if (( jobp->flags & FLG_MULTI_IMAGE ) == 0 ) {
2076
gtk_tooltips_set_tip (tooltips, previous, "Move cursor back one frame",
2077
"Move cursor back one frame");
2078
gtk_tooltips_set_tip (tooltips, next, "Move cursor to next frame",
2079
"Move cursor to next frame");
2080
gtk_tooltips_set_tip (tooltips, filename,
2081
"Left Click: Reset frame counter and filename\nRight Click: Popup Menu",
2082
"Left Click: Reset frame counter and filename\nRight Click: Popup Menu");
2083
if (jobp->pic_no >= jobp->step ) gtk_widget_set_sensitive(previous, TRUE);
2084
else gtk_widget_set_sensitive(previous, FALSE);
2086
if ( is_filename_mutable(jobp->file) ) {
2087
gtk_widget_set_sensitive(next, TRUE);
2088
if (jobp->movie_no > 0 ) gtk_widget_set_sensitive(previous, TRUE);
2089
else gtk_widget_set_sensitive(previous, FALSE);
2091
gtk_widget_set_sensitive(next, FALSE);
2092
gtk_widget_set_sensitive(previous, FALSE);
2094
gtk_tooltips_set_tip (tooltips, previous, "Move cursor to previous movie",
2095
"Move cursor to previous movie");
2096
gtk_tooltips_set_tip (tooltips, next, "Move cursor to next movie",
2097
"Move cursor to next movie");
2098
gtk_tooltips_set_tip (tooltips, filename,
2099
"Left Click: Reset movie counter to zero\nRight Click: Popup Menu",
2100
"Left Click: Reset movie counter to zero\nRight Click: Popup Menu");
2103
/* If we run without GUI, we autostart the recording */
2104
if ( jobp->flags & FLG_NOGUI ) {
2105
XCloseDisplay(mydisplay);
2106
gtk_init_add( (GtkFunction) start_recording_nongui_stuff, jobp );
2109
// register key_snooper for shortcuts ...
2110
// gtk_key_snooper_install(keySnooper, NULL);