PDA

View Full Version : Snapshot Button - Logitech Camera



Smikey
February 22nd, 2006, 10:00 AM
I need (want) to be able to trigger a GIRDER event based on the snapshot button being pressed atop the Logitech 3000/4000/5000 camera. The software that comes with these cameras is able to see this pushbutton pressed and takes a snapshot. I would like to use it to start an application instead - and not use the Logitech software at all.
------------------
any ideas?

Promixis
February 22nd, 2006, 11:26 AM
? likely not doable unless logitech tells you how... unless the button shows up as a hid device under the device manager.

Smikey
February 24th, 2006, 08:48 AM
I did check to see if the snapshot button was identified as an HID but it is not :(

I contacted Logitech who sent me to their SDK for the camera. I have attached the .pdf file that contains some code regarding the button.

Please see page 14 of the attached file for the "camerabuttonclicked" notification.

There are also programming guides for MFC and VB if that would be any more help.

Thanks in advance for your help.

Smikey
February 24th, 2006, 08:50 AM
I did check to see if the snapshot button was identified as an HID but it is not :(

I contacted Logitech who sent me to their SDK for the camera. I have attached the .pdf file that contains some code regarding the button.

Please see page 14 of the attached file for the "camerabuttonclicked" notification.

There are also programming guides for MFC and VB if that would be any more help.

Thanks in advance for your help.

Promixis
February 24th, 2006, 10:01 AM
nothing attached :(

Smikey
February 24th, 2006, 02:07 PM
ok, the document exceeds the attachment size limit(512k) so here's a piece of the doc I was mentioning prior - sorry for the long post.

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
. . .
// the following two files are located in the inc directory of the QuickCam
// SDK. These two files contain interface definitions for the video portal
// control.
#include "VPortal2.h"
#include "VPortal2_i.c"
#include “LVServerDefs.H”
// IVideoPortal is the interface to the video portal control
IVideoPortal* gpVideo = NULL;
// InitializeVideo is used to actually create an instance of the video
// portal control and obtain a IVideoPortal pointer to this interface.
BOOL InitializeVideo( HWND hWnd );
// UnInitializeVideo is used for clean up purposes
BOOL UnInitializeVideo( void );
CComModule _Module;
HWND gMainHwnd = NULL;
DWORD gdwAdviseCookie = 0;
//the following CDriver class implements the connection point to the video
//portal control. This connection point allows the video control to commuicate
//with the application through the PortalNotification event. The
//PortalNotification method is called by the video portal control and is
//handled here.
class CDriver :
public IDispatchImpl<_IVideoPortalEvents, &IID__IVideoPortalEvents,
&LIBID_VPORTAL2Lib>,
public CComObjectRoot
{
public:
CDriver() {}
BEGIN_COM_MAP(CDriver)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(_IVideoPortalEvents)
END_COM_MAP()
STDMETHOD(PortalNotification)(
long lMsg,
long lParam1,
Logitech Confidential -14-
long lParam2,
long lParam3)
{
// implement any PortalNotification notification handling here.
switch( lMsg )
{
case NOTIFICATIONMSG_MOTION:
break;
case NOTIFICATIONMSG_MOVIERECORDERROR:
break;
case NOTIFICATIONMSG_CAMERADETACHED:
break;
case NOTIFICATIONMSG_CAMERAREATTACHED:
break;
case NOTIFICATIONMSG_IMAGESIZECHANGE:
break;
case NOTIFICATIONMSG_CAMERAPRECHANGE:
break;
case NOTIFICATIONMSG_CAMERACHANGEFAILED:
break;
case NOTIFICATIONMSG_POSTCAMERACHANGED:
break;
case NOTIFICATIONMSG_CAMERBUTTONCLICKED:
break;
case NOTIFICATIONMSG_VIDEOHOOK:
break;
case NOTIFICATIONMSG_SETTINGDLGCLOSED:
break;
case NOTIFICATIONMSG_QUERYPRECAMERAMODIFICATION:
break;
case NOTIFICATIONMSG_MOVIESIZE:
break;
default:
break;
};
return S_OK;
}
};
// the following defines the connection point interface pointer
CComObject<CDriver>* gpDriver;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
. . .

Smikey
February 24th, 2006, 02:09 PM
ok, the document exceeds the attachment size limit(512k) so here's a piece of the doc I was mentioning prior - sorry for the long post.

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
. . .
// the following two files are located in the inc directory of the QuickCam
// SDK. These two files contain interface definitions for the video portal
// control.
#include "VPortal2.h"
#include "VPortal2_i.c"
#include “LVServerDefs.H”
// IVideoPortal is the interface to the video portal control
IVideoPortal* gpVideo = NULL;
// InitializeVideo is used to actually create an instance of the video
// portal control and obtain a IVideoPortal pointer to this interface.
BOOL InitializeVideo( HWND hWnd );
// UnInitializeVideo is used for clean up purposes
BOOL UnInitializeVideo( void );
CComModule _Module;
HWND gMainHwnd = NULL;
DWORD gdwAdviseCookie = 0;
//the following CDriver class implements the connection point to the video
//portal control. This connection point allows the video control to commuicate
//with the application through the PortalNotification event. The
//PortalNotification method is called by the video portal control and is
//handled here.
class CDriver :
public IDispatchImpl<_IVideoPortalEvents, &IID__IVideoPortalEvents,
&LIBID_VPORTAL2Lib>,
public CComObjectRoot
{
public:
CDriver() {}
BEGIN_COM_MAP(CDriver)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(_IVideoPortalEvents)
END_COM_MAP()
STDMETHOD(PortalNotification)(
long lMsg,
long lParam1,
Logitech Confidential -14-
long lParam2,
long lParam3)
{
// implement any PortalNotification notification handling here.
switch( lMsg )
{
case NOTIFICATIONMSG_MOTION:
break;
case NOTIFICATIONMSG_MOVIERECORDERROR:
break;
case NOTIFICATIONMSG_CAMERADETACHED:
break;
case NOTIFICATIONMSG_CAMERAREATTACHED:
break;
case NOTIFICATIONMSG_IMAGESIZECHANGE:
break;
case NOTIFICATIONMSG_CAMERAPRECHANGE:
break;
case NOTIFICATIONMSG_CAMERACHANGEFAILED:
break;
case NOTIFICATIONMSG_POSTCAMERACHANGED:
break;
case NOTIFICATIONMSG_CAMERBUTTONCLICKED:
break;
case NOTIFICATIONMSG_VIDEOHOOK:
break;
case NOTIFICATIONMSG_SETTINGDLGCLOSED:
break;
case NOTIFICATIONMSG_QUERYPRECAMERAMODIFICATION:
break;
case NOTIFICATIONMSG_MOVIESIZE:
break;
default:
break;
};
return S_OK;
}
};
// the following defines the connection point interface pointer
CComObject<CDriver>* gpDriver;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
. . .

Promixis
February 24th, 2006, 02:10 PM
well, it looks doable. But lots of coding :x

Do you know if it exposes an activex control or com object?

Smikey
February 25th, 2006, 10:56 PM
I read that the SDK is COM based but I don't know enough about this level of programming to confirm.

The SDK is at ftp://ftp.logitech.com/.developer/quickcam/sdk/qcsdk.exe if you'd like to see first hand.

Promixis
February 26th, 2006, 08:17 AM
will try and look later...

Smikey
March 3rd, 2006, 08:31 PM
Hey Mike, did you get a chance to look at that Logitech SDK by chance? Thanks in advance for your help!

Promixis
March 3rd, 2006, 08:39 PM
Hey Mike, did you get a chance to look at that Logitech SDK by chance? Thanks in advance for your help!

I did. Its probably doable. But given about 10 hours of time or so its too much time to invest for us. Sorry. :(