previous song for player to play

        NOTE: not the last played song
432012
def previous_song(self):
        
        if self.current_song is None:
            return self._get_good_song(base=-1, direction=-1)

        if self.playback_mode == PlaybackMode.random:
            previous_song = self._get_good_song(direction=-1)
        else:
            current_index = self._songs.index(self.current_song)
            previous_song = self._get_good_song(base=current_index - 1, direction=-1)
        return previous_song
1301643
private void fireMusicEnded() {
		playing = false;
		for (int i=0;i<listeners.size();i++) {
			((MusicListener) listeners.get(i)).musicEnded(this);
		}
	}
1057263
def _new_song(self):
        '''
        
        '''
        # We'll need this later
        s = self.song
        
        if self.shuffle:
            # If shuffle is on, we need to (1) get a random song that 
            # (2) accounts for weighting. This line does both.
            self.song = self.shuffles[random.randrange(len(self.shuffles))]
        else:
            # Nice and easy, just get the next song...
            self.song += 1
            # But wait! need to make sure it exists!
            if self.song >= len(self.loop):
                # It doesn't, so start over at the beginning.
                self.song = 0
        # Set flag if we have the same song as we had before.
        self.dif_song = s != self.song
        # Reset the position within the metasong
        self.pos = 0
804406
def play_song(self, song):
        
        if song is not None and song == self.current_song:
            logger.warning('The song is already under playing.')
        else:
            self._playlist.current_song = song
1070495
public Collection getNotesBetween(MusicElement elmtBegin,
			MusicElement elmtEnd) throws IllegalArgumentException {
		int idxBegin = indexOf(elmtBegin);
		int idxEnd = this.indexOf(elmtEnd);
		if (idxBegin == -1)
			throw new IllegalArgumentException("Note " + elmtBegin
					+ " hasn't been found in tune");
		if (idxEnd == -1)
			throw new IllegalArgumentException("Note " + elmtEnd
					+ " hasn't been found in tune");
		if (idxBegin > idxEnd)
			throw new IllegalArgumentException("Note " + elmtBegin
					+ " is located after " + elmtEnd + " in the score");
		Collection ret = new Vector();
		MusicElement currentScoreEl;
		for (int i = idxBegin; i <= idxEnd; i++) {
			currentScoreEl = (MusicElement) elementAt(i);
			if (currentScoreEl instanceof NoteAbstract)
				ret.add(currentScoreEl);
		}
		return ret;
	}
848552
def resume(self):
        """"""
        directive = self._play_directive('REPLACE_ALL')
        directive['audioItem'] = self._audio_item()
        self._response['directives'].append(directive)
        return self
59786
def repeat(self, repeat):
        """"""
        shuffle = self.shuffle
        self.play_mode = PLAY_MODE_BY_MEANING[(shuffle, repeat)]
891979
function(index) {
    var self = this;

    // Stop the current track.
    if (self.playlist[self.index].howl) {
      self.playlist[self.index].howl.stop();
    }

    // Reset progress.
    progress.style.width = '0%';

    // Play the new track.
    self.play(index);
  }
143125
public void next() {
        final PlayList pl = getPlaylist();

        final int previousPosition = pl.getCurrentSlide();
        pl.next();
        final int currentPosition = pl.getCurrentSlide();

        playSlide(currentPosition, previousPosition);
    }
933101
def append_note(self, player, text):
        """"""
        note = self._find_note(player)
        note.text += text
572761
def play(self, stream_url, offset=0, opaque_token=None):
        """"""

        self._response['shouldEndSession'] = True
        directive = self._play_directive('REPLACE_ALL')
        directive['audioItem'] = self._audio_item(stream_url=stream_url, offset=offset, opaque_token=opaque_token)
        self._response['directives'].append(directive)
        return self
318150
function getNotesUp($scalenum, $root, $octaves, $hand) {
        $initialnote = clone($root);
        $str = "\n % going up \n";
        $clef = ''; // this will force a clef to be defined for the first note
        for ($o=0; $o<$octaves; $o++) {
            $scale = new Scale($scalenum, $initialnote, 'ascending');
            $pitches = $scale->getPitches();
            $degree = 0;
            foreach ($pitches as $pitch) {
                $newclef = ($initialnote->interval($this->middleC) > 0) ? 'bass' : 'treble';
                if ($newclef != $clef) {
                    $clef = $newclef;
                    $str .= '\\clef "' . $clef . '" ';
                }
                $str .= $pitch->toLilypond() . $this->duration;

                $isbottom = $pitch->isEnharmonic($root);
                $finger = $this->getFinger($scalenum, $initialnote, $hand, $degree, false, $isbottom);
                $str .= '-' . $finger;

                $str .= ' ';
                $degree++;
            }
            $initialnote->transpose(12);
        }
        return $str;
    }
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);
  }
1179331
def add_note(self, note):
        
        for n in self.selected_tracks:
            self.tracks[n] + note
512024
public void play() {
        checkState();
        if (mState == STATE_PAUSED) {
            PlaybackService.resume(getContext(), mClientKey);
        } else if (mState == STATE_STOPPED) {
            SoundCloudTrack track = mPlayerPlaylist.getCurrentTrack();
            if (track != null) {
                PlaybackService.play(getContext(), mClientKey, track);
            } else {
                return;
            }
        }
        mState = STATE_PLAYING;
    }
707700
private void play(String track, String name)
    {
        Verbose.info(INFO_PLAYING, name);
        play(track);
    }
576663
def add_note(self, player, text, label=None, update=None):
        """"""
        if label is not None and (label not in self.label_names):
            raise LabelNotFoundError('Invalid label: {}'.format(label))
        if update is None:
            update = datetime.utcnow()
        # converted to timestamp, rounded to ones
        update = update.strftime('%s')
        label_id = self._get_label_id(label)
        new_note = etree.Element('note', player=player, label=label_id, update=update)
        new_note.text = text
        self.root.append(new_note)