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.
43 lines
1.3 KiB
PHP
43 lines
1.3 KiB
PHP
<?php
|
|
|
|
require_once dirname(__DIR__) . '/vendor/autoload.php';
|
|
|
|
use ProPresenter\Parser\PresentationBundle;
|
|
use ProPresenter\Parser\ProBundleWriter;
|
|
use ProPresenter\Parser\ProFileGenerator;
|
|
|
|
$image = imagecreatetruecolor(200, 150);
|
|
$blue = imagecolorallocate($image, 30, 60, 180);
|
|
imagefill($image, 0, 0, $blue);
|
|
$white = imagecolorallocate($image, 255, 255, 255);
|
|
imagestring($image, 5, 10, 10, 'ProPresenter', $white);
|
|
$tmpPng = tempnam(sys_get_temp_dir(), 'testbild-') . '.png';
|
|
imagepng($image, $tmpPng);
|
|
$imageBytes = file_get_contents($tmpPng);
|
|
unlink($tmpPng);
|
|
|
|
$refDir = dirname(__DIR__) . '/doc/reference_samples';
|
|
|
|
$song = ProFileGenerator::generate(
|
|
'TestBild',
|
|
[
|
|
[
|
|
'name' => 'Verse 1',
|
|
'color' => [0.0, 0.0, 0.0, 1.0],
|
|
'slides' => [
|
|
[
|
|
'media' => 'test-background.png',
|
|
'format' => 'png',
|
|
'label' => 'test-background.png',
|
|
'bundleRelative' => true,
|
|
],
|
|
],
|
|
],
|
|
],
|
|
[['name' => 'normal', 'groupNames' => ['Verse 1']]],
|
|
);
|
|
|
|
$bundle = new PresentationBundle($song, 'TestBild.pro', ['test-background.png' => $imageBytes]);
|
|
ProBundleWriter::write($bundle, $refDir . '/TestBild.probundle');
|
|
echo "TestBild.probundle written\n";
|