From patchwork Fri Aug 12 12:46:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Utkarsh Tiwari X-Patchwork-Id: 17106 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7D3A8BE173 for ; Fri, 12 Aug 2022 12:47:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 12B2F6333D; Fri, 12 Aug 2022 14:47:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1660308446; bh=wQeQ1Ln3iAWeCQ+hlJFdS8O+yK8fw3jxJ25JPQM2QF0=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eOnbt7uawKm63O2YUWF4+IsVNJjpvU2Isqh5Y+tFJPgRnE+STohVlzZAKVQAXZHtr KGbgyaAau2FLG+m5uU/3aFdDuznHB6xF56i180S9vA531y9KepWzikRJ8FmnW6KYNb /ksJjl4epc2YP2t/qocvR5yO931t/BuJkHLkG1z2fVJOceAe0pMJ+N4AliI3f6YPHb CMQwpCNFSIyuuXbEM+NtLlbhQmvmSBMU+uwEZV+1oO77alonNExvh8QiTKTyx0EBrE 4z8TodGcsdRPcihnAa1IUHVmjWVRvsGLnnPgfiqUhjcjvRMIWZzbGshfJrDdoptjIX mpIBRAVnO+BAA== Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6BD7C6332F for ; Fri, 12 Aug 2022 14:47:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ese1uDVr"; dkim-atps=neutral Received: by mail-pg1-x535.google.com with SMTP id 12so720603pga.1 for ; Fri, 12 Aug 2022 05:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=0mSGTAJYgBUn9gbfDNStPGozQZftpJdLDYTBsC3J34U=; b=ese1uDVr2Ioe9MXvV6lsFBm4CcK+nfxa2ki3gbYGytDgWbXf+LLSUO/zImr10kWj57 da21LOta4o7D1sXP4qOHgjXD1yEhzrxJRGAbjDYU1GYJmrWNE4lZvhBeFIO/mOVxuTNc YMBZMshB50qtwNHNNFVrslAvVgWIFsh+47lArVRuCBtIGzkV3WZJOt2MmoOD2j5vjq9U 2KBg3PxlpNxbUOF/T78KKHR02UTtfc7a/UrdBX7dcM/vn7LgiveUqueBA03vc0DqTC6D RnBPP34a8E3RrmMKY0T98yVAsgzIu5JDZlmwbw8z1ONgpXxYsyOnC+VY+8OJmX7apvKc 2KgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=0mSGTAJYgBUn9gbfDNStPGozQZftpJdLDYTBsC3J34U=; b=KqUU1t3qg4pWjpR1vMTxjGr/6srRCl9nBimJhBhXAaX1Al/EiZwd4LOVqp22YILnWn Bq98vgcaQmxeuYr1RGwyNYvLxM8vJCL6wz3curPhqi5mdJPVx81oTwYQg5rQQbQzhQ6B fd9D0t/ALyIQ669DkHd8R701CdECQZ+GvFBqT/jLWyKFG5+wmyr25gYKB4/92f/rymGl mWKtECYboMeJFkv4XUda7GSYHZII7futsViCE2uiYakXGFkqUTVExlR9yywdUHZCXSzX xO1C0yTn+euX6Rgpa8ooAWNVI7TknvqfZhtLSAudVDElQT29Yuh8gPE9aM8ouy/g1P14 1b/Q== X-Gm-Message-State: ACgBeo1OXLdDiQDykxUOElYQ4X6wuaMXkTG0UmgQ3uXRromXbHpFJy2w LCFB2PHV3fNNNo8UnPiZbj4Lc0m473I= X-Google-Smtp-Source: AA6agR5jb4sRx+6hsjr5LHI78qLpQPN2Mm6asLt7lKeW0z4qbS3K+yPpS6zjhyqpIbiwQbeBFogAmA== X-Received: by 2002:a63:dd4b:0:b0:41d:e855:7137 with SMTP id g11-20020a63dd4b000000b0041de8557137mr3075434pgj.595.1660308442826; Fri, 12 Aug 2022 05:47:22 -0700 (PDT) Received: from localhost.localdomain ([2404:bd00:3:dc0d:d8e:96a2:2dbe:5a83]) by smtp.gmail.com with ESMTPSA id e6-20020a17090a728600b001f069352d73sm1431785pjg.25.2022.08.12.05.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 05:47:22 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 12 Aug 2022 18:16:50 +0530 Message-Id: <20220812124651.27496-11-utkarsh02t@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220812124651.27496-1-utkarsh02t@gmail.com> References: <20220812124651.27496-1-utkarsh02t@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 10/11] qcam: ControlFrame: Add GUI way to interact with ControlTypeIntger32 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Utkarsh Tiwari via libcamera-devel From: Utkarsh Tiwari Reply-To: Utkarsh Tiwari Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add an integer slider for ControlTypeIntger32 control types. The default value on the slider is the default value for the control and it may not be the current value for the control. Signed-off-by: Utkarsh Tiwari --- src/qcam/settings/control_frame.cpp | 16 ++++++++++++++++ src/qcam/settings/control_frame.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/qcam/settings/control_frame.cpp b/src/qcam/settings/control_frame.cpp index 9e38da37..d9c294a2 100644 --- a/src/qcam/settings/control_frame.cpp +++ b/src/qcam/settings/control_frame.cpp @@ -93,6 +93,19 @@ QWidget *ControlFrame::controlInteraction(QWidget *parent) SliderLayout *fSliderLayout = new SliderLayout(floatSlider_, this); return fSliderLayout; } + case ControlTypeInteger32: { + intSlider_ = new Slider(this); + intSlider_->setRange(controlInfo_.min().get(), + controlInfo_.max().get()); + intSlider_->setValue(controlInfo_.def().get()); + intSlider_->setOrientation(Qt::Orientation::Horizontal); + + connect(intSlider_, &Slider::valueChanged, + this, &ControlFrame::notifyControlChange); + + SliderLayout *iSliderLayout = new SliderLayout(intSlider_, this); + return iSliderLayout; + } default: return (new QLabel("Currently Unavailable")); } @@ -162,6 +175,9 @@ void ControlFrame::notifyControlChange() case ControlTypeFloat: controlValue.set(floatSlider_->value()); break; + case ControlTypeInteger32: + controlValue.set(intSlider_->value()); + break; default: /* Nothing to emit so return */ return; diff --git a/src/qcam/settings/control_frame.h b/src/qcam/settings/control_frame.h index e9e256aa..205bb96b 100644 --- a/src/qcam/settings/control_frame.h +++ b/src/qcam/settings/control_frame.h @@ -47,6 +47,7 @@ private: QCheckBox *controlCheckBox_; QLabel *currentValue_; FloatSlider *floatSlider_; + Slider *intSlider_; /* Helper Hunctions */ QString getDefaultValueQStr();