2011-08-15 22:10:46 +02:00
|
|
|
<?php
|
|
|
|
|
2011-08-18 19:53:12 +02:00
|
|
|
class Application_Form_StreamSetting extends Zend_Form
|
2011-08-15 22:10:46 +02:00
|
|
|
{
|
2011-08-18 19:53:12 +02:00
|
|
|
private $setting;
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2023-09-08 15:45:24 +02:00
|
|
|
public function init() {}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-08-29 05:04:55 +02:00
|
|
|
public function setSetting($setting)
|
|
|
|
{
|
2011-08-18 19:53:12 +02:00
|
|
|
$this->setting = $setting;
|
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-08-29 05:04:55 +02:00
|
|
|
public function startFrom()
|
|
|
|
{
|
2021-10-11 16:10:47 +02:00
|
|
|
$this->setDecorators([
|
|
|
|
['ViewScript', ['viewScript' => 'preference/stream-setting.phtml']],
|
|
|
|
]);
|
2015-07-03 19:32:41 +02:00
|
|
|
|
2011-08-18 19:53:12 +02:00
|
|
|
$setting = $this->setting;
|
2012-07-11 00:55:44 +02:00
|
|
|
|
2022-09-06 12:00:50 +02:00
|
|
|
$stream_format = new Zend_Form_Element_Radio('streamFormat');
|
|
|
|
$stream_format
|
|
|
|
->setLabel(_('Stream Label:'))
|
2021-10-11 16:10:47 +02:00
|
|
|
->setMultiOptions([
|
2022-09-06 12:00:50 +02:00
|
|
|
_('Artist - Title'),
|
|
|
|
_('Show - Artist - Title'),
|
|
|
|
_('Station name - Show name'),
|
2022-06-09 16:50:21 +02:00
|
|
|
])
|
2022-09-06 12:00:50 +02:00
|
|
|
->setValue(Application_Model_Preference::GetStreamLabelFormat())
|
2022-01-23 19:15:55 +01:00
|
|
|
->setDecorators(['ViewHelper']);
|
2011-12-13 12:10:25 +01:00
|
|
|
$this->addElement($stream_format);
|
2021-10-11 16:10:47 +02:00
|
|
|
|
2013-01-08 00:14:57 +01:00
|
|
|
$offAirMeta = new Zend_Form_Element_Text('offAirMeta');
|
2022-09-06 12:00:50 +02:00
|
|
|
$offAirMeta
|
|
|
|
->setLabel(_('Off Air Metadata'))
|
2022-08-06 19:18:40 +02:00
|
|
|
->setValue(Application_Model_Preference::getOffAirMeta())
|
2022-01-23 19:15:55 +01:00
|
|
|
->setDecorators(['ViewHelper']);
|
2013-01-08 00:14:57 +01:00
|
|
|
$this->addElement($offAirMeta);
|
2021-10-11 16:10:47 +02:00
|
|
|
|
|
|
|
$enable_replay_gain = new Zend_Form_Element_Checkbox('enableReplayGain');
|
2022-09-06 12:00:50 +02:00
|
|
|
$enable_replay_gain
|
|
|
|
->setLabel(_('Enable Replay Gain'))
|
2021-10-11 16:10:47 +02:00
|
|
|
->setValue(Application_Model_Preference::GetEnableReplayGain())
|
2022-01-23 19:15:55 +01:00
|
|
|
->setDecorators(['ViewHelper']);
|
2013-01-10 19:49:41 +01:00
|
|
|
$this->addElement($enable_replay_gain);
|
2021-10-11 16:10:47 +02:00
|
|
|
|
|
|
|
$replay_gain = new Zend_Form_Element_Hidden('replayGainModifier');
|
2022-09-06 12:00:50 +02:00
|
|
|
$replay_gain
|
|
|
|
->setLabel(_('Replay Gain Modifier'))
|
2021-10-11 16:10:47 +02:00
|
|
|
->setValue(Application_Model_Preference::getReplayGainModifier())
|
|
|
|
->setAttribs(['style' => 'border: 0; color: #f6931f; font-weight: bold;'])
|
2022-01-23 19:15:55 +01:00
|
|
|
->setDecorators(['ViewHelper']);
|
2012-12-28 04:58:41 +01:00
|
|
|
$this->addElement($replay_gain);
|
2015-07-03 19:32:41 +02:00
|
|
|
|
2022-09-06 12:00:50 +02:00
|
|
|
$output_sound_device = new Zend_Form_Element_Checkbox('output_sound_device');
|
|
|
|
$output_sound_device
|
|
|
|
->setLabel(_('Hardware Audio Output:'))
|
|
|
|
->setAttrib('readonly', true)
|
|
|
|
->setRequired(false)
|
|
|
|
->setValue(($setting['output_sound_device'] == 'true') ? 1 : 0)
|
|
|
|
->setDecorators(['ViewHelper']);
|
|
|
|
$this->addElement($output_sound_device);
|
2012-08-29 05:04:55 +02:00
|
|
|
|
2022-09-06 12:00:50 +02:00
|
|
|
$output_sound_device_type = new Zend_Form_Element_Select('output_sound_device_type');
|
|
|
|
$output_sound_device_type
|
|
|
|
->setLabel(_('Output Type'))
|
|
|
|
->setAttrib('readonly', true)
|
|
|
|
->setValue(isset($setting['output_sound_device_type']) ? $setting['output_sound_device_type'] : 0)
|
|
|
|
->setDecorators(['ViewHelper']);
|
|
|
|
$this->addElement($output_sound_device_type);
|
2011-08-15 22:10:46 +02:00
|
|
|
}
|
|
|
|
}
|