<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,5 @@
+* track.volume and track.volume=(vol) for getting and setting a track's volume
+
 * QuickTime settings dialog comes into the forground properly
 
 0.1.1 (October 3rd, 2008)</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,15 @@
 Fixes
 - check if movie/track really exists each time we call it
-- add rdocs
-- fill README
 
 Features
-- export a single frame as pict
 - resize movie
-- export image sequence
-- import image sequence
-- import other file formats (mpeg, aiff, mp3, etc.)
 - get movie metadata (album, author, artist, etc.)
 - set movie metadata
-- programatically adjust export settings (framerate, codec, etc.)
-
-Possible
 - add text track to movie
 - add chapters to movie
-- time remapping
\ No newline at end of file
+
+Possible
+- time remapping
+- programatically adjust export settings (framerate, codec, etc.)
+- export image sequence
+- import image sequence</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -146,6 +146,28 @@ static VALUE track_enabled(VALUE obj, VALUE boolean)
   }
 }
 
+/*
+  call-seq: volume() -&gt; volume_float
+  
+  Returns the volume of the audio from 0.0 to 1.0.
+*/
+static VALUE track_get_volume(VALUE obj)
+{
+  return rb_float_new((double)GetTrackVolume(TRACK(obj))/0x0100);
+}
+
+/*
+  call-seq: volume=(volume_float)
+  
+  Sets the volume to the given value (0.0 to 1.0)
+*/
+static VALUE track_set_volume(VALUE obj, VALUE volume_obj)
+{
+  SetTrackVolume(TRACK(obj), (short)(0x0100*NUM2DBL(volume_obj)));
+  return Qnil;
+}
+
+
 void Init_quicktime_track()
 {
   VALUE mQuicktime;
@@ -162,4 +184,6 @@ void Init_quicktime_track()
   rb_define_method(cTrack, &quot;enabled?&quot;, track_enabled, 0);
   rb_define_method(cTrack, &quot;enable&quot;, track_enable, 0);
   rb_define_method(cTrack, &quot;disable&quot;, track_disable, 0);
+  rb_define_method(cTrack, &quot;volume&quot;, track_get_volume, 0);
+  rb_define_method(cTrack, &quot;volume=&quot;, track_set_volume, 1);
 }</diff>
      <filename>ext/track.c</filename>
    </modified>
    <modified>
      <diff>@@ -4,37 +4,57 @@ describe Quicktime::Track do
   describe &quot;example.mov&quot; do
     before(:each) do
       @movie = Quicktime::Movie.open(File.dirname(__FILE__) + '/../fixtures/example.mov')
-      @track = @movie.video_tracks.first
     end
+  
+    describe &quot;example.mov video track&quot; do
+      before(:each) do
+        @track = @movie.video_tracks.first
+      end
     
-    it &quot;duration should be 3.1 seconds&quot; do
-      @track.duration.should == 3.1
-    end
+      it &quot;duration should be 3.1 seconds&quot; do
+        @track.duration.should == 3.1
+      end
     
-    it &quot;frame count should be 31&quot; do
-      @track.frame_count.should == 31
-    end
+      it &quot;frame count should be 31&quot; do
+        @track.frame_count.should == 31
+      end
     
-    it &quot;frame rate should be 10&quot; do
-      @track.frame_rate.should == 10
-    end
+      it &quot;frame rate should be 10&quot; do
+        @track.frame_rate.should == 10
+      end
     
-    it &quot;should be able to delete a track&quot; do
-      @track.delete
-      @movie.video_tracks.should == []
-    end
+      it &quot;should be able to delete a track&quot; do
+        @track.delete
+        @movie.video_tracks.should == []
+      end
+    
+      it &quot;should be able to add a track&quot; do
+        @track.delete
+        @movie.video_tracks.should == []
+      end
     
-    it &quot;should be able to add a track&quot; do
-      @track.delete
-      @movie.video_tracks.should == []
+      it &quot;should be able to disable and enable a track&quot; do
+        @track.should be_enabled
+        @track.disable
+        @track.should_not be_enabled
+        @track.enable
+        @track.should be_enabled
+      end
     end
+  
+    describe &quot;example.mov audio track&quot; do
+      before(:each) do
+        @track = @movie.audio_tracks.first
+      end
+    
+      it &quot;should have a volume of 1.0&quot; do
+        @track.volume.should == 1.0
+      end
     
-    it &quot;should be able to disable and enable a track&quot; do
-      @track.should be_enabled
-      @track.disable
-      @track.should_not be_enabled
-      @track.enable
-      @track.should be_enabled
+      it &quot;should be able to set volume to 0.5&quot; do
+        @track.volume = 0.5
+        @track.volume.should == 0.5
+      end
     end
   end
 end</diff>
      <filename>spec/quicktime/track_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cbbfcd26d46b8152096a703c6c86442ad31a5f89</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Bates</name>
    <email>ryan@railscasts.com</email>
  </author>
  <url>http://github.com/ryanb/rmov/commit/574b09fbc1eaf527ff65d24bf935f2d4d82ec1c8</url>
  <id>574b09fbc1eaf527ff65d24bf935f2d4d82ec1c8</id>
  <committed-date>2008-10-03T08:07:36-07:00</committed-date>
  <authored-date>2008-10-03T08:07:36-07:00</authored-date>
  <message>adding track.volume getter and setter</message>
  <tree>e5cb258478153c1962420327948edfb7d0856263</tree>
  <committer>
    <name>Ryan Bates</name>
    <email>ryan@railscasts.com</email>
  </committer>
</commit>
