Commit f791a738 authored by Xavier de Blas's avatar Xavier de Blas

webcam preview on preferences gui

parent 7e51aac1
......@@ -3409,17 +3409,6 @@ Other</property>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label_webcam_windows">
<property name="can_focus">False</property>
<property name="label" translatable="yes">On Windows at least Windows 7 is required.</property>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox_camera_resolution_framerate">
<property name="visible">True</property>
......@@ -3501,6 +3490,62 @@ Other</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button_video_preview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip" translatable="yes">Preview video</property>
<signal name="clicked" handler="on_button_video_preview_clicked" swapped="no"/>
<child>
<widget class="GtkHBox" id="hbox321">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">4</property>
<child>
<widget class="GtkImage" id="image_video_preview">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label392">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Preview</property>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label_webcam_windows">
<property name="can_focus">False</property>
<property name="label" translatable="yes">On Windows at least Windows 7 is required.</property>
</widget>
<packing>
<property name="expand">True</property>
......
......@@ -152,6 +152,7 @@ public class PreferencesWindow
[Widget] Gtk.ComboBox combo_camera_framerate;
[Widget] Gtk.Label label_no_cameras;
[Widget] Gtk.Label label_webcam_windows;
[Widget] Gtk.Image image_video_preview;
//language tab
[Widget] Gtk.Box hbox_combo_language;
......@@ -242,6 +243,7 @@ public class PreferencesWindow
PreferencesWindowBox.preferences = preferences;
PreferencesWindowBox.createComboLanguage();
Pixbuf pixbuf;
//appearence tab
if(preferences.maximized == Preferences.MaximizedTypes.NO)
......@@ -299,6 +301,8 @@ public class PreferencesWindow
wd_list = UtilMultimedia.GetVideoDevices();
PreferencesWindowBox.createComboCamera(preferences.videoDevice, preferences.videoDeviceResolution, preferences.videoDeviceFramerate);
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_photo_preview.png");
PreferencesWindowBox.image_video_preview.Pixbuf = pixbuf;
string [] decs = {"1", "2", "3"};
......@@ -377,7 +381,6 @@ public class PreferencesWindow
//start of double contacts stuff ----
Pixbuf pixbuf;
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_run_simple.png");
PreferencesWindowBox.image_races_simple.Pixbuf = pixbuf;
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_run_multiple.png");
......@@ -683,6 +686,17 @@ public class PreferencesWindow
Util.TestSound = false;
}
private void on_button_video_preview_clicked (object o, EventArgs args)
{
string cameraCode = wd_list.GetCodeOfFullname(UtilGtk.ComboGetActive(combo_camera));
if(cameraCode == "")
return;
Webcam webcamPlay = new WebcamFfmpeg (Webcam.Action.PLAYPREVIEW, UtilAll.GetOSEnum(),
cameraCode, UtilGtk.ComboGetActive(combo_camera_resolution), UtilGtk.ComboGetActive(combo_camera_framerate));
Webcam.Result result = webcamPlay.PlayPreviewNoBackground ();
}
// ---- end of multimedia stuff
// ---- Language stuff
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment