Split Liquidsoap service control and configuration writer components.

This commit is contained in:
Buster "Silver Eagle" Neece 2020-03-19 14:41:22 -05:00
parent db95d25d30
commit c851f92f27
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
7 changed files with 1086 additions and 1079 deletions

View File

@ -114,12 +114,12 @@ return function (\App\EventDispatcher $dispatcher) {
// Other event subscribers from across the application.
$dispatcher->addServiceSubscriber([
\App\Radio\AutoDJ::class,
\App\Radio\Backend\Liquidsoap::class,
\App\Sync\Task\NowPlaying::class,
\App\Webhook\Dispatcher::class,
\App\Controller\Api\NowplayingController::class,
\App\Notification\Manager::class,
App\Radio\AutoDJ::class,
App\Radio\Backend\Liquidsoap\ConfigWriter::class,
App\Sync\Task\NowPlaying::class,
App\Webhook\Dispatcher::class,
App\Controller\Api\NowplayingController::class,
App\Notification\Manager::class,
]);
};

View File

@ -3,6 +3,7 @@
use App\Entity\Station;
use App\Entity\StationMountInterface;
use App\Radio\Adapters;
use App\Radio\Backend\Liquidsoap\ConfigWriter;
$frontends = Adapters::listFrontendAdapters(true);
$frontend_types = [];
@ -243,11 +244,11 @@ return [
'belongsTo' => 'backend_config',
'description' => __('Choose a method to use when transitioning from one song to another. Smart Mode considers the volume of the two tracks when fading for a smoother effect, but requires more CPU resources.'),
'choices' => [
\App\Radio\Backend\Liquidsoap::CROSSFADE_SMART => __('Smart Mode'),
\App\Radio\Backend\Liquidsoap::CROSSFADE_NORMAL => __('Normal Mode'),
\App\Radio\Backend\Liquidsoap::CROSSFADE_DISABLED => __('Disable Crossfading'),
ConfigWriter::CROSSFADE_SMART => __('Smart Mode'),
ConfigWriter::CROSSFADE_NORMAL => __('Normal Mode'),
ConfigWriter::CROSSFADE_DISABLED => __('Disable Crossfading'),
],
'default' => \App\Radio\Backend\Liquidsoap::CROSSFADE_NORMAL,
'default' => ConfigWriter::CROSSFADE_NORMAL,
'form_group_class' => 'col-md-8',
],
],

View File

@ -8,7 +8,7 @@ return [
Message\AddNewMediaMessage::class => Task\Media::class,
Message\ReprocessMediaMessage::class => Task\Media::class,
Message\WritePlaylistFileMessage::class => Liquidsoap::class,
Message\WritePlaylistFileMessage::class => Liquidsoap\ConfigWriter::class,
Message\UpdateNowPlayingMessage::class => Task\NowPlaying::class,

View File

@ -24,11 +24,11 @@ class EditLiquidsoapConfigController
}
$configSections = [
Liquidsoap::CUSTOM_TOP,
Liquidsoap::CUSTOM_PRE_PLAYLISTS,
Liquidsoap::CUSTOM_PRE_FADE,
Liquidsoap::CUSTOM_PRE_LIVE,
Liquidsoap::CUSTOM_PRE_BROADCAST,
Liquidsoap\ConfigWriter::CUSTOM_TOP,
Liquidsoap\ConfigWriter::CUSTOM_PRE_PLAYLISTS,
Liquidsoap\ConfigWriter::CUSTOM_PRE_FADE,
Liquidsoap\ConfigWriter::CUSTOM_PRE_LIVE,
Liquidsoap\ConfigWriter::CUSTOM_PRE_BROADCAST,
];
$config = $backend->getEditableConfiguration($station);

View File

@ -738,7 +738,7 @@ class StationMedia
// Convert Liquidsoap-specific annotations to floats.
if ('duration' === $annotation_name || 0 === strpos($annotation_name, 'liq')) {
$prop = Liquidsoap::toFloat($prop);
$prop = Liquidsoap\ConfigWriter::toFloat($prop);
}
$annotations[$annotation_name] = $prop;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff