Package net.sf.jiga.xtended.kernel

Examples of net.sf.jiga.xtended.kernel.Monitor


        return handlers;
    }

    @Override
    public void end() {
        final Monitor monitor = imageSynch;
        synchronized (monitor) {
            if (!isReverseEnabled()) {
                animator = length - 1;
            } else {
                animator = 0;
            }
            monitor.notify();
        }
    }
View Full Code Here


        return status();
    }

    @Override
    public int getPosition() {
        final Monitor monitor = imageSynch;
        synchronized (monitor) {
            monitor.notify();
            return animator;
        }
    }
View Full Code Here

        return isReverseEnabled() ? realTimeLengthNanos() - posTime : posTime;
    }

    @Override
    public boolean hasNext() {
        final Monitor monitor = imageSynch;
        synchronized (monitor) {
            int next = (isReverseEnabled()) ? -1 : +1;
            monitor.notify();
            return frames.containsKey(animator + next);
        }
    }
View Full Code Here

    /**
     * @return hashCode of the next Sprite to display
     */
    @Override
    public SpriteGLHandler next() {
        final Monitor monitor = imageSynch;
        synchronized (monitor) {
            pause();
            animator = getAnimatorValue(NEXT, animator);
            monitor.notify();
            return getSprite(animator);
        }
    }
View Full Code Here

        }
    }

    @Override
    public long position(int i) {
        final Monitor monitor = imageSynch;
        synchronized (monitor) {
            assert (i < length && i >= 0) : getClass().getCanonicalName() + " iterator is not in the correct interval!";
            animator = i;
            monitor.notify();
        }
        adjustStartTime();
        return getTimeFramePosition();
    }
View Full Code Here

        return getTimeFramePosition();
    }

    @Override
    public int position(long timeFrame) {
        final Monitor monitor = imageSynch;
        synchronized (monitor) {
            if (isReverseEnabled()) {
                timeFrame = realTimeLength() - timeFrame;
            }
            animator = Math.min(length - 1, Math.max(0, (int) Math.round(((float) timeFrame / (float) realTimeLength()) * (float) length)));
            position(animator);
            monitor.notify();
            return animator;
        }
    }
View Full Code Here

        }
    }

    @Override
    public SpriteGLHandler previous() {
        final Monitor monitor = imageSynch;
        synchronized (monitor) {
            pause();
            animator = getAnimatorValue(PREVIOUS, animator);
            monitor.notify();
            return getSprite(animator);
        }
    }
View Full Code Here

        return Math.round(realTimeLengthNanos() / 1000000.);
    }

    @Override
    public void remove() {
        final Monitor monitor = imageSynch;
        synchronized (monitor) {
            frames.remove(animator);
            monitor.notify();
        }
    }
View Full Code Here

        }
    }

    @Override
    public void rewind() {
        final Monitor monitor = imageSynch;
        synchronized (monitor) {
            pause();
            if (isReverseEnabled()) {
                animator = length - 1;
            } else {
                animator = 0;
            }
            sfx_played = false;
            monitor.notify();
        }
    }
View Full Code Here

            initSound().loadResource();
        }
        if ((getLoadState() & RenderingSceneGL._GLLOADSTATE_Loaded) == 0) {
            return this;
        }
        final Monitor monitor2 = imageSynch;
        synchronized (monitor2) {
            if (status() == Animation.PLAYING) {
                if (elapsedTime() >= realTimeLengthNanos()) {
                    stop();
                } else {
                    if (isReverseEnabled()) {
                        animator -= elapsedTickFrames();
                    } else {
                        animator += elapsedTickFrames();
                    }
                    lastTick = System.nanoTime();
                }
            }
            animator = Math.min(animator, length - 1);
            animator = Math.max(animator, 0);
            float rCoord = (float) Sf3Texture3D._3DTexLayersAmount * animator;
            float rCoordRange = Sf3Texture3D._3DTexLayersAmount * (length - 1);
            if (status() == Animation.PLAYING) {
                if (isReverseEnabled()) {
                    if (faders) {
                        rCoord = (1f - (float) elapsedTime() / (float) realTimeLengthNanos()) * rCoordRange;
                    }
                } else {
                    if (faders) {
                        rCoord = (float) elapsedTime() / (float) realTimeLengthNanos() * rCoordRange;
                    }
                }
            }
            getSprite(animator).setrCoord(rCoord);
            if (status() == Animation.PLAYING) {
                if ((isReverseEnabled() ? sfx_frame >= animator : sfx_frame <= animator) && sfx.isResourceLoaded()) {
                    if (!sfx_played) {
                        sfx_played = playSfx();
                    }
                } else {
                    sfx_played = false;
                }
            }
            monitor2.notify();
        }
        return this;
    }
View Full Code Here

TOP

Related Classes of net.sf.jiga.xtended.kernel.Monitor

Copyright © 2018 www.massapicom. 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.