Changeset 1123:f0334593281d for src/mlx
- Timestamp:
- 12/10/23 09:50:04 (12 months ago)
- Branch:
- python3
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/config.py
r1098 r1123 255 255 self._enableApproachCallouts = False 256 256 self._speedbrakeAtTD = True 257 self._soundSet = 0 257 258 258 259 self._enableChecklists = False … … 672 673 if speedbrakeAtTD!=self._speedbrakeAtTD: 673 674 self._speedbrakeAtTD = speedbrakeAtTD 675 self._modified = True 676 677 @property 678 def soundSet(self): 679 """Get the number of the sound set to use.""" 680 return self._soundSet 681 682 @soundSet.setter 683 def soundSet(self, soundSet): 684 """Set the number of the sound set.""" 685 if soundSet!=self._soundSet: 686 self._soundSet = soundSet 674 687 self._modified = True 675 688 … … 856 869 self._speedbrakeAtTD = self._getBoolean(config, "sounds", 857 870 "speedbrakeAtTD", True) 871 self._soundSet = self._getInteger(config, "sounds", 872 "soundSet", 0) 858 873 859 874 self._enableChecklists = self._getBoolean(config, "sounds", … … 963 978 config.set("sounds", "speedbrakeAtTD", 964 979 "yes" if self._speedbrakeAtTD else "no") 980 config.set("sounds", "soundSet", str(self._soundSet)) 965 981 966 982 config.set("sounds", "enableChecklists", … … 998 1014 otherwise the default.""" 999 1015 return config.getboolean(section, option) \ 1016 if config.has_option(section, option) \ 1017 else default 1018 1019 def _getInteger(self, config, section, option, default): 1020 """Get the given option as an integer, if found in the given config, 1021 otherwise the default.""" 1022 return config.getint(section, option) \ 1000 1023 if config.has_option(section, option) \ 1001 1024 else default … … 1109 1132 print(" enableApproachCallouts:", self._enableApproachCallouts) 1110 1133 print(" speedbrakeAtTD:", self._speedbrakeAtTD) 1134 print(" soundSet:", self._soundSet) 1111 1135 1112 1136 print(" enableChecklists:", self._enableChecklists) -
src/mlx/const.py
r1117 r1123 461 461 SOUND_TAXI_BOEING737NG = "737taxi.mp3" 462 462 463 ## Sound: taxi: Boeing 737 NG (alternative variant) 464 SOUND_TAXI_BOEING737NG_ALT1 = "737taxi_1.mp3" 465 463 466 ## Sound: taxi: Boeing 767 464 467 SOUND_TAXI_BOEING767 = "767taxi.mp3" 468 469 ## Sound: taxi: Boeing 767 (alternative variant) 470 SOUND_TAXI_BOEING767_ALT1 = "767taxi_1.mp3" 465 471 466 472 ## Sound: taxi: Fokker F70 -
src/mlx/gui/prefs.py
r1098 r1123 268 268 self._enableApproachCallouts.set_active(config.enableApproachCallouts) 269 269 self._speedbrakeAtTD.set_active(config.speedbrakeAtTD) 270 self._alternativeSoundSet.set_active(config.soundSet!=0) 270 271 271 272 self._enableChecklists.set_active(config.enableChecklists) … … 321 322 config.enableApproachCallouts = self._enableApproachCallouts.get_active() 322 323 config.speedbrakeAtTD = self._speedbrakeAtTD.get_active() 324 config.soundSet = 1 if self._alternativeSoundSet.get_active() else 0 323 325 324 326 config.enableChecklists = self._enableChecklists.get_active() … … 726 728 backgroundBox.pack_start(self._speedbrakeAtTD, False, False, 4) 727 729 730 self._alternativeSoundSet = Gtk.CheckButton(xstr("prefs_sounds_alternativeSoundSet")) 731 self._alternativeSoundSet.set_use_underline(True) 732 self._alternativeSoundSet.set_tooltip_text( 733 xstr("prefs_sounds_alternativeSoundSet_tooltip")) 734 backgroundBox.pack_start(self._alternativeSoundSet, False, False, 4) 735 728 736 checklistFrame = Gtk.Frame(label = xstr("prefs_sounds_frame_checklists")) 729 737 mainBox.pack_start(checklistFrame, False, False, 4) … … 769 777 self._enableApproachCallouts.set_sensitive(active) 770 778 self._speedbrakeAtTD.set_sensitive(active) 779 self._alternativeSoundSet.set_sensitive(active) 771 780 772 781 def _pilotControlsSoundsToggled(self, button): -
src/mlx/soundsched.py
r1094 r1123 139 139 played.""" 140 140 141 _sounds = { const.AIRCRAFT_B736 : const.SOUND_TAXI_BOEING737NG, 142 const.AIRCRAFT_B737 : const.SOUND_TAXI_BOEING737NG, 143 const.AIRCRAFT_B738 : const.SOUND_TAXI_BOEING737NG, 144 const.AIRCRAFT_B738C : const.SOUND_TAXI_BOEING737NG, 145 const.AIRCRAFT_B762 : const.SOUND_TAXI_BOEING767, 146 const.AIRCRAFT_B763 : const.SOUND_TAXI_BOEING767, 147 const.AIRCRAFT_F70 : const.SOUND_TAXI_F70 } 141 _sounds = [{ const.AIRCRAFT_B736 : const.SOUND_TAXI_BOEING737NG, 142 const.AIRCRAFT_B737 : const.SOUND_TAXI_BOEING737NG, 143 const.AIRCRAFT_B738 : const.SOUND_TAXI_BOEING737NG, 144 const.AIRCRAFT_B738C : const.SOUND_TAXI_BOEING737NG, 145 const.AIRCRAFT_B762 : const.SOUND_TAXI_BOEING767, 146 const.AIRCRAFT_B763 : const.SOUND_TAXI_BOEING767, 147 const.AIRCRAFT_F70 : const.SOUND_TAXI_F70 }, 148 { const.AIRCRAFT_B736 : const.SOUND_TAXI_BOEING737NG_ALT1, 149 const.AIRCRAFT_B737 : const.SOUND_TAXI_BOEING737NG_ALT1, 150 const.AIRCRAFT_B738 : const.SOUND_TAXI_BOEING737NG_ALT1, 151 const.AIRCRAFT_B738C : const.SOUND_TAXI_BOEING737NG_ALT1, 152 const.AIRCRAFT_B762 : const.SOUND_TAXI_BOEING767_ALT1, 153 const.AIRCRAFT_B763 : const.SOUND_TAXI_BOEING767_ALT1, 154 const.AIRCRAFT_F70 : const.SOUND_TAXI_F70 }, 155 ] 148 156 149 157 def __init__(self, flight, boardingSound = None): … … 165 173 super(TaxiSound, self)._playbackDone(success, extra) 166 174 aircraftType = self._flight.aircraftType 175 176 soundSet = self._flight.config.soundSet 167 177 sounds = TaxiSound._sounds 178 sounds = sounds[soundSet] if soundSet<len(sounds) else sounds[-1] 179 168 180 if aircraftType in sounds: 169 181 startSound(sounds[aircraftType])
Note:
See TracChangeset
for help on using the changeset viewer.