AudioSettings::AudioSettings(int audioOn, int volume, QWidget *parent ) : QWidget(parent) { ui.setupUi(this); ui.AudioOnOffBox->setCurrentIndex( audioOn ); ui.volumeSlider->setValue( volume ); connect(ui.AudioOnOffBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setAudioOn(int))); connect(ui.volumeSlider, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); updateVolumeLabel( volume ); }
void AudioSettings::setVolume( int volume ) { updateVolumeLabel( volume ); emit( Volume(volume) ); }
AudioStatusBox::AudioStatusBox(ScServer *server, QWidget *parent): StatusBox(parent), mServer(server), m_avg_cpu(0.f), m_peak_cpu(0.f), m_ugens(0), m_synths(0), m_groups(0), m_synthdefs(0) { mStatisticsLabel = new StatusLabel; mVolumeLabel = new StatusLabel; mMuteLabel = new StatusLabel; mMuteLabel->setText("M"); mRecordLabel = new StatusLabel; mRecordLabel->setText("R"); QHBoxLayout *layout = new QHBoxLayout; layout->setContentsMargins(0,0,0,0); layout->setSpacing(1); layout->addWidget(mStatisticsLabel); layout->addWidget(mVolumeLabel); layout->addWidget(mMuteLabel); layout->addWidget(mRecordLabel); setLayout(layout); server->action(ScServer::Record)->setProperty("keep_menu_open", true); server->action(ScServer::VolumeRestore)->setProperty("keep_menu_open", true); server->action(ScServer::Mute)->setProperty("keep_menu_open", true); server->action(ScServer::DumpOSC)->setProperty("keep_menu_open", true); QAction *separator; addAction( server->action(ScServer::ToggleRunning) ); addAction( server->action(ScServer::Reboot) ); addAction( server->action(ScServer::KillAll) ); addActionSeparator(); addAction( server->action(ScServer::ShowMeters) ); addAction( server->action(ScServer::ShowScope) ); addAction( server->action(ScServer::ShowFreqScope) ); addAction( server->action(ScServer::DumpNodeTree) ); addAction( server->action(ScServer::DumpNodeTreeWithControls) ); addAction( server->action(ScServer::PlotTree) ); addAction( server->action(ScServer::DumpOSC) ); addActionSeparator(); addAction( server->action(ScServer::Record) ); addActionSeparator(); addAction( server->action(ScServer::VolumeRestore) ); addAction( server->action(ScServer::Mute) ); addAction( server->action(ScServer::Volume) ); connect(server, SIGNAL(runningStateChange(bool,QString,int)), this, SLOT(onServerRunningChanged(bool,QString,int))); connect(server, SIGNAL(updateServerStatus(int,int,int,int,float,float)), this, SLOT(onServerStatusReply(int,int,int,int,float,float))); connect(server, SIGNAL(volumeChanged(float)), this, SLOT(updateVolumeLabel(float))); connect(server, SIGNAL(mutedChanged(bool)), this, SLOT(updateMuteLabel(bool))); connect(server, SIGNAL(recordingChanged(bool)), this, SLOT(updateRecordLabel(bool))); onServerRunningChanged(false, "", 0); updateVolumeLabel( mServer->volume() ); updateMuteLabel( mServer->isMuted() ); updateRecordLabel( mServer->isRecording() ); }