# Path: camp/tracker/fx_bus.py
# class FxBus(object):
# 
#     def __init__(self, member_list):
#         self._nodes = [ member.copy() for member in member_list ]
# 
#     def nodes(self):
#         return [ node.copy() for node in self._nodes ]
# 
#     def to_data(self):
#         return [ x.to_data() for x in self._nodes ]


from camp.tracker.fx_bus import FxBus
"""
Copyright 2016, Michael DeHaan <michael.dehaan@gmail.com>

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.
"""


class FxBuses(object):

    __slots__ = [ '_buses', '_factory' ]

    def __init__(self, song, **buses):

        self._factory = song
        self._buses = dict()

        for (bus_name, bus) in buses.items():
            if getattr(bus, '__call__', None) is not None:
                bus = bus(song)

# Path: camp/tracker/fx_bus.py
# class FxBus(object):
# 
#     def __init__(self, member_list):
#         self._nodes = [ member.copy() for member in member_list ]
# 
#     def nodes(self):
#         return [ node.copy() for node in self._nodes ]
# 
#     def to_data(self):
#         return [ x.to_data() for x in self._nodes ]


# Path: camp/tracker/fx_buses.py
from camp.tracker.fx_bus import FxBus

"""
Copyright 2016, Michael DeHaan <michael.dehaan@gmail.com>

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.
"""


class FxBuses(object):

    __slots__ = [ '_buses', '_factory' ]

    def __init__(self, song, **buses):

        self._factory = song
        self._buses = dict()

        for (bus_name, bus) in buses.items():
            if getattr(bus, '__call__', None) is not None:
                bus = bus(song)

            if not isinstance(bus, FxBus):