diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | bin/gui/control.c | 9 |
2 files changed, 10 insertions, 1 deletions
@@ -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 (); |