// Path: src/uk/ac/open/audio/adpcm/ADPCMRecording.java
// public class ADPCMRecording
// {
// 	private LinkedList<ADPCMEncoder.Block> blocks=new LinkedList<ADPCMEncoder.Block>();
// 
// 	/**
// 	 * Adds a block to the end of the recording.
// 	 * @param block Block data
// 	 */
// 	public synchronized void addBlock(ADPCMEncoder.Block block)
// 	{
// 		blocks.addLast(block);
// 	}
// 
// 	/**
// 	 * Clears the recording.
// 	 */
// 	public synchronized void clear()
// 	{
// 		blocks.clear();
// 	}
// 
// 	/**
// 	 * @return Total recording time in milliseconds
// 	 */
// 	public synchronized int getTime()
// 	{
// 		return (ADPCMEncoder.BLOCKSAMPLES*blocks.size())/16;
// 	}
// 
// 	/**
// 	 * @param index Block that we want start time of
// 	 * @return Start time of that block in milliseconds since start of file
// 	 */
// 	public static int getBlockTime(int index)
// 	{
// 		return (ADPCMEncoder.BLOCKSAMPLES*index)/16;
// 	}
// 
// 	/**
// 	 * Obtains a range of blocks for display or output.
// 	 * @param start First block to retrieve
// 	 * @param count Number of blocks
// 	 * @return Requested blocks (or fewer if there weren't enough available)
// 	 */
// 	public synchronized ADPCMEncoder.Block[] getBlocks(int start,int count)
// 	{
// 		if(start+count>blocks.size()) count=blocks.size()-start;
// 		ADPCMEncoder.Block[] result=new ADPCMEncoder.Block[count];
// 
// 		Iterator<ADPCMEncoder.Block> i=blocks.iterator();
// 		for(int skip=0;skip<start;skip++) i.next();
// 		for(int dest=0;dest<count;dest++)
// 		{
// 			result[dest]=i.next();
// 		}
// 		return result;
// 	}
// 
// 	/**
// 	 * Obtains all blocks for display or output.
// 	 * @return Array of all blocks
// 	 */
// 	public synchronized ADPCMEncoder.Block[] getBlocks()
// 	{
// 		return blocks.toArray(new ADPCMEncoder.Block[blocks.size()]);
// 	}
// 
// 	/**
// 	 * Saves data as a .wav file.
// 	 * @param f Target for saving
// 	 * @throws IOException Any I/O errors
// 	 */
// 	public synchronized void save(File f) throws IOException
// 	{
// 		ADPCMEncoder.writeToWav(getBlocks(0,blocks.size()), f);
// 	}
// 
// }
// 
// Path: src/uk/ac/open/tabapplet/TabAppletFocuser.java
// public interface TabAppletFocuser
// {
// 	/**
// 	 * Called from JavaScript. Initialises focus for the applet.
// 	 * @param last True to focus the last thing, false for the first
// 	 */
// 	public void initFocus(boolean last);
// }


import java.awt.BorderLayout;
import java.awt.event.*;
import javax.swing.*;
import uk.ac.open.audio.adpcm.ADPCMRecording;
import uk.ac.open.tabapplet.TabAppletFocuser;
		case FOCUS_LEFT1: focusButton=left1Button; break;
		case FOCUS_LEFT2: focusButton=left2Button; break;
		default: focusButton=null;
		}

		SwingUtilities.invokeLater(new Runnable()
		{
			public void run()
			{
				if(focusButton!=null && focusButton.isShowing())
				{
					getRootPane().setDefaultButton(focusButton);
					focusButton.requestFocus();
				}
			}
		});
	}

	/** Called when page is left. */
	protected void leave()
	{
	}

	/** @return Owner panel */
	protected MainPanel getOwner()
	{
		return owner;
	}

	/** @return Current recording */
// Path: src/uk/ac/open/audio/adpcm/ADPCMRecording.java
// public class ADPCMRecording
// {
// 	private LinkedList<ADPCMEncoder.Block> blocks=new LinkedList<ADPCMEncoder.Block>();
// 
// 	/**
// 	 * Adds a block to the end of the recording.
// 	 * @param block Block data
// 	 */
// 	public synchronized void addBlock(ADPCMEncoder.Block block)
// 	{
// 		blocks.addLast(block);
// 	}
// 
// 	/**
// 	 * Clears the recording.
// 	 */
// 	public synchronized void clear()
// 	{
// 		blocks.clear();
// 	}
// 
// 	/**
// 	 * @return Total recording time in milliseconds
// 	 */
// 	public synchronized int getTime()
// 	{
// 		return (ADPCMEncoder.BLOCKSAMPLES*blocks.size())/16;
// 	}
// 
// 	/**
// 	 * @param index Block that we want start time of
// 	 * @return Start time of that block in milliseconds since start of file
// 	 */
// 	public static int getBlockTime(int index)
// 	{
// 		return (ADPCMEncoder.BLOCKSAMPLES*index)/16;
// 	}
// 
// 	/**
// 	 * Obtains a range of blocks for display or output.
// 	 * @param start First block to retrieve
// 	 * @param count Number of blocks
// 	 * @return Requested blocks (or fewer if there weren't enough available)
// 	 */
// 	public synchronized ADPCMEncoder.Block[] getBlocks(int start,int count)
// 	{
// 		if(start+count>blocks.size()) count=blocks.size()-start;
// 		ADPCMEncoder.Block[] result=new ADPCMEncoder.Block[count];
// 
// 		Iterator<ADPCMEncoder.Block> i=blocks.iterator();
// 		for(int skip=0;skip<start;skip++) i.next();
// 		for(int dest=0;dest<count;dest++)
// 		{
// 			result[dest]=i.next();
// 		}
// 		return result;
// 	}
// 
// 	/**
// 	 * Obtains all blocks for display or output.
// 	 * @return Array of all blocks
// 	 */
// 	public synchronized ADPCMEncoder.Block[] getBlocks()
// 	{
// 		return blocks.toArray(new ADPCMEncoder.Block[blocks.size()]);
// 	}
// 
// 	/**
// 	 * Saves data as a .wav file.
// 	 * @param f Target for saving
// 	 * @throws IOException Any I/O errors
// 	 */
// 	public synchronized void save(File f) throws IOException
// 	{
// 		ADPCMEncoder.writeToWav(getBlocks(0,blocks.size()), f);
// 	}
// 
// }
// 
// Path: src/uk/ac/open/tabapplet/TabAppletFocuser.java
// public interface TabAppletFocuser
// {
// 	/**
// 	 * Called from JavaScript. Initialises focus for the applet.
// 	 * @param last True to focus the last thing, false for the first
// 	 */
// 	public void initFocus(boolean last);
// }


// Path: src/uk/ac/open/audiorecorder/PageBase.java
import java.awt.BorderLayout;
import java.awt.event.*;
import javax.swing.*;
import uk.ac.open.audio.adpcm.ADPCMRecording;
import uk.ac.open.tabapplet.TabAppletFocuser;

		case FOCUS_LEFT1: focusButton=left1Button; break;
		case FOCUS_LEFT2: focusButton=left2Button; break;
		default: focusButton=null;
		}

		SwingUtilities.invokeLater(new Runnable()
		{
			public void run()
			{
				if(focusButton!=null && focusButton.isShowing())
				{
					getRootPane().setDefaultButton(focusButton);
					focusButton.requestFocus();
				}
			}
		});
	}

	/** Called when page is left. */
	protected void leave()
	{
	}

	/** @return Owner panel */
	protected MainPanel getOwner()
	{
		return owner;
	}

	/** @return Current recording */
	protected ADPCMRecording getRecording()