Examples of ClockTime


Examples of org.gstreamer.ClockTime

            // enable the slider
            progressSlider.setEnabled(true);

            int elapsedHours = -1, elapsedMinutes = -1, elapsedSeconds = -1;
            ClockTime pos = null;
            while (hasNotEnded() && isPlayBinReady() && !isCancelled()) {

                synchronized (playbinLock) {
                    pos = gstPlaybin2.queryPosition();
                }
                millisElapsed = pos.toMillis();

                // pick out the elapsed hours, minutes, seconds
                long secondsElapsed = millisElapsed / 1000;
                elapsedHours = (int) secondsElapsed / 3600;
                secondsElapsed -= elapsedHours * 3600;
 
View Full Code Here

Examples of org.gstreamer.ClockTime

        void playMedia() {
            if (jFile == null || !jFile.exists()) {
                progressLabel.setText(NbBundle.getMessage(this.getClass(), "GstVideoPanel.progressLabel.bufferingErr"));
                return;
            }
            ClockTime dur = null;
            synchronized (playbinLock) {
                // must play, then pause and get state to get duration.
                if (gstPlaybin2.play() == StateChangeReturn.FAILURE) {
                    logger.log(Level.WARNING, "Attempt to call PlayBin2.play() failed."); //NON-NLS
                    infoLabel.setText(MEDIA_PLAYER_ERROR_STRING);
                    return;
                }
                if (gstPlaybin2.pause() == StateChangeReturn.FAILURE) {
                    logger.log(Level.WARNING, "Attempt to call PlayBin2.pause() failed."); //NON-NLS
                    infoLabel.setText(MEDIA_PLAYER_ERROR_STRING);
                    return;
                }
                gstPlaybin2.getState();
                dur = gstPlaybin2.queryDuration();
            }
            duration = dur.toString();
            durationMillis = dur.toMillis();

            // pick out the total hours, minutes, seconds
            long durationSeconds = (int) durationMillis / 1000;
            totalHours = (int) durationSeconds / 3600;
            durationSeconds -= totalHours * 3600;
 
View Full Code Here

Examples of org.opengis.temporal.ClockTime

        NamedIdentifier name2 = new NamedIdentifier(Citations.CRS, "Julian calendar");
        TemporalReferenceSystem frame1 = new DefaultTemporalReferenceSystem(name1, null);
        TemporalReferenceSystem frame2 = new DefaultTemporalReferenceSystem(name2, null);
        Number[] clockTime1 = {0, 0, 0};
        Number[] clockTime2 = {12, 0, 0.0};
        ClockTime clocktime1 = new DefaultClockTime(frame1, null, clockTime1);
        ClockTime clocktime2 = new DefaultClockTime(frame2, null, clockTime2);
        ClockTime utcReference1 = new DefaultClockTime(frame1, null, clockTime1);
        ClockTime utcReference2 = new DefaultClockTime(frame2, null, clockTime2);
        clock1 = new DefaultClock(name1, null, new SimpleInternationalString("reference event"), clocktime1, utcReference1);
        clock2 = new DefaultClock(name2, null, new SimpleInternationalString("description"), clocktime2, utcReference2);
    }
View Full Code Here

Examples of org.opengis.temporal.ClockTime

    /**
     * Test of getReferenceTime method, of class DefaultClock.
     */
    @Test
    public void testGetReferenceTime() {
        ClockTime result = clock1.getReferenceTime();
        assertFalse(clock2.getReferenceTime().equals(result));
    }
View Full Code Here

Examples of org.opengis.temporal.ClockTime

    /**
     * Test of getUTCReference method, of class DefaultClock.
     */
    @Test
    public void testGetUTCReference() {
        ClockTime result = clock1.getUTCReference();
        assertFalse(clock2.getUTCReference().equals(result));
    }
View Full Code Here

Examples of org.opengis.temporal.ClockTime

    /**
     * Test of setReferenceTime method, of class DefaultClock.
     */
    @Test
    public void testSetReferenceTime() {
        ClockTime result = clock1.getReferenceTime();
        ((DefaultClock) clock1).setReferenceTime(new DefaultClockTime(clock1, IndeterminateValue.UNKNOWN, null));
        assertFalse(clock1.getReferenceTime().equals(result));
    }
View Full Code Here

Examples of org.opengis.temporal.ClockTime

    /**
     * Test of setUtcReference method, of class DefaultClock.
     */
    @Test
    public void testSetUtcReference() {
        ClockTime result = clock1.getUTCReference();
        ((DefaultClock) clock1).setUtcReference(new DefaultClockTime(clock1, IndeterminateValue.UNKNOWN, null));
        assertFalse(clock1.getUTCReference().equals(result));
    }
View Full Code Here

Examples of org.opengis.temporal.ClockTime

    @Test
    public void testDateTrans_CalendarDate_ClockTime() {
        int[] cal = {2012, 9, 10};
        CalendarDate calendarDate = new DefaultCalendarDate(calendar1, IndeterminateValue.NOW, new SimpleInternationalString("new Era"), cal);
        Number[] clock = {12, 10, 5.488};
        ClockTime clockTime = new DefaultClockTime(calendar1, IndeterminateValue.NOW, clock);
        JulianDate result = calendar1.dateTrans(calendarDate, clockTime);
        assertTrue(calendar2.dateTrans(calendarDate, clockTime).equals(result));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.