328 |
|
log = fopen("log", "w"); |
329 |
|
#endif |
330 |
|
|
331 |
– |
// Init X11 |
332 |
– |
XtAppContext app_context; |
333 |
– |
app_shell = XtAppInitialize(&app_context, "mintv", NULL, 0, &argc, argv, NULL, NULL, 0); |
334 |
– |
dpy = XtDisplay(app_shell); |
335 |
– |
XtAppAddActions(app_context,actionTable, sizeof(actionTable) / sizeof(XtActionsRec)); |
336 |
– |
XtOverrideTranslations(app_shell, XtParseTranslationTable( |
337 |
– |
"<Message>WM_PROTOCOLS: quit()\n" |
338 |
– |
"<Key>q: quit()\n" |
339 |
– |
"<Key>1: select_channel_1()\n" |
340 |
– |
"<Key>2: select_channel_2()\n" |
341 |
– |
"<Key>KP_7: inc_brightness()\n" |
342 |
– |
"<Key>KP_4: reset_brightness()\n" |
343 |
– |
"<Key>KP_1: dec_brightness()\n" |
344 |
– |
"<Key>KP_8: inc_contrast()\n" |
345 |
– |
"<Key>KP_5: reset_contrast()\n" |
346 |
– |
"<Key>KP_2: dec_contrast()\n" |
347 |
– |
"<Key>KP_9: inc_color()\n" |
348 |
– |
"<Key>KP_6: reset_color()\n" |
349 |
– |
"<Key>KP_3: dec_color()" |
350 |
– |
)); |
351 |
– |
XtAddEventHandler(app_shell, StructureNotifyMask, True, resize_event, NULL); |
352 |
– |
wm = XInternAtom(XtDisplay(app_shell), "WM_DELETE_WINDOW", False); |
353 |
– |
|
331 |
|
// Parse options |
332 |
|
for (;;) { |
333 |
|
int c; |
346 |
|
case 'h': |
347 |
|
default: |
348 |
|
fprintf(stderr, |
349 |
< |
"50/60Hz video display application\n" |
349 |
> |
"50/60Hz video display application\n\n" |
350 |
|
"Options:\n" |
351 |
|
" -h | --help this text\n" |
352 |
|
" -n | --ntsc NTSC mode\n" |
363 |
|
} |
364 |
|
} |
365 |
|
|
366 |
+ |
// Init X11 |
367 |
+ |
XtAppContext app_context; |
368 |
+ |
app_shell = XtAppInitialize(&app_context, "mintv", NULL, 0, &argc, argv, NULL, NULL, 0); |
369 |
+ |
dpy = XtDisplay(app_shell); |
370 |
+ |
XtAppAddActions(app_context,actionTable, sizeof(actionTable) / sizeof(XtActionsRec)); |
371 |
+ |
XtOverrideTranslations(app_shell, XtParseTranslationTable( |
372 |
+ |
"<Message>WM_PROTOCOLS: quit()\n" |
373 |
+ |
"<Key>q: quit()\n" |
374 |
+ |
"<Key>1: select_channel_1()\n" |
375 |
+ |
"<Key>2: select_channel_2()\n" |
376 |
+ |
"<Key>KP_7: inc_brightness()\n" |
377 |
+ |
"<Key>KP_4: reset_brightness()\n" |
378 |
+ |
"<Key>KP_1: dec_brightness()\n" |
379 |
+ |
"<Key>KP_8: inc_contrast()\n" |
380 |
+ |
"<Key>KP_5: reset_contrast()\n" |
381 |
+ |
"<Key>KP_2: dec_contrast()\n" |
382 |
+ |
"<Key>KP_9: inc_color()\n" |
383 |
+ |
"<Key>KP_6: reset_color()\n" |
384 |
+ |
"<Key>KP_3: dec_color()" |
385 |
+ |
)); |
386 |
+ |
XtAddEventHandler(app_shell, StructureNotifyMask, True, resize_event, NULL); |
387 |
+ |
wm = XInternAtom(XtDisplay(app_shell), "WM_DELETE_WINDOW", False); |
388 |
+ |
|
389 |
|
// Xvideo available? |
390 |
|
unsigned ver, rel, req, ev, err, val; |
391 |
|
if (XvQueryExtension(dpy, &ver, &rel, &req, &ev, &err) != Success) { |