Calculates the timestamp of all tracks' sync samples.

@param movie <code>track</code> is located in this movie
@param track get this track's samples timestamps
@return a list of timestamps
165207
public static List<long[]> getSyncSamplesTimestamps(Movie movie, Track track) {
        List<long[]> times = new LinkedList<long[]>();
        for (Track currentTrack : movie.getTracks()) {
            if (currentTrack.getHandler().equals(track.getHandler())) {
                long[] currentTrackSyncSamples = currentTrack.getSyncSamples();
                if (currentTrackSyncSamples != null && currentTrackSyncSamples.length > 0) {
                    final long[] currentTrackTimes = getTimes(currentTrack, movie);
                    times.add(currentTrackTimes);
                }
            }
        }
        return times;
    }
1029299
public Date getTimestamp(FastTrackField dateName, FastTrackField timeName)
   {
      Date result = null;
      Date date = getDate(dateName);
      if (date != null)
      {
         Calendar dateCal = DateHelper.popCalendar(date);
         Date time = getDate(timeName);
         if (time != null)
         {
            Calendar timeCal = DateHelper.popCalendar(time);
            dateCal.set(Calendar.HOUR_OF_DAY, timeCal.get(Calendar.HOUR_OF_DAY));
            dateCal.set(Calendar.MINUTE, timeCal.get(Calendar.MINUTE));
            dateCal.set(Calendar.SECOND, timeCal.get(Calendar.SECOND));
            dateCal.set(Calendar.MILLISECOND, timeCal.get(Calendar.MILLISECOND));
            DateHelper.pushCalendar(timeCal);
         }

         result = dateCal.getTime();
         DateHelper.pushCalendar(dateCal);
      }

      return result;
   }
527408
def addTrack(self, track):
        
        if track.kind == 'audio':
            if self.__container.format.name == 'wav':
                codec_name = 'pcm_s16le'
            elif self.__container.format.name == 'mp3':
                codec_name = 'mp3'
            else:
                codec_name = 'aac'
            stream = self.__container.add_stream(codec_name)
        else:
            if self.__container.format.name == 'image2':
                stream = self.__container.add_stream('png', rate=30)
                stream.pix_fmt = 'rgb24'
            else:
                stream = self.__container.add_stream('libx264', rate=30)
                stream.pix_fmt = 'yuv420p'
        self.__tracks[track] = MediaRecorderContext(stream)
295268
public static TimestampSpec mergeTimestampSpec(List<TimestampSpec> toMerge)
  {
    if (toMerge == null || toMerge.size() == 0) {
      return null;
    }

    TimestampSpec result = toMerge.get(0);
    for (int i = 1; i < toMerge.size(); i++) {
      if (toMerge.get(i) == null) {
        continue;
      }
      if (!Objects.equals(result, toMerge.get(i))) {
        return null;
      }
    }

    return result;
  }
239852
public boolean dropTrack( CombinedTrack<TD> track ) {
		if( !tracksPureKlt.remove(track) )
			if( !tracksReactivated.remove(track) )
				if( !tracksDormant.remove(track) )
					return false;

		tracksUnused.add(track);
		return true;
	}
1125615
public long[] getTrackNumbers() {

        List<TrackBox> trackBoxes = this.getBoxes(TrackBox.class);
        long[] trackNumbers = new long[trackBoxes.size()];
        for (int trackCounter = 0; trackCounter < trackBoxes.size(); trackCounter++) {
            trackNumbers[trackCounter] = trackBoxes.get(trackCounter).getTrackHeaderBox().getTrackId();
        }
        return trackNumbers;
    }
178785
def get_tracks(self, offset=0, limit=50):
        
        response = self.client.get(
            self.client.USER_TRACKS % (self.name, offset, limit))
        return self._parse_response(response, strack)
948484
@SuppressWarnings("deprecation")
    public void setMetaData(SoundCloudTrack track, Bitmap artwork) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {

            // set meta data on the lock screen for pre lollipop.
            mRemoteControlClientCompat.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
            RemoteControlClientCompat.MetadataEditorCompat mediaEditorCompat
                    = mRemoteControlClientCompat.editMetadata(true)
                    .putString(MediaMetadataRetriever.METADATA_KEY_TITLE, track.getTitle())
                    .putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, track.getArtist());
            if (artwork != null) {
                mediaEditorCompat.putBitmap(
                        RemoteControlClientCompat.MetadataEditorCompat.METADATA_KEY_ARTWORK, artwork);
            }
            mediaEditorCompat.apply();
        }

        // set meta data to the media session.
        MediaMetadataCompat.Builder metadataCompatBuilder = new MediaMetadataCompat.Builder()
                .putString(MediaMetadataCompat.METADATA_KEY_TITLE, track.getTitle())
                .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, track.getArtist());
        if (artwork != null) {
            metadataCompatBuilder.putBitmap(MediaMetadataCompat.METADATA_KEY_ART, artwork);
        }
        mMediaSession.setMetadata(metadataCompatBuilder.build());
        setMediaSessionCompatPlaybackState(PlaybackStateCompat.STATE_PLAYING);
    }
1271524
public ResultsMap<String, List<String>> getTimezones() throws MovieDbException {
        URL url = new ApiUrl(apiKey, MethodBase.TIMEZONES).subMethod(MethodSub.LIST).buildUrl();
        String webpage = httpTools.getRequest(url);

        List<Map<String, List<String>>> tzList;
        try {
            tzList = MAPPER.readValue(webpage, new TypeReference<List<Map<String, List<String>>>>() {
            });
        } catch (IOException ex) {
            throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get timezone list", url, ex);
        }

        ResultsMap<String, List<String>> timezones = new ResultsMap<>();

        for (Map<String, List<String>> tzMap : tzList) {
            for (Map.Entry<String, List<String>> x : tzMap.entrySet()) {
                timezones.put(x.getKey(), x.getValue());
            }
        }

        return timezones;
    }
591340
public synchronized void updateFromTrackParameters(TrackParameters track) {
    parameters.clear();
    for(TrackedParameter p : track.getAllParameters()) {
      Parameter<?> option = p.getParameter();
      String value = null;
      if(option.isDefined()) {
        if(option.tookDefaultValue()) {
          value = DynamicParameters.STRING_USE_DEFAULT + option.getDefaultValueAsString();
        }
        else {
          value = option.getValueAsString();
        }
      }
      if(value == null) {
        value = (option instanceof Flag) ? Flag.NOT_SET : "";
      }
      int bits = 0;
      if(option.isOptional()) {
        bits |= BIT_OPTIONAL;
      }
      if(option.hasDefaultValue() && option.tookDefaultValue()) {
        bits |= BIT_DEFAULT_VALUE;
      }
      if(value.length() <= 0) {
        if((bits & BIT_DEFAULT_VALUE) == 0 && (bits & BIT_OPTIONAL) == 0) {
          bits |= BIT_INCOMPLETE;
        }
      }
      else {
        try {
          if(!option.tookDefaultValue() && !option.isValid(value)) {
            bits |= BIT_INVALID;
          }
        }
        catch(ParameterException e) {
          bits |= BIT_INVALID;
        }
      }
      int depth = 0;
      {
        Object pos = track.getParent(option);
        while(pos != null) {
          pos = track.getParent(pos);
          depth += 1;
          if(depth > 10) {
            break;
          }
        }
      }
      parameters.add(new Node(option, value, bits, depth));
    }
  }
134322
function (trackIndex, animation, loop, delay) {
		var entry = new spine.TrackEntry();
		entry.animation = animation;
		entry.loop = loop;
		entry.endTime = animation.duration;

		var last = this._expandToIndex(trackIndex);
		if (last) {
			while (last.next)
				last = last.next;
			last.next = entry;
		} else
			this.tracks[trackIndex] = entry;

		if (delay <= 0) {
			if (last)
				delay += last.endTime - this.data.getMix(last.animation, animation);
			else
				delay = 0;
		}
		entry.delay = delay;

		return entry;
	}
948426
public ResultList<ReleaseDates> getReleaseDates(int movieId) throws MovieDbException {
        TmdbParameters parameters = new TmdbParameters();
        parameters.add(Param.ID, movieId);

        URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.RELEASE_DATES).buildUrl(parameters);
        WrapperGenericList<ReleaseDates> wrapper = processWrapper(getTypeReference(ReleaseDates.class), url, "release dates");
        return wrapper.getResultsList();
    }
242427
private void playTrack(SoundCloudTrack track) {
        pauseTimer();
        try {
            // acquire lock on wifi.
            mWifiLock.acquire();

            mIsPaused = false;
            mIsPausedAfterAudioFocusChanged = false;
            mHasAlreadyPlayed = true;

            // 1 - UPDATE ALL VISUAL CALLBACK FIRST TO IMPROVE USER EXPERIENCE

            updateNotification();
            // update playback state as well as meta data.
            mMediaSession.setPlaybackState(MediaSessionWrapper.PLAYBACK_STATE_PLAYING);
            // start loading of the artwork.
            loadArtwork(this,
                    SoundCloudArtworkHelper.getArtworkUrl(track, SoundCloudArtworkHelper.XXXLARGE));
            // broadcast events
            Intent intent = new Intent(PlaybackListener.ACTION_ON_TRACK_PLAYED);
            intent.putExtra(PlaybackListener.EXTRA_KEY_TRACK, track);
            mLocalBroadcastManager.sendBroadcast(intent);
            Intent bufferingStart = new Intent(PlaybackListener.ACTION_ON_BUFFERING_STARTED);
            mLocalBroadcastManager.sendBroadcast(bufferingStart);

            // 2 - THEN PREPARE THE TRACK STREAMING

            // set media player to stop state in order to be able to call prepare.
            mMediaPlayer.reset();

            // set new data source
            mMediaPlayer.setDataSource(track.getStreamUrl() + SOUND_CLOUD_CLIENT_ID_PARAM
                    + mSoundCloundClientId);

            // Try to gain the audio focus before preparing and starting the media player.
            if (mAudioManager.requestAudioFocus(this, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN)
                    == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
                // prepare asynchronously the stream to be able to handle new action on the
                // service thread such as a pause command.
                mIsPreparing = true;
                mMediaPlayer.prepareAsync();
            }

        } catch (IOException e) {
            Log.e(TAG, "File referencing not exist : " + track);
        }
    }
803451
def from_Track(track):
    """"""
    # Throw exception
    if not hasattr(track, 'bars'):
        return False
    lastkey = Key('C')
    lasttime = (4, 4)

    # Handle the Bars:
    result = ''
    for bar in track.bars:
        if lastkey != bar.key:
            showkey = True
        else:
            showkey = False
        if lasttime != bar.meter:
            showtime = True
        else:
            showtime = False
        result += from_Bar(bar, showkey, showtime) + ' '
        lastkey = bar.key
        lasttime = bar.meter
    return '{ %s}' % result
866437
public Snippet getSnippet(int trackID) throws MusixMatchException {
        Snippet snippet = null;
        SnippetGetMessage message = null;
        Map<String, Object> params = new HashMap<String, Object>();

        params.put(Constants.API_KEY, apiKey);
        params.put(Constants.TRACK_ID, new String("" + trackID));

        String response = null;

        response = MusixMatchRequest.sendRequest(Helper.getURLString(
				Methods.TRACK_SNIPPET_GET, params));

        Gson gson = new Gson();

        try {
            message = gson.fromJson(response, SnippetGetMessage.class);
        } catch (JsonParseException jpe) {
            handleErrorResponse(response);
        }

        snippet = message.getContainer().getBody().getSnippet();

        return snippet;
    }
572477
def at(time)
      add_tracks if ! @tracks_added

      if time.is_a?(String)
        time = Time.parse(time)
      end
      time = time.to_i

      location = nil

      @tracks.each do |track|
        location = track.at(time)
        break if location
      end

      if ! location
        case @intersegment_behavior
        when :interpolate then
          @intersegments.each do |track|
            location = track.at(time)
            break if location
          end
        when :nearest then
          # hash is sorted in ascending time order.
          # all start/end points for all segments
          points = {}
          @tracks.each do |t|
            points[t.start_time.to_i] = t.start_location
            points[t.end_time.to_i] = t.end_location
          end

          last_diff = Infinity
          last_time = -1
          points.each do |p_time,p_location|
            this_diff = (p_time.to_i - time).abs

            # as long as the differences keep getting smaller, we keep going
            # as soon as we see a larger one, we step back one and use that value.
            if this_diff > last_diff
              l = points[last_time]
              location = Track.array_to_hash(points[last_time])
              break
            else
              last_diff = this_diff
              last_time = p_time
            end
          end

          # if we got here, time is > the end of the last segment
          location = Track.array_to_hash(points[last_time])
        end
      end

      # each segment has a begin and end time.
      # which one is this time closest to?
      # array of times in order. compute abs diff between time and each point.
      # put times in order. abs diff to each, until we get a larger value or we run out of points. then back up one and use that.
      # {time => [lat, lon, elev], time => [lat, lon, elev]}

      location
    end
204749
function(track, beatInd) {
  var event = clock.callbackAtTime(function(event) {
    var bufferNode = soundBank[track].createNode()
    bufferNode.start(event.deadline)
  }, nextBeatTime(beatInd))
  event.repeat(barDur)
  event.tolerance({late: 0.01})
  beats[track][beatInd] = event
}