org.davic.media
Interface LanguageControl

All Superinterfaces:
javax.media.Control
All Known Subinterfaces:
AudioLanguageControl, SubtitlingEventControl, SubtitlingLanguageControl

public interface LanguageControl
extends javax.media.Control

This interface is the base interface for both audio and subtitling language control. This interface should never be implemented in a control alone, but always either as audio or subtitling language control. If a language can not be selected because the user/application is not entitled to access it, the language is reset to that before the invocation of the method. If more than one stream with the same language exists, the behaviour of selectLanguage(String)is to select the first listed in the network signalling. NOTE:This is equivalent to item b under 11.4.2.3,"Default media player behaviour".


Method Summary
 java.lang.String getCurrentLanguage()
          Returns the language code of the currently selected language.
 java.lang.String[] listAvailableLanguages()
          Provides the application a list of available languages.
 java.lang.String selectDefaultLanguage()
          Changes the language to the default language determined by the implementation.
 void selectLanguage(java.lang.String lang)
          Changes the language to the language given in the parameter.
 
Methods inherited from interface javax.media.Control
getControlComponent
 

Method Detail

listAvailableLanguages

public java.lang.String[] listAvailableLanguages()
Provides the application a list of available languages. The returned strings contain three letter language codes according to ISO 639 standard. If there are no selectable languages, the method returns an array of length zero.


selectLanguage

public void selectLanguage(java.lang.String lang)
                    throws LanguageNotAvailableException,
                           NotAuthorizedException
Changes the language to the language given in the parameter.

Parameters:
lang - the desired language code according to the ISO 639 standard.
Throws:
LanguageNotAvailableException - if the language given in the parameter is not available,
NotAuthorizedException - if access to the required language is not permitted

getCurrentLanguage

public java.lang.String getCurrentLanguage()
Returns the language code of the currently selected language. If this information is not available, a String of length zero is returned.


selectDefaultLanguage

public java.lang.String selectDefaultLanguage()
                                       throws NotAuthorizedException
Changes the language to the default language determined by the implementation.

Returns:
the language code of the default language.
Throws:
NotAuthorizedException - If access to the default language is not permitted