summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-07-17 10:23:39 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2013-07-17 10:23:39 +0200
commitc852392d9e27d244ee48238e056f7dac5bc7e131 (patch)
tree3edd0f46ca460651a65e0aeccede27f31f7c5a49
parent75cf94de86e3d6daa1bc270852eec512ce1085b2 (diff)
downloadlibuca-c852392d9e27d244ee48238e056f7dac5bc7e131.tar.gz
libuca-c852392d9e27d244ee48238e056f7dac5bc7e131.tar.bz2
libuca-c852392d9e27d244ee48238e056f7dac5bc7e131.tar.xz
libuca-c852392d9e27d244ee48238e056f7dac5bc7e131.zip
Add -c/--camera flag to uca-camera-control
-rw-r--r--NEWS2
-rw-r--r--bin/gui/control.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 7e32454..dd52495 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ Changes in libuca 1.3
- Added `sensor-pixel-width` and `sensor-pixel-height` to describe the cameras
pixel size in meters.
+- Added `-c/--camera` flag to uca-camera-control to specify a camera name from
+ the command-line and by-pass the choice window.
Changes in libuca 1.2
diff --git a/bin/gui/control.c b/bin/gui/control.c
index ea150f3..9653bb3 100644
--- a/bin/gui/control.c
+++ b/bin/gui/control.c
@@ -746,16 +746,19 @@ main (int argc, char *argv[])
GtkBuilder *builder;
GOptionContext *context;
GError *error = NULL;
+ static gchar *camera_name = NULL;
static GOptionEntry entries[] =
{
{ "mem-size", 'm', 0, G_OPTION_ARG_INT, &mem_size, "Memory in megabytes to allocate for frame storage", "M" },
+ { "camera", 'c', 0, G_OPTION_ARG_STRING, &camera_name, "Default camera (skips choice window)", "NAME" },
{ NULL }
};
context = g_option_context_new ("- control libuca cameras");
g_option_context_add_main_entries (context, entries, NULL);
g_option_context_add_group (context, gtk_get_option_group (TRUE));
+
if (!g_option_context_parse (context, &argc, &argv, &error)) {
g_print ("Option parsing failed: %s\n", error->message);
return 1;
@@ -773,9 +776,13 @@ main (int argc, char *argv[])
}
plugin_manager = uca_plugin_manager_new ();
- create_choice_window (builder);
gtk_builder_connect_signals (builder, NULL);
+ if (camera_name != NULL)
+ create_main_window (builder, camera_name);
+ else
+ create_choice_window (builder);
+
gdk_threads_enter ();
gtk_main ();
gdk_threads_leave ();