def onExport(self): device = self.gui.devices[self.list.currentRow() + 1] file_name, a = self.gui.getSaveFileName( 'Save Device', 'Super Boucle Mapping (*.sbm)', self) if file_name: file_name = verify_ext(file_name, 'sbm') with open(file_name, 'w') as f: f.write(json.dumps(device.mapping))
def onExport(self): device = self.gui.devices[self.list.currentRow() + 1] file_name, a = self.gui.getSaveFileName('Save Device', 'Super Boucle Mapping (*.sbm)', self) if file_name: file_name = verify_ext(file_name, 'sbm') with open(file_name, 'w') as f: f.write(json.dumps(device.mapping))
def onSavePlaylist(self): file_name, a = self.gui.getSaveFileName('Save Playlist', ('Super Boucle ' 'Playlist (*.sbp)'), self) if file_name: file_name = verify_ext(file_name, 'sbp') with open(file_name, 'w') as f: f.write(json.dumps(self.gui.playlist))
def onActionSaveAs(self): file_name, a = self.getSaveFileName('Save Song', 'Super Boucle Song (*.sbs)') if file_name: file_name = verify_ext(file_name, 'sbs') self.song.file_name = file_name self.song.save() print("File saved to : {}".format(self.song.file_name))
def onExport(self): device = self.gui.devices[self.list.currentRow() + 1] file_name, a = ( QFileDialog.getSaveFileName(self, 'Save As', expanduser('~'), 'Super Boucle Mapping (*.sbm)')) if file_name: file_name = verify_ext(file_name, 'sbm') with open(file_name, 'w') as f: f.write(json.dumps(device.mapping))
def onExportClip(self): if self.last_clip and self.last_clip.audio_file: audio_file = self.last_clip.audio_file file_name, a = self.getSaveFileName( 'Export Clip : %s' % self.last_clip.name, 'WAVE (*.wav)') if file_name: file_name = verify_ext(file_name, 'wav') sf.write(self.song.data[audio_file], file_name, self.song.samplerate[audio_file], subtype=sf.default_subtype('WAV'), format='WAV')
def onActionSaveAs(self): file_name, a = ( QFileDialog.getSaveFileName(self, 'Save As', expanduser('~'), 'Super Boucle Song (*.sbs)')) if file_name: file_name = verify_ext(file_name, 'sbs') self.song.file_name = file_name self.song.save() print("File saved to : {}".format(self.song.file_name))
def onSavePortlist(self): file_name, a = ( self.gui.getSaveFileName('Save Portlist', 'Super Boucle Portlist (*.sbl)', self)) if file_name: file_name = verify_ext(file_name, 'sbl') with open(file_name, 'w') as f: data = {"clips": [ [c.output if isinstance(c, Clip) else Clip.DEFAULT_OUTPUT for c in cliprow] for cliprow in self.gui.song.clips_matrix], "outputs": self.gui.song.outputs} f.write(json.dumps(data))
def onSavePortlist(self): file_name, a = (self.gui.getSaveFileName( 'Save Portlist', 'Super Boucle Portlist (*.sbl)', self)) if file_name: file_name = verify_ext(file_name, 'sbl') with open(file_name, 'w') as f: data = { "clips": [[ c.output if isinstance(c, Clip) else Clip.DEFAULT_OUTPUT for c in cliprow ] for cliprow in self.gui.song.clips_matrix], "outputs": self.gui.song.outputs } f.write(json.dumps(data))