示例#1
0
    def save(self, bank_index, pedalboard_index):
        data = {
            "bank": bank_index,
            "pedalboard": pedalboard_index
        }

        Persistence.save(self.path, data)
示例#2
0
    def delete_bank(self, bank):
        """
        Delete the bank's file

        :param Bank bank: Bank that will be removed
        """
        path = self._bank_path(bank)
        Persistence.delete(path)
示例#3
0
    def save_bank(self, bank):
        """
        Save the bank in your file

        :param Bank bank: Bank that will be persisted
        """
        path = self._bank_path(bank)
        Persistence.save(path, bank.json)
示例#4
0
    def delete_all_banks(self):
        """
        Delete all banks files.

        Util for manual save, because isn't possible know which banks
        were removed
        """
        for file in glob(str(self.data_path) + "/*.json"):
            Persistence.delete(file)
示例#5
0
    def _configure_lv2_plugins_data(self):
        if not self._dao.exists_data:
            try:
                self.reload_lv2_plugins_data()
                self.app.log("Lv2Plugins data - Loaded lv2 plugins data installed")
            except:
                self.app.log("Lv2Plugins data - It's not possible reload lv2 plugins data")
                self.app.log("                  Please install lilv")
                self.app.log("Lv2Plugins data - Using PluginsManager default lv2 plugins data")
                print(self._dao.data_path, Lv2EffectBuilder.plugins_json_file)
                self._dao.save(Persistence.read(Path(Lv2EffectBuilder.plugins_json_file)))

        return Lv2EffectBuilder(plugins_json=self._dao.path)
示例#6
0
    def load(self, indexables):
        """
        Load the index file and reorder the banks based in order listed in index

        :param list[Indexable] indexables: Banks that will be reordered based in index file
        :return list[Bank]: Banks reordered
        """
        try:
            data = Persistence.read(self.path, create_file=True)
        except ValueError:
            data = {}

        return self.load_data(data, indexables)
示例#7
0
    def load(self, system_effect):
        """
        Return a list if banks presents in data_path

        :param SystemEffect system_effect: SystemEffect used in pedalboards
        :return list[Bank]: List with Banks persisted in
                :attr:`~pluginsmanager.observer.autosaver.banks_files.BanksFiles.data_path`
        """
        persistence = PersistenceDecoder(system_effect)

        banks = []

        for file in glob(str(self.data_path) + "/*.json"):
            bank = persistence.read(Persistence.read(file))
            bank._uuid = file.split('/')[-1].split('.json')[0]
            banks.append(bank)

        return banks
示例#8
0
    def _configure_lv2_plugins_data(self):
        if not self._dao.exists_data:
            try:
                self.reload_lv2_plugins_data()
                self.app.log(
                    "Lv2Plugins data - Loaded lv2 plugins data installed")
            except:
                self.app.log(
                    "Lv2Plugins data - It's not possible reload lv2 plugins data"
                )
                self.app.log("                  Please install lilv")
                self.app.log(
                    "Lv2Plugins data - Using PluginsManager default lv2 plugins data"
                )
                print(self._dao.data_path, Lv2EffectBuilder.plugins_json_file)
                self._dao.save(
                    Persistence.read(Path(Lv2EffectBuilder.plugins_json_file)))

        return Lv2EffectBuilder(plugins_json=self._dao.path)
示例#9
0
 def save(self, data):
     Persistence.save(self.path, data)
示例#10
0
 def load(self):
     return Persistence.read(self.path)
示例#11
0
 def save(self, indexables):
     data = self.generate_data(indexables)
     Persistence.save(self.path, data)
示例#12
0
 def save_empty(self):
     Persistence.save(self.path, {})
示例#13
0
 def load(self):
     data = Persistence.read(self.path)
     return CurrentData(data)