~ubuntu-branches/ubuntu/hardy/vice/hardy

« back to all changes in this revision

Viewing changes to src/arch/unix/gui/uicommands.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2007-10-07 07:05:46 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071007070546-81yy0twlka7p2t0e
Tags: 1.22-1
* New upstream version (closes: #428280).
* Correct link to HTML documentation in manpage (closes: #409567).
* Fix most packaging mistakes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
{
144
144
    const char *bcommand = NULL;
145
145
 
146
 
    resources_get_value("HTMLBrowserCommand", (void *)&bcommand);
 
146
    resources_get_string("HTMLBrowserCommand", &bcommand);
147
147
 
148
148
    if (bcommand == NULL ||
149
149
        *bcommand == '\0') {
153
153
#define BROWSE_CMD_BUF_MAX 16384
154
154
        char buf[BROWSE_CMD_BUF_MAX];
155
155
 
156
 
#ifdef MACOSX_SUPPORT
 
156
#ifdef MACOSX_BUNDLE
157
157
        /* On Macs the manual path is relative to the bundle. */
158
158
        const char *boot_path;
159
159
        boot_path = archdep_boot_path();
160
160
        char *manual_path;
161
 
        manual_path = util_concat(boot_path,"/../Resources/doc/vice_toc.html",NULL);
 
161
        manual_path = util_concat(boot_path,"/../doc/vice_toc.html",NULL);
162
162
#else
163
163
        static const char manual_path[] = DOCDIR "/vice_toc.html";
164
164
#endif
220
220
        if (system(buf) != 0)
221
221
            ui_error(_("Cannot run HTML browser."));
222
222
            
223
 
#ifdef MACOSX_SUPPORT
 
223
#ifdef MACOSX_BUNDLE
224
224
        lib_free(manual_path);
225
225
#endif
226
226
    }
308
308
{
309
309
    if (data) {
310
310
        /* quick snapshot, save ROMs & disks (??) */
311
 
        log_debug(_("Quicksaving file %s."), (char *)data);
 
311
        log_debug("Quicksaving file %s.", (char *)data);
312
312
        if (machine_write_snapshot(data, 1, 1, 0) < 0) {
313
313
            ui_error(_("Cannot write snapshot file\n`%s'\n"), data);
314
314
        }
351
351
        if (!is_dir)
352
352
            ui_error(_("Directory not found"));
353
353
        else
354
 
            resources_set_value("EventSnapshotDir", (resource_value_t)wd);
 
354
            resources_set_string("EventSnapshotDir", wd);
355
355
    }
356
356
    lib_free(wd);
357
357
    
387
387
    event_record_reset_milestone();
388
388
}
389
389
 
390
 
static UI_CALLBACK(sound_record)
 
390
static void sound_record_stop(void)
 
391
{
 
392
    resources_set_string("SoundRecordDeviceName", "");
 
393
    ui_display_statustext(_("Sound Recording stopped..."),10);
 
394
}
 
395
 
 
396
static void sound_record_start(char *format, char *extension)
391
397
{
392
398
    ui_button_t button;
393
399
    char *s;
394
 
    const char *devicename;
395
400
 
396
401
    vsync_suspend_speed_eval();
397
402
 
398
 
    resources_get_value("SoundRecordDeviceName",(void *) &devicename);
399
 
    if (devicename && !strcmp(devicename,"wav")) {
400
 
        /* the recording is active; stop it  */
401
 
        resources_set_value("SoundRecordDeviceName", "");
402
 
/*        ui_display_statustext("");*/
403
 
    } else {
404
 
        s = ui_select_file(_("Record sound to file"), NULL, 0, False, NULL,
405
 
                              "*.wav", &button, False, NULL);
406
 
        if (button == UI_BUTTON_OK && s != NULL) {
407
 
            util_add_extension(&s, "wav");
408
 
            resources_set_value("SoundRecordDeviceArg", s);
409
 
            resources_set_value("SoundRecordDeviceName", "wav");
410
 
            resources_set_value("Sound", (resource_value_t)1);
411
 
            lib_free(s);
412
 
/*            ui_display_statustext("Recording wav...");*/
413
 
        }
 
403
    resources_set_string("SoundRecordDeviceName", "");
 
404
    s = ui_select_file(_("Record sound to file"), NULL, 0, False, NULL,
 
405
                              extension, &button, False, NULL);
 
406
    if (button == UI_BUTTON_OK && s != NULL)
 
407
    {
 
408
        util_add_extension(&s, format);
 
409
        resources_set_string("SoundRecordDeviceArg", s);
 
410
        resources_set_string("SoundRecordDeviceName", format);
 
411
        resources_set_int("Sound", 1);
 
412
        lib_free(s);
 
413
        ui_display_statustext(_("Sound Recording started..."),10);
414
414
    }
415
415
}
416
416
 
 
417
static UI_CALLBACK(sound_record_wav)
 
418
{
 
419
    sound_record_start("wav","*.wav");
 
420
}
 
421
 
 
422
static UI_CALLBACK(sound_record_voc)
 
423
{
 
424
    sound_record_start("voc","*.voc");
 
425
}
 
426
 
 
427
static UI_CALLBACK(sound_record_iff)
 
428
{
 
429
    sound_record_start("iff","*.iff");
 
430
}
 
431
 
 
432
static UI_CALLBACK(sound_record_aiff)
 
433
{
 
434
    sound_record_start("aiff","*.aiff");
 
435
}
 
436
 
 
437
#ifdef USE_LAMEMP3
 
438
static UI_CALLBACK(sound_record_mp3)
 
439
{
 
440
    sound_record_start("mp3","*.mp3");
 
441
}
 
442
#endif
 
443
 
417
444
/* ------------------------------------------------------------------------- */
418
445
 
419
446
static ui_menu_entry_t reset_submenu[] = {
502
529
};
503
530
 
504
531
ui_menu_entry_t ui_sound_record_commands_menu[] = {
505
 
    { N_("Sound record..."),
506
 
      (ui_callback_t)sound_record, NULL, NULL,
507
 
      XK_r, UI_HOTMOD_META },
 
532
    { N_("Sound record WAV..."),
 
533
      (ui_callback_t)sound_record_wav, NULL, NULL },
 
534
    { N_("Sound record AIFF..."),
 
535
      (ui_callback_t)sound_record_aiff, NULL, NULL },
 
536
    { N_("Sound record VOC..."),
 
537
      (ui_callback_t)sound_record_voc, NULL, NULL },
 
538
    { N_("Sound record IFF..."),
 
539
      (ui_callback_t)sound_record_iff, NULL, NULL },
 
540
#ifdef USE_LAMEMP3
 
541
    { N_("Sound record MP3..."),
 
542
      (ui_callback_t)sound_record_mp3, NULL, NULL },
 
543
#endif
 
544
    { N_("Stop Sound record"),
 
545
      (ui_callback_t)sound_record_stop, NULL, NULL },
508
546
    { NULL }
509
547
};
510
548