Skip to content

Commit

Permalink
Fix #276: Fix loading snapshot for correctly routing LinuxSampler lay…
Browse files Browse the repository at this point in the history
…ers and probably others.
  • Loading branch information
jofemodo committed Jul 31, 2020
1 parent cb2a4cc commit bb888fc
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions zyngui/zynthian_gui_layer.py
Expand Up @@ -1088,31 +1088,18 @@ def load_snapshot(self, fpath):
# Finally, stop all unused engines
self.zyngui.screens['engine'].stop_unused_engines()

#Restore MIDI profile state
if 'midi_profile_state' in snapshot:
self.set_midi_profile_state(snapshot['midi_profile_state'])

#Set MIDI Routing
if 'midi_routing' in snapshot:
self.set_midi_routing(snapshot['midi_routing'])
else:
self.reset_midi_routing()

#Set Audio Routing
if 'audio_routing' in snapshot:
self.set_audio_routing(snapshot['audio_routing'])
else:
self.reset_audio_routing()

#Set Audio Routing
if 'audio_capture' in snapshot:
self.set_audio_capture(snapshot['audio_capture'])
else:
self.reset_audio_routing()

#Autoconnect
#Autoconnect MIDI
self.zyngui.zynautoconnect_midi(True)
self.zyngui.zynautoconnect_audio()

#Restore MIDI profile state
if 'midi_profile_state' in snapshot:
self.set_midi_profile_state(snapshot['midi_profile_state'])

#Set extended config
if 'extended_config' in snapshot:
Expand All @@ -1130,6 +1117,21 @@ def load_snapshot(self, fpath):
self.layers[i].restore_snapshot_2(lss)
i += 1

#Set Audio Routing
if 'audio_routing' in snapshot:
self.set_audio_routing(snapshot['audio_routing'])
else:
self.reset_audio_routing()

#Set Audio Capture
if 'audio_capture' in snapshot:
self.set_audio_capture(snapshot['audio_capture'])
else:
self.reset_audio_routing()

#Autoconnect Audio
self.zyngui.zynautoconnect_audio()

# Restore ALSA Mixer settings
if self.amixer_layer and 'amixer_layer' in snapshot:
self.amixer_layer.restore_snapshot_1(snapshot['amixer_layer'])
Expand Down

0 comments on commit bb888fc

Please sign in to comment.