# Path: pylsdj/bread_spec.py
# NUM_SYNTHS = 16
# 
# WAVES_PER_SYNTH = 16


import json
from .bread_spec import NUM_SYNTHS, WAVES_PER_SYNTH


class WaveSynthOverwriteLock(object):
    def __init__(self, song, index):
        self._index = NUM_SYNTHS - index - 1
        self._locks = song.song_data.wave_synth_overwrite_locks

    def enable(self):
        self._locks[self._index] = True

    def disable(self):
        self._locks[self._index] = False

    def status(self):
        return self._locks[self._index]

class SynthSoundParams(object):

    def __init__(self, params, overwrite_lock):
        self._params = params
        self._overwrite_lock = overwrite_lock

    def as_native(self):
        return self._params.as_native()

    def import_lsdinst(self, struct):
        self.volume = struct['volume']
        self.filter_cutoff = struct['filter_cutoff']

# Path: pylsdj/bread_spec.py
# NUM_SYNTHS = 16
# 
# WAVES_PER_SYNTH = 16


# Path: pylsdj/synth.py
import json
from .bread_spec import NUM_SYNTHS, WAVES_PER_SYNTH



class WaveSynthOverwriteLock(object):
    def __init__(self, song, index):
        self._index = NUM_SYNTHS - index - 1
        self._locks = song.song_data.wave_synth_overwrite_locks

    def enable(self):
        self._locks[self._index] = True

    def disable(self):
        self._locks[self._index] = False

    def status(self):
        return self._locks[self._index]

class SynthSoundParams(object):

    def __init__(self, params, overwrite_lock):
        self._params = params
        self._overwrite_lock = overwrite_lock

    def as_native(self):
        return self._params.as_native()

    def import_lsdinst(self, struct):
        self.volume = struct['volume']
        self.filter_cutoff = struct['filter_cutoff']

        self.phase_amount = struct['phase_amount']