You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
/***************************************************************************************
|
|
*
|
|
* video.cc is part of SimpleSkyCam.
|
|
*
|
|
*****************************************************************************************/
|
|
|
|
#include <list>
|
|
#include <string>
|
|
#include "gui.h"
|
|
#include "video.h"
|
|
|
|
VideoDev videodev;
|
|
|
|
void cb_video_refreshlist (GtkWidget *widget, gpointer data) {
|
|
GtkWidget *cbox = GTK_WIDGET(gtk_builder_get_object (GTK_BUILDER(_builder_), "cb-videodev"));
|
|
GtkListStore *model = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(cbox)));
|
|
|
|
std::list<std::string> devlist;
|
|
std::list<std::string>::iterator iter;
|
|
|
|
printf ("%s:%d %s\n", __FILE__, __LINE__, __FUNCTION__);
|
|
|
|
if (model == NULL) {
|
|
model = gtk_list_store_new(1, G_TYPE_STRING);
|
|
gtk_combo_box_set_model(GTK_COMBO_BOX(cbox),GTK_TREE_MODEL(model));
|
|
}
|
|
|
|
gtk_list_store_clear(GTK_LIST_STORE(model));
|
|
|
|
if (videodev.GetDeviceList(&devlist)) {
|
|
for (iter = devlist.begin(); iter != devlist.end(); iter++) {
|
|
gtk_list_store_insert_with_values(GTK_LIST_STORE(model), NULL, -1,
|
|
0, iter->c_str(),
|
|
-1);
|
|
}
|
|
}
|
|
}
|