javauis/mmapi_qt/baseline/javasrc/com/nokia/microedition/media/animation/StopTimeControl.java
changeset 23 98ccebc37403
child 26 dc7c549001d5
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 /**
       
    18  * 
       
    19  */
       
    20 package com.nokia.microedition.media.animation;
       
    21 
       
    22 import javax.microedition.media.Player;
       
    23 
       
    24 import com.nokia.microedition.media.control.ControlImpl;
       
    25 
       
    26 /**
       
    27  * @author d35kumar
       
    28  *
       
    29  */
       
    30 public class StopTimeControl extends ControlImpl implements
       
    31 		javax.microedition.media.control.StopTimeControl {
       
    32 
       
    33 	long iStopTime=RESET;
       
    34 	/**
       
    35 	 * 
       
    36 	 */
       
    37 	public StopTimeControl(Player aPlayer) {
       
    38 		this.iPlayer=aPlayer;
       
    39 	}
       
    40 
       
    41 	/* (non-Javadoc)
       
    42 	 * @see javax.microedition.media.control.StopTimeControl#getStopTime()
       
    43 	 */
       
    44 	public long getStopTime() {
       
    45 		 checkState();
       
    46 		return iStopTime;
       
    47 	}
       
    48 
       
    49 	/* (non-Javadoc)
       
    50 	 * @see javax.microedition.media.control.StopTimeControl#setStopTime(long)
       
    51 	 */
       
    52 	public void setStopTime(long aStopTime) {
       
    53 		checkState();
       
    54 		if (iPlayer.getState() == Player.STARTED && getStopTime() != RESET) {
       
    55 			throw new IllegalStateException(
       
    56 					"Player is STARTED or setStopTime() is already called successfully");
       
    57 		}
       
    58 		iStopTime = aStopTime;
       
    59 	}
       
    60 }