Provides appropriate parameters to the on_playback functions.
518419
def _map_player_request_to_func(self, player_request_type):
        """"""
        # calbacks for on_playback requests are optional
        view_func = self._intent_view_funcs.get(player_request_type, lambda: None)

        argspec = inspect.getargspec(view_func)
        arg_names = argspec.args
        arg_values = self._map_params_to_view_args(player_request_type, arg_names)

        return partial(view_func, *arg_values)
810093
function() {
    var self = this;

    // Get the Howl we want to manipulate.
    var sound = self.playlist[self.index].howl;

    // Determine our current seek position.
    var seek = sound.seek() || 0;
    timer.innerHTML = self.formatTime(Math.round(seek));
    progress.style.width = (((seek / sound.duration()) * 100) || 0) + '%';

    // If the sound is still playing, continue stepping.
    if (sound.playing()) {
      requestAnimationFrame(self.step.bind(self));
    }
  }
576223
function () {
            /*  determine parameters  */
            var params = $cs.params("listen", arguments, {
                name:    { pos: 0,     req: true },
                ctx:     {             def: this },
                func:    { pos: 1,     req: true },
                args:    { pos: "...", def: []   },
                spec:    {             def: null } /* customized matching */
            });

            /*  attach listener information  */
            var id = _cs.cid();
            this.__listener[id] = params;
            return id;
        }
315633
function(requestParameters, next) {
    if(self.providerProvidesValidateNotReplayClient) {
      self.provider.validateNotReplayClient(requestParameters.oauth_consumer_key, requestParameters.oauth_token, requestParameters.oauth_timestamp, requestParameters.oauth_nonce, function(err, result) {
        if(err) {
          callback(new errors.OAuthUnauthorizedError('Invalid / used nonce'), null);
        } else {
          next();
        }
      });
    } else {
      self.provider.validateNotReplay(requestParameters.oauth_token, requestParameters.oauth_timestamp, requestParameters.oauth_nonce, function(err, result) {
        if(err) {
          callback(new errors.OAuthUnauthorizedError('Invalid / used nonce'), null);
        } else {
          next();
        }
      });
    }
  }
408706
function (now) {

      if (this.lastFrameTime){
        // chrome bug, see: https://code.google.com/p/chromium/issues/detail?id=268213
        // http://jsfiddle.net/pehrlich/35pTx/
        // console.assert(this.lastFrameTime < now);
        if (now < this.lastFrameTime){
          // this fix will cause an extra animation frame before the lerp frame advances. no big.
          this.lastFrameTime = now;
        }else{
          this.timeSinceLastFrame += (now - this.lastFrameTime);
        }
      }

      this.lastFrameTime = now;

//      console.assert(!isNaN(this.timeSinceLastFrame));


      var timeToNextFrame;

      // handle frame dropping, etc
      while ( this.timeSinceLastFrame > ( timeToNextFrame = this.recording.timeToNextFrame() ) ){
        this.timeSinceLastFrame -= timeToNextFrame;
        if (!this.recording.advanceFrame()){
          this.pause();
          this.controller.emit('playback.playbackFinished', this);
          return
        }
      }

      this.sendFrame(
        this.recording.createLerpFrameData(this.timeSinceLastFrame / timeToNextFrame)
      );

    }
280824
public function loadParameters()
	{
		$container = \System::getContainer();
	
		if ($container->hasParameter('contao.video.valid_extensions'))
		{
			$GLOBALS['TL_CONFIG']['validVideoTypes'] = implode(',', $container->getParameter('contao.video.valid_extensions'));
		}
		
		if ($container->hasParameter('contao.audio.valid_extensions'))
		{
			$GLOBALS['TL_CONFIG']['validAudioTypes'] = implode(',', $container->getParameter('contao.audio.valid_extensions'));
		}
	}
1260045
function Player(eventHandlers) {
    var self = this, loading = null;
    this.label = 'Bandcamp';
    this.eventHandlers = eventHandlers || {};
    this.currentTrack = {position: 0, duration: 0};
    this.sound = null;
    this.isReady = false;
    loading = setInterval(function(){
      if (!!window["soundManager"]) {
        clearInterval(loading);
        self.isReady = true;
        self.clientCall("onApiReady", self);
      }
    }, 200);
  }
313044
function replayFrame(index) {

        var frame = frames[index];

        // Replay all instructions within the retrieved frame
        for (var i = 0; i < frame.instructions.length; i++) {
            var instruction = frame.instructions[i];
            playbackTunnel.receiveInstruction(instruction.opcode, instruction.args);
        }

        // Store client state if frame is flagged as a keyframe
        if (frame.keyframe && !frame.clientState) {
            playbackClient.exportState(function storeClientState(state) {
                frame.clientState = state;
            });
        }

    }
188570
public static void registerListener(Context context, PlaybackListener listener) {
        IntentFilter filter = new IntentFilter();
        filter.addAction(PlaybackListener.ACTION_ON_TRACK_PLAYED);
        filter.addAction(PlaybackListener.ACTION_ON_PLAYER_PAUSED);
        filter.addAction(PlaybackListener.ACTION_ON_SEEK_COMPLETE);
        filter.addAction(PlaybackListener.ACTION_ON_PLAYER_DESTROYED);
        filter.addAction(PlaybackListener.ACTION_ON_BUFFERING_STARTED);
        filter.addAction(PlaybackListener.ACTION_ON_BUFFERING_ENDED);
        filter.addAction(PlaybackListener.ACTION_ON_PROGRESS_CHANGED);

        LocalBroadcastManager.getInstance(context.getApplicationContext())
                .registerReceiver(listener, filter);
    }
545560
def do_media(self, args):
        """"""
        func = getattr(args, 'func', None)
        if func is not None:
            # Call whatever subcommand function was selected
            func(self, args)
        else:
            # No subcommand was provided, so call help
            self.do_help('media')
567022
def play(self):
        """"""
        if self._proc.state() == QProcess.Running:
            if self.isPlaying is False:
                self._execute("pause")
                self._changePlayingState(True)
        elif self._filePath is not None:
            self._kill()
            self._run(self._filePath)
            self._changePlayingState(True)
1168734
function(o) {
      var self = this;

      // If we don't have an AudioContext created yet, run the setup.
      if (!Howler.ctx) {
        setupAudioContext();
      }

      // Setup user-defined default properties.
      self._autoplay = o.autoplay || false;
      self._format = (typeof o.format !== 'string') ? o.format : [o.format];
      self._html5 = o.html5 || false;
      self._muted = o.mute || false;
      self._loop = o.loop || false;
      self._pool = o.pool || 5;
      self._preload = (typeof o.preload === 'boolean') ? o.preload : true;
      self._rate = o.rate || 1;
      self._sprite = o.sprite || {};
      self._src = (typeof o.src !== 'string') ? o.src : [o.src];
      self._volume = o.volume !== undefined ? o.volume : 1;
      self._xhrWithCredentials = o.xhrWithCredentials || false;

      // Setup all other default properties.
      self._duration = 0;
      self._state = 'unloaded';
      self._sounds = [];
      self._endTimers = {};
      self._queue = [];
      self._playLock = false;

      // Setup event listeners.
      self._onend = o.onend ? [{fn: o.onend}] : [];
      self._onfade = o.onfade ? [{fn: o.onfade}] : [];
      self._onload = o.onload ? [{fn: o.onload}] : [];
      self._onloaderror = o.onloaderror ? [{fn: o.onloaderror}] : [];
      self._onplayerror = o.onplayerror ? [{fn: o.onplayerror}] : [];
      self._onpause = o.onpause ? [{fn: o.onpause}] : [];
      self._onplay = o.onplay ? [{fn: o.onplay}] : [];
      self._onstop = o.onstop ? [{fn: o.onstop}] : [];
      self._onmute = o.onmute ? [{fn: o.onmute}] : [];
      self._onvolume = o.onvolume ? [{fn: o.onvolume}] : [];
      self._onrate = o.onrate ? [{fn: o.onrate}] : [];
      self._onseek = o.onseek ? [{fn: o.onseek}] : [];
      self._onunlock = o.onunlock ? [{fn: o.onunlock}] : [];
      self._onresume = [];

      // Web Audio or HTML5 Audio?
      self._webAudio = Howler.usingWebAudio && !self._html5;

      // Automatically try to enable audio.
      if (typeof Howler.ctx !== 'undefined' && Howler.ctx && Howler.autoUnlock) {
        Howler._unlockAudio();
      }

      // Keep track of this Howl group in the global controller.
      Howler._howls.push(self);

      // If they selected autoplay, add a play event to the load queue.
      if (self._autoplay) {
        self._queue.push({
          event: 'play',
          action: function() {
            self.play();
          }
        });
      }

      // Load the source file unless otherwise specified.
      if (self._preload) {
        self.load();
      }

      return self;
    }
220248
private static Playback createPlayback(Media media, Align alignment, int volume) throws IOException
    {
        final AudioInputStream input = openStream(media);
        final SourceDataLine dataLine = getDataLine(input);
        dataLine.start();
        updateAlignment(dataLine, alignment);
        updateVolume(dataLine, volume);

        return new Playback(input, dataLine);
    }
426512
private void pause() {
        if (mHasAlreadyPlayed && !mIsPaused) {
            mIsPaused = true;
            if (!mIsPreparing) {
                mMediaPlayer.pause();
            }

            // broadcast event
            Intent intent = new Intent(PlaybackListener.ACTION_ON_PLAYER_PAUSED);
            mLocalBroadcastManager.sendBroadcast(intent);

            updateNotification();

            mMediaSession.setPlaybackState(MediaSessionWrapper.PLAYBACK_STATE_PAUSED);
            pauseTimer();
        }
    }
219525
def geist_replay(wrapped, instance, args, kwargs):
    """"""
    path_parts = []
    file_parts = []

    if hasattr(wrapped, '__module__'):
        module = wrapped.__module__
        module_file = sys.modules[module].__file__
        root, _file = os.path.split(module_file)
        path_parts.append(root)
        _file, _ = os.path.splitext(_file)
        file_parts.append(_file)
    if hasattr(wrapped, '__objclass__'):
        file_parts.append(wrapped.__objclass__.__name__)
    elif hasattr(wrapped, '__self__'):
        file_parts.append(wrapped.__self__.__class__.__name__)
    file_parts.append(wrapped.__name__ + '.log')
    path_parts.append('_'.join(file_parts))
    filename = os.path.join(*path_parts)

    if is_in_record_mode():
        platform_backend = get_platform_backend()
        backend = RecordingBackend(
            source_backend=platform_backend,
            recording_filename=filename
        )
    else:
        backend = PlaybackBackend(
            recording_filename=filename
        )
    gui = GUI(backend)
    return wrapped(gui, *args, **kwargs)
160839
def _goto_playing_station(self, changing_playlist=False):
        
        if (self.player.isPlaying() or self.operation_mode == PLAYLIST_MODE) and \
            (self.selection != self.playing or changing_playlist):
            if changing_playlist:
                self.startPos = 0
            max_lines = self.bodyMaxY - 2
            if logger.isEnabledFor(logging.INFO):
                logger.info('max_lines = {0}, self.playing = {1}'.format(max_lines, self.playing))
            if self.number_of_items < max_lines:
                self.startPos = 0
            elif self.playing < self.startPos or \
                    self.playing >= self.startPos + max_lines:
                if logger.isEnabledFor(logging.INFO):
                    logger.info('=== _goto:adjusting startPos')
                if self.playing < max_lines:
                    self.startPos = 0
                    if self.playing - int(max_lines/2) > 0:
                        self.startPos = self.playing - int(max_lines/2)
                elif self.playing > self.number_of_items - max_lines:
                    self.startPos = self.number_of_items - max_lines
                else:
                    self.startPos = int(self.playing+1/max_lines) - int(max_lines/2)
            if logger.isEnabledFor(logging.INFO):
                logger.info('===== _goto:startPos = {0}, changing_playlist = {1}'.format(self.startPos, changing_playlist))
            self.selection = self.playing
            self.refreshBody()
181948
function shareReplay(bufferSize, windowTime, scheduler) {
    return function (source) { return source.lift(shareReplayOperator(bufferSize, windowTime, scheduler)); };
}