from __future__ import absolute_import, division, print_function, unicode_literals

import cechomesh

from echomesh.expression.Envelope import Envelope
from echomesh.sound import PlayerSetter
from echomesh.util import Log
from echomesh.util.thread.MasterRunnable import MasterRunnable

LOGGER = Log.logger(__name__)


def test():
  print('test!')

class CPlayer(MasterRunnable):
  def __init__(self, element, level=1, pan=0, loops=1, length=-1, **kwds):
    super(CPlayer, self).__init__()
    PlayerSetter.evaluate_player(
      self, element, level=level, pan=pan, loops=loops, length=length, **kwds)

    self.test2 = self.test
    self.player = cechomesh.AudioSource(
      self._filename, self._loops, self._begin, self._end,
      self._length, "", 2, self._level, self._pan, self.pause)

  def __del__(self):
    super(CPlayer, self).__del__()
    self.unload()

  def _on_begin(self):
    return self.player.begin()

  def _on_run(self):
    return self.player.run()

  def _on_pause(self):
    return self.player.pause()

  def test(self):
    print('test2!!')

  def unload(self):
    super(CPlayer, self).unload()
    self.player.unload()

from __future__ import absolute_import, division, print_function, unicode_literals

import cechomesh

from echomesh.expression.Envelope import Envelope
from echomesh.sound import PlayerSetter
from echomesh.util import Log
from echomesh.util.thread.MasterRunnable import MasterRunnable

LOGGER = Log.logger(__name__)

class CPlayer(MasterRunnable):
  def __init__(self, element, level=1, pan=0, loops=1, length=-1, **kwds):
    super(CPlayer, self).__init__()
    PlayerSetter.evaluate_player(
      self, element, level=level, pan=pan, loops=loops, length=length, **kwds)

    self.test2 = self.test
    self.player = cechomesh.AudioSource(
      self._filename, self._loops, self._begin, self._end,
      self._length, "", 2, self._level, self._pan, self.pause)

  def __del__(self):
    super(CPlayer, self).__del__()
    self.unload()

  def _on_begin(self):
    return self.player.begin()

  def _on_run(self):
    return self.player.run()

  def _on_pause(self):
    return self.player.pause()

  def unload(self):
    super(CPlayer, self).unload()
    self.player.unload()

Remove tiny amounts of cruft.
Remove tiny amounts of cruft.
