105 lines
2.1 KiB
C++
105 lines
2.1 KiB
C++
#include "AvReceiverGui.h"
|
|
#include "ui_AvReceiverGui.h"
|
|
|
|
#include "AvReceiver.h"
|
|
|
|
CAvReceiverGui::CAvReceiverGui(QWidget *parent) :
|
|
QWidget(parent),
|
|
ui(new Ui::CAvReceiverGui)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
connect(ui->mSpkBCheckBox,SIGNAL(toggled(bool)),this,SLOT(SpeakerBRadioClicked(bool)));
|
|
connect(ui->mSpkACheckBox,SIGNAL(toggled(bool)),this,SLOT(SpeakerARadioClicked(bool)));
|
|
}
|
|
|
|
CAvReceiverGui::~CAvReceiverGui()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void CAvReceiverGui::SpeakerBRadioClicked(bool checked)
|
|
{
|
|
mProgramHandle->SpeakerBToggleSwitchPressed(checked);
|
|
}
|
|
|
|
void CAvReceiverGui::SpeakerARadioClicked(bool checked)
|
|
{
|
|
mProgramHandle->SpeakerAToggleSwitchPressed(checked);
|
|
}
|
|
|
|
int CAvReceiverGui::UpdateReceiverStatus(CAvReceiverMainStatus Status)
|
|
{
|
|
QString StatusText;
|
|
|
|
StatusText.clear();
|
|
StatusText += "Receiver Status:\n\n";
|
|
|
|
StatusText += "Power: ";
|
|
if(Status.mMainPwrStatus == true)
|
|
{
|
|
StatusText += "ON\n";
|
|
}
|
|
else
|
|
{
|
|
StatusText += "OFF\n";
|
|
}
|
|
|
|
StatusText += "Mute: ";
|
|
if(Status.mIsMute == true)
|
|
{
|
|
StatusText += "ON\n";
|
|
}
|
|
else
|
|
{
|
|
StatusText += "OFF\n";
|
|
}
|
|
|
|
StatusText += "Main sleep: ";
|
|
if(Status.mMainSleepStatus == true)
|
|
{
|
|
StatusText += "ON\n";
|
|
}
|
|
else
|
|
{
|
|
StatusText += "OFF\n";
|
|
}
|
|
|
|
StatusText += "Volume: ";
|
|
StatusText += QString("%1").arg(Status.mMainVolume);
|
|
StatusText +="\n";
|
|
StatusText += "Input: ";
|
|
StatusText +=Status.mInput;
|
|
StatusText += "\n";
|
|
StatusText += "Program: ";
|
|
StatusText +=Status.mProgram;
|
|
StatusText += "\n";
|
|
|
|
StatusText += "Zone A: ";
|
|
if(Status.mSpeakerAState == true)
|
|
{
|
|
StatusText += "ON\n";
|
|
ui->mSpkACheckBox->setChecked(true);
|
|
}
|
|
else
|
|
{
|
|
StatusText += "OFF\n";
|
|
ui->mSpkACheckBox->setChecked(false);
|
|
}
|
|
|
|
StatusText += "Zone B: ";
|
|
if(Status.mSpeakerBState == true)
|
|
{
|
|
StatusText += "ON\n";
|
|
ui->mSpkBCheckBox->setChecked(true);
|
|
}
|
|
else
|
|
{
|
|
StatusText += "OFF\n";
|
|
ui->mSpkBCheckBox->setChecked(false);
|
|
}
|
|
|
|
|
|
ui->mRcvrStatusLabel->setText(StatusText);
|
|
}
|