Here you can find the source of intToTime(int time)
Parameter | Description |
---|---|
time | An integer value representing time (hour, minute, second, or frame) |
public static byte intToTime(int time)
//package com.java2s; /*/* w w w. j ava 2 s .c o m*/ * @(#)VCRUtil.java 2009.02.24 at 09:44:49 PST * * Copyright 2007 MBARI * * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1 * (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.gnu.org/copyleft/lesser.html * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { /** * Convert an <i>int</i> value to a timecode byte that can be used in sending a seekTimecode command. * @param time An integer value representing time (hour, minute, second, or frame) * @return The byte representiation of that time as a value recognized by a VCR. * @see org.mbari.vcr.VCRCommand */ public static byte intToTime(int time) { double timeD = (double) time; int tens = (int) Math.floor(timeD / 10D) * 10; int ones = time - tens; return (byte) (((tens / 10) << 4) + ones); } }