[longomatch] Implement different behaviour depending on MultiCamera support.



commit 0f6dd4bd1329bb7a7786e91ddf6bb0ce5410e70b
Author: Julien Moutte <julien fluendo com>
Date:   Thu Apr 9 14:38:28 2015 +0200

    Implement different behaviour depending on MultiCamera support.
    
    The widget will now detect that multi camera is supported or not and adapt the behaviour accordingly. 
Without multi camera support we should only propose a single media file entry

 .../Gui/Component/MediaFileSetSelection.cs         |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs 
b/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs
index cb5c359..78a0edb 100644
--- a/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs
+++ b/LongoMatch.GUI/Gui/Component/MediaFileSetSelection.cs
@@ -46,9 +46,14 @@ namespace LongoMatch.Gui.Component
                                fileSet = value;
 
                                if (fileSet.Count > 0) {
-                                       // Create all choosers
-                                       foreach (MediaFile mf in fileSet) {
-                                               AddMediaFileChooser (mf.Name);
+                                       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);
                                        }
                                } else {
                                        // Add the first media file chooser for main camera
@@ -141,7 +146,11 @@ namespace LongoMatch.Gui.Component
                                        fileSet.Add (chooser.MediaFile);
                                } else {
                                        // Mark for removal as we only want one empty file chooser at most
-                                       to_remove.Add (chooser);
+                                       if (fileChoosers.Count > 1) {
+                                               to_remove.Add (chooser);
+                                       } else {
+                                               have_empty_chooser = true;
+                                       }
                                }
                        }
 
@@ -153,7 +162,7 @@ namespace LongoMatch.Gui.Component
 
                        to_remove.Clear ();
 
-                       if (!have_empty_chooser) {
+                       if (!have_empty_chooser && Config.SupportsMultiCamera) {
                                AddMediaFileChooser (null);
                        }
                }


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