propresenter7-php-lib/bin/parse-test-patterns.php
Thorsten Buss 4d10db4f17 Initial public release
PHP 8.4 library and CLI tools to read, modify, and generate ProPresenter 7
files: songs (.pro), playlists (.proplaylist), bundles (.probundle), themes,
and the global library files (Macros, Labels, Groups, ClearGroups, CCLI,
Messages, Timers, Stage, Workspace, Props, TestPatterns, Calendar,
KeyMappings, CommunicationDevices).

Built on the MIT-licensed ProPresenter7-Proto schema by greyshirtguy
(v7.16.2). Includes 18 CLI parsers, comprehensive API docs in doc/,
binary-format specs, and a synthetic 369-test PHPUnit suite covering
RTF extraction, translation slides, ZIP64 repair, round-trip fidelity,
and end-to-end generation.
2026-05-03 22:21:01 +02:00

35 lines
1.2 KiB
PHP

#!/usr/bin/env php
<?php
declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
use ProPresenter\Parser\TestPatternsFileReader;
if ($argc < 2) {
echo "Usage: parse-test-patterns.php <TestPatterns>\n";
exit(1);
}
$filePath = $argv[1];
try {
$library = TestPatternsFileReader::read($filePath);
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
exit(1);
}
echo "TestPatterns (" . $library->count() . "):\n";
echo sprintf(" State: selected=%s :: name=%s :: display_location=%d :: screen=%s\n", $library->getSelectedPatternUuid() === '' ? '(none)' : $library->getSelectedPatternUuid(), $library->getSelectedPatternNameLocalizationKey() === '' ? '(none)' : $library->getSelectedPatternNameLocalizationKey(), $library->getDisplayLocation(), $library->getSpecificScreenUuid() === '' ? '(none)' : $library->getSpecificScreenUuid());
foreach ($library->getPatterns() as $index => $pattern) {
$number = $index + 1;
$name = $pattern->getNameLocalizationKey();
$displayName = $name === '' ? '(unnamed)' : $name;
$uuid = $pattern->getUuid()?->getString() ?? '';
echo sprintf(" [%d] %s :: %s\n", $number, $displayName, $uuid);
}