              [(ssc/text :id :vlc-password :columns 10)
               :gridx 5 :weightx 1.0 :gridwidth 3]
              [(make-vlc-refresh-button) :gridx 8 :gridwidth 2]
+             [(ssc/label :halign :right :text "Metric")
+              :grid :wrap :gridwidth 1]
              [(ssc/combobox :id :control-metric
                             :listen [:action handle-control-metric-selection]
                             :model (keys stat-process-fns))
-              :grid :wrap :weightx 1.0 :gridx 0 :gridwidth 2]
+              :gridx 1 :gridwidth 3 :weightx 1.0]
              [(ssc/label :text "Avg. per" :halign :right)
-              :gridx 2 :gridwidth 1]
+              :gridx 4 :gridwidth 1]
              [(ssc/text :id :average-interval :columns 4 :text "1")
-              :gridx 3 :gridwidth 1]
-             [(ssc/label :text "sec") :gridx 4]
-             [(ssc/label :text "Cmd. each" :halign :right) :gridx 5]
+              :gridx 5 :gridwidth 1]
+             [(ssc/label :text "sec")
+              :gridx 6 :gridwidth 1]
+             [(ssc/label :text "Cmd. each" :halign :right)
+              :gridx 7 :gridwidth 1]
              [(ssc/text :id :command-interval :columns 4 :text "1")
-              :gridx 6 :gridwidth 1]
-             [(ssc/label :text "sec") :gridx 7]
-             [(make-vlc-start-button) :gridx 8 :gridwidth 2]
+              :gridx 8 :gridwidth 1]
+             [(ssc/label :text "sec")
+              :gridx 9 :gridwidth 1]
              [(ssc/label :id :metric-help-msg
                          :halign :center
                          :text (get metric-help-messages "Attention"))

  (let [items-ids (vals (:items (vlc/get-playlist)))]
    (filter map? (map #(get-vlc-item-rule %) items-ids))))

(defn- vlc-start-button-click [evt]
  (update-vlc-config!)
  (update-metric-bars! {:attention 0, :meditation 0})
  (let [rules (get-vlc-rules)]
    (when (seq rules)
      (alter-connection! (partial (get backend->consume-fn "VLC") rules))
      (ssc/config! (.getSource evt)
                   :text (get vlc-button-texts (nsky/get-connection-status))))))

(defn- make-vlc-start-button []
  (ssc/button :id :start-vlc
              :text (:disconnected vlc-button-texts)
              :listen [:action vlc-start-button-click]))

(defn- handle-control-metric-selection [evt]
  (let [metric (ssc/config (.getSource evt) :text)
        help-label (ssc/select window [:#metric-help-msg])]

  (:require [clojure.data :refer (diff)]
            [seesaw.core :as ssc]
            [seesaw.graphics :as ssg]
            [seesaw.border :refer (line-border to-border)]
            [seesaw.color :refer (color)]
            [nl-streamer.serial-port :refer (port-names)]
            [nl-streamer.neurosky :as nsky]
