public static Timebase valueOf(String rate)
	{
		if (rate.equalsIgnoreCase("PAL"))
		{
			return HZ_25;
		}
		else if (rate.equals("23.976"))
		{
			return NTSC_24;
		}
		else if (rate.equalsIgnoreCase("NTSC") || rate.equals("29.97"))
		{
			return NTSC;
		}
		else if (rate.equals("59.94"))
		{
			return NTSC_60;
		}
		else if (rate.equalsIgnoreCase("NTSC30"))
		{
			return HZ_30;
		}
		else
		{
			final String[] parts = rate.split(":");

			final int denominator;
			final int numerator;

			if (parts.length == 2)
			{
				numerator = Integer.parseInt(parts[1]);
			}
			else if (parts.length == 1)
			{
				numerator = 1; // default to 1 when numerator is not provided
			}
			else
			{
				throw new IllegalArgumentException("Cannot parse encoded timebase: " + rate);
			}

			denominator = Integer.parseInt(parts[0]);

			return new Timebase(numerator, denominator);
		}
	}
public static Timebase valueOf ( String rate ) { if ( rate . equalsIgnoreCase ( "PAL" ) ) { return HZ_25 ; } else if ( rate . equals ( "23.976" ) ) { return NTSC_24 ; } else if ( rate . equalsIgnoreCase ( "NTSC" ) || rate . equals ( "29.97" ) ) { return NTSC ; } else if ( rate . equals ( "59.94" ) ) { return NTSC_60 ; } else if ( rate . equalsIgnoreCase ( "NTSC30" ) ) { return HZ_30 ; } else { final String [ ] parts = rate . split ( ":" ) ; final int denominator ; final int numerator ; if ( parts . length == 2 ) { numerator = Integer . parseInt ( parts [ 1 ] ) ; } else if ( parts . length == 1 ) { numerator = 1 ; } else { throw new IllegalArgumentException ( "Cannot parse encoded timebase: " + rate ) ; } denominator = Integer . parseInt ( parts [ 0 ] ) ; return new Timebase ( numerator , denominator ) ; } }
Parses an encoded timebase.<br
/>
<p>The following textual representations are valid for time bases:</p>
<ul>
Its inverse as a rational number. The syntax is <i>{denominator}[:{numerator}]</i>, where numerator can be omitted if its
value is 1.
<li>A TimeBaseConstant string</li>
<li>TimeBaseConstant</li>
</ul>
<p>
The following TimeBaseConstants are currently defined:</p>
<p/>
<table>
<tr>
<th>TimeBaseConstant</th>
<th>Time base</th>
</tr>
<tr>
<td>PAL</td>
<td>25:1</td>
</tr>
<tr>
<td>NTSC or 29.97</td>
<td>30000:1001</td>
</tr>
<tr>
<td>23.976</td>
<td>24000:1001</td>
</tr>
<tr>
<td>59.94</td>
<td>60000:1001</td>
</tr>
<tr>
<td>NTSC30</td>
<td>30:1</td>
</tr>
</table>

@param rate

@return