Ignore:
Timestamp:
12/10/23 09:50:04 (5 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Support for an alternative sound set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.