[beast: 4/7] BST: make use of Track.outputs



commit 83aa9bf8c41e8ca7e44031b9368d274b8bfce99b
Author: Tim Janik <timj gnu org>
Date:   Sat Oct 7 14:38:43 2017 +0200

    BST: make use of Track.outputs
    
    Signed-off-by: Tim Janik <timj gnu org>

 beast-gtk/bsttrackview.cc |   31 ++++++++++++-------------------
 1 files changed, 12 insertions(+), 19 deletions(-)
---
diff --git a/beast-gtk/bsttrackview.cc b/beast-gtk/bsttrackview.cc
index 1abe655..c2407aa 100644
--- a/beast-gtk/bsttrackview.cc
+++ b/beast-gtk/bsttrackview.cc
@@ -121,8 +121,6 @@ track_view_fill_value (BstItemView *iview,
       gboolean vbool;
       SfiInt vint;
       SfiProxy snet, wave, sound_font_preset;
-      BseIt3mSeq *iseq;
-      SfiSeq *seq;
     case COL_SEQID:
       sfi_value_take_string (value, g_strdup_format ("%03d", seqid));
       break;
@@ -169,18 +167,16 @@ track_view_fill_value (BstItemView *iview,
       sfi_value_take_string (value, g_strdup_format ("%2d", vint));
       break;
     case COL_OUTPUTS:
-      bse_proxy_get (item.proxy_id(), "outputs", &seq, NULL);
-      iseq = bse_it3m_seq_from_seq (seq);
-      if (iseq && iseq->n_items == 1)
-        {
-          Bse::ItemH item = Bse::ItemH::down_cast (bse_server.from_proxy (iseq->items[0]));
-          g_value_take_string (value, g_strdup_format ("%s", item.get_name_or_type()));
-        }
-      else if (iseq && iseq->n_items > 1)
-        g_value_take_string (value, g_strdup_format ("#%u", iseq ? iseq->n_items : 0));
-      else
-        g_value_set_string (value, "");
-      bse_it3m_seq_free (iseq);
+      {
+        Bse::TrackH track = Bse::TrackH::down_cast (item);
+        Bse::ItemSeq items = track.outputs();
+        if (items.size() == 1)
+          g_value_take_string (value, g_strdup_format ("%s", items[0].get_name_or_type()));
+        else if (items.size() > 1)
+          g_value_take_string (value, g_strdup_format ("#%u", items.size()));
+        else if (items.size() > 1)
+          g_value_set_string (value, "");
+      }
       break;
     case COL_POST_SYNTH:
       snet = 0;
@@ -392,11 +388,8 @@ track_view_outputs_changed (gpointer              data,
 {
   OutputsPopup *odata = (OutputsPopup*) data;
   gxk_cell_renderer_popup_change (odata->pcell, NULL, FALSE, FALSE);
-  SfiSeq *seq = bse_it3m_seq_to_seq (iseq);
-  GValue *value = sfi_value_seq (seq);
-  sfi_seq_unref (seq);
-  bse_proxy_set_property (odata->item, "outputs", value);
-  sfi_value_free (value);
+  Bse::TrackH track = Bse::TrackH::down_cast (bse_server.from_proxy (odata->item));
+  track.outputs (bst_item_seq_from_it3m_seq (iseq));
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]