FileDocCategorySizeDatePackage
TrackPanelAudio.javaAPI DocJMF 2.1.1e3532Mon May 12 12:20:30 BST 2003jmapps.ui

TrackPanelAudio

public class TrackPanelAudio extends TrackPanel implements ActionListener

Fields Summary
private AudioFormat
formatOld
private String
strContentType
private AudioFormatChooser
chooserAudioFormat
Constructors Summary
public TrackPanelAudio(TrackControl trackControl, ActionListener listenerEnableTrack)


            
        super ( trackControl, listenerEnableTrack );

        try {
            init();
        } catch (Exception e) {
            e.printStackTrace();
        }
    
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent event)
This method overwrites the ActionListener method to process events from buttons, track pages, and Progress dialog.

param
event action event

        String        strCmd;
        ActionEvent   eventNew;

        strCmd = event.getActionCommand ();
        if ( strCmd.equals(AudioFormatChooser.ACTION_TRACK_ENABLED) ) {
            eventNew = new ActionEvent ( this, ActionEvent.ACTION_PERFORMED, event.getActionCommand() );
            listenerEnableTrack.actionPerformed ( eventNew );
        }
        else if ( strCmd.equals(AudioFormatChooser.ACTION_TRACK_DISABLED) ) {
            eventNew = new ActionEvent ( this, ActionEvent.ACTION_PERFORMED, event.getActionCommand() );
            listenerEnableTrack.actionPerformed ( eventNew );
        }
    
public javax.media.FormatgetFormat()

        Format         format;
        format = chooserAudioFormat.getFormat ();
        return ( format );
    
private voidinit()

        this.setLayout ( new BorderLayout() );
        formatOld = (AudioFormat) trackControl.getFormat ();
        chooserAudioFormat = new AudioFormatChooser ( arrSupportedFormats, formatOld, true, this );
        this.add ( chooserAudioFormat, BorderLayout.NORTH );
    
public booleanisTrackEnabled()

        boolean     boolEnabled;
        boolEnabled = chooserAudioFormat.isTrackEnabled ();
        return ( boolEnabled );
    
public voidsetContentType(java.lang.String strContentType)

        int                   i;
        int                   nSize;
        AudioFormat           formatAudio;

        arrSupportedFormats = trackControl.getSupportedFormats();
        this.strContentType = strContentType;
        nSize = arrSupportedFormats.length;
        vectorContSuppFormats = new Vector ();

        for ( i = 0;  i < nSize;  i++ ) {
            if ( !(arrSupportedFormats[i] instanceof AudioFormat) )
                continue;
            formatAudio = (AudioFormat) arrSupportedFormats[i];
            vectorContSuppFormats.addElement ( formatAudio );
        }

        chooserAudioFormat.setSupportedFormats ( vectorContSuppFormats );
        chooserAudioFormat.setCurrentFormat ( formatOld );
    
public voidsetDefaults(boolean boolTrackEnable, javax.media.Format format)

        chooserAudioFormat.setTrackEnabled ( boolTrackEnable );
        if ( format instanceof AudioFormat ) {
            formatOld = (AudioFormat) format;
            chooserAudioFormat.setCurrentFormat ( formatOld );
        }