From 67fdbde187273ab4f0a9ad3564dd6549c36ce929 Mon Sep 17 00:00:00 2001 From: Gonzalo Exequiel Pedone Date: Fri, 29 Oct 2021 11:24:36 -0300 Subject: [PATCH] Added -f, --force flags to the manager, this bypass the virtual camera usage check. --- ChangeLog | 5 +++++ Manager/src/cmdparser.cpp | 9 ++++++++- appveyor.yml | 2 +- commons.cmake | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e95b0b8..35ce765 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +akvirtualcamera 9.1.0: + +- Added -f, --force flags to the manager, this bypass the virtual camera usage + check. + akvirtualcamera 9.0.0: - Code forked from Webcamoid. This virtual camera isn't compatible with diff --git a/Manager/src/cmdparser.cpp b/Manager/src/cmdparser.cpp index 30d5634..6127196 100644 --- a/Manager/src/cmdparser.cpp +++ b/Manager/src/cmdparser.cpp @@ -80,6 +80,7 @@ namespace AkVCam { std::vector m_commands; IpcBridge m_ipcBridge; bool m_parseable {false}; + bool m_force {false}; static const std::map &typeStrMap(); std::string basename(const std::string &path); @@ -184,6 +185,9 @@ AkVCam::CmdParser::CmdParser() this->addFlags("", {"-p", "--parseable"}, "Show parseable output."); + this->addFlags("", + {"-f", "--force"}, + "Force command."); this->addCommand("devices", "", "List devices.", @@ -430,7 +434,7 @@ int AkVCam::CmdParser::parse(int argc, char **argv) } } - if (this->d->m_ipcBridge.isBusyFor(command->command)) { + if (!this->d->m_force && this->d->m_ipcBridge.isBusyFor(command->command)) { std::cerr << "This operation is not permitted." << std::endl; std::cerr << "The virtual camera is in use. Stop or close the virtual " << "camera clients and try again." << std::endl; @@ -791,6 +795,9 @@ int AkVCam::CmdParserPrivate::defaultHandler(const StringMap &flags, if (this->containsFlag(flags, "", "-p")) this->m_parseable = true; + if (this->containsFlag(flags, "", "-f")) + this->m_force = true; + return 0; } diff --git a/appveyor.yml b/appveyor.yml index cf993ee..e927498 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 9.0.0.{build}-{branch} +version: 9.1.0.{build}-{branch} os: MinGW image: Visual Studio 2019 diff --git a/commons.cmake b/commons.cmake index 334bf68..2d04e78 100644 --- a/commons.cmake +++ b/commons.cmake @@ -28,7 +28,7 @@ set(COMMONS_APPNAME AkVirtualCamera) string(TOLOWER ${COMMONS_APPNAME} COMMONS_TARGET) set(VER_MAJ 9) -set(VER_MIN 0) +set(VER_MIN 1) set(VER_PAT 0) set(VERSION ${VER_MAJ}.${VER_MIN}.${VER_PAT}) set(DAILY_BUILD OFF CACHE BOOL "Mark this as a daily build")