Esempio n. 1
0
    def __init__(self, name, disable_autoswitch=False):
        self.queue = None
        self._name = name

        self._playtime_stamp = None

        self._delay_id = None
        self._stop_id = None
        self._engine = None

        self._auto_advance_delay = 0
        self._auto_advance = True
        self._gapless_enabled = True
        self.__volume = 1.0

        options = {
            '%s/auto_advance_delay' % name: '_auto_advance_delay',
            '%s/auto_advance' % name: '_auto_advance',
            '%s/gapless_playback' % name: '_gapless_enabled',
            '%s/volume' % name: '_volume',
        }

        self._settings_unsub = common.subscribe_for_settings(
            name, options, self)

        self._setup_engine(disable_autoswitch)

        event.add_callback(self._on_track_end, 'playback_track_end', self)
        event.add_callback(self._on_track_tags_changed, 'track_tags_changed')
Esempio n. 2
0
 def __init__(self, name, player):
     ExaileEngine.__init__(self, name, player)
     self.logger = logging.getLogger('%s [%s]' % (__name__, name))
     
     # Default settings
     self.crossfade_enabled = False
     self.crossfade_duration = 3000
     
     self.audiosink_device = None
     self.audiosink = None
     self.custom_sink_pipe = None
     
     # This means to fade in when the user plays a track, only enabled
     # when crossfade isn't enabled
     self.user_fade_enabled = False
     self.user_fade_duration = 1000 
     
     # Key: option name; value: attribute on self
     options = {
         '%s/crossfading' % self.name: 'crossfade_enabled',
         '%s/crossfade_duration' % self.name: 'crossfade_duration',
         
         '%s/audiosink_device' % self.name: 'audiosink_device',
         '%s/audiosink' % self.name: 'audiosink',
         '%s/custom_sink_pipe' % self.name: 'custom_sink_pipe',
         
         '%s/user_fade_enabled' % self.name: 'user_fade_enabled',
         '%s/user_fade' % self.name: 'user_fade_duration'
     }
     
     self.settings_unsubscribe = common.subscribe_for_settings(self.name, options, self)
Esempio n. 3
0
 def __init__(self, name):
     self.queue = None
     self._name = name
     
     self._playtime_stamp = None
     
     self._delay_id = None
     self._stop_id = None
     self._engine = None
     
     self._auto_advance_delay = 0
     self._auto_advance = True
     self._gapless_enabled = True
     self.__volume = 1.0
     
     options = {
         '%s/auto_advance_delay' % name: '_auto_advance_delay',
         '%s/auto_advance' % name: '_auto_advance',
         '%s/gapless_playback' % name: '_gapless_enabled',
         '%s/volume' % name: '_volume',
     }
     
     self._settings_unsub = common.subscribe_for_settings(name, options, self)
     
     self._setup_engine()
     
     event.add_callback(self._on_track_end, 'playback_track_end', self)
     event.add_callback(self._on_track_tags_changed, 'track_tags_changed')
Esempio n. 4
0
    def __init__(self, name, player, disable_autoswitch):
        ExaileEngine.__init__(self, name, player)
        self.logger = logging.getLogger('%s [%s]' % (__name__, name))

        # Default settings
        self.crossfade_enabled = False
        self.crossfade_duration = 3000

        self.audiosink_device = None
        self.audiosink = None
        self.custom_sink_pipe = None

        # If True, then playback will be stopped if the audio sink changes without
        # the user asking for it
        self.disable_autoswitch = disable_autoswitch

        # This means to fade in when the user plays a track, only enabled
        # when crossfade isn't enabled
        self.user_fade_enabled = False
        self.user_fade_duration = 1000

        # Key: option name; value: attribute on self
        options = {
            '%s/crossfading' % self.name: 'crossfade_enabled',
            '%s/crossfade_duration' % self.name: 'crossfade_duration',
            '%s/audiosink_device' % self.name: 'audiosink_device',
            '%s/audiosink' % self.name: 'audiosink',
            '%s/custom_sink_pipe' % self.name: 'custom_sink_pipe',
            '%s/user_fade_enabled' % self.name: 'user_fade_enabled',
            '%s/user_fade' % self.name: 'user_fade_duration',
        }

        self.settings_unsubscribe = common.subscribe_for_settings(
            self.name, options, self)