From patchwork Fri Jul 15 19:13:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Utkarsh Tiwari X-Patchwork-Id: 16665 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 0E1D9BE173 for ; Fri, 15 Jul 2022 19:14:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B1E9463316; Fri, 15 Jul 2022 21:14:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657912466; bh=M/bGKICe+abowWk3enf/2u14NjFcx2yU0xmzMayWrY0=; 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=toEPvn2Y2+5rP1MOHWqkrP/LWFplwbYgUwMSG/qeE26Jed0flDeoIrfxyMqHe7rdg 33TiCT0o+Vycg0DUvA6S7i+MGFJf48oZZen31RlchYOgj1pNURxjw0lIxV8BzYYd6U KbNp5TE8M6cEjhjfhIKpU370fZL1+WsC0QPAqdHlN+q2wRnLE5ZE4zxAMt5xwOEWQI sgu+MgVCyWqX2DRTv4j36QXvGbDXmA7jAqG5Zr8xpcPLsZYEu12C3szDVjmYXF5YVD wBGWAMIx9PRKCiRaBrCFUMsTkZ+46oTh9X/rS9L3CCaxeobBycBTcJpyRXmT0cDMbd iLUpTlehTcFtQ== Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A4DB46331B for ; Fri, 15 Jul 2022 21:14:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pmE4IXLF"; dkim-atps=neutral Received: by mail-pj1-x1029.google.com with SMTP id o15so6466540pjh.1 for ; Fri, 15 Jul 2022 12:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h3ZqblOF9y1/2pt7SDzz4eO84BlwOPFX1e1bby5aPGw=; b=pmE4IXLF5sRND4BjxT5oqXIZb1+Eb6FpwUTgvSUaoYANXTgIbYAgHwAIErQLsDDLpe qPi9YS4CeHU7ntVtgckW2HUGQRo7sbIeUSCxA2i8uNwYpZfg0rXLIjHzQ3QrBIF5S+ug ceAvFrZXiF6fBPER/umlPyMZ5djj3Xc/899tD7Xa6C5HaZp9ad4/8h8CsSySEbOJu5a8 cC2fG/8147/KikmsGI61wlpLvV2atSKLwS3L2TLSwqS3xVO6oUHC7tRJU7zqL/mC4ZqM TiN2ZgT3J4L9kHJX7B4njFnjozjR870Ytp/TX6oKLzr/dTyy5JQkBAXOVTvibIrNAUXB 9BHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h3ZqblOF9y1/2pt7SDzz4eO84BlwOPFX1e1bby5aPGw=; b=x6paNRmYoWtT0IYdWXmNV2KAekHAamtu40TpgBcMizXukOPMYNf++ZHtTR7aos7bny ifxKJ1IL2HbrlNg+isBdmHNo1/GdRREFPxy6yHh17Rzgyky+u8dvP/zesg13xdQ6EQP3 EiRp2MWKbzX8LElj7lXMh/a7F3P4kumVGYgw2rIgR0tNenybk9B6b9GtjgmgeqtagTRW vJMWmNl0Z7uqo3nmFSXLZ7TFgW2vBbQXHHjslGY650lrsMz3Vl/+K78gVqp1Mz8aZcoQ PeRqdEraeuzYrW+ExFrMPLoqMb4OyPpToHKZ9ygN1ApaagtP9ojhqWDqdtEuaPFXI90f IqFQ== X-Gm-Message-State: AJIora+g0zm/wY+C9RsViUyH76S3xIimaFmgHkgLbL9kkEmxOijs+kiO wi1IM1o/VuZA3GKWMnkcKtUYdf9A65Pwjw== X-Google-Smtp-Source: AGRyM1ueWhsBaD8haQW6xuvTmLmaEiaXu41tEqdvLi34xkJXMgG5ZpZRZRO0MM519asqpMGXnz4bag== X-Received: by 2002:a17:90b:3008:b0:1ef:86a3:3699 with SMTP id hg8-20020a17090b300800b001ef86a33699mr23900996pjb.240.1657912462072; Fri, 15 Jul 2022 12:14:22 -0700 (PDT) Received: from localhost.localdomain ([2406:3003:2005:1c27:d8e8:f9ac:919c:9ac8]) by smtp.gmail.com with ESMTPSA id s10-20020a170903214a00b0016be834d544sm3834315ple.237.2022.07.15.12.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jul 2022 12:14:21 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sat, 16 Jul 2022 03:13:59 +0800 Message-Id: <20220715191400.890976-11-utkarsh02t@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220715191400.890976-1-utkarsh02t@gmail.com> References: <20220715191400.890976-1-utkarsh02t@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 10dcd05a..5a3258d6 100644 --- a/src/qcam/settings/control_frame.cpp +++ b/src/qcam/settings/control_frame.cpp @@ -94,6 +94,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")); } @@ -163,6 +176,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();