| 1 |
<?php |
| 2 |
|
| 3 |
// Sort plugins by name |
| 4 |
function plugin_cmp($a, $b) |
| 5 |
{ |
| 6 |
$a = $a['description']; |
| 7 |
$b = $b['description']; |
| 8 |
return ($a == $b) ? 0 : (($a > $b) ? 1 : -1); |
| 9 |
} |
| 10 |
|
| 11 |
function sort_plugins() |
| 12 |
{ |
| 13 |
global $PLUGINS; |
| 14 |
usort($PLUGINS, 'plugin_cmp'); |
| 15 |
} |
| 16 |
|
| 17 |
function plugin_header() |
| 18 |
{ |
| 19 |
global $PACKAGE, $PLUGINS, $PAGE, $DOCROOT; |
| 20 |
|
| 21 |
// Output plugin |
| 22 |
foreach ($PLUGINS as $plugin) |
| 23 |
{ |
| 24 |
if ($plugin['id'] != $PAGE) |
| 25 |
continue; |
| 26 |
|
| 27 |
echo "<h1>" . htmlspecialchars($plugin['description']) . "</h1>\n"; |
| 28 |
|
| 29 |
$fmt = array(); |
| 30 |
if (isset($plugin['clap_uid']) && ($plugin['clap_uid'])) |
| 31 |
array_push($fmt, '<a href="https://github.com/free-audio/clap" target="_blank">CLAP</a>'); |
| 32 |
if (isset($plugin['gst_uid']) && ($plugin['gst_uid'])) |
| 33 |
array_push($fmt, '<a href="https://gstreamer.freedesktop.org/" target="_blank">GST</a>'); |
| 34 |
if (isset($plugin['jack']) && ($plugin['jack'])) |
| 35 |
array_push($fmt, '<a href="https://jackaudio.org" target="_blank">JACK</a>'); |
| 36 |
if (isset($plugin['ladspa_label']) && (strlen($plugin['ladspa_label']) > 0)) |
| 37 |
array_push($fmt, '<a href="https://en.wikipedia.org/wiki/LADSPA" target="_blank">LADSPA</a>'); |
| 38 |
if ((isset($plugin['lv2_uri'])) && (strlen($plugin['lv2_uri']) > 0)) |
| 39 |
array_push($fmt, '<a href="https://lv2plug.in/" target="_blank">LV2</a>'); |
| 40 |
if ((isset($plugin['vst2_uid'])) && (strlen($plugin['vst2_uid']) > 0)) |
| 41 |
array_push($fmt, '<a href="https://www.steinberg.net/" target="_blank">VST2</a>'); |
| 42 |
if ((isset($plugin['vst3_uid'])) && (strlen($plugin['vst3_uid']) > 0)) |
| 43 |
array_push($fmt, '<a href="https://www.steinberg.net/" target="_blank">VST3</a>'); |
| 44 |
|
| 45 |
$full_name = htmlspecialchars("{$PACKAGE['short']} {$plugin['description']} ({$plugin['acronym']})"); |
| 46 |
$author = htmlspecialchars($plugin['author']); |
| 47 |
|
| 48 |
echo "<img class=\"plugin\" src=\"{$DOCROOT}img/plugins/{$plugin['id']}.png\" alt=\"{$plugin['name']}\">\n"; |
| 49 |
echo "<p><b>Detailed: </b>{$full_name}</p>\n"; |
| 50 |
echo "<p><b>Formats: </b>" . implode(', ', $fmt) . "</p>\n"; |
| 51 |
echo "<p><b>Categories: </b>" . implode(', ', $plugin['groups']) . "</p>\n"; |
| 52 |
echo "<p><b>Developer: </b>{$author}</p>\n"; |
| 53 |
echo "<p><b>Description: </b></p>\n"; |
| 54 |
break; |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
function out_image($id, $alt) |
| 59 |
{ |
| 60 |
global $DOCROOT; |
| 61 |
echo "<img src=\"{$DOCROOT}/img/{$id}.png\" alt=\"{$alt}\">\n"; |
| 62 |
} |
| 63 |
|
| 64 |
function plugin_ref($id) |
| 65 |
{ |
| 66 |
global $DOCROOT, $PACKAGE; |
| 67 |
$page = find_menu_item($id); |
| 68 |
if (!isset($page)) |
| 69 |
return; |
| 70 |
|
| 71 |
$header = htmlspecialchars("{$PACKAGE['short']} {$page['text']}"); |
| 72 |
print("<b><a href=\"{$DOCROOT}html/plugins/{$page['id']}.html\">{$header}</a></b>"); |
| 73 |
} |
| 74 |
|
| 75 |
?> |