net.sf.dvbcentral.lib
Class Tune

java.lang.Object
  extended by net.sf.dvbcentral.lib.Tune
All Implemented Interfaces:
Cloneable

public final class Tune
extends Object
implements Cloneable

Class that encapsulates frequency and other aspects of a DVB broadcast. The class is immutable. Once created all the information in it remain. There is a support for creation of clones with some modified values, while basing the others on the defaults provided by the original (like frequency method). There is a support for creation of completely new and empty Tune by calling createNew() or one can create a tune most suitable to his local settings (based on default locale) by calling createTelestrial(java.util.Locale).


Nested Class Summary
static class Tune.Bandwidth
          Constants representing possible bandwidth values.
static class Tune.CodeRate
          Enumerates possible values for code rate.
static class Tune.GuardInterval
          Enumerates possible values for guard interval.
static class Tune.Hierarchy
          Set of hierarchy constants.
static class Tune.Modulation
          Enumeration of constants for modulation.
static class Tune.SpectralInversion
          Value for spectral inversion.
static class Tune.TransmitMode
          Constants for transmit mode.
 
Method Summary
 Tune bandwidth(Tune.Bandwidth b)
          New clone of the tune with changed bandwidth is created.
 Tune codeRate(boolean highPriorityStream, Tune.CodeRate codeRate)
          Creates new clonned tune with different code rate than this one has.
static Tune createNew()
          Creates new completely empty tune.
static Tune createTelestrial(Locale l)
          Creates a tune predefined with values according to the usual DVB-T settings in a location identified by the provided locale.
 boolean equals(Object o)
           
 Tune frequency(int hz)
          Creates new tune with all values equal to this instance, just with changes frequency.
 Tune.Bandwidth getBandwidth()
          Getter for bandwidth in MHz.
 int getFrequency()
          Getter for the frequency
 Tune.GuardInterval getGuardInterval()
          Getter for guard interval.
 Tune.Hierarchy getHierarchy()
          Getter for hierarchy.
 Tune.CodeRate getHPCodeRate()
          Getter for frontend's high priority stream code rate.
 Tune.CodeRate getLPCodeRate()
          Getter for frontend's low priority stream code rate.
 Tune.Modulation getModulation()
          Getter for type of modulation.
 Tune.SpectralInversion getSpectralInversion()
          Spectral inversion getter.
 Tune.TransmitMode getTransmitMode()
          Getter for transmit mode.
 Tune guardInterval(Tune.GuardInterval g)
          New cloned tune with changed guard interval.
 int hashCode()
           
 Tune hierarchy(Tune.Hierarchy h)
          New cloned tune with changed hierachy.
 Tune inversion(Tune.SpectralInversion si)
          New cloned tune with inversion set to new value.
 Tune modulation(Tune.Modulation m)
          New cloned tune with different modulation
 Tune transmitMode(Tune.TransmitMode mode)
          New cloned tune with changed transmition mode.
static Tune valueOf(String value, Locale locale)
          Support for parsing tunes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

valueOf

public static Tune valueOf(String value,
                           Locale locale)
Support for parsing tunes. Can expect various formats including:

Parameters:
value - the textual representation of the tune
locale - use defaults for given locale

getFrequency

public int getFrequency()
Getter for the frequency

Returns:
frequency in Hz

getSpectralInversion

public Tune.SpectralInversion getSpectralInversion()
Spectral inversion getter.

Returns:
one of the SpectralInversion constants

getHPCodeRate

public Tune.CodeRate getHPCodeRate()
Getter for frontend's high priority stream code rate.


getLPCodeRate

public Tune.CodeRate getLPCodeRate()
Getter for frontend's low priority stream code rate.


getModulation

public Tune.Modulation getModulation()
Getter for type of modulation.


getTransmitMode

public Tune.TransmitMode getTransmitMode()
Getter for transmit mode.


getBandwidth

public Tune.Bandwidth getBandwidth()
Getter for bandwidth in MHz.

Returns:
0 for automatic mode or 6, 7, 8 for BANDWIDTH_6_MHZ, BANDWIDTH_7_MHZ, BANDWIDTH_8_MHZ

getGuardInterval

public Tune.GuardInterval getGuardInterval()
Getter for guard interval.


getHierarchy

public Tune.Hierarchy getHierarchy()
Getter for hierarchy.


createNew

public static Tune createNew()
Creates new completely empty tune.

Returns:
tune with no predefined values.

createTelestrial

public static Tune createTelestrial(Locale l)
Creates a tune predefined with values according to the usual DVB-T settings in a location identified by the provided locale.

Parameters:
l - the locale to get the defaults from
Returns:
tune with default values

frequency

public Tune frequency(int hz)
Creates new tune with all values equal to this instance, just with changes frequency. The tune is immutable.


inversion

public Tune inversion(Tune.SpectralInversion si)
New cloned tune with inversion set to new value.

Parameters:
si - the inversion to set

codeRate

public Tune codeRate(boolean highPriorityStream,
                     Tune.CodeRate codeRate)
Creates new clonned tune with different code rate than this one has.

Parameters:
highPriorityStream - true if the rate shall apply to high priority stream or false when the low priority shall be changed
codeRate - one of the Tune.CodeRate constant values or null for auto detection

bandwidth

public Tune bandwidth(Tune.Bandwidth b)
New clone of the tune with changed bandwidth is created.

Parameters:
b - the bandWidth to associate with new tune

modulation

public Tune modulation(Tune.Modulation m)
New cloned tune with different modulation

Parameters:
m - one of Tune.Modulation constants

transmitMode

public Tune transmitMode(Tune.TransmitMode mode)
New cloned tune with changed transmition mode.

Parameters:
mode - the mode to set

guardInterval

public Tune guardInterval(Tune.GuardInterval g)
New cloned tune with changed guard interval.

Parameters:
g - the new guard interval

hierarchy

public Tune hierarchy(Tune.Hierarchy h)
New cloned tune with changed hierachy.

Parameters:
h - new hierachy


Built on May 22 2009.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.