<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,7 +2,6 @@
 #  Created by mootoh on 6/3/08.
 #  Copyright (c) 2008 deadbeaf.org. All rights reserved.
 #
-require 'logger'
 require 'osx/cocoa'
 OSX.require_framework 'QuartzComposer'
 require 'funnel'
@@ -13,49 +12,47 @@ class QCGainer &lt; OSX::QCPlugIn
   end
 
   def self.timeMode
-    0
+    1
   end
 
   def initialize
-    @logger = Logger.new('/tmp/qc_ruby_plugin.log')
-    @logger.level = Logger::DEBUG
-    @yet = true
+    @initialized = false
     @gio = Funnel::Gainer.new(Funnel::Gainer::MODE1)
+
+    @ain = [0,0,0,0]
+    @din = [0,0,0,0]
+    @aot = [0,0,0,0]
+    @dot = [0,0,0,0]
   end
 
   def startExecution(context)
-    @logger.debug(&quot;startExecution&quot;)
-
-    Thread.new {
+    Thread.new do
       sleep 0.1
-      5.times do |i|
-        begin
-          addInputPortWithType_forKey_withAttributes(OSX::QCPortTypeString, &quot;input_&quot; + i.to_s, nil)
-          addOutputPortWithType_forKey_withAttributes(OSX::QCPortTypeString, &quot;out_&quot; + i.to_s, nil)
-          @logger.debug(&quot;ports added&quot;)
-        rescue =&gt; e
-          @logger.error(e.message)
-        end
-      end
-    }
+      4.times { |i| addInputPortWithType_forKey_withAttributes(OSX::QCPortTypeNumber, &quot;aot_&quot; + i.to_s, nil)  }
+      4.times { |i| addInputPortWithType_forKey_withAttributes(OSX::QCPortTypeNumber, &quot;dot_&quot; + i.to_s, nil)  }
+      4.times { |i| addOutputPortWithType_forKey_withAttributes(OSX::QCPortTypeNumber, &quot;ain_&quot; + i.to_s, nil) }
+      4.times { |i| addOutputPortWithType_forKey_withAttributes(OSX::QCPortTypeNumber, &quot;din_&quot; + i.to_s, nil) }
+    end
     true
   end
 
   def execute_atTime_withArguments(context, time, args)
-    @logger.debug(&quot;execute !&quot;)
-
-    if @yet
+    unless @initialized
       @gio.ain(0).on Funnel::PortEvent::CHANGE do |event|
-        setValue_forOutputKey(event.target.value, &quot;out_0&quot;)
+        @ain[0] = event.target.value
       end
-      @yet = false
+      @initialized = false
+    end
+
+    4.times do |i|
+      self.setValue_forOutputKey(@ain[i], &quot;ain_&quot; + i.to_s)
+      self.setValue_forOutputKey(@din[i], &quot;din_&quot; + i.to_s)
     end
 
     true
   end
 
   def stopExecution(context)
-    @logger.debug(&quot;stopExecution&quot;)
     true
   end
 end</diff>
      <filename>qc_gainer.rb</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>test.qtz</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a2c3c5e0486c189ee793dd3570b0cb093545d7d1</id>
    </parent>
  </parents>
  <author>
    <name>mootoh</name>
    <email>mootoh@gmail.com</email>
  </author>
  <url>http://github.com/mootoh/qc_gainer/commit/b94cb08c70b05fb45bf1828ec951505c1f2536ed</url>
  <id>b94cb08c70b05fb45bf1828ec951505c1f2536ed</id>
  <committed-date>2008-06-06T01:37:33-07:00</committed-date>
  <authored-date>2008-06-06T01:37:33-07:00</authored-date>
  <message>it works fine :)</message>
  <tree>fd7ed2c1e8cf557081491e36b7ab1d4a2c4b6532</tree>
  <committer>
    <name>mootoh</name>
    <email>mootoh@gmail.com</email>
  </committer>
</commit>
