Changeset 176:cb593ff93551 for src/mlx/soundsched.py
- Timestamp:
- 05/13/12 08:17:00 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/soundsched.py
r170 r176 5 5 from sound import startSound 6 6 import const 7 import fs 7 8 8 9 import threading … … 211 212 212 213 #------------------------------------------------------------------------------ 214 215 class ChecklistScheduler(object): 216 """A scheduler for the checklist sounds""" 217 def __init__(self, flight): 218 """Construct the checklist scheduler for the given flight.""" 219 self._flight = flight 220 self._checklist = None 221 self._itemIndex = 0 222 223 def hotkeyPressed(self): 224 """Called when the checklist hotkey is pressed.""" 225 flight = self._flight 226 config = flight.config 227 if config.enableChecklists and flight.aircraftType is not None: 228 if self._checklist is None: 229 self._checklist = config.getChecklist(flight.aircraftType) 230 231 index = self._itemIndex 232 if index>=len(self._checklist): 233 fs.sendMessage(const.MESSAGETYPE_INFORMATION, 234 "End of checklist") 235 else: 236 startSound(self._checklist[index]) 237 self._itemIndex += 1 238 239 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.