Mon Nov 15 19:04:53 2010 UTC ()
Import shotwell 0.7.2 into the NetBSD Packages collection.
Shotwell is a photo organizer for the GNOME desktop. It lets you import photos
from disk or camera, organize them in various ways, view them in full-window or
fullscreen mode, and export them to share with others.
Status:
Vendor Tag: TNF
Release Tags: pkgsrc-base
(gls)
diff -r0 -r1.1.1.1 pkgsrc/graphics/shotwell/Makefile
diff -r0 -r1.1.1.1 pkgsrc/graphics/shotwell/PLIST
diff -r0 -r1.1.1.1 pkgsrc/graphics/shotwell/DESCR
diff -r0 -r1.1.1.1 pkgsrc/graphics/shotwell/distinfo
diff -r0 -r1.1.1.1 pkgsrc/graphics/shotwell/patches/patch-aa
diff -r0 -r1.1.1.1 pkgsrc/graphics/shotwell/patches/patch-ab
# $NetBSD: Makefile,v 1.1.1.1 2010/11/15 19:04:53 gls Exp $
#
DISTNAME= shotwell-0.7.2
CATEGORIES= graphics
MASTER_SITES= http://yorba.org/download/shotwell/0.7/
EXTRACT_SUFX= .tar.bz2
MAINTAINER= pkgrsc-users@NetBSD.org
HOMEPAGE= http://yorba.org/download/shotwell/0.7/
COMMENT= Shotwell is a photo organizer for the GNOME desktop
LICENSE= gnu-lgpl-v2.1
PKG_DESTDIR_SUPPORT= user-destdir
HAS_CONFIGURE= yes
USE_TOOLS+= gmake bash
CONFIG_SHELL= bash
CONFIGURE_ARGS+= --prefix=${PREFIX}
CONFIGURE_ENV+= --define=NO_CAMERA
REPLACE_SH+= minver configure libraw-config
GCONF_SCHEMAS= shotwell.schemas
INSTALLATION_DIRS+= share/gconf/schemas
post-install:
${INSTALL_DATA} ${WRKSRC}/misc/shotwell.schemas \
${DESTDIR}${PREFIX}/share/gconf/schemas
.include "../../databases/sqlite3/buildlink3.mk"
.include "../../devel/GConf/schemas.mk"
.include "../../devel/libgee/buildlink3.mk"
.include "../../devel/libgphoto2/buildlink3.mk"
.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
.include "../../graphics/libexif/buildlink3.mk"
.include "../../graphics/libgexiv2/buildlink3.mk"
.include "../../graphics/libraw/buildlink3.mk"
.include "../../lang/vala/buildlink3.mk"
.include "../../net/libsoup24/buildlink3.mk"
.include "../../sysutils/desktop-file-utils/desktopdb.mk"
.include "../../sysutils/dbus-glib/buildlink3.mk"
.include "../../textproc/libxml2/buildlink3.mk"
.include "../../www/webkit-gtk/buildlink3.mk"
.include "../../x11/gtk2/buildlink3.mk"
.include "../../x11/libunique/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
@comment $NetBSD: PLIST,v 1.1.1.1 2010/11/15 19:04:53 gls Exp $
bin/shotwell
share/applications/shotwell-viewer.desktop
share/applications/shotwell.desktop
share/gconf/schemas/shotwell.schemas
share/gnome/help/shotwell/C/edit-adjustments.page
share/gnome/help/shotwell/C/edit-crop.page
share/gnome/help/shotwell/C/edit-enhance.page
share/gnome/help/shotwell/C/edit-external.page
share/gnome/help/shotwell/C/edit-nondestructive.page
share/gnome/help/shotwell/C/edit-redeye.page
share/gnome/help/shotwell/C/edit-rotate.page
share/gnome/help/shotwell/C/edit-time-date.page
share/gnome/help/shotwell/C/edit-undo.page
share/gnome/help/shotwell/C/figures/crop_thirds.jpg
share/gnome/help/shotwell/C/figures/edit_toolbar.png
share/gnome/help/shotwell/C/figures/editing_overview.png
share/gnome/help/shotwell/C/figures/shotwell_logo.png
share/gnome/help/shotwell/C/figures/trash_process.png
share/gnome/help/shotwell/C/formats.page
share/gnome/help/shotwell/C/import-camera.page
share/gnome/help/shotwell/C/import-f-spot.page
share/gnome/help/shotwell/C/import-file.page
share/gnome/help/shotwell/C/import-memorycard.page
share/gnome/help/shotwell/C/index.page
share/gnome/help/shotwell/C/organize-event.page
share/gnome/help/shotwell/C/organize-rating.page
share/gnome/help/shotwell/C/organize-remove.page
share/gnome/help/shotwell/C/organize-tag.page
share/gnome/help/shotwell/C/organize-title.page
share/gnome/help/shotwell/C/other-missing.page
share/gnome/help/shotwell/C/other-multiple.page
share/gnome/help/shotwell/C/running.page
share/gnome/help/shotwell/C/share-background.page
share/gnome/help/shotwell/C/share-export.page
share/gnome/help/shotwell/C/share-print.page
share/gnome/help/shotwell/C/share-slideshow.page
share/gnome/help/shotwell/C/share-upload.page
share/gnome/help/shotwell/C/view-displaying.page
share/gnome/help/shotwell/C/view-information.page
share/gnome/help/shotwell/C/view-sidebar.page
share/icons/hicolor/scalable/apps/shotwell.svg
share/locale/ar/LC_MESSAGES/shotwell.mo
share/locale/ast/LC_MESSAGES/shotwell.mo
share/locale/bg/LC_MESSAGES/shotwell.mo
share/locale/bn/LC_MESSAGES/shotwell.mo
share/locale/ca/LC_MESSAGES/shotwell.mo
share/locale/cs/LC_MESSAGES/shotwell.mo
share/locale/da/LC_MESSAGES/shotwell.mo
share/locale/de/LC_MESSAGES/shotwell.mo
share/locale/el/LC_MESSAGES/shotwell.mo
share/locale/en_GB/LC_MESSAGES/shotwell.mo
share/locale/es/LC_MESSAGES/shotwell.mo
share/locale/et/LC_MESSAGES/shotwell.mo
share/locale/fi/LC_MESSAGES/shotwell.mo
share/locale/fr/LC_MESSAGES/shotwell.mo
share/locale/gl/LC_MESSAGES/shotwell.mo
share/locale/hr/LC_MESSAGES/shotwell.mo
share/locale/hu/LC_MESSAGES/shotwell.mo
share/locale/id/LC_MESSAGES/shotwell.mo
share/locale/it/LC_MESSAGES/shotwell.mo
share/locale/ja/LC_MESSAGES/shotwell.mo
share/locale/kk/LC_MESSAGES/shotwell.mo
share/locale/ko/LC_MESSAGES/shotwell.mo
share/locale/lt/LC_MESSAGES/shotwell.mo
share/locale/lv/LC_MESSAGES/shotwell.mo
share/locale/nb/LC_MESSAGES/shotwell.mo
share/locale/nl/LC_MESSAGES/shotwell.mo
share/locale/pa/LC_MESSAGES/shotwell.mo
share/locale/pl/LC_MESSAGES/shotwell.mo
share/locale/pt/LC_MESSAGES/shotwell.mo
share/locale/ro/LC_MESSAGES/shotwell.mo
share/locale/ru/LC_MESSAGES/shotwell.mo
share/locale/sk/LC_MESSAGES/shotwell.mo
share/locale/sl/LC_MESSAGES/shotwell.mo
share/locale/sr/LC_MESSAGES/shotwell.mo
share/locale/sv/LC_MESSAGES/shotwell.mo
share/locale/th/LC_MESSAGES/shotwell.mo
share/locale/tr/LC_MESSAGES/shotwell.mo
share/locale/uk/LC_MESSAGES/shotwell.mo
share/locale/zh_CN/LC_MESSAGES/shotwell.mo
share/locale/zh_TW/LC_MESSAGES/shotwell.mo
share/shotwell/icons/all-rejected.png
share/shotwell/icons/crop-pivot-reticle.png
share/shotwell/icons/crop.svg
share/shotwell/icons/drag_nub.png
share/shotwell/icons/enhance.png
share/shotwell/icons/five-star-filter.svg
share/shotwell/icons/five-stars.svg
share/shotwell/icons/four-star-filter-plus.svg
share/shotwell/icons/four-stars.svg
share/shotwell/icons/image-adjust.svg
share/shotwell/icons/import-all.png
share/shotwell/icons/import.svg
share/shotwell/icons/last-import-roll.png
share/shotwell/icons/make-primary.svg
share/shotwell/icons/merge.svg
share/shotwell/icons/multiple-events.png
share/shotwell/icons/multiple-tags.png
share/shotwell/icons/one-event.png
share/shotwell/icons/one-star-filter-plus.svg
share/shotwell/icons/one-star.svg
share/shotwell/icons/one-tag.png
share/shotwell/icons/pin-toolbar.svg
share/shotwell/icons/publish.png
share/shotwell/icons/redeye.png
share/shotwell/icons/rejected.svg
share/shotwell/icons/shotwell-16.svg
share/shotwell/icons/shotwell-24.svg
share/shotwell/icons/shotwell-street.jpg
share/shotwell/icons/shotwell.ico
share/shotwell/icons/shotwell.svg
share/shotwell/icons/three-star-filter-plus.svg
share/shotwell/icons/three-stars.svg
share/shotwell/icons/two-star-filter-plus.svg
share/shotwell/icons/two-stars.svg
share/shotwell/icons/zoom-in.png
share/shotwell/icons/zoom-out.png
share/shotwell/ui/collection.ui
share/shotwell/ui/direct.ui
share/shotwell/ui/event.ui
share/shotwell/ui/events_directory.ui
share/shotwell/ui/fullscreen.ui
share/shotwell/ui/import.ui
share/shotwell/ui/import_queue.ui
share/shotwell/ui/offline.ui
share/shotwell/ui/photo.ui
share/shotwell/ui/shotwell.glade
share/shotwell/ui/tags.ui
share/shotwell/ui/trash.ui
Shotwell is a photo organizer for the GNOME desktop. It lets you import photos
from disk or camera, organize them in various ways, view them in full-window or
fullscreen mode, and export them to share with others.
$NetBSD: distinfo,v 1.1.1.1 2010/11/15 19:04:53 gls Exp $
SHA1 (shotwell-0.7.2.tar.bz2) = 892ae852e990ab9815108b41b8151ee7ef7f11d9
RMD160 (shotwell-0.7.2.tar.bz2) = 4b9e6abfda6fb479a7cb376340c226fa10357e86
Size (shotwell-0.7.2.tar.bz2) = 1064127 bytes
SHA1 (patch-aa) = 038b4913bfe937121c084a438b002eeb283f714e
SHA1 (patch-ab) = f415b6a90eb61f5a2696a9f87733fa617af8f163
$NetBSD: patch-aa,v 1.1.1.1 2010/11/15 19:04:53 gls Exp $
--- Makefile.orig 2010-09-10 22:55:54.000000000 +0000
+++ Makefile
@@ -124,11 +124,6 @@ SRC_FILES = \
FSpotDatabaseDriver.vala \
FSpotDatabaseTables.vala
-ifndef LINUX
-SRC_FILES += \
- GConf.vala
-endif
-
VAPI_FILES = \
libexif.vapi \
libgphoto2.vapi \
@@ -268,6 +263,7 @@ EXT_PKGS = \
gee-1.0 \
gtk+-2.0 \
glib-2.0 \
+ gmodule-2.0 \
libexif \
sqlite3 \
gexiv2
@@ -275,7 +271,6 @@ EXT_PKGS = \
LIBRAW_PKG = \
libraw
-ifdef LINUX
EXT_PKGS += \
gconf-2.0 \
libgphoto2 \
@@ -283,10 +278,8 @@ EXT_PKGS += \
libxml-2.0 \
unique-1.0 \
webkit-1.0 \
- gudev-1.0 \
dbus-glib-1 \
gdk-x11-2.0
-endif
# libraw is handled separately (see note below); when libraw-config is no longer needed, the version
# should be added to this list
@@ -301,7 +294,6 @@ EXT_PKG_VERSIONS = \
LIBRAW_VERSION = \
0.9.0
-ifdef LINUX
EXT_PKG_VERSIONS += \
gconf-2.0 >= 2.22.0 \
libgphoto2 >= 2.4.2 \
@@ -309,9 +301,7 @@ EXT_PKG_VERSIONS += \
libxml-2.0 >= 2.6.32 \
unique-1.0 >= 1.0.0 \
webkit-1.0 >= 1.1.5 \
- gudev-1.0 >= 145 \
dbus-glib-1 >= 0.80
-endif
PKGS = $(EXT_PKGS) $(LOCAL_PKGS) $(LIBRAW_PKG)
@@ -366,7 +356,7 @@ ifndef BUILD_DEBUG
# -mwindows prevents a console window from appearing when we run Shotwell, but also hides
# all logging/debugging output, so we specify it only in a release build.
VALA_LDFLAGS += -mwindows
-endif
+endif
shotwell.res: windows/shotwell.rc
windres windows/shotwell.rc -O coff -o shotwell.res
@@ -470,7 +460,6 @@ endif
ifndef DISABLE_DESKTOP_UPDATE
-update-desktop-database || :
endif
-ifdef LINUX
ifndef DISABLE_SCHEMAS_INSTALL
GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-install-rule misc/shotwell.schemas
else
@@ -487,7 +476,6 @@ ifndef DISABLE_HELP_INSTALL
mkdir -p $(DESTDIR)$(PREFIX)/share/gnome/help/shotwell/C/figures
$(INSTALL_DATA) $(EXPANDED_HELP_IMAGES) $(DESTDIR)$(PREFIX)/share/gnome/help/shotwell/C/figures
endif
-endif
-$(foreach lang,$(SUPPORTED_LANGUAGES),`mkdir -p $(SYSTEM_LANG_DIR)/$(lang)/LC_MESSAGES ; \
$(INSTALL_DATA) $(LOCAL_LANG_DIR)/$(lang)/LC_MESSAGES/shotwell.mo \
$(SYSTEM_LANG_DIR)/$(lang)/LC_MESSAGES/shotwell.mo`)
@@ -518,7 +506,6 @@ endif
$(VALA_STAMP): $(EXPANDED_SRC_FILES) $(EXPANDED_VAPI_FILES) $(EXPANDED_SRC_HEADER_FILES) Makefile \
$(CONFIG_IN)
- @ ./minver `valac --version | awk '{print $$2}'` $(MIN_VALAC_VERSION) || ( echo 'Shotwell requires Vala compiler $(MIN_VALAC_VERSION) or greater. You are running' `valac --version` '\b.'; exit 1 )
ifndef ASSUME_PKGS
ifdef EXT_PKG_VERSIONS
@pkg-config --print-errors --exists '$(EXT_PKG_VERSIONS)'
@@ -546,15 +533,15 @@ $(EXPANDED_C_FILES): $(VALA_STAMP)
@
$(EXPANDED_OBJ_FILES): %.o: %.c $(CONFIG_IN) Makefile
- $(CC) -c $(VALA_CFLAGS) `$(LIBRAW_CONFIG) --cflags` $(CFLAGS) -o $@ $<
+ $(CC) -c $(VALA_CFLAGS) $(CFLAGS) `pkg-config --cflags raw` -o $@ $<
$(PROGRAM): $(EXPANDED_OBJ_FILES) $(RESOURCES) $(LANG_STAMP)
- $(CC) $(EXPANDED_OBJ_FILES) $(CFLAGS) $(RESOURCES) $(VALA_LDFLAGS) `$(LIBRAW_CONFIG) --libs` $(EXPORT_FLAGS) -o $@
+ $(CC) $(EXPANDED_OBJ_FILES) $(CFLAGS) $(RESOURCES) $(VALA_LDFLAGS) $(LDFLAGS) `pkg-config --libs raw` $(EXPORT_FLAGS) -o $@
glade: lib$(PROGRAM).so
lib$(PROGRAM).so: $(EXPANDED_OBJ_FILES) $(RESOURCES) $(LANG_STAMP)
- $(CC) $(EXPANDED_OBJ_FILES) $(CFLAGS) $(RESOURCES) $(VALA_LDFLAGS) `$(LIBRAW_CONFIG) --libs` $(EXPORT_FLAGS) -shared -o $@
+ $(CC) $(EXPANDED_OBJ_FILES) $(CFLAGS) $(RESOURCES) $(VALA_LDFLAGS) $(LDFLAGS) `pkg-config --libs raw` $(EXPORT_FLAGS) -shared -o $@
shotwell-setup-$(VERSION).exe: $(PROGRAM) windows/winstall.iss
iscc windows\winstall.iss
$NetBSD: patch-ab,v 1.1.1.1 2010/11/15 19:04:53 gls Exp $
--- src/CameraTable.vala.orig 2010-09-10 22:55:55.000000000 +0000
+++ src/CameraTable.vala
@@ -1,7 +1,7 @@
/* Copyright 2009-2010 Yorba Foundation
*
* This software is licensed under the GNU Lesser General Public License
- * (version 2.1 or later). See the COPYING file in this distribution.
+ * (version 2.1 or later). See the COPYING file in this distribution.
*/
#if !NO_CAMERA
@@ -9,7 +9,7 @@
public class DiscoveredCamera {
public GPhoto.Camera gcamera;
public string uri;
-
+
public DiscoveredCamera(GPhoto.Camera gcamera, string uri) {
this.gcamera = gcamera;
this.uri = uri;
@@ -18,70 +18,66 @@ public class DiscoveredCamera {
public class CameraTable {
private const int UPDATE_DELAY_MSEC = 500;
-
+
// list of subsystems being monitored for events
private const string[] SUBSYSTEMS = { "usb", "block", null };
-
+
private static CameraTable instance = null;
-
- private GUdev.Client client = new GUdev.Client(SUBSYSTEMS);
+
private OneShotScheduler camera_update_scheduler = null;
private GPhoto.Context null_context = new GPhoto.Context();
private GPhoto.CameraAbilitiesList abilities_list;
-
+
private Gee.HashMap<string, DiscoveredCamera> camera_map = new Gee.HashMap<string, DiscoveredCamera>(
str_hash, str_equal, direct_equal);
public signal void camera_added(DiscoveredCamera camera);
-
+
public signal void camera_removed(DiscoveredCamera camera);
-
+
private CameraTable() {
camera_update_scheduler = new OneShotScheduler("CameraTable update scheduler",
on_update_cameras);
-
- // listen for interesting events on the specified subsystems
- client.uevent.connect(on_udev_event);
-
+
// because loading the camera abilities list takes a bit of time and slows down app
// startup, delay loading it (and notifying any observers) for a small period of time,
// after the dust has settled
Timeout.add(500, delayed_init);
}
-
+
private bool delayed_init() {
try {
init_camera_table();
} catch (GPhotoError err) {
warning("Unable to initialize camera table: %s", err.message);
-
+
return false;
}
-
+
try {
update_camera_table();
} catch (GPhotoError err) {
warning("Unable to update camera table: %s", err.message);
}
-
+
return false;
}
-
+
public static CameraTable get_instance() {
if (instance == null)
instance = new CameraTable();
-
+
return instance;
}
-
+
public Gee.Iterable<DiscoveredCamera> get_cameras() {
return camera_map.values;
}
-
+
public int get_count() {
return camera_map.size;
}
-
+
public DiscoveredCamera? get_for_uri(string uri) {
return camera_map.get(uri);
}
@@ -90,43 +86,18 @@ public class CameraTable {
if (res != GPhoto.Result.OK)
throw new GPhotoError.LIBRARY("[%d] Unable to %s: %s", (int) res, op, res.as_string());
}
-
+
private void init_camera_table() throws GPhotoError {
do_op(GPhoto.CameraAbilitiesList.create(out abilities_list), "create camera abilities list");
do_op(abilities_list.load(null_context), "load camera abilities list");
}
-
+
private string[] get_all_usb_cameras() {
string[] cameras = new string[0];
-
- GLib.List<GUdev.Device> device_list = client.query_by_subsystem(null);
- foreach (GUdev.Device device in device_list) {
- string device_file = device.get_device_file();
- if(
- // only keep devices that have a non-null device file and that
- // have both the ID_GPHOTO2 and GPHOTO2_DRIVER properties set
- (device_file != null) &&
- (device.has_property("ID_GPHOTO2")) &&
- (device.has_property("GPHOTO2_DRIVER"))
- ) {
- int camera_bus, camera_device;
- // extract the bus and device IDs from the device file string
- // TODO: is it safe to parse the absolute path or should we be
- // smarter and use a regex to only pick up the end of the path?
- if (device_file.scanf("/dev/bus/usb/%d/%d", out camera_bus, out camera_device) < 2) {
- critical("get_all_usb_cameras: Failed to scanf device file %s", device_file);
-
- continue;
- }
- string camera = "usb:%.3d,%.3d".printf(camera_bus, camera_device);
- debug("USB camera detected at %s", camera);
- cameras += camera;
- }
- }
-
+
return cameras;
}
-
+
// USB (or libusb) is a funny beast; if only one USB device is present (i.e. the camera),
// then a single camera is detected at port usb:. However, if multiple USB devices are
// present (including non-cameras), then the first attached camera will be listed twice,
@@ -135,59 +106,59 @@ public class CameraTable {
//
// This function gleans the full port name of a particular port, even if it's the unadorned
// "usb:", by using GUdev.
- private bool usb_esp(int current_camera_count, string[] usb_cameras, string port,
+ private bool usb_esp(int current_camera_count, string[] usb_cameras, string port,
out string full_port) {
// sanity
assert(current_camera_count > 0);
-
+
debug("USB ESP: current_camera_count=%d port=%s", current_camera_count, port);
-
+
// if GPhoto detects one camera, and USB reports one camera, all is swell
if (current_camera_count == 1 && usb_cameras.length == 1) {
full_port = usb_cameras[0];
-
+
debug("USB ESP: port=%s full_port=%s", port, full_port);
-
+
return true;
}
// with more than one camera, skip the mirrored "usb:" port
if (port == "usb:") {
debug("USB ESP: Skipping %s", port);
-
+
return false;
}
-
+
// parse out the bus and device ID
int bus, device;
if (port.scanf("usb:%d,%d", out bus, out device) < 2) {
critical("USB ESP: Failed to scanf %s", port);
-
+
return false;
}
-
+
foreach (string usb_camera in usb_cameras) {
int camera_bus, camera_device;
if (usb_camera.scanf("usb:%d,%d", out camera_bus, out camera_device) < 2) {
critical("USB ESP: Failed to scanf %s", usb_camera);
-
+
continue;
}
-
+
if ((bus == camera_bus) && (device == camera_device)) {
full_port = port;
-
+
debug("USB ESP: port=%s full_port=%s", port, full_port);
return true;
}
}
-
+
debug("USB ESP: No matching bus/device found for port=%s", port);
-
+
return false;
}
-
+
public static string get_port_uri(string port) {
return "gphoto2://[%s]/".printf(port);
}
@@ -201,13 +172,13 @@ public class CameraTable {
GPhoto.CameraList camera_list;
do_op(GPhoto.CameraList.create(out camera_list), "create camera list");
do_op(abilities_list.detect(port_info_list, camera_list, null_context), "detect cameras");
-
+
Gee.HashMap<string, string> detected_map = new Gee.HashMap<string, string>(str_hash, str_equal,
str_equal);
-
+
// walk the USB chain and find all PTP cameras; this is necessary for usb_esp
string[] usb_cameras = get_all_usb_cameras();
-
+
// go through the detected camera list and glean their ports
for (int ctr = 0; ctr < camera_list.count(); ctr++) {
string name;
@@ -215,55 +186,55 @@ public class CameraTable {
string port;
do_op(camera_list.get_value(ctr, out port), "get detected camera port");
-
+
debug("Detected %d/%d %s @ %s", ctr + 1, camera_list.count(), name, port);
-
+
// do some USB ESP, skipping ports that cannot be deduced
if (port.has_prefix("usb:")) {
string full_port;
if (!usb_esp(camera_list.count(), usb_cameras, port, out full_port))
continue;
-
+
port = full_port;
}
detected_map.set(port, name);
}
-
+
// find cameras that have disappeared
DiscoveredCamera[] missing = new DiscoveredCamera[0];
foreach (DiscoveredCamera camera in camera_map.values) {
GPhoto.PortInfo port_info;
- do_op(camera.gcamera.get_port_info(out port_info),
+ do_op(camera.gcamera.get_port_info(out port_info),
"retrieve missing camera port information");
-
+
GPhoto.CameraAbilities abilities;
do_op(camera.gcamera.get_abilities(out abilities), "retrieve camera abilities");
-
+
if (detected_map.has_key(port_info.path)) {
debug("Found camera for %s @ %s in detected map", abilities.model, port_info.path);
-
+
continue;
}
-
+
debug("%s @ %s missing", abilities.model, port_info.path);
-
+
missing += camera;
}
-
+
// have to remove from hash map outside of iterator
foreach (DiscoveredCamera camera in missing) {
GPhoto.PortInfo port_info;
do_op(camera.gcamera.get_port_info(out port_info),
"retrieve missing camera port information");
-
+
GPhoto.CameraAbilities abilities;
do_op(camera.gcamera.get_abilities(out abilities), "retrieve missing camera abilities");
debug("Removing from camera table: %s @ %s", abilities.model, port_info.path);
camera_map.unset(get_port_uri(port_info.path));
-
+
camera_removed(camera);
}
@@ -275,50 +246,42 @@ public class CameraTable {
if (camera_map.has_key(uri)) {
// already known about
debug("%s @ %s already registered, skipping", name, port);
-
+
continue;
}
-
+
int index = port_info_list.lookup_path(port);
if (index < 0)
do_op((GPhoto.Result) index, "lookup port %s".printf(port));
-
+
GPhoto.PortInfo port_info;
do_op(port_info_list.get_info(index, out port_info), "get port info for %s".printf(port));
-
+
// this should match, every time
assert(port == port_info.path);
-
+
index = abilities_list.lookup_model(name);
if (index < 0)
do_op((GPhoto.Result) index, "lookup camera model %s".printf(name));
GPhoto.CameraAbilities camera_abilities;
- do_op(abilities_list.get_abilities(index, out camera_abilities),
+ do_op(abilities_list.get_abilities(index, out camera_abilities),
"lookup camera abilities for %s".printf(name));
-
+
GPhoto.Camera gcamera;
do_op(GPhoto.Camera.create(out gcamera), "create camera object for %s".printf(name));
do_op(gcamera.set_abilities(camera_abilities), "set camera abilities for %s".printf(name));
do_op(gcamera.set_port_info(port_info), "set port info for %s on %s".printf(name, port));
-
+
debug("Adding to camera table: %s @ %s", name, port);
-
+
DiscoveredCamera camera = new DiscoveredCamera(gcamera, uri);
camera_map.set(uri, camera);
-
+
camera_added(camera);
}
}
-
- private void on_udev_event(string action, GUdev.Device device) {
- debug("udev event: %s on %s", action, device.get_name());
-
- // Device add/removes often arrive in pairs; this allows for a single
- // update to occur when they come in all at once
- camera_update_scheduler.after_timeout(UPDATE_DELAY_MSEC, true);
- }
-
+
private void on_update_cameras() {
try {
get_instance().update_camera_table();