Commit 47c40eb2 authored by Edric Milaret's avatar Edric Milaret Committed by Nicolas Jager

audio: let user choose output and input

This had been deactivated because non-working in the deamon

Change-Id: Ibd658af14277d1435cda400d23fc2078d9de3b5a
Tuleap: #32
parent 5a32fa84
......@@ -31,6 +31,10 @@
#include "video/rate.h"
#include "video/previewmanager.h"
#include "audio/settings.h"
#include "audio/outputdevicemodel.h"
#include "audio/inputdevicemodel.h"
#include "media/recordingmodel.h"
#include "accountserializationadapter.h"
......@@ -152,6 +156,17 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
ui->generalTabButton->setChecked(true);
auto inputModel = Audio::Settings::instance().inputDeviceModel();
auto outputModel = Audio::Settings::instance().outputDeviceModel();
ui->outputComboBox->setModel(outputModel);
ui->inputComboBox->setModel(inputModel);
ui->outputComboBox->setCurrentIndex(outputModel->selectionModel()->currentIndex().row());
ui->inputComboBox->setCurrentIndex(inputModel->selectionModel()->currentIndex().row());
connect(ui->outputComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(outputIndexChanged(int)));
connect(ui->inputComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(inputIndexChanged(int)));
#ifndef ENABLE_AUTOUPDATE
ui->checkUpdateButton->hide();
ui->intervalUpdateCheckSpinBox->hide();
......@@ -331,3 +346,17 @@ ConfigurationWidget::on_recordPath_clicked()
ui->recordPath->setText(dir);
}
}
void
ConfigurationWidget::outputIndexChanged(int index)
{
auto outputModel = Audio::Settings::instance().outputDeviceModel();
outputModel->selectionModel()->setCurrentIndex(outputModel->index(index), QItemSelectionModel::ClearAndSelect);
}
void
ConfigurationWidget::inputIndexChanged(int index)
{
auto inputModel = Audio::Settings::instance().inputDeviceModel();
inputModel->selectionModel()->setCurrentIndex(inputModel->index(index), QItemSelectionModel::ClearAndSelect);
}
......@@ -63,7 +63,8 @@ private slots:
private slots:
void accountSelected(QItemSelection itemSel);
void deviceIndexChanged(int index);
void outputIndexChanged(int index);
void inputIndexChanged(int index);
private:
Ui::ConfigurationWidget *ui;
AccountModel* accountModel_;
......
......@@ -200,7 +200,7 @@
<bool>true</bool>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="generalPage">
<layout class="QHBoxLayout" name="verticalLayout_2">
......@@ -718,7 +718,7 @@
</layout>
</widget>
<widget class="QWidget" name="videoPage">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,1" columnstretch="0,0">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,1" columnstretch="0,0,0">
<property name="leftMargin">
<number>10</number>
</property>
......@@ -734,6 +734,59 @@
<property name="spacing">
<number>10</number>
</property>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="3">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="VideoWidget" name="videoView" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QLabel" name="previewUnavailable">
<property name="font">
<font>
<pointsize>13</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(77, 77, 77);</string>
</property>
<property name="text">
<string>Preview unavailable during call</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
......@@ -814,6 +867,9 @@
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="formAlignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<property name="horizontalSpacing">
<number>15</number>
</property>
......@@ -886,59 +942,62 @@
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="VideoWidget" name="videoView" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="1">
<layout class="QFormLayout" name="formLayout_2">
<property name="formAlignment">
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
<property name="horizontalSpacing">
<number>15</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
<property name="text">
<string>Output Device</string>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QLabel" name="previewUnavailable">
<item row="1" column="1">
<widget class="QComboBox" name="outputComboBox"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="font">
<font>
<pointsize>13</pointsize>
<weight>75</weight>
<bold>true</bold>
<pointsize>11</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(77, 77, 77);</string>
</property>
<property name="text">
<string>Preview unavailable during call</string>
<string>Input Device</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="inputComboBox"/>
</item>
<item row="0" column="0">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="accountPage">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment