<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>etc/test_data/dog_1.au</filename>
    </added>
    <added>
      <filename>productions/examples/sandbox/sounds/players/clip.rb</filename>
    </added>
    <added>
      <filename>productions/examples/sandbox/sounds/props.rb</filename>
    </added>
    <added>
      <filename>productions/examples/sandbox/sounds/styles.rb</filename>
    </added>
    <added>
      <filename>src/limelight/AudioPlayer.java</filename>
    </added>
    <added>
      <filename>src/limelight/audio/MockAudioPlayer.java</filename>
    </added>
    <added>
      <filename>src/limelight/audio/RealAudioPlayer.java</filename>
    </added>
    <added>
      <filename>src/limelight/audio/RealAudioPlayerTest.java</filename>
    </added>
    <added>
      <filename>src/limelight/ui/model2/TextAccessor.java</filename>
    </added>
    <added>
      <filename>src/limelight/ui/model2/inputs/TextBoxPanel.java</filename>
    </added>
    <added>
      <filename>src/limelight/ui/model2/inputs/TextBoxPanelTest.java</filename>
    </added>
    <added>
      <filename>src/limelight/ui/model2/painting/TextBoxPainter.java</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -23,7 +23,7 @@ module Limelight
       Frame = Java::limelight.ui.model2.Frame
       Panel = Java::limelight.ui.model2.PropPanel
       module Painting
-        TextBoxPainter = Java::limelight.ui.model.painting.TextBoxPainter
+        TextBoxPainter = Java::limelight.ui.model2.painting.TextBoxPainter
         ButtonPainter = Java::limelight.ui.model.painting.ButtonPainter
         CheckBoxPainter = Java::limelight.ui.model.painting.CheckBoxPainter
         ComboBoxPainter = Java::limelight.ui.model.painting.ComboBoxPainter</diff>
      <filename>lib/limelight/java_couplings2.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,7 @@ module Limelight
       end
       
       def path_to(path)
+        #TODO What about windoze?
         if(path[0] == &quot;/&quot;[0])
           return path
         else</diff>
      <filename>lib/limelight/loaders/file_scene_loader.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,9 +6,10 @@ module Limelight
     
     module TextBox
       class &lt;&lt; self
+
         def extended(prop)
           prop.panel.painters.clear
-          prop.panel.painters &lt;&lt; Java.limelight.ui.model.painting.TextBoxPainter.new(prop.panel)
+          prop.panel.painters &lt;&lt; Limelight::UI::Model::Painting::TextBoxPainter.new(prop.panel)
           prop.panel.clear_event_listeners
           set_default_styles(prop)
         end</diff>
      <filename>lib/limelight/players/text_box.rb</filename>
    </modified>
    <modified>
      <diff>@@ -164,6 +164,10 @@ module Limelight
       return Pen.new(panel.getGraphics)
     end
     
+    def play_sound(filename)
+      @panel.play_sound(@scene.loader.path_to(filename))
+    end
+    
     # GUI Events ##########################################
     
     def hover_on</diff>
      <filename>lib/limelight/prop.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,5 +11,6 @@ header do
   example_link :text =&gt; &quot;Rounded Corners&quot;, :on_mouse_clicked =&gt; &quot;scene.load('rounded_corners')&quot;
   example_link :text =&gt; &quot;Floaters&quot;, :on_mouse_clicked =&gt; &quot;scene.load('floaters')&quot;
   example_link :text =&gt; &quot;Sketching&quot;, :on_mouse_clicked =&gt; &quot;scene.load('sketching')&quot;
+  example_link :text =&gt; &quot;Sound&quot;, :on_mouse_clicked =&gt; &quot;scene.load('sounds')&quot;
 end
 </diff>
      <filename>productions/examples/sandbox/header.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,32 +9,32 @@ arena do
   	cell(:border_width =&gt; &quot;1&quot;) { input_log :id =&gt; &quot;text_box_log&quot; }
   	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;text_box_results&quot; }
     # end row
-    cell { text_area_input :players =&gt; &quot;text_area&quot; }
-  	cell { input_log :id =&gt; &quot;text_area_log&quot; }
-  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;text_area_results&quot; }
-    # end row
-    cell { check_box_input :players =&gt; &quot;check_box&quot; }
-  	cell { input_log :id =&gt; &quot;check_box_log&quot; }
-  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;check_box_results&quot; }
-    # end row
-    cell do
-      radio_button_input :players =&gt; &quot;radio_button&quot;, :id =&gt; &quot;radio_1&quot;, :group =&gt; &quot;radios&quot;
-      radio_label :text =&gt; &quot;One&quot;
-      radio_button_input :players =&gt; &quot;radio_button&quot;, :id =&gt; &quot;radio_2&quot;, :group =&gt; &quot;radios&quot;
-      radio_label :text =&gt; &quot;Two&quot;
-      radio_button_input :players =&gt; &quot;radio_button&quot;, :id =&gt; &quot;radio_3&quot;, :group =&gt; &quot;radios&quot;
-      radio_label :text =&gt; &quot;Three&quot;
-    end
-  	cell { input_log :id =&gt; &quot;radio_button_log&quot; }
-  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;radio_button_results&quot; }
-    # end row
-    cell { combo_box_input :players =&gt; &quot;combo_box&quot;, :choices =&gt; &quot;%w{Red Orange Yellow Green Blue Indigo Violet}&quot; }
-  	cell { input_log :id =&gt; &quot;combo_box_log&quot; }
-  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;combo_box_results&quot; }
-    # end row
-    cell { button_input :players =&gt; &quot;button&quot;, :text =&gt; &quot;A Button&quot; }
-  	cell { input_log :id =&gt; &quot;button_log&quot; }
-  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;button_results&quot; }
+#    cell { text_area_input :players =&gt; &quot;text_area&quot; }
+#  	cell { input_log :id =&gt; &quot;text_area_log&quot; }
+#  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;text_area_results&quot; }
+#    # end row
+#    cell { check_box_input :players =&gt; &quot;check_box&quot; }
+#  	cell { input_log :id =&gt; &quot;check_box_log&quot; }
+#  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;check_box_results&quot; }
+#    # end row
+#    cell do
+#      radio_button_input :players =&gt; &quot;radio_button&quot;, :id =&gt; &quot;radio_1&quot;, :group =&gt; &quot;radios&quot;
+#      radio_label :text =&gt; &quot;One&quot;
+#      radio_button_input :players =&gt; &quot;radio_button&quot;, :id =&gt; &quot;radio_2&quot;, :group =&gt; &quot;radios&quot;
+#      radio_label :text =&gt; &quot;Two&quot;
+#      radio_button_input :players =&gt; &quot;radio_button&quot;, :id =&gt; &quot;radio_3&quot;, :group =&gt; &quot;radios&quot;
+#      radio_label :text =&gt; &quot;Three&quot;
+#    end
+#  	cell { input_log :id =&gt; &quot;radio_button_log&quot; }
+#  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;radio_button_results&quot; }
+#    # end row
+#    cell { combo_box_input :players =&gt; &quot;combo_box&quot;, :choices =&gt; &quot;%w{Red Orange Yellow Green Blue Indigo Violet}&quot; }
+#  	cell { input_log :id =&gt; &quot;combo_box_log&quot; }
+#  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;combo_box_results&quot; }
+#    # end row
+#    cell { button_input :players =&gt; &quot;button&quot;, :text =&gt; &quot;A Button&quot; }
+#  	cell { input_log :id =&gt; &quot;button_log&quot; }
+#  	cell(:border_width =&gt; &quot;1&quot;) { input_results :id =&gt; &quot;button_results&quot; }
     # end row
   end
 end
\ No newline at end of file</diff>
      <filename>productions/examples/sandbox/inputs/props.rb</filename>
    </modified>
    <modified>
      <diff>@@ -211,6 +211,15 @@ describe Limelight::Prop do
     @prop.children[1].children.length.should == 1
     @prop.children[1].children[0].name.should == &quot;three&quot;
   end
+
+  it &quot;should play sound&quot; do
+    loader = make_mock(&quot;loader&quot;)
+    @scene.loader = loader
+    loader.should_receive(:path_to).with(&quot;some.au&quot;).and_return(&quot;/full/path/to/some.au&quot;);
+    @prop.panel.should_receive(:play_sound).with(&quot;/full/path/to/some.au&quot;);
+
+    @prop.play_sound(&quot;some.au&quot;)
+  end
   
 end
 </diff>
      <filename>spec/prop_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ import limelight.task.TaskEngine;
 import limelight.ui.Panel;
 import limelight.ui.model2.FrameManager;
 import limelight.caching.Cache;
-
+import javax.sound.sampled.Clip;
 import java.awt.image.BufferedImage;
 
 public class Context
@@ -21,6 +21,7 @@ public class Context
   public TaskEngine taskEngine;
   public Cache&lt;Panel, BufferedImage&gt; bufferedImageCache;
   public FrameManager frameManager;
+  public AudioPlayer audioPlayer;
 
   protected Context()
   {</diff>
      <filename>src/limelight/Context.java</filename>
    </modified>
    <modified>
      <diff>@@ -6,21 +6,21 @@ package limelight;
 import limelight.io.Downloader;
 import limelight.io.FileUtil;
 import limelight.io.TempDirectory;
-import limelight.ui.painting.VerboseRepaintManager;
 import limelight.ui.Panel;
 import limelight.ui.model2.FrameManager;
 import limelight.ui.model2.Frame;
 import limelight.task.TaskEngine;
 import limelight.task.RecurringTask;
 import limelight.caching.TimedCache;
+import limelight.audio.RealAudioPlayer;
 import org.jruby.Ruby;
 import org.jruby.RubyInstanceConfig;
 
+import javax.sound.sampled.Clip;
 import java.io.ByteArrayInputStream;
 import java.io.FileNotFoundException;
 import java.awt.image.BufferedImage;
-import java.util.Iterator;
-import java.util.Set;
+import java.awt.*;
 
 public class Main
 {
@@ -93,6 +93,9 @@ public class Main
   public void configureContext()
   {
 //VerboseRepaintManager.install();
+
+//    KeyboardFocusManager.setCurrentKeyboardFocusManager(new MyKeyboardFocusManager());
+
     if(contextIsConfigured)
       return;
     Context context = Context.instance();
@@ -101,6 +104,7 @@ public class Main
     context.taskEngine = new TaskEngine().started();
     context.bufferedImageCache = new TimedCache&lt;Panel, BufferedImage&gt;(1);
     context.frameManager = new FrameManager();
+    context.audioPlayer = new RealAudioPlayer();
 
     addBufferedImageCacheCleanerTask(context);
     addPanelPainterTask(context);
@@ -130,4 +134,5 @@ public class Main
       }
     });
   }
+
 }
\ No newline at end of file</diff>
      <filename>src/limelight/Main.java</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,7 @@ import limelight.task.RecurringTask;
 import limelight.caching.Cache;
 import limelight.caching.TimedCache;
 import limelight.ui.Panel;
+import limelight.audio.RealAudioPlayer;
 
 import java.awt.image.BufferedImage;
 
@@ -92,4 +93,11 @@ public class MainTest extends TestCase
     assertEquals(80, ((RecurringTask)task).getPerformancesPerSecond(), 0.01);
     assertEquals(false, ((RecurringTask)task).isStrict());
   }
+
+  public void testAudioPlayerIsAdded() throws Exception
+  {
+    main.configureContext();
+
+    assertEquals(RealAudioPlayer.class, Context.instance().audioPlayer.getClass());
+  }
 }</diff>
      <filename>src/limelight/MainTest.java</filename>
    </modified>
    <modified>
      <diff>@@ -387,5 +387,10 @@ if(&quot;application_list&quot;.equals(prop.getName()))
       super(&quot;The panel for prop named '&quot; + name + &quot;' has been sterilized and child components may not be added.&quot;);
     }
   }
+
+  public void playSound(String filename)
+  {
+    Context.instance().audioPlayer.playAuFile(filename);
+  }
 }
 </diff>
      <filename>src/limelight/ui/model/Panel.java</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@ public class RadioButtonPainter extends Painter
     panel.sterilize();
     panel.setLayout(new InputLayout());
     panel.setTextAccessor(new TextAccessor() {
-      public void setText(String text) throws LimelightException
+      public void setText(String text)
       {
         radioButton.setText(text);
       }</diff>
      <filename>src/limelight/ui/model/painting/RadioButtonPainter.java</filename>
    </modified>
    <modified>
      <diff>@@ -110,13 +110,34 @@ public class EventListener implements MouseListener, MouseMotionListener, MouseW
 
   public void keyTyped(KeyEvent e)
   {
+    System.err.println(&quot;keyTyped&quot;);
+//    KeyListener[] keyListeners = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner().getKeyListeners();
+//    for(int i = 0; i &lt; keyListeners.length; i++)
+//    {
+//      KeyListener keyListener = keyListeners[i];
+//      keyListener.keyTyped(e);
+//    }
   }
 
   public void keyPressed(KeyEvent e)
   {
+    System.err.println(&quot;keyPressed&quot;);
+//    KeyListener[] keyListeners = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner().getKeyListeners();
+//    for(int i = 0; i &lt; keyListeners.length; i++)
+//    {
+//      KeyListener keyListener = keyListeners[i];
+//      keyListener.keyPressed(e);
+//    }
   }
 
   public void keyReleased(KeyEvent e)
   {
+    System.err.println(&quot;keyReleased&quot;);
+//    KeyListener[] keyListeners = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner().getKeyListeners();
+//    for(int i = 0; i &lt; keyListeners.length; i++)
+//    {
+//      KeyListener keyListener = keyListeners[i];
+//      keyListener.keyReleased(e);
+//    }
   }
 }</diff>
      <filename>src/limelight/ui/model2/EventListener.java</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,7 @@ public class Frame extends JFrame
     this.stage = stage;
     Context.instance().frameManager.watch(this);
     setIconImage(new ImageIcon(System.getProperty(&quot;limelight.home&quot;) + &quot;/bin/icon_48.gif&quot;).getImage());
+    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
   }
 
   public void close()</diff>
      <filename>src/limelight/ui/model2/Frame.java</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ public class FrameManager implements WindowFocusListener, WindowListener
 
   public void windowGainedFocus(WindowEvent e)
   {
-    Window window = e.getWindow();
+    Window window = e.getWindow();  
     if(window instanceof Frame)
     {
       activeFrame = (Frame)window;</diff>
      <filename>src/limelight/ui/model2/FrameManager.java</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,8 @@ import limelight.ui.api.MockStage;
 import limelight.ui.MockPanel;
 import limelight.Context;
 
+import javax.swing.*;
+
 public class FrameTest extends TestCase
 {
   private MockStage stage;
@@ -59,4 +61,9 @@ public class FrameTest extends TestCase
     assertEquals(1, frameManager.getFrameCount());
     assertEquals(true, frameManager.isWatching(frame));
   }
+  
+  public void testDefaultCloseOperations() throws Exception
+  {
+    assertEquals(WindowConstants.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
+  }
 }</diff>
      <filename>src/limelight/ui/model2/FrameTest.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 package limelight.ui.model2;
 
 import limelight.LimelightError;
+import limelight.Context;
 import limelight.styles.Style;
 import limelight.styles.StyleDescriptor;
 import limelight.styles.StyleObserver;
@@ -28,7 +29,7 @@ public class PropPanel extends BasePanel implements PropablePanel, PaintablePane
   private PropPanelLayout layout;
   private LinkedList&lt;Painter&gt; painters;
   private Border borderShaper;
-  private TextPaneTextAccessor textAccessor;
+  private TextAccessor textAccessor;
   private Box boxInsideMargins;
   private Box boxInsideBorders;
   private Box boxInsidePadding;
@@ -66,12 +67,12 @@ public class PropPanel extends BasePanel implements PropablePanel, PaintablePane
     textAccessor.setText(text);
   }
 
-  public TextPaneTextAccessor getTextAccessor()
+  public TextAccessor getTextAccessor()
   {
     return textAccessor;
   }
 
-  public void setTextAccessor(TextPaneTextAccessor textAccessor)
+  public void setTextAccessor(TextAccessor textAccessor)
   {
     this.textAccessor = textAccessor;
   }
@@ -354,5 +355,10 @@ public class PropPanel extends BasePanel implements PropablePanel, PaintablePane
     horizontalScrollBar = null;
     childConsumableArea = null;
   }
+
+  public void playSound(String filename)
+  {
+    Context.instance().audioPlayer.playAuFile(filename);
+  }
 }
 </diff>
      <filename>src/limelight/ui/model2/PropPanel.java</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,8 @@ import limelight.ui.painting.Border;
 import limelight.ui.painting.PaintAction;
 import limelight.styles.FlatStyle;
 import limelight.util.Box;
+import limelight.Context;
+import limelight.audio.MockAudioPlayer;
 import junit.framework.TestCase;
 
 import javax.swing.*;
@@ -296,4 +298,14 @@ public class PropPanelTest extends TestCase
     assertEquals(0, panel.getVerticalScrollBar().getScrollBar().getValue());
     assertEquals(16, panel.getHorizontalScrollBar().getScrollBar().getValue());
   }
+
+  public void testPlayAudioFile() throws Exception
+  {
+    MockAudioPlayer audioPlayer = new MockAudioPlayer();
+    Context.instance().audioPlayer = audioPlayer;
+
+    panel.playSound(&quot;blah&quot;);
+
+    assertEquals(&quot;blah&quot;, audioPlayer.playedFile);
+  }
 }</diff>
      <filename>src/limelight/ui/model2/PropPanelTest.java</filename>
    </modified>
    <modified>
      <diff>@@ -16,9 +16,11 @@ public class RootPanel implements Panel
   private EventListener listener;
   private boolean alive;
   private HashSet&lt;Panel&gt; changedPanels;
+  private Frame frame;
 
   public RootPanel(Frame frame)
   {
+    this.frame = frame;
     contentPane = frame.getContentPane();
     changedPanels = new HashSet&lt;Panel&gt;();
   }
@@ -328,4 +330,9 @@ public class RootPanel implements Panel
   public void add(Panel child)
   {
   }
+
+  public Frame getFrame()
+  {
+    return frame;
+  }
 }</diff>
      <filename>src/limelight/ui/model2/RootPanel.java</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,6 @@
 
 package limelight.ui.model2;
 
-import limelight.ui.model.TextAccessor;
 import limelight.LimelightError;
 
 public class TextPaneTextAccessor implements TextAccessor</diff>
      <filename>src/limelight/ui/model2/TextPaneTextAccessor.java</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ Build styles from code
 Build style from props.rb
 Make text selectable
 Drop shadows
-Allow production styles and stages to be build in production.rb
+Allow production styles and stages to be built in production.rb
 Exit when last stage is closed.  (Windows only?)
 Figure out and implement solution for productions to use gems.
 Default style? - Not sure how this should work eactly</diff>
      <filename>todo.txt</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b21b14ae3d73fe326f536c67d5b6b545a7ca0abc</id>
    </parent>
  </parents>
  <author>
    <name>Micah Martin</name>
    <email>micah@8thlight.com</email>
  </author>
  <url>http://github.com/slagyr/limelight/commit/e9f291237cdee2ac21b6e38daf33c3259881c8b5</url>
  <id>e9f291237cdee2ac21b6e38daf33c3259881c8b5</id>
  <committed-date>2008-07-21T15:21:08-07:00</committed-date>
  <authored-date>2008-07-21T15:21:08-07:00</authored-date>
  <message>worked on textbox... took breather and implemented simple sound API</message>
  <tree>2fb5306f416d6d16d1b00a22b7ad3ee181e30591</tree>
  <committer>
    <name>Micah Martin</name>
    <email>micah@8thlight.com</email>
  </committer>
</commit>
