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.
31 lines
818 B
PHP
31 lines
818 B
PHP
#!/usr/bin/env php
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use ProPresenter\Parser\ThemeFileReader;
|
|
|
|
if ($argc < 2) {
|
|
echo "Usage: parse-theme.php <theme-folder>\n";
|
|
exit(1);
|
|
}
|
|
|
|
try {
|
|
$bundle = ThemeFileReader::read($argv[1]);
|
|
} catch (Exception $e) {
|
|
echo 'Error: ' . $e->getMessage() . "\n";
|
|
exit(1);
|
|
}
|
|
|
|
echo "Theme folder: {$argv[1]}\n";
|
|
echo 'Slides (' . $bundle->count() . "):\n";
|
|
foreach ($bundle->getSlides() as $index => $slide) {
|
|
echo sprintf(" [%d] %s\n", $index + 1, $slide->getName() ?: '(unnamed)');
|
|
}
|
|
echo 'Assets (' . $bundle->getAssetCount() . "):\n";
|
|
foreach ($bundle->getAssets() as $index => $asset) {
|
|
echo sprintf(" [%d] Assets/%s :: %d bytes :: %s\n", $index + 1, $asset->getName(), $asset->getSize(), $asset->getMimeType());
|
|
}
|