[chronojump] selectable camera on main gui
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] selectable camera on main gui
- Date: Tue, 30 Apr 2013 18:19:48 +0000 (UTC)
commit c99841edf241f7a23e18662b3576dbc0469ee86a
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Apr 30 20:19:20 2013 +0200
selectable camera on main gui
glade/chronojump.glade | 24 +++++++++++++++++++++++-
src/gui/chronojump.cs | 42 +++++++++++++++++++++++++++++++++++++++---
src/gui/person.cs | 1 +
3 files changed, 63 insertions(+), 4 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 2b38ad2..b0f05f6 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6316,10 +6316,32 @@ Second Chronopic to platforms.</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="pack_type">end</property>
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <widget class="GtkButton"
id="button_video_source">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property
name="use_action_appearance">False</property>
+ <signal name="clicked"
handler="on_button_video_source_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkImage" id="image31">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-preferences</property>
+ <property name="icon-size">2</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="left_attach">2</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 254236e..cd4455f 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2797,7 +2797,8 @@ public partial class ChronoJumpWindow
videoCapturePrepare();
}
-
+
+ int videoSourceNum = 0;
private void videoCapturePrepare() {
CapturePropertiesStruct s = new CapturePropertiesStruct();
@@ -2809,6 +2810,7 @@ public partial class ChronoJumpWindow
s.Width = 360;
s.Height = 288;
+Log.WriteLine("videoCapturePPPPPPPPPPPPPPPPPrepare");
List<LongoMatch.Video.Utils.Device> devices =
LongoMatch.Video.Utils.Device.ListVideoDevices();
foreach(LongoMatch.Video.Utils.Device dev in devices){
Log.WriteLine(dev.ID.ToString());
@@ -2816,7 +2818,7 @@ public partial class ChronoJumpWindow
Log.WriteLine(dev.DeviceType.ToString());
}
- s.DeviceID = devices[0].ID;
+ s.DeviceID = devices[videoSourceNum].ID;
capturer.CaptureProperties = s;
@@ -2834,6 +2836,41 @@ public partial class ChronoJumpWindow
capturer.Run();
}
+ private void on_button_video_source_clicked (object o, EventArgs args) {
+ List<LongoMatch.Video.Utils.Device> devices =
LongoMatch.Video.Utils.Device.ListVideoDevices();
+ string [] devicesStr = new String[devices.Count];
+ int count = 0;
+Log.WriteLine("yessssssssssssssssss");
+ foreach(LongoMatch.Video.Utils.Device dev in devices) {
+ devicesStr[count++] = dev.ID.ToString();
+ Log.WriteLine(dev.ID.ToString());
+ }
+
+ if(count == 0)
+ new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Sorry, No
cameras found."));
+ else {
+ genericWin = GenericWindow.Show(
+ Catalog.GetString("Select video source"),
+ Constants.GenericWindowShow.COMBO);
+ genericWin.SetComboValues(devicesStr, devicesStr[0]);
+ genericWin.ShowCombo(true);
+ genericWin.Button_accept.Clicked += new EventHandler(on_button_video_source_accepted);
+ genericWin.ShowNow();
+ }
+ }
+
+ private void on_button_video_source_accepted (object o, EventArgs args) {
+ List<LongoMatch.Video.Utils.Device> devices =
LongoMatch.Video.Utils.Device.ListVideoDevices();
+ int count = 0;
+ foreach(LongoMatch.Video.Utils.Device dev in devices) {
+ if(dev.ToString() == genericWin.GetComboSelected)
+ videoSourceNum = count;
+ count ++;
+ }
+ genericWin.HideAndNull();
+ }
+
+
private void changeVideoButtons(bool myVideo) {
image_video_yes.Visible = myVideo;
image_video_no.Visible = ! myVideo;
@@ -4707,7 +4744,6 @@ Console.WriteLine("X");
myTreeViewMultiChronopic.EventSelectedID));
}
-
/* ---------------------------------------------------------
* ---------------- EVENTS DELETE -------------------------
* --------------------------------------------------------
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 7848f5b..453bdab 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -25,6 +25,7 @@ using Glade;
using GLib; //for Value
using System.Text; //StringBuilder
using System.Collections; //ArrayList
+using System.Collections.Generic; //List
using Mono.Unix;
using System.Threading;
using System.IO;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]