6 Commits

Author SHA1 Message Date
Martin Richter
cd0af32a1f Added support for Logitech PTZ Pro camera.
Fixed bug, that settigs dialog didn't show the matching camera names.
2022-10-30 11:58:27 +01:00
Martin Richter
74b5a32679 Delete PTZControl.aps
Not required.
2022-10-06 18:19:01 +02:00
Martin Richter
77eb4db494 Added docu for hotkeys. 2022-10-06 18:17:30 +02:00
Martin Richter
221b560aa4 Added Accelerator to switch between the cameras. 2022-10-06 16:13:43 +02:00
Martin Richter
2b04b5b90c Update README.md
Fixed types.
2022-02-16 15:56:13 +01:00
Martin Richter
e229b7df3a Update README.md
Minor changes to the readme.
2022-02-16 15:51:21 +01:00
8 changed files with 48 additions and 22 deletions

1
.gitignore vendored
View File

@@ -7,5 +7,6 @@ PTZControl/PTZControl.vcxproj.filters
PTZControl/PTZControl.vcxproj.user
PTZControl/PTZControlDEU.docx
PTZControl/PTZControl.exe
PTZControl/PTZControl.aps
*.docx
*.bak

Binary file not shown.

View File

@@ -27,7 +27,9 @@
#define REG_NORESET _T("NoReset")
#define REG_NOGUARD _T("NoGuard")
#define DEFAULT_DEVICE_NAME_1 _T("PTZ Pro 2")
// Allow the cameras with the following tags in the device name.
// This will match all Logitech PRT Pro, PTZ Pro 2 and Rally camers.
#define DEFAULT_DEVICE_NAME_1 _T("PTZ Pro")
#define DEFAULT_DEVICE_NAME_2 _T("Logi Rally")
#define TIMER_FOCUS_CHECK 4711

Binary file not shown.

View File

@@ -495,6 +495,9 @@ CStringArray aStrCameraNameToSearch;
}
}
}
// save the camera names.
m_strCameraDeviceNames = strCameras;
// On SHIFT and CTRL key down we show all found camera device names.
if (theApp.m_bShowDevices || (::GetAsyncKeyState(VK_SHIFT) & 0x8000) && (::GetAsyncKeyState(VK_CONTROL) & 0x8000))
@@ -789,7 +792,8 @@ void CPTZControlDlg::OnBtUnpushed()
void CPTZControlDlg::OnBtSettings()
{
CSettingsDlg dlg;
dlg.m_strCameraName = m_strCameraDeviceName;
dlg.m_strCameraName = m_strCameraDeviceNames;
dlg.m_strCameraName.Replace(_T("\r\n"), _T(", "));
dlg.m_bLogitechCameraControl = GetCurrentWebCam().UseLogitechMotionControl();
dlg.m_iMotorIntervalTimer = GetCurrentWebCam().GetMotorIntervalTimer();

View File

@@ -100,7 +100,7 @@ protected:
CString m_strTooltips[NUM_MAX_WEBCAMS][CWebcamController::NUM_PRESETS];
HACCEL m_hAccel;
CString m_strCameraDeviceName;
CString m_strCameraDeviceNames;
int m_iCurrentWebCam; // zero based index to m_aWebCams
int m_iNumWebCams;

View File

@@ -16,42 +16,42 @@
#define IDC_CHECK1 1001
#define IDC_CH_LOGITECHCONTROL 1001
#define IDC_BT_UP 1002
#define IDC_ED_TOOLTIP_1_1 1002
#define IDC_ED_TOOLTIP_1_1 1002
#define IDC_BT_DOWN 1003
#define IDC_ED_TOOLTIP_1_2 1003
#define IDC_ED_TOOLTIP_1_2 1003
#define IDC_BT_HOME 1004
#define IDC_ED_TOOLTIP_1_3 1004
#define IDC_ED_TOOLTIP_1_3 1004
#define IDC_BT_MEMORY 1005
#define IDC_ED_TOOLTIP_1_4 1005
#define IDC_ED_TOOLTIP_1_4 1005
#define IDC_BT_PRESET1 1006
#define IDC_ED_TOOLTIP_1_5 1006
#define IDC_ED_TOOLTIP_1_5 1006
#define IDC_BT_PRESET2 1007
#define IDC_ED_TOOLTIP_1_6 1007
#define IDC_ED_TOOLTIP_1_6 1007
#define IDC_BT_PRESET3 1008
#define IDC_ED_TOOLTIP_1_7 1008
#define IDC_ED_TOOLTIP_1_7 1008
#define IDC_BT_PRESET4 1009
#define IDC_ED_TOOLTIP_1_8 1009
#define IDC_ED_TOOLTIP_1_8 1009
#define IDC_BT_PRESET5 1010
#define IDC_ED_CAMERA 1010
#define IDC_BT_PRESET6 1011
#define IDC_EDIT1 1011
#define IDC_ED_MOTORTIME 1011
#define IDC_BT_PRESET7 1012
#define IDC_ED_TOOLTIP_2_1 1012
#define IDC_ED_TOOLTIP_2_1 1012
#define IDC_BT_PRESET8 1013
#define IDC_ED_TOOLTIP_2_2 1013
#define IDC_BT_ZOOM_IN 1014
#define IDC_ED_TOOLTIP_2_3 1014
#define IDC_ED_TOOLTIP_2_3 1014
#define IDC_BT_ZOOM_OUT 1015
#define IDC_ED_TOOLTIP_2_4 1015
#define IDC_ED_TOOLTIP_2_4 1015
#define IDC_BT_EXIT 1016
#define IDC_ED_TOOLTIP_2_5 1016
#define IDC_ED_TOOLTIP_2_5 1016
#define IDC_BT_SETTINGS 1017
#define IDC_ED_TOOLTIP_2_6 1017
#define IDC_ED_TOOLTIP_2_6 1017
#define IDC_BT_WEBCAM1 1018
#define IDC_ED_TOOLTIP_2_7 1018
#define IDC_ED_TOOLTIP_2_7 1018
#define IDC_BT_WEBCAM2 1019
#define IDC_ED_TOOLTIP_2_8 1019
#define IDC_ED_TOOLTIP_2_8 1019
#define DC_BT_SETTINGS 32791
// Next default values for new objects
@@ -59,7 +59,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 135
#define _APS_NEXT_COMMAND_VALUE 32793
#define _APS_NEXT_COMMAND_VALUE 32799
#define _APS_NEXT_CONTROL_VALUE 1012
#define _APS_NEXT_SYMED_VALUE 101
#endif

View File

@@ -2,9 +2,16 @@
## History
This small program is designed to control a Logitech PTZ 2 Pro. The camera was purchased to stream our church services.
Unfortunately, it quickly turned out that the operation with the remote control is possible but cumbersome and inaccurate, since the camera was installed directly behind and above the video technician. So I made the decision to build a corresponding control program.
Some month later we bought a second camera and the program was extended by the function to control another camera. A maximum of two cameras are supported.
And finally I added support for the Logitech Rally.
Unfortunately, it quickly turned out that the operation with the remote control is possible but cumbersome and inaccurate. The camera was installed directly behind and above the video technician and always pointing back with the remote control was not comfortable.
The control Logitech software shipped with the camera is completely worthless.
So, I made the decision to build a corresponding control program.
Some months later we bought a second camera, and the program was extended by the function to control another camera. A maximum of two cameras are supported.
And finally, I added support for the Logitech Rally.
### Where is the basic code from?
It wasn't easy to get code that shows how to control a PTZ camera.
Finally I contacted Lgoitech and I received download link to the `Logitech Collaboration Software Reference Kit` (Logitech CSRK)
I found some Lync remote control code in it, that gave me some hints and the guids and usage for the Logitect camera interface.
## Used interfaces
The program directly uses the camera media control via the Windows SDK (see links in the source code).
@@ -61,6 +68,18 @@ If you click on a direction button once, the motor is turned on and off again af
If the direction button remains pressed, the motor remains switched on for the corresponding direction until the button is released again.
This control seems more effective and accurate to me and is the standard. The disadvantage is that if the timer interval is too small, the camera does not react immediately when a button is clicked. But since precision was more important to me because our camera is installed relatively far away from the podium, I use this setting with a 70msec timer.
## Hotkeys
The program has serveral hotkeys that allows a control without the mouse when it has the focus.
- Pan-Tilt control with Left, Right, Up, Down keys.
- Home position with Num-0, Home keys.
- Memory function with the M-key.
- Recall stored position with the numeric keys 1-8 or the numeric key pad keys Num-1 to Num-8.#
- Open the setings dialog with Num-Divide or Num-Multiply
- Zoom in/out Page-Up/Down, Num+Plus, Num-Minus
- Select Camera 1. Alt+1, Alt+Num-1, Alt+Page-Up
- Select Camera 2. Alt+2, Alt+Num-2, Alt+Page-Down
## Command Line Options
A few options can be set from the command line. Command-line switches override the settings in the registry.