         (.scale 1 (* -1 y-zoom))
         (.drawPolyline ^ints x-array ^ints y-a width)))))
 
-(defn scope-panel [id width height]
+(defn- scope-panel [id width height]
   (let [panel (proxy [JPanel] [true]
                 (paint [g] (paint-scope g id)))
         _ (.setPreferredSize panel (Dimension. width height))]

  (doall (map reset-data-arrays (vals @scopes*))))

(defn scopes-stop
  []
  (at-at/stop-and-reset-pool! scope-pool)
  (empty-scope-data)
  (dosync (ref-set scopes-running?* false)))

   (scopes-start)))


(on-deps #{:synthdefs-loaded :scope-group-created} ::reset-scopes #(when (internal-server?)
                                                                     (reset-scopes)))
(on-sync-event :shutdown #(when (internal-server?)
                            (scopes-stop)
                            (dorun
                             (map (fn [s] scope-close s) @scopes*)))
               ::stop-scopes)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Testing
