-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from PedalPi/issue-15-mod-host-parameter
Issue 15 mod host parameter
- Loading branch information
Showing
10 changed files
with
237 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
Version 0.2.1 -- released 05/07/17 | ||
================================= | ||
- Refactor persistence_decoder: Using now design pattern; | ||
- Fix mod-host: Bug when changing value of a parameter from a plugin; | ||
- observable_list: Add method ``.pop()``. | ||
|
||
Version 0.2.0 -- released 3/31/17 | ||
================================= | ||
- Initial release | ||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2017 SrMouraSilva | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2017 SrMouraSilva | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from abc import ABCMeta, abstractmethod | ||
|
||
|
||
class AudioPortBuilder(metaclass=ABCMeta): | ||
""" | ||
Extracts the inputs and outputs of an effect defined in a json. | ||
Use it to get the `AudioPorts`_ (inputs and outputs) to build a connection correctly. | ||
.. _AudioPorts: http://lv2plug.in/ns/lv2core/#AudioPort | ||
""" | ||
|
||
@abstractmethod | ||
def build_input(self, json): | ||
""" | ||
:return Input: Input of an effect defined in json | ||
""" | ||
pass | ||
|
||
@abstractmethod | ||
def build_output(self, json): | ||
""" | ||
:return Output: Input of an effect defined in json | ||
""" | ||
pass | ||
|
||
|
||
class EffectBuilder(metaclass=ABCMeta): | ||
|
||
@abstractmethod | ||
def build(self, json): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright 2017 SrMouraSilva | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
from pluginsmanager.util.builder.builder import AudioPortBuilder, EffectBuilder | ||
|
||
|
||
class Lv2AudioPortBuilder(AudioPortBuilder): | ||
""" | ||
Extracts the :class:`Lv2Input`s and :class:`Lv2Outputs`s of an :class:`Lv2Effect` defined in a json. | ||
""" | ||
|
||
def __init__(self, pedalboard): | ||
self.pedalboard = pedalboard | ||
|
||
def build_input(self, json): | ||
symbol = json['symbol'] | ||
return self.get_effect(json).inputs[symbol] | ||
|
||
def build_output(self, json): | ||
symbol = json['symbol'] | ||
return self.get_effect(json).outputs[symbol] | ||
|
||
def get_effect(self, json): | ||
effect_index = json['effect'] | ||
return self.pedalboard.effects[effect_index] | ||
|
||
|
||
class Lv2EffectBuilder(EffectBuilder): | ||
def __init__(self, lv2_effect_builder): | ||
""" | ||
:param model.lv2.lv2_effect_builder.Lv2EffectBuilder lv2_effect_builder: | ||
""" | ||
self.builder = lv2_effect_builder | ||
|
||
def build(self, json): | ||
effect = self.builder.build(json['plugin']) | ||
|
||
for param, param_json in zip(effect.params, json['params']): | ||
param.value = param_json['value'] | ||
|
||
effect.active = json['active'] | ||
|
||
return effect | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2017 SrMouraSilva | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from pluginsmanager.util.builder.builder import AudioPortBuilder | ||
|
||
|
||
class SystemAudioPortBuilder(AudioPortBuilder): | ||
""" | ||
Extracts the :class:`SystemInput`s and :class:`SystemOutputs`s of an :class:`SystemEffect` defined in a json. | ||
""" | ||
|
||
def __init__(self, system_effect): | ||
self.system_effect = system_effect | ||
|
||
def build_input(self, json): | ||
symbol = json['symbol'] | ||
return self.system_effect.inputs[symbol] | ||
|
||
def build_output(self, json): | ||
symbol = json['symbol'] | ||
return self.system_effect.outputs[symbol] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters