[longomatch] Filter incoming fileset depending on multi camera support.



commit 20f940bf7f08e2897e6682b506490cd5eced71c2
Author: Julien Moutte <julien fluendo com>
Date:   Thu Apr 9 16:02:27 2015 +0200

    Filter incoming fileset depending on multi camera support.
    
    Instead of just showing the first media file crop the fileset so that caller can update it in project 
description. (mostly needed for import).

 .../Gui/Component/MediaFileSetSelection.cs         |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs 
b/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs
index 78a0edb..73c299d 100644
--- a/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs
+++ b/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs
@@ -43,17 +43,18 @@ namespace LongoMatch.Gui.Component
 
                public MediaFileSet FileSet {
                        set {
-                               fileSet = value;
+                               // In case we don't support multi camera, clip fileset to only one file.
+                               if (!Config.SupportsMultiCamera && value.Count > 1) {
+                                       fileSet = new MediaFileSet ();
+                                       fileSet.Add (value [0]);
+                               } else {
+                                       fileSet = value;
+                               }
 
                                if (fileSet.Count > 0) {
-                                       if (Config.SupportsMultiCamera) {
-                                               // Create all choosers
-                                               foreach (MediaFile mf in fileSet) {
-                                                       AddMediaFileChooser (mf.Name);
-                                               }
-                                       } else {
-                                               // Or just one if we don't support multi camera
-                                               AddMediaFileChooser (fileSet.First ().Name);
+                                       // Create all choosers
+                                       foreach (MediaFile mf in fileSet) {
+                                               AddMediaFileChooser (mf.Name);
                                        }
                                } else {
                                        // Add the first media file chooser for main camera


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