3 final class PhabricatorConpherenceSoundSetting
4 extends PhabricatorSelectSetting
{
6 const SETTINGKEY
= 'conpherence-sound';
8 const VALUE_CONPHERENCE_SILENT
= '0';
9 const VALUE_CONPHERENCE_MENTION
= '1';
10 const VALUE_CONPHERENCE_ALL
= '2';
12 public function getSettingName() {
13 return pht('Conpherence Sound');
16 public function getSettingPanelKey() {
17 return PhabricatorConpherencePreferencesSettingsPanel
::PANELKEY
;
20 protected function getControlInstructions() {
22 'Choose the default sound behavior for new Conpherence rooms.');
25 protected function isEnabledForViewer(PhabricatorUser
$viewer) {
26 return PhabricatorApplication
::isClassInstalledForViewer(
27 'PhabricatorConpherenceApplication',
31 public function getSettingDefaultValue() {
32 return self
::VALUE_CONPHERENCE_ALL
;
35 protected function getSelectOptions() {
36 return self
::getOptionsMap();
39 public static function getSettingLabel($key) {
40 $labels = self
::getOptionsMap();
41 return idx($labels, $key, pht('Unknown ("%s")', $key));
44 public static function getDefaultSound($value) {
46 case self
::VALUE_CONPHERENCE_ALL
:
48 ConpherenceRoomSettings
::SOUND_RECEIVE
=>
49 ConpherenceRoomSettings
::DEFAULT_RECEIVE_SOUND
,
50 ConpherenceRoomSettings
::SOUND_MENTION
=>
51 ConpherenceRoomSettings
::DEFAULT_MENTION_SOUND
,
54 case self
::VALUE_CONPHERENCE_MENTION
:
56 ConpherenceRoomSettings
::SOUND_RECEIVE
=>
57 ConpherenceRoomSettings
::DEFAULT_NO_SOUND
,
58 ConpherenceRoomSettings
::SOUND_MENTION
=>
59 ConpherenceRoomSettings
::DEFAULT_MENTION_SOUND
,
62 case self
::VALUE_CONPHERENCE_SILENT
:
64 ConpherenceRoomSettings
::SOUND_RECEIVE
=>
65 ConpherenceRoomSettings
::DEFAULT_NO_SOUND
,
66 ConpherenceRoomSettings
::SOUND_MENTION
=>
67 ConpherenceRoomSettings
::DEFAULT_NO_SOUND
,
73 private static function getOptionsMap() {
75 self
::VALUE_CONPHERENCE_SILENT
=> pht('No Sounds'),
76 // self::VALUE_CONPHERENCE_MENTION => pht('Mentions Only'),
77 self
::VALUE_CONPHERENCE_ALL
=> pht('All Messages'),