Changeset 1123:f0334593281d


Ignore:
Timestamp:
12/10/23 09:50:04 (5 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Support for an alternative sound set

Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • locale/en/mlx.po

    r1098 r1123  
    18901890"If checked, a speedbrake sound will be played after touchdown, "
    18911891"when the speedbrakes deploy."
     1892
     1893msgid "prefs_sounds_alternativeSoundSet"
     1894msgstr "Use an a_lternative sound set"
     1895
     1896msgid "prefs_sounds_alternativeSoundSet_tooltip"
     1897msgstr ""
     1898"If checked, an alternative set of sound recording will be used, when available. "
     1899"Currently, an extended version of the taxi sounds is played, which includes "
     1900"the original Malév safety demo when flying a Boeing 737 or 767 aircraft. "
     1901"The rest of the recordings remains unchanged."
    18921902
    18931903msgid "prefs_sounds_frame_checklists"
  • locale/hu/mlx.po

    r1098 r1123  
    19021902"Ha kijelölöd, egy, a spoilerek kibocsájtását imitáló hang "
    19031903"hallatszik földetérés után, ha a spoilerek automatikusan kinyílnak."
     1904
     1905msgid "prefs_sounds_alternativeSoundSet"
     1906msgstr "Al_ternatív hangkészlet használata"
     1907
     1908msgid "prefs_sounds_alternativeSoundSet_tooltip"
     1909msgstr ""
     1910"Ha bejelölöd, alternatív hangkészletet használ a program bizonyos esetekben. "
     1911"Jelenleg Boeing 737 és 767 típusú gépeknél a gurulás során lejátszott hangfelvétel "
     1912"a korábban és alapértelmezésben jelenleg is használtnak egy kibővített változata, "
     1913"amely a Malév eredeti biztonsági bemutatóját is tartalmazza. "
     1914"A többi hangfelvétel ugyanaz, mint korábban is."
    19041915
    19051916msgid "prefs_sounds_frame_checklists"
  • src/mlx/config.py

    r1098 r1123  
    255255        self._enableApproachCallouts = False
    256256        self._speedbrakeAtTD = True
     257        self._soundSet = 0
    257258
    258259        self._enableChecklists = False
     
    672673        if speedbrakeAtTD!=self._speedbrakeAtTD:
    673674            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
    674687            self._modified = True
    675688
     
    856869        self._speedbrakeAtTD = self._getBoolean(config, "sounds",
    857870                                                "speedbrakeAtTD", True)
     871        self._soundSet = self._getInteger(config, "sounds",
     872                                          "soundSet", 0)
    858873
    859874        self._enableChecklists = self._getBoolean(config, "sounds",
     
    963978        config.set("sounds", "speedbrakeAtTD",
    964979                   "yes" if self._speedbrakeAtTD else "no")
     980        config.set("sounds", "soundSet", str(self._soundSet))
    965981
    966982        config.set("sounds", "enableChecklists",
     
    9981014        otherwise the default."""
    9991015        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) \
    10001023               if config.has_option(section, option) \
    10011024               else default
     
    11091132        print("  enableApproachCallouts:", self._enableApproachCallouts)
    11101133        print("  speedbrakeAtTD:", self._speedbrakeAtTD)
     1134        print("  soundSet:", self._soundSet)
    11111135
    11121136        print("  enableChecklists:", self._enableChecklists)
  • src/mlx/const.py

    r1117 r1123  
    461461SOUND_TAXI_BOEING737NG = "737taxi.mp3"
    462462
     463## Sound: taxi: Boeing 737 NG (alternative variant)
     464SOUND_TAXI_BOEING737NG_ALT1 = "737taxi_1.mp3"
     465
    463466## Sound: taxi: Boeing 767
    464467SOUND_TAXI_BOEING767 = "767taxi.mp3"
     468
     469## Sound: taxi: Boeing 767 (alternative variant)
     470SOUND_TAXI_BOEING767_ALT1 = "767taxi_1.mp3"
    465471
    466472## Sound: taxi: Fokker F70
  • src/mlx/gui/prefs.py

    r1098 r1123  
    268268        self._enableApproachCallouts.set_active(config.enableApproachCallouts)
    269269        self._speedbrakeAtTD.set_active(config.speedbrakeAtTD)
     270        self._alternativeSoundSet.set_active(config.soundSet!=0)
    270271
    271272        self._enableChecklists.set_active(config.enableChecklists)
     
    321322        config.enableApproachCallouts = self._enableApproachCallouts.get_active()
    322323        config.speedbrakeAtTD = self._speedbrakeAtTD.get_active()
     324        config.soundSet = 1 if self._alternativeSoundSet.get_active() else 0
    323325
    324326        config.enableChecklists = self._enableChecklists.get_active()
     
    726728        backgroundBox.pack_start(self._speedbrakeAtTD, False, False, 4)
    727729
     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
    728736        checklistFrame = Gtk.Frame(label = xstr("prefs_sounds_frame_checklists"))
    729737        mainBox.pack_start(checklistFrame, False, False, 4)
     
    769777        self._enableApproachCallouts.set_sensitive(active)
    770778        self._speedbrakeAtTD.set_sensitive(active)
     779        self._alternativeSoundSet.set_sensitive(active)
    771780
    772781    def _pilotControlsSoundsToggled(self, button):
  • src/mlx/soundsched.py

    r1094 r1123  
    139139    played."""
    140140
    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               ]
    148156
    149157    def __init__(self, flight, boardingSound = None):
     
    165173        super(TaxiSound, self)._playbackDone(success, extra)
    166174        aircraftType = self._flight.aircraftType
     175
     176        soundSet = self._flight.config.soundSet
    167177        sounds = TaxiSound._sounds
     178        sounds = sounds[soundSet] if soundSet<len(sounds) else sounds[-1]
     179
    168180        if aircraftType in sounds:
    169181            startSound(sounds[aircraftType])
Note: See TracChangeset for help on using the changeset viewer.