8 Commits

Author SHA1 Message Date
Martin Richter
546152b568 Minor changes to the readme. 2022-12-10 13:48:08 +01:00
Martin Richter
a3282a0044 Added support for a thrid camera and a dynamic layout so save screen space.
Added support for the ConferenceCam CC3000e Camera.
Some redisgn.
2022-12-10 13:39:26 +01:00
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
10 changed files with 219 additions and 61 deletions

1
.gitignore vendored
View File

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

Binary file not shown.

View File

@@ -27,9 +27,6 @@
#define REG_NORESET _T("NoReset") #define REG_NORESET _T("NoReset")
#define REG_NOGUARD _T("NoGuard") #define REG_NOGUARD _T("NoGuard")
#define DEFAULT_DEVICE_NAME_1 _T("PTZ Pro 2")
#define DEFAULT_DEVICE_NAME_2 _T("Logi Rally")
#define TIMER_FOCUS_CHECK 4711 #define TIMER_FOCUS_CHECK 4711
#define TIMER_AUTO_REPEAT 4712 #define TIMER_AUTO_REPEAT 4712
#define TIMER_CLEAR_MEMORY 4713 #define TIMER_CLEAR_MEMORY 4713

Binary file not shown.

View File

@@ -13,6 +13,88 @@
#endif #endif
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Array of supported cameras
// Allow the cameras with the following tags in the device name.
// This will match all Logitech PRT Pro, PTZ Pro 2 and Rally cameras.
// Also the ConferenceCam CC3000e Camera will be detected.
// Remember: Just a partial token must match the name.
static const LPCTSTR g_aCameras[] =
{
_T("PTZ Pro"),
_T("Logi Rally"),
_T("ConferenceCam"),
};
//////////////////////////////////////////////////////////////////////////////////////////
// We have several layouts for the Buttons
// 0-1 cameras (dialog will shrink by one column)
// E |
// S |
// 2 cameras
// S E
// - -
// 1 2
// 3 cameras
// 1 E
// 2 S
// 3
struct SPosition
{
UINT nId; // Id of button
bool bShow; // Show or hide
int x, y; // outside raster, left two columns
};
struct SLayout
{
int cxDelta; // Num to shrink / grow the dialog
const SPosition* pButtons; // List of entries terminated with nId==0.
};
static const SPosition layoutBtns1[] // 0 or 1 camera (uses only 1 column)
{
IDC_BT_EXIT, true, 0, 0, // one columns
IDC_BT_SETTINGS, true, 0, 1,
// Invisible
IDC_BT_WEBCAM1, false, 0, 0,
IDC_BT_WEBCAM2, false, 0, 0,
IDC_BT_WEBCAM3, false, 0, 0,
0
};
static const SPosition layoutBtns2[] // 2 cameras (uses 2 columns)
{
IDC_BT_SETTINGS, true, 0, 0, // Top row
IDC_BT_EXIT, true, 1, 0,
IDC_BT_WEBCAM1, true, 0, 2, // bottom row
IDC_BT_WEBCAM2, true, 1, 2,
// Invisible
IDC_BT_WEBCAM3, false, 0, 0,
0
};
static const SPosition layoutBtns3[] // 3 cameras
{
IDC_BT_EXIT, true, 1, 0, // Outer left column
IDC_BT_SETTINGS, true, 1, 1,
IDC_BT_WEBCAM1, true, 0, 0, // all in one column left (top down)
IDC_BT_WEBCAM2, true, 0, 1,
IDC_BT_WEBCAM3, true, 0, 2,
0
};
const SLayout g_layout[CPTZControlDlg::NUM_MAX_WEBCAMS+1] =
{
-1, layoutBtns1, // 0 or 1 camera (shrink dialog)
-1, layoutBtns1, // 0 or 1 camera (shrink dialog)
0, layoutBtns2, // 2 cameras (keep size)
0, layoutBtns3, // 3 cameras (keep size)
};
//////////////////////////////////////////////////////////////////////////////////////////
// Special new notification
#define ON_BN_UNPUSHED(id, memberFxn) \ #define ON_BN_UNPUSHED(id, memberFxn) \
ON_CONTROL(BN_UNPUSHED, id, memberFxn) ON_CONTROL(BN_UNPUSHED, id, memberFxn)
@@ -221,6 +303,7 @@ void CPTZControlDlg::DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_BT_SETTINGS, m_btSettings); DDX_Control(pDX, IDC_BT_SETTINGS, m_btSettings);
DDX_Control(pDX, IDC_BT_WEBCAM1, m_btWebCam[0]); DDX_Control(pDX, IDC_BT_WEBCAM1, m_btWebCam[0]);
DDX_Control(pDX, IDC_BT_WEBCAM2, m_btWebCam[1]); DDX_Control(pDX, IDC_BT_WEBCAM2, m_btWebCam[1]);
DDX_Control(pDX, IDC_BT_WEBCAM3, m_btWebCam[2]);
} }
BEGIN_MESSAGE_MAP(CPTZControlDlg, CDialogEx) BEGIN_MESSAGE_MAP(CPTZControlDlg, CDialogEx)
@@ -233,6 +316,7 @@ BEGIN_MESSAGE_MAP(CPTZControlDlg, CDialogEx)
ON_BN_CLICKED(IDC_BT_MEMORY, &CPTZControlDlg::OnBtMemory) ON_BN_CLICKED(IDC_BT_MEMORY, &CPTZControlDlg::OnBtMemory)
ON_COMMAND_EX(IDC_BT_WEBCAM1, &CPTZControlDlg::OnBtWebCam) ON_COMMAND_EX(IDC_BT_WEBCAM1, &CPTZControlDlg::OnBtWebCam)
ON_COMMAND_EX(IDC_BT_WEBCAM2, &CPTZControlDlg::OnBtWebCam) ON_COMMAND_EX(IDC_BT_WEBCAM2, &CPTZControlDlg::OnBtWebCam)
ON_COMMAND_EX(IDC_BT_WEBCAM3, &CPTZControlDlg::OnBtWebCam)
ON_COMMAND_EX(IDC_BT_PRESET1, &CPTZControlDlg::OnBtPreset) ON_COMMAND_EX(IDC_BT_PRESET1, &CPTZControlDlg::OnBtPreset)
ON_COMMAND_EX(IDC_BT_PRESET2, &CPTZControlDlg::OnBtPreset) ON_COMMAND_EX(IDC_BT_PRESET2, &CPTZControlDlg::OnBtPreset)
ON_COMMAND_EX(IDC_BT_PRESET3, &CPTZControlDlg::OnBtPreset) ON_COMMAND_EX(IDC_BT_PRESET3, &CPTZControlDlg::OnBtPreset)
@@ -363,6 +447,9 @@ BOOL CPTZControlDlg::OnInitDialog()
{ {
__super::OnInitDialog(); __super::OnInitDialog();
//---------------------------------------------------------------------
// INIT MFC STUFF
// Set the icon for this dialog. The framework does this automatically // Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog // when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, TRUE); // Set big icon
@@ -397,6 +484,7 @@ BOOL CPTZControlDlg::OnInitDialog()
&m_btSettings, &m_btSettings,
&m_btWebCam[0], &m_btWebCam[0],
&m_btWebCam[1], &m_btWebCam[1],
&m_btWebCam[2],
}; };
for (auto* pBtn : apButtons) for (auto* pBtn : apButtons)
{ {
@@ -419,23 +507,10 @@ BOOL CPTZControlDlg::OnInitDialog()
m_btMemory.SetCheckStyle(); m_btMemory.SetCheckStyle();
for (auto &btn : m_btWebCam) for (auto &btn : m_btWebCam)
btn.SetCheckStyle(); btn.SetCheckStyle();
// First Center
CenterWindow();
// Adjust the window
CRect rect;
GetWindowRect(rect);
CPoint pt = rect.TopLeft();
rect.OffsetRect(-pt);
pt.x = theApp.GetProfileInt(REG_WINDOW,REG_WINDOW_POSX,pt.x);
pt.y = theApp.GetProfileInt(REG_WINDOW,REG_WINDOW_POSY,pt.y);
rect.OffsetRect(pt);
AdjustVisibleWindowRect(rect);
// Move it
SetWindowPos(&CWnd::wndTopMost, rect.left, rect.top, 0, 0, SWP_NOSIZE);
//---------------------------------------------------------------------
// INIT AND FIND WEB CAMS
//
// Try to find the Device list // Try to find the Device list
CStringArray aDevices; CStringArray aDevices;
CWebcamController::ListDevices(aDevices); CWebcamController::ListDevices(aDevices);
@@ -457,10 +532,10 @@ BOOL CPTZControlDlg::OnInitDialog()
// Find the devices to search for. We have some default devices if no other is set in // Find the devices to search for. We have some default devices if no other is set in
// the registry o on the command line. // the registry o on the command line.
CStringArray aStrCameraNameToSearch; CStringArray aStrCameraNameToSearch;
aStrCameraNameToSearch.Add(DEFAULT_DEVICE_NAME_1); for (const auto *p : g_aCameras)
aStrCameraNameToSearch.Add(DEFAULT_DEVICE_NAME_2); aStrCameraNameToSearch.Add(p);
CString strCameraNameToSearch = theApp.GetProfileString(REG_DEVICE,REG_DEVICENAME,_T("")); CString strCameraNameToSearch = theApp.GetProfileString(REG_DEVICE, REG_DEVICENAME, _T(""));
if (!strCameraNameToSearch.IsEmpty()) if (!strCameraNameToSearch.IsEmpty())
aStrCameraNameToSearch.Add(strCameraNameToSearch); aStrCameraNameToSearch.Add(strCameraNameToSearch);
if (!theApp.m_strDevName.IsEmpty()) if (!theApp.m_strDevName.IsEmpty())
@@ -495,6 +570,9 @@ CStringArray aStrCameraNameToSearch;
} }
} }
} }
// save the camera names.
m_strCameraDeviceNames = strCameras;
// On SHIFT and CTRL key down we show all found camera device names. // 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)) if (theApp.m_bShowDevices || (::GetAsyncKeyState(VK_SHIFT) & 0x8000) && (::GetAsyncKeyState(VK_CONTROL) & 0x8000))
@@ -511,14 +589,52 @@ CStringArray aStrCameraNameToSearch;
AfxMessageBox(IDP_ERR_NO_CAMERA, MB_ICONERROR); AfxMessageBox(IDP_ERR_NO_CAMERA, MB_ICONERROR);
} }
// Only 1 or none, we don't need the camera selection buttons //---------------------------------------------------------------------
if (m_iNumWebCams<=1) // ADJUST THE DIALOG
// Calculate the with an position of the Grid.
CRect rectBtn11, rectBtn12, rectBtn21;
m_btWebCam[0].GetWindowRect(rectBtn11);
m_btWebCam[1].GetWindowRect(rectBtn12);
m_btExit.GetWindowRect(rectBtn21);
ScreenToClient(rectBtn11);
ScreenToClient(rectBtn12);
ScreenToClient(rectBtn21);
CPoint pointBase { rectBtn11.TopLeft() };
CSize sizeRaster { rectBtn21.left-rectBtn11.left, rectBtn12.top-rectBtn11.top };
// Get the required layout
const auto &layout = g_layout[m_iNumWebCams];
for (const auto* pLayoutBtn = layout.pButtons; pLayoutBtn->nId; ++pLayoutBtn)
{ {
// Sow the web cam buttons only if we have 2 cams CWnd *pWnd = GetDlgItem(pLayoutBtn->nId);
for (auto &btn : m_btWebCam) // Move the button and hide or show the button
btn.ShowWindow(SW_HIDE); pWnd->SetWindowPos(nullptr,
pointBase.x + pLayoutBtn->x * sizeRaster.cx, pointBase.y + pLayoutBtn->y * sizeRaster.cy,
0, 0, SWP_NOSIZE|SWP_NOZORDER|(pLayoutBtn->bShow ? SWP_SHOWWINDOW : SWP_HIDEWINDOW)
);
pWnd->EnableWindow(pLayoutBtn->bShow);
} }
// First Center
CenterWindow();
// Adjust the window
CRect rect;
GetWindowRect(rect);
CPoint pt = rect.TopLeft();
rect.OffsetRect(-pt);
pt.x = theApp.GetProfileInt(REG_WINDOW, REG_WINDOW_POSX, pt.x);
pt.y = theApp.GetProfileInt(REG_WINDOW, REG_WINDOW_POSY, pt.y);
rect.OffsetRect(pt);
AdjustVisibleWindowRect(rect);
// Move it
SetWindowPos(&CWnd::wndTopMost, rect.left, rect.top, rect.Width()+layout.cxDelta*sizeRaster.cx, rect.Height(), 0);
// Set the tooltips for all presets
for (int i = 0; i < CWebcamController::NUM_PRESETS; ++i) for (int i = 0; i < CWebcamController::NUM_PRESETS; ++i)
{ {
for (int j = 0; j < CPTZControlDlg::NUM_MAX_WEBCAMS; ++j) for (int j = 0; j < CPTZControlDlg::NUM_MAX_WEBCAMS; ++j)
@@ -687,7 +803,8 @@ BOOL CPTZControlDlg::OnBtPreset(UINT nId)
BOOL CPTZControlDlg::OnBtWebCam(UINT nId) BOOL CPTZControlDlg::OnBtWebCam(UINT nId)
{ {
SetActiveCam(nId==IDC_BT_WEBCAM1 ? 0 : 1); SetActiveCam(nId==IDC_BT_WEBCAM1 ? 0 :
nId==IDC_BT_WEBCAM2 ? 1 : 2);
return 1; return 1;
} }
@@ -789,7 +906,8 @@ void CPTZControlDlg::OnBtUnpushed()
void CPTZControlDlg::OnBtSettings() void CPTZControlDlg::OnBtSettings()
{ {
CSettingsDlg dlg; 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_bLogitechCameraControl = GetCurrentWebCam().UseLogitechMotionControl();
dlg.m_iMotorIntervalTimer = GetCurrentWebCam().GetMotorIntervalTimer(); dlg.m_iMotorIntervalTimer = GetCurrentWebCam().GetMotorIntervalTimer();

View File

@@ -73,7 +73,7 @@ public:
~CPTZControlDlg(); ~CPTZControlDlg();
// Dialog Data // Dialog Data
enum { IDD = IDD_PTZCONTROL_DIALOG }; enum { IDD = IDD_PTZCONTROL_DIALOG };
static const int NUM_MAX_WEBCAMS = 2; static const int NUM_MAX_WEBCAMS = 3;
protected: protected:
CPTZButton m_btZoomIn; CPTZButton m_btZoomIn;
@@ -100,7 +100,7 @@ protected:
CString m_strTooltips[NUM_MAX_WEBCAMS][CWebcamController::NUM_PRESETS]; CString m_strTooltips[NUM_MAX_WEBCAMS][CWebcamController::NUM_PRESETS];
HACCEL m_hAccel; HACCEL m_hAccel;
CString m_strCameraDeviceName; CString m_strCameraDeviceNames;
int m_iCurrentWebCam; // zero based index to m_aWebCams int m_iCurrentWebCam; // zero based index to m_aWebCams
int m_iNumWebCams; int m_iNumWebCams;

View File

@@ -27,6 +27,12 @@ void CSettingsDlg::DoDataExchange(CDataExchange* pDX)
{ {
CDialogEx::DoDataExchange(pDX); CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_ED_CAMERA, m_strCameraName); DDX_Text(pDX, IDC_ED_CAMERA, m_strCameraName);
DDX_Check(pDX, IDC_CH_LOGITECHCONTROL, m_bLogitechCameraControl);
DDX_Text(pDX, IDC_ED_MOTORTIME, m_iMotorIntervalTimer);
DDX_Control(pDX, IDC_ED_MOTORTIME, m_edMotorInterval);
DDX_Control(pDX, IDC_CH_LOGITECHCONTROL, m_chLogitechControl);
// Tooltips
DDX_Text(pDX, IDC_ED_TOOLTIP_1_1, m_strTooltip[0][0]); DDX_Text(pDX, IDC_ED_TOOLTIP_1_1, m_strTooltip[0][0]);
DDX_Text(pDX, IDC_ED_TOOLTIP_1_2, m_strTooltip[0][1]); DDX_Text(pDX, IDC_ED_TOOLTIP_1_2, m_strTooltip[0][1]);
DDX_Text(pDX, IDC_ED_TOOLTIP_1_3, m_strTooltip[0][2]); DDX_Text(pDX, IDC_ED_TOOLTIP_1_3, m_strTooltip[0][2]);
@@ -43,10 +49,15 @@ void CSettingsDlg::DoDataExchange(CDataExchange* pDX)
DDX_Text(pDX, IDC_ED_TOOLTIP_2_6, m_strTooltip[1][5]); DDX_Text(pDX, IDC_ED_TOOLTIP_2_6, m_strTooltip[1][5]);
DDX_Text(pDX, IDC_ED_TOOLTIP_2_7, m_strTooltip[1][6]); DDX_Text(pDX, IDC_ED_TOOLTIP_2_7, m_strTooltip[1][6]);
DDX_Text(pDX, IDC_ED_TOOLTIP_2_8, m_strTooltip[1][7]); DDX_Text(pDX, IDC_ED_TOOLTIP_2_8, m_strTooltip[1][7]);
DDX_Check(pDX, IDC_CH_LOGITECHCONTROL, m_bLogitechCameraControl); DDX_Text(pDX, IDC_ED_TOOLTIP_3_1, m_strTooltip[2][0]);
DDX_Text(pDX, IDC_ED_MOTORTIME, m_iMotorIntervalTimer); DDX_Text(pDX, IDC_ED_TOOLTIP_3_2, m_strTooltip[2][1]);
DDX_Control(pDX, IDC_ED_MOTORTIME, m_edMotorInterval); DDX_Text(pDX, IDC_ED_TOOLTIP_3_3, m_strTooltip[2][2]);
DDX_Control(pDX, IDC_CH_LOGITECHCONTROL, m_chLogitechControl); DDX_Text(pDX, IDC_ED_TOOLTIP_3_4, m_strTooltip[2][3]);
DDX_Text(pDX, IDC_ED_TOOLTIP_3_5, m_strTooltip[2][4]);
DDX_Text(pDX, IDC_ED_TOOLTIP_3_6, m_strTooltip[2][5]);
DDX_Text(pDX, IDC_ED_TOOLTIP_3_7, m_strTooltip[2][6]);
DDX_Text(pDX, IDC_ED_TOOLTIP_3_8, m_strTooltip[2][7]);
if (pDX->m_bSaveAndValidate) if (pDX->m_bSaveAndValidate)
m_iMotorIntervalTimer = min(max(10,m_iMotorIntervalTimer),1000); m_iMotorIntervalTimer = min(max(10,m_iMotorIntervalTimer),1000);
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -16,42 +16,52 @@
#define IDC_CHECK1 1001 #define IDC_CHECK1 1001
#define IDC_CH_LOGITECHCONTROL 1001 #define IDC_CH_LOGITECHCONTROL 1001
#define IDC_BT_UP 1002 #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_BT_DOWN 1003
#define IDC_ED_TOOLTIP_1_2 1003 #define IDC_ED_TOOLTIP_1_2 1003
#define IDC_BT_HOME 1004 #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_BT_MEMORY 1005
#define IDC_ED_TOOLTIP_1_4 1005 #define IDC_ED_TOOLTIP_1_4 1005
#define IDC_BT_PRESET1 1006 #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_BT_PRESET2 1007
#define IDC_ED_TOOLTIP_1_6 1007 #define IDC_ED_TOOLTIP_1_6 1007
#define IDC_BT_PRESET3 1008 #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_BT_PRESET4 1009
#define IDC_ED_TOOLTIP_1_8 1009 #define IDC_ED_TOOLTIP_1_8 1009
#define IDC_BT_PRESET5 1010 #define IDC_BT_PRESET5 1010
#define IDC_ED_CAMERA 1010 #define IDC_ED_CAMERA 1010
#define IDC_BT_PRESET6 1011 #define IDC_BT_PRESET6 1011
#define IDC_EDIT1 1011 #define IDC_EDIT1 1011
#define IDC_ED_MOTORTIME 1011 #define IDC_ED_MOTORTIME 1011
#define IDC_BT_PRESET7 1012 #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_BT_PRESET8 1013
#define IDC_ED_TOOLTIP_2_2 1013 #define IDC_ED_TOOLTIP_2_2 1013
#define IDC_BT_ZOOM_IN 1014 #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_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_BT_EXIT 1016
#define IDC_ED_TOOLTIP_2_5 1016 #define IDC_ED_TOOLTIP_2_5 1016
#define IDC_BT_SETTINGS 1017 #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_BT_WEBCAM1 1018
#define IDC_ED_TOOLTIP_2_7 1018 #define IDC_ED_TOOLTIP_2_7 1018
#define IDC_BT_WEBCAM2 1019 #define IDC_BT_WEBCAM2 1019
#define IDC_ED_TOOLTIP_2_8 1019 #define IDC_ED_TOOLTIP_2_8 1019
#define IDC_BT_WEBCAM3 1020
#define IDC_ED_TOOLTIP_3_1 1020
#define IDC_ED_TOOLTIP_3_2 1021
#define IDC_ED_TOOLTIP__3_3 1022
#define IDC_ED_TOOLTIP_3_3 1022
#define IDC_ED_TOOLTIP_3_4 1023
#define IDC_ED_TOOLTIP_3_5 1024
#define IDC_ED_TOOLTIP_3_6 1025
#define IDC_ED_TOOLTIP_3_7 1026
#define IDC_ED_TOOLTIP_3_8 1027
#define DC_BT_SETTINGS 32791 #define DC_BT_SETTINGS 32791
// Next default values for new objects // Next default values for new objects
@@ -59,7 +69,7 @@
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 135 #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_CONTROL_VALUE 1012
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif

View File

@@ -2,9 +2,17 @@
## History ## History
This small program is designed to control a Logitech PTZ 2 Pro. The camera was purchased to stream our church services. 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. 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.
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. The control Logitech software shipped with the camera is completely worthless.
And finally I added support for the Logitech Rally. 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. At this time a maximum of two cameras was supported.
Later added support for the Logitech Rally, the PTZ Pro and other Logitech cameras.
And finnaly as last feature the PTZcontrol now supports three cameras.
### 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 ## Used interfaces
The program directly uses the camera media control via the Windows SDK (see links in the source code). The program directly uses the camera media control via the Windows SDK (see links in the source code).
@@ -23,7 +31,7 @@ The program supports tooltips that and you can define them yourself to give the
## Used environment and libraries ## Used environment and libraries
I used the Visual Studoi 2019 Community Edition to develop this program with C++. I used the Visual Studoi 2019 Community Edition to develop this program with C++.
MFC and ATL as the library. No additional software is used. MFC and ATL as the library. No additional software is used.
The EXE runs alone, without installing any other files. The EXE runs alone, without installing any other files or DLLs or any installation.
## Behaviour ## Behaviour
The program is always in the foreground and has been designed relatively compact and small, so that you can hover somewhere over your OBS program and it is really easy to use. The program is always in the foreground and has been designed relatively compact and small, so that you can hover somewhere over your OBS program and it is really easy to use.
@@ -36,12 +44,13 @@ All settings are stored in the registry under the branch `HKEY_CURRENT_USER\SOFT
See the command line secion too. See the command line secion too.
### Supported Cameras ### Supported Cameras
Currently, the Logitech PTZ 2 Pro and Logitech Rally cameras are automatically detected. Currently, the Logitech PTZ 2 Pro, PTZ Pro, Logitech Rally cameras and ConferenceCam CC3000e Camera are automatically detected.
For other cameras, you can try to force detection by specifying the name (or part of the name) of the cameras in the registry or on the command line. For other cameras, you can try to force detection by specifying the name (or part of the name) of the cameras in the registry or on the command line.
Internally, all cameras that have one of the following tokens in the name are automatically used: Internally, all cameras that have one of the following tokens in the name are automatically used:
- *PTZ 2 Pro* - *PTZ Pro*
- *Logi Rally* - *Logi Rally*
- *ConferenceCam*
### Guard Thread ### Guard Thread
Unfortunately, we have sometimes had the experience that OBS or the USB bus hangs with a camera. The PTZControl program then usually stops and stops responding because the camera control commands block the application. Unfortunately, we have sometimes had the experience that OBS or the USB bus hangs with a camera. The PTZControl program then usually stops and stops responding because the camera control commands block the application.
@@ -61,12 +70,24 @@ 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. 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. 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 ## Command Line Options
A few options can be set from the command line. Command-line switches override the settings in the registry. A few options can be set from the command line. Command-line switches override the settings in the registry.
**-device:"name of device"** **-device:"name of device"**
The device option can be used to specify a name component of a camera to be used for control. The device option can be used to specify a name component of a camera to be used for control.
If you enter "*" as the name, then each camera will be recognized. If you enter "*" as the name, then any camera will be recognized.
**-showdevices** **-showdevices**
Displays a message box after startup showing the name(s) of the detected cameras. Displays a message box after startup showing the name(s) of the detected cameras.
@@ -77,10 +98,10 @@ At startup, a detected camera is moved to the home position (Logitech Preset) an
**-noguard** **-noguard**
-noguard prevents the application from terminating itself in a controlled manner. This can be especially important in the event of a bug and for testing. -noguard prevents the application from terminating itself in a controlled manner. This can be especially important in the event of a bug and for testing.
## Registry ## Registry settings
In the registry branch `HKEY_CURRENT_USER\SOFTWARE\MRi-Software\PTZControl\Options` it is possible to preset the following options without using the command line. In the registry branch `HKEY_CURRENT_USER\SOFTWARE\MRi-Software\PTZControl\Options` it is possible to preset the following options without using the command line.
**NoReset (DWORD value** **NoReset (DWORD value)**
*Value <>0:* Has the same function as -noreset on the command line. The current camera and zoom position is maintained when starting the program. Value = 0: When starting the program, you move to the home position and zoom to maximum wide angle. (Default) *Value <>0:* Has the same function as -noreset on the command line. The current camera and zoom position is maintained when starting the program. Value = 0: When starting the program, you move to the home position and zoom to maximum wide angle. (Default)
**NoGuard (DWORD value)** **NoGuard (DWORD value)**