Bugfix: Single track MIDI-File did not work. Patched now.

This commit is contained in:
simplePCBuilding
2022-03-01 17:55:47 +01:00
parent 753943bcc4
commit 900dc0de41
3 changed files with 8 additions and 3 deletions

View File

@@ -14,7 +14,10 @@ class MidiManagement:
self.tracks = []
for self.track in self.midi_imp.tracks:
self.tracks.append(str(self.track))
if len(self.tracks) > 1:
self.tracks.pop(0)
else:
pass
self.track_ext = self.tracks.pop(0)
self.trackn = 0
while self.track_ext != trackname:

View File

@@ -1 +1 @@
/home/janis/Desktop/Victory.mid
/home/janis/Desktop/Water Drops Melodie.mid
1 /home/janis/Desktop/Victory.mid /home/janis/Desktop/Water Drops Melodie.mid

View File

@@ -27,12 +27,14 @@ class FileChooserScreen(MDScreen):
self.tracks = []
for self.track in self.mid.tracks:
self.tracks.append(str(self.track))
self.tracks.pop(0)
if len(self.tracks) > 1:
self.tracks.pop(0)
screen_manager.get_screen("Track").ids.track_spinner.values = self.tracks
screen_manager.current = "Track"
screen_manager.transition.direction = "up"
else:
backend.midi_management.MidiManagement().analyse_track(str(self.path), self.tracks.pop(0))
screen_manager.get_screen("Home").ids.infobox.text = "The command has been copied to the clipboard"
screen_manager.current = "Home"
screen_manager.transition.direction = "right"
except: