Remove a track from the SoundCloud player playlist.
<p/>
If the track is currently played, it will be stopped before being removed.

@param trackIndex index of the track to be removed.
@return track removed or null if given index can't be found.
339084
public SoundCloudTrack remove(int trackIndex) {

        SoundCloudTrack removedTrack = null;
        ArrayList<SoundCloudTrack> tracks = mSoundCloudPlaylist.getTracks();

        // check if track is in the playlist
        if (trackIndex >= 0 && trackIndex < tracks.size()) {
            removedTrack = tracks.remove(trackIndex);

            if (tracks.size() == 0) {
                // track list empty after removal
                mCurrentTrackIndex = 0;
            } else if (trackIndex == tracks.size()) {
                // last song removed
                mCurrentTrackIndex = (mCurrentTrackIndex - 1) % tracks.size();
            } else if (trackIndex >= 0 && trackIndex < mCurrentTrackIndex) {
                // tracks translated on the right after a deletion before current played one.
                mCurrentTrackIndex = (mCurrentTrackIndex - 1) % tracks.size();
            }
        }
        return removedTrack;
    }
842067
public Object remove(int index) {
        return index >= 0 && index < this.length()
            ? this.myArrayList.remove(index)
            : null;
    }
1131184
public void remove( int index ) {
		T removed = data[index];
		for( int i = index+1; i < size; i++ ) {
			data[i-1] = data[i];
		}
		data[size-1] = removed;
		size--;
	}
436597
public final synchronized void removeEventListener(final Class cls) {
        for (int listenerIndex = 0; listenerIndex < this.listeners.size();) {
            E listener = this.listeners.get(listenerIndex);
            
            if (cls.isAssignableFrom(listener.getClass())) {
                this.listeners.remove(listenerIndex);
            } else {
                listenerIndex++;
            }
        }
    }
897389
private void doMoveSelectedEntriesInList(int moveBy)
	{
		PlayListEntry [] selected = playList.getSelectedEntries();
		if (selected!=null)
		{
			playlistUpdateThread.halt();
			try
			{
				if (moveBy < 0)
				{
					// Moveup --> Still possible?
					if ((selected[0].getIndexInPlaylist() + moveBy) < 0)
						moveBy = selected[0].getIndexInPlaylist();
					if (moveBy == 0) return;
					
					for (int i=0; i<selected.length; i++)
					{
						int fromIndex = selected[i].getIndexInPlaylist();
						playList.move(fromIndex, fromIndex + moveBy);
					}
				}
				else
				{
					// Movedown --> Still possible?
					int lastIndex = selected.length - 1;
					if ((selected[lastIndex].getIndexInPlaylist() + moveBy) >= playList.size())
						moveBy = playList.size() - 1 - selected[lastIndex].getIndexInPlaylist();
					if (moveBy == 0) return;
					
					for (int i=lastIndex; i>=0; i--)
					{
						int fromIndex = selected[i].getIndexInPlaylist();
						playList.move(fromIndex, fromIndex + moveBy);
					}
				}
				int showIndex = (moveBy<0)?selected[0].getIndexInPlaylist()-PLUS_LINES_VISABLE:selected[selected.length-1].getIndexInPlaylist()+PLUS_LINES_VISABLE;   
				createList(showIndex);
				firePlaylistChanged();
			}
			finally
			{
				playlistUpdateThread.restart();
			}
		}
	}
542453
public void removeSource(GVRAudioSource audioSource)
    {
        synchronized (mAudioSources)
        {
            audioSource.setListener(null);
            mAudioSources.remove(audioSource);
        }
    }
1338484
private void setTrack(SoundCloudTrack track) {
        if (track == null) {
            mTitle.setText("");
            mArtwork.setImageDrawable(null);
            mPlayPause.setImageResource(R.drawable.ic_play_white);
            mSeekBar.setProgress(0);
            String none = String.format(getResources().getString(R.string.playback_view_time), 0, 0);
            mCurrentTime.setText(none);
            mDuration.setText(none);
        } else {
            Picasso.with(getContext())
                    .load(SoundCloudArtworkHelper.getArtworkUrl(track, SoundCloudArtworkHelper.XLARGE))
                    .fit()
                    .centerCrop()
                    .placeholder(R.color.grey)
                    .into(mArtwork);
            mTitle.setText(Html.fromHtml(String.format(getResources().getString(R.string.playback_view_title),
                    track.getArtist(), track.getTitle())));
            mPlayPause.setImageResource(R.drawable.ic_pause_white);
            if (getTranslationY() != 0) {
                this.animate().translationY(0);
            }
            mSeekBar.setMax(((int) track.getDurationInMilli()));
            String none = String.format(getResources().getString(R.string.playback_view_time), 0, 0);
            int[] secondMinute = getSecondMinutes(track.getDurationInMilli());
            String duration = String.format(getResources().getString(R.string.playback_view_time),
                    secondMinute[0], secondMinute[1]);
            mCurrentTime.setText(none);
            mDuration.setText(duration);
        }
    }
460843
private int dropUnusedTracks() {

		List<PointTrack> all = tracker.getAllTracks(null);
		int num = 0;

		for (PointTrack t : all) {
			VoTrack p = t.getCookie();
			if (tick - p.lastInlier > thresholdRetire) {
				tracker.dropTrack(t);
				num++;
			}
		}

		return num;
	}
1132443
public void play(SoundCloudTrack track) {
        checkState();
        ArrayList<SoundCloudTrack> tracks = mPlayerPlaylist.getPlaylist().getTracks();
        int position = tracks.indexOf(track);
        if (position > -1) {
            mPlayerPlaylist.setPlayingTrack(position);
            PlaybackService.play(getContext(), mClientKey, track);
        }
    }
1232167
void removeAt(final int removeIndex) {
        // assert lock.getHoldCount() == 1;
        // assert items[removeIndex] != null;
        // assert removeIndex >= 0 && removeIndex < items.length;
        final Object[] items = this.items;
        if (removeIndex == takeIndex) {
            // removing front item; just advance
            items[takeIndex] = null;
            if (++takeIndex == items.length) takeIndex = 0;
            count--;
            if (itrs != null)
                itrs.elementDequeued();
        } else {
            // an "interior" remove

            // slide over all others up through putIndex.
            for (int i = removeIndex, putIndex = this.putIndex;;) {
                int pred = i;
                if (++i == items.length) i = 0;
                if (i == putIndex) {
                    items[pred] = null;
                    this.putIndex = pred;
                    break;
                }
                items[pred] = items[i];
            }
            count--;
            if (itrs != null)
                itrs.removedAt(removeIndex);
        }
        notFull.signal();
    }
1114428
def remove_from_queue(self, index):
        
        # TODO: what do these parameters actually do?
        updid = '0'
        objid = 'Q:0/' + str(index + 1)
        self.avTransport.RemoveTrackFromQueue([
            ('InstanceID', 0),
            ('ObjectID', objid),
            ('UpdateID', updid),
        ])
406050
public void removeValue(int index) {

        m_content.removeValue(getPath(), getLocale(), index);

        // re-initialize the value list
        m_values = m_content.getValues(getPath(), getLocale());
    }
129271
private void doChangeSelectionInList(int moveBy)
	{
		PlayListEntry [] selected = playList.getSelectedEntries();
		if (selected==null || selected.length == 0)
		{
			playList.setSelectedElement(0);
			doMakeIndexVisible(0);
		}
		else
		{
			int firstIndex = selected[0].getIndexInPlaylist(); 
			int lastIndex = selected[selected.length - 1].getIndexInPlaylist();
			if (moveBy < 0)
			{
				firstIndex += moveBy;
				if (firstIndex<0) firstIndex = 0;
			}
			else
			{
				lastIndex += moveBy;
				if (lastIndex >= playList.size()) lastIndex = playList.size() - 1; 
			}
			playList.setSelectedElements(firstIndex, lastIndex);
			if (moveBy < 0) doMakeIndexVisible(firstIndex); else doMakeIndexVisible(lastIndex);
		}
	}
1092823
public boolean removeRoadSegment(int segmentIndex) {
		if (segmentIndex >= 0 && segmentIndex < this.roadSegments.getRoadSegmentCount()) {
			final RoadSegment segment = this.roadSegments.getRoadSegmentAt(segmentIndex);
			if (segment != null) {
				//
				// Invalidate the bus halts on the segment
				//
				final Map<BusItineraryHalt, RoadSegment> segmentMap = new TreeMap<>(
						(obj1, obj2) -> Integer.compare(System.identityHashCode(obj1), System.identityHashCode(obj2)));
				final Iterator<BusItineraryHalt> haltIterator = this.validHalts.iterator();
				while (haltIterator.hasNext()) {
					final BusItineraryHalt halt = haltIterator.next();
					final int sgmtIndex = halt.getRoadSegmentIndex();
					if (sgmtIndex == segmentIndex) {
						segmentMap.put(halt, null);
					} else {
						final RoadSegment sgmt = this.roadSegments.getRoadSegmentAt(sgmtIndex);
						segmentMap.put(halt, sgmt);
					}
				}

				//
				// Remove the road segment itself on the segment
				//
				this.roadSegments.removeRoadSegmentAt(segmentIndex);

				//
				// Force the road segment indexes
				//
				for (final Entry<BusItineraryHalt, RoadSegment> entry : segmentMap.entrySet()) {
					final BusItineraryHalt halt = entry.getKey();
					final RoadSegment sgmt = entry.getValue();
					if (sgmt == null) {
						halt.setRoadSegmentIndex(-1);
						halt.setPositionOnSegment(Float.NaN);
						halt.checkPrimitiveValidity();
					} else {
						final int sgmtIndex = halt.getRoadSegmentIndex();
						final int idx = this.roadSegments.indexOf(sgmt);
						if (idx != sgmtIndex) {
							halt.setRoadSegmentIndex(idx);
							halt.checkPrimitiveValidity();
						}
					}
				}

				//
				// Change the road network reference
				//
				if (this.roadSegments.isEmpty() && this.roadNetwork != null) {
					final RoadNetwork network = this.roadNetwork.get();
					if (network != null) {
						network.removeRoadNetworkListener(this);
					}
					this.roadNetwork = null;
				}

				fireShapeChanged(new BusChangeEvent(this,
						BusChangeEventType.SEGMENT_REMOVED,
						segment,
						segmentIndex,
						"shape", //$NON-NLS-1$
						null,
						null));
				checkPrimitiveValidity();
				return true;
			}
		}
		return false;
	}
111227
@Override
    public void delete(int index)
    {
        checkNotSealed(null, index);
        slotMap.remove(null, index);
    }
361228
@Override
  public NetworkReqListener removeSessionListener(String sessionId) {
    if (this.localDataSource.exists(sessionId)) {
      return this.localDataSource.removeSessionListener(sessionId);
    }
    else if (!this.localMode && this.existReplicated(sessionId)) {
      // does not make much sense ;[
      this.makeLocal(sessionId);
      return this.localDataSource.removeSessionListener(sessionId);
    }

    return null;
  }
90324
public boolean removeWatcher(Listener watcher) {
        if (watcher == null) {
            throw new IllegalArgumentException("Null watcher removed");
        }

        synchronized (mutex) {
            AtomicBoolean removed = new AtomicBoolean(removeFromListeners(watchers, watcher));
            watchedFiles.forEach((path, suppliers) -> {
                if (removeFromListeners(suppliers, watcher)) {
                    removed.set(true);
                }
            });
            return removed.get();
        }
    }