Function that is called after a song finishes playing
505242
async def vafter(self):
        """"""
        self.logger.debug("Finished playing a song")
        if self.state != 'ready':
            self.logger.debug("Returning because player is in state {}".format(self.state))
            return

        self.pause_time = None

        if self.vclient_task:
            loop = asyncio.get_event_loop()
            loop.call_soon(self.vclient_task.cancel)
            self.vclient_task = None

        try:
            if self.streamer is None:
                await self.stop()
                return

            if self.streamer.error is None:
                await self.vplay()
            else:
                self.statuslog.error(self.streamer.error)
                await self.destroy()
        except Exception as e:
            logger.exception(e)
            try:
                await self.destroy()
            except Exception as e:
                logger.exception(e)
1086236
function debounce(func) {
  var timeout = void 0;
  return function () {
    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    var context = this;

    var lastCall = function lastCall() {
      timeout = null;
      func.apply(context, args);
    };

    clearTimeout(timeout);
    timeout = setTimeout(lastCall, 100);
  };
}
221010
function after(results, next) {
    item.trigger('after:' + method, function done(error) {
      next(error, results);
    });
  }
892772
void playAsMusic(int buffer,float pitch,float gain, boolean loop) {
		paused = false;
		
		setMOD(null);
		
		if (soundWorks) {
			if (currentMusic != -1) {
				AL10.alSourceStop(sources.get(0));
			}
			
			getMusicSource();
			
			AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffer);
			AL10.alSourcef(sources.get(0), AL10.AL_PITCH, pitch);
		    AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, loop ? AL10.AL_TRUE : AL10.AL_FALSE);
			
			currentMusic = sources.get(0);
			
			if (!music) {
				pauseLoop();
			} else {
				AL10.alSourcePlay(sources.get(0)); 
			}
		}
	}
348580
function() {
      var self = this || Howler;

      // Return the next object from the pool if one exists.
      if (self._html5AudioPool.length) {
        return self._html5AudioPool.pop();
      }

      //.Check if the audio is locked and throw a warning.
      var testPlay = new Audio().play();
      if (testPlay && typeof Promise !== 'undefined' && (testPlay instanceof Promise || typeof testPlay.then === 'function')) {
        testPlay.catch(function() {
          console.warn('HTML5 Audio pool exhausted, returning potentially locked audio object.');
        });
      }

      return new Audio();
    }
647917
def current_song(self, song):
        
        self._last_song = self.current_song
        if song is None:
            self._current_song = None
        # add it to playlist if song not in playlist
        elif song in self._songs:
            self._current_song = song
        else:
            self.insert(song)
            self._current_song = song
        self.song_changed.emit(song)
519542
function Listener(func, max_out) {
  this._func = func;
  this._max = max_out || 0;
  this._out = 0;
  this._end = false;
  this._ended = false;
  this._listening = false;

  var self = this;

  this.on('done', function () {
    self._out = Math.max(self._out - 1, 0);

    if (self._end && self._out === 0 && !self._listenning) {
      self.emit('end'); // We are ready to end
    }

    self.start();
  });

  this.on('end', function () {
    this._ended = true;
  });
}
152735
def play_Track(self, track):
        """"""
        if hasattr(track, 'name'):
            self.set_track_name(track.name)
        self.delay = 0
        instr = track.instrument
        if hasattr(instr, 'instrument_nr'):
            self.change_instrument = True
            self.instrument = instr.instrument_nr
        for bar in track:
            self.play_Bar(bar)
49572
function after(count, callback) {
    var countdown = count;

    return function shim(err) {
        if (typeof callback !== 'function') return;

        if (err) {
            callback(err);
            callback = null;
            return;
        }

        if (--countdown === 0) {
            callback();
            callback = null;
        }
    };
}
601208
function finish(e) {
      if (e && e.target !== node) {
        return;
      }

      clearTimeout(timer);
      if (removeListeners) removeListeners();

      (0, _removeClass2.default)(node, className);
      (0, _removeClass2.default)(node, activeClassName);

      if (removeListeners) removeListeners();

      // Usually this optional callback is used for informing an owner of
      // a leave animation and telling it to remove the child.
      if (finishCallback) {
        finishCallback();
      }
    }
31279
function(frame) {
                if (this.status != "playing") {
                    return;
                }
                this.time += frame.dur;
                this.setValue(this.getValue());
                if (this.time >= this.duration) {
                    this.timeUp();
                }
                frame.next();
            }
847539
function checkIfPlaying(){
          runInPage(window.fetaSource.isPlayingStr(),
            function(result){
                if(!result){
                    setTimeout(checkIfPlaying,500);
                }else{
                    _window.msgFromDevtools("revertRun",{data: result});
                }
            },
            function(err){
              alert(errorMessage+"error playing script, line 96.");
            });
        }
310817
function(){
			this.columnsVisibleFun();
			this.resetThVariable();
			this.countRowHeight();
			this.noRowsShowFun();
			this.renderTypeFun();
			this.resetScrollLeft();
			this.hideEditMenu();
			if(typeof this.options.afterCreate == 'function'){
				this.options.afterCreate.call(this);
			}
		}
169300
def update(self, screen, clock):
        """"""

        # If a music file was passed, start playing it on repeat
        if self.music is not None:
            pygame.mixer.music.play(-1)

        while True:
            clock.tick(30)
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()
                    sys.exit()
                # Check if any of the buttons were clicked
                for i in self.buttonlist:
                    if (event.type == pygame.MOUSEBUTTONUP and
                            i.rect.collidepoint(pygame.mouse.get_pos())):
                        if self.music is not None:
                            pygame.mixer.music.stop()
                        if self.widgetlist:
                            return [i(), self.widget_status()]
                        else:
                            return i()
                # If there is a widget list, check to see if any were clicked
                if self.widgetlist:
                    for i in self.widgetlist:
                        if (event.type == pygame.MOUSEBUTTONDOWN and
                                i.rect.collidepoint(pygame.mouse.get_pos())):
                            # Call the widget and give it the menu information
                            i(self)
            screen.blit(self.image, self.pos)
            pygame.display.flip()
205171
function endListener(state) {
    // Note:  If incremental is conclusive for 'end' event, this will be called
    // with isDone === true, since removeListener doesn't affect listeners for
    // an event which is already in-progress.
    if (state.ended || isDone) {
      return;
    }

    state.ended = true;
    ended += 1;

    debug(`${streamName(this)} has ended.`);

    if (options.incremental) {
      if (doCompare(options.incremental, CompareType.incremental)) {
        return;
      }
    }

    if (ended === 2) {
      const postEndCompare = function() {
        doCompare(options.compare, CompareType.last);
      };
      if (options.delay) {
        debug(`All streams have ended.  Delaying for ${options.delay
        }ms before final compare.`);
        postEndTimeout = setTimeout(postEndCompare, options.delay);
      } else {
        // Let pending I/O and callbacks complete to catch some errant events
        debug('All streams have ended.  Delaying before final compare.');
        postEndImmediate = setImmediate(postEndCompare);
      }
    }
  }
120441
function() {
        sound._paused = false;
        sound._seek = seek;
        sound._start = start;
        sound._stop = stop;
        sound._loop = loop;
      }
848552
def resume(self):
        """"""
        directive = self._play_directive('REPLACE_ALL')
        directive['audioItem'] = self._audio_item()
        self._response['directives'].append(directive)
        return self