Subversion Repositories filter_foundry

Rev

Rev 492 | Rev 495 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 492 Rev 493
Line 356... Line 356...
356
        case IDCANCEL:
356
        case IDCANCEL:
357
#endif
357
#endif
358
                dispose_preview();
358
                dispose_preview();
359
                return false; // end dialog
359
                return false; // end dialog
360
        case OPENITEM:
360
        case OPENITEM:
-
 
361
        {
-
 
362
                TCHAR filters[3000];
-
 
363
                TCHAR *tmp1, *tmp2;
-
 
364
                size_t len;
-
 
365
 
-
 
366
                memset(&filters[0], 0, sizeof(filters));
-
 
367
                tmp1 = &filters[0];
-
 
368
 
-
 
369
                FF_GetMsg(tmp1, MSG_ALL_SUPPORTED_FILES_ID);
-
 
370
                tmp1 += xstrlen(tmp1);
-
 
371
                len = xstrlen(tmp2 = TEXT(" (*.afs, *.8bf, *.pff, *.prm, *.bin, *.rsrc, *.txt, *.ffx)"));
-
 
372
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
373
                tmp1 += (len + 1);
-
 
374
                len = xstrlen(tmp2 = TEXT("*.afs;*.8bf;*.pff;*.prm;*.bin;*.rsrc;*.txt;*.ffx"));
-
 
375
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
376
                tmp1 += (len + 1);
-
 
377
 
-
 
378
                FF_GetMsg(tmp1, MSG_OPEN_AFS_ID);
-
 
379
                tmp1 += xstrlen(tmp1);
-
 
380
                len = xstrlen(tmp2 = TEXT(" (*.afs)"));
-
 
381
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
382
                tmp1 += (len + 1);
-
 
383
                len = xstrlen(tmp2 = TEXT("*.afs"));
-
 
384
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
385
                tmp1 += (len + 1);
-
 
386
 
-
 
387
                FF_GetMsg(tmp1, MSG_OPEN_TXT_ID);
-
 
388
                tmp1 += xstrlen(tmp1);
-
 
389
                len = xstrlen(tmp2 = TEXT(" (*.txt)"));
-
 
390
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
391
                tmp1 += (len + 1);
-
 
392
                len = xstrlen(tmp2 = TEXT("*.txt"));
-
 
393
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
394
                tmp1 += (len + 1);
-
 
395
 
-
 
396
                FF_GetMsg(tmp1, MSG_OPEN_8BF_ID);
-
 
397
                tmp1 += xstrlen(tmp1);
-
 
398
                len = xstrlen(tmp2 = TEXT(" (*.8bf)"));
-
 
399
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
400
                tmp1 += (len + 1);
-
 
401
                len = xstrlen(tmp2 = TEXT("*.8bf"));
-
 
402
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
403
                tmp1 += (len + 1);
-
 
404
 
-
 
405
                FF_GetMsg(tmp1, MSG_OPEN_PFF_ID);
-
 
406
                tmp1 += xstrlen(tmp1);
-
 
407
                len = xstrlen(tmp2 = TEXT(" (*.pff)"));
-
 
408
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
409
                tmp1 += (len + 1);
-
 
410
                len = xstrlen(tmp2 = TEXT("*.pff"));
-
 
411
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
412
                tmp1 += (len + 1);
-
 
413
 
-
 
414
                FF_GetMsg(tmp1, MSG_OPEN_PRM_ID);
-
 
415
                tmp1 += xstrlen(tmp1);
-
 
416
                len = xstrlen(tmp2 = TEXT(" (*.prm)"));
-
 
417
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
418
                tmp1 += (len + 1);
-
 
419
                len = xstrlen(tmp2 = TEXT("*.prm"));
-
 
420
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
421
                tmp1 += (len + 1);
-
 
422
 
-
 
423
                FF_GetMsg(tmp1, MSG_OPEN_RSRC_ID);
-
 
424
                tmp1 += xstrlen(tmp1);
-
 
425
                len = xstrlen(tmp2 = TEXT(" (*.bin, *.rsrc)"));
-
 
426
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
427
                tmp1 += (len + 1);
-
 
428
                len = xstrlen(tmp2 = TEXT("*.bin;*.rsrc"));
-
 
429
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
430
                tmp1 += (len + 1);
-
 
431
 
-
 
432
                FF_GetMsg(tmp1, MSG_OPEN_FFX_ID);
-
 
433
                tmp1 += xstrlen(tmp1);
-
 
434
                len = xstrlen(tmp2 = TEXT(" (*.ffx)"));
-
 
435
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
436
                tmp1 += (len + 1);
-
 
437
                len = xstrlen(tmp2 = TEXT("*.ffx"));
-
 
438
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
439
                tmp1 += (len + 1);
-
 
440
 
-
 
441
                FF_GetMsg(tmp1, MSG_ALL_FILES_ID);
-
 
442
                tmp1 += xstrlen(tmp1);
-
 
443
                len = xstrlen(tmp2 = TEXT(" (*.*)"));
-
 
444
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
445
                tmp1 += (len + 1);
-
 
446
                len = xstrlen(tmp2 = TEXT("*.*"));
-
 
447
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
448
                tmp1 += (len + 1);
-
 
449
 
361
                if(!gdata->standalone && choosefiletypes(
450
                if (!gdata->standalone && choosefiletypes(
362
                        #ifdef MAC_ENV
451
                #ifdef MAC_ENV
363
                        (StringPtr)_strdup("\pChoose filter settings"), // "\p" means "Pascal string" // TODO: TRANSLATE
452
                (StringPtr)_strdup("\pChoose filter settings"), // "\p" means "Pascal string" // TODO (Not important yet): TRANSLATE
364
                        & sfr, & reply, types, 2,
453
                        &sfr, &reply, types, 2,
365
                        "All supported files (*.afs, *.8bf, *.pff, *.prm, *.bin, *.rsrc, *.txt, *.ffx)\0*.afs;*.8bf;*.pff;*.prm;*.bin;*.rsrc;*.txt;*.ffx\0Filter Factory Settings (*.afs, *.txt)\0*.afs;*.txt\0PluginCommander or FFDecomp TXT file (*.txt)\0*.txt\0Filter Factory for Windows, Standalone Filter (*.8bf)\0*.8bf\0Premiere TF/FF Settings (*.pff)\0*.pff\0Premiere TT/FF for Windows, Standalone Filter (*.prm)\0*.prm\0FilterFactory for MacOS, Standalone Filter (*.bin, *.rsrc)\0*.bin\0\"Filters Unlimited\" filter (*.ffx)\0*.ffx\0All files (*.*)\0*.*\0\0" // TODO: TRANSLATE
454
                        &filters[0]
366
                        #else
455
                #else
367
                        TEXT("Choose filter settings"), // TODO: TRANSLATE
456
                        FF_GetMsg_Cpy(MSG_LOAD_FILTER_SETTINGS_TITLE_ID),
368
                        & sfr, & reply, types, 2,
457
                        &sfr, &reply, types, 2,
369
                        TEXT("All supported files (*.afs, *.8bf, *.pff, *.prm, *.bin, *.rsrc, *.txt, *.ffx)\0*.afs;*.8bf;*.pff;*.prm;*.bin;*.rsrc;*.txt;*.ffx\0Filter Factory Settings (*.afs, *.txt)\0*.afs;*.txt\0PluginCommander or FFDecomp TXT file (*.txt)\0*.txt\0Filter Factory for Windows, Standalone Filter (*.8bf)\0*.8bf\0Premiere TF/FF Settings (*.pff)\0*.pff\0Premiere TT/FF for Windows, Standalone Filter (*.prm)\0*.prm\0FilterFactory for MacOS, Standalone Filter (*.bin, *.rsrc)\0*.bin\0\"Filters Unlimited\" filter (*.ffx)\0*.ffx\0All files (*.*)\0*.*\0\0") // TODO: TRANSLATE
458
                        &filters[0], gdata->hWndMainDlg
370
                        ,gdata->hWndMainDlg
-
 
371
                        #endif
459
                #endif
372
                )){
460
                )) {
373
                        // Backup everything, otherwise we might lose parameter data if the loading fails
461
                        // Backup everything, otherwise we might lose parameter data if the loading fails
374
                        bakState = saveInternalState();
462
                        bakState = saveInternalState();
375
 
463
 
Line 383... Line 471...
383
                                // Restore
471
                                // Restore
384
                                restoreInternalState(bakState);
472
                                restoreInternalState(bakState);
385
                        }
473
                        }
386
                }
474
                }
387
                break;
475
                break;
-
 
476
        }
388
        case SAVEITEM:
477
        case SAVEITEM:
-
 
478
        {
-
 
479
                TCHAR filters[3000];
-
 
480
                TCHAR* tmp1, * tmp2;
-
 
481
                size_t len;
-
 
482
 
-
 
483
                memset(&filters[0], 0, sizeof(filters));
-
 
484
                tmp1 = &filters[0];
-
 
485
 
-
 
486
                FF_GetMsg(tmp1, MSG_ALL_SUPPORTED_FILES_ID);
-
 
487
                tmp1 += xstrlen(tmp1);
-
 
488
                len = xstrlen(tmp2 = TEXT(" (*.afs, *.pff, *.txt)"));
-
 
489
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
490
                tmp1 += (len + 1);
-
 
491
                len = xstrlen(tmp2 = TEXT("*.afs;*.pff;*.txt"));
-
 
492
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
493
                tmp1 += (len + 1);
-
 
494
 
-
 
495
                FF_GetMsg(tmp1, MSG_SAVE_AFS_ID);
-
 
496
                tmp1 += xstrlen(tmp1);
-
 
497
                len = xstrlen(tmp2 = TEXT(" (*.afs)"));
-
 
498
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
499
                tmp1 += (len + 1);
-
 
500
                len = xstrlen(tmp2 = TEXT("*.afs"));
-
 
501
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
502
                tmp1 += (len + 1);
-
 
503
 
-
 
504
                FF_GetMsg(tmp1, MSG_SAVE_PFF_ID);
-
 
505
                tmp1 += xstrlen(tmp1);
-
 
506
                len = xstrlen(tmp2 = TEXT(" (*.pff)"));
-
 
507
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
508
                tmp1 += (len + 1);
-
 
509
                len = xstrlen(tmp2 = TEXT("*.pff"));
-
 
510
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
511
                tmp1 += (len + 1);
-
 
512
 
-
 
513
                FF_GetMsg(tmp1, MSG_SAVE_TXT_ID);
-
 
514
                tmp1 += xstrlen(tmp1);
-
 
515
                len = xstrlen(tmp2 = TEXT(" (*.txt)"));
-
 
516
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
517
                tmp1 += (len + 1);
-
 
518
                len = xstrlen(tmp2 = TEXT("*.txt"));
-
 
519
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
520
                tmp1 += (len + 1);
-
 
521
 
-
 
522
                FF_GetMsg(tmp1, MSG_ALL_FILES_ID);
-
 
523
                tmp1 += xstrlen(tmp1);
-
 
524
                len = xstrlen(tmp2 = TEXT(" (*.*)"));
-
 
525
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
526
                tmp1 += (len + 1);
-
 
527
                len = xstrlen(tmp2 = TEXT("*.*"));
-
 
528
                memcpy(tmp1, tmp2, len * sizeof(TCHAR));
-
 
529
                tmp1 += (len + 1);
-
 
530
 
389
                if(!gdata->standalone && putfile(
531
                if (!gdata->standalone && putfile(
390
                        #ifdef MAC_ENV
532
                #ifdef MAC_ENV
391
                        (StringPtr)_strdup("\pSave filter settings"), // "\p" means "Pascal string" // TODO: TRANSLATE
533
                (StringPtr)_strdup("\pSave filter settings"), // "\p" means "Pascal string" // TODO (Not important yet): TRANSLATE
392
                        (StringPtr)_strdup("\0"),
534
                        (StringPtr)_strdup("\0"),
393
                        TEXT_FILETYPE, SIG_SIMPLETEXT, & reply, & sfr,
535
                        TEXT_FILETYPE, SIG_SIMPLETEXT, &reply, &sfr,
394
                        "afs",
536
                        "afs",
395
                        "All supported files (.afs, *.pff, .txt)\0*.afs;*.pff;*.txt\0Filter Factory Settings (*.afs)\0*.afs\0Premiere TF/FF Settings (*.pff)\0*.pff\0PluginCommander TXT file (*.txt)\0*.txt\0All files (*.*)\0*.*\0\0", 1 // TODO: TRANSLATE
-
 
-
 
537
                        & filters[0], 1
396
                        #else
538
                #else
397
                        TEXT("Save filter settings"), // TODO: TRANSLATE
539
                        FF_GetMsg_Cpy(MSG_SAVE_FILTER_SETTINGS_TITLE_ID),
398
                        TEXT("\0"),
540
                        TEXT("\0"),
399
                        TEXT_FILETYPE, SIG_SIMPLETEXT, & reply, & sfr,
541
                        TEXT_FILETYPE, SIG_SIMPLETEXT, &reply, &sfr,
400
                        TEXT("afs"),
542
                        TEXT("afs"),
401
                        TEXT("All supported files (.afs, *.pff, .txt)\0*.afs;*.pff;*.txt\0Filter Factory Settings (*.afs)\0*.afs\0Premiere TF/FF Settings (*.pff)\0*.pff\0PluginCommander TXT file (*.txt)\0*.txt\0All files (*.*)\0*.*\0\0"), 1 // TODO: TRANSLATE
-
 
402
                        ,gdata->hWndMainDlg
543
                        & filters[0], 1, gdata->hWndMainDlg
403
                        #endif
544
                #endif
404
                )){
545
                )) {
405
                        if(savefile_afs_pff_picotxt(&sfr)) {
546
                        if (savefile_afs_pff_picotxt(&sfr)) {
406
                                completesave(&reply);
547
                                completesave(&reply);
407
 
548
 
Line 434... Line 575...
434
                                }
575
                                }
435
 
576
 
436
                        }
577
                        }
437
                }
578
                }
438
                break;
579
                break;
-
 
580
        }
439
        case MAKEITEM:
581
        case MAKEITEM:
440
                if (gdata->standalone) return true; // should not happen since the button should be grayed out
582
                if (gdata->standalone) return true; // should not happen since the button should be grayed out
441
 
583
 
442
                builddialog(gpb);
584
                builddialog(gpb);
443
 
585