DeckMon::DeckMon(QString station,unsigned channel,QWidget *parent) : QFrame(parent) { mon_station=station; mon_channel=channel; setFrameStyle(Box|Raised); setLineWidth(1); setMidLineWidth(2); // // Generate Fonts // QFont small_font=QFont("Helvetica",6,QFont::Bold); small_font.setPixelSize(6); QFont label_font("Helvetica",12,QFont::Normal); label_font.setPixelSize(12); QFont event_font("Helvetica",12,QFont::Bold); event_font.setPixelSize(12); // // Generate Palettes // mon_red_palette=palette(); mon_red_palette.setColor(QColorGroup::Background,Qt::darkRed); mon_red_palette.setColor(QColorGroup::Foreground,Qt::white); mon_dark_palette=palette(); mon_dark_palette. setColor(QColorGroup::Background,palette().color(QPalette::Active,QColorGroup::Mid)); mon_dark_palette.setColor(QColorGroup::Foreground,Qt::white); // // Station/Channel // mon_station_label=new QLabel(this); mon_station_label->setFont(label_font); if((mon_channel>0)&&(mon_channel<(MAX_DECKS+1))) { mon_station_label-> setText(QString(). sprintf("%s : %uR",(const char *)mon_station,mon_channel)); } if((mon_channel>128)&&(mon_channel<(MAX_DECKS+129))) { mon_station_label-> setText(QString(). sprintf("%s : %uP",(const char *)mon_station,mon_channel-128)); } // // Monitor Button // mon_monitor_button=new QPushButton(this); mon_monitor_button->setFont(small_font); mon_monitor_button->setText(tr("MON")); mon_monitor_palette=new QPalette(QColor(BUTTON_MONITOR_FLASHING_COLOR), backgroundColor()); if((mon_channel>128)&&(mon_channel<(MAX_DECKS+129))) { mon_monitor_button->hide(); } connect(mon_monitor_button,SIGNAL(clicked()), this,SLOT(monitorButtonData())); // // Abort Button // mon_abort_button=new QPushButton(this); mon_abort_button->setFont(small_font); mon_abort_button->setText(tr("ABORT")); mon_abort_button->setDisabled(true); connect(mon_abort_button,SIGNAL(clicked()),this,SLOT(abortButtonData())); // // Cut // mon_cut_label=new QLabel(this); mon_cut_label->setFont(label_font); // // Event Indicator // mon_event_label=new QLabel(this); mon_event_label->setFont(event_font); mon_event_label->setAlignment(Qt::AlignCenter); mon_event_label->setFrameStyle(QFrame::Panel|QFrame::Sunken); mon_event_label->setPalette(mon_dark_palette); mon_event_label->setText("--"); mon_event_timer=new QTimer(this); connect(mon_event_timer,SIGNAL(timeout()),this,SLOT(eventResetData())); // // Status // mon_status_label=new QLabel(tr("OFFLINE"),this); mon_status_label->setFont(label_font); // // Audio Meter // mon_left_meter=new RDPlayMeter(RDSegMeter::Right,this); mon_left_meter->setMode(RDSegMeter::Peak); mon_left_meter->setRange(-4600,-800); mon_left_meter->setHighThreshold(-1600); mon_left_meter->setClipThreshold(-1100); mon_left_meter->setLabel(tr("L")); mon_right_meter=new RDPlayMeter(RDSegMeter::Right,this); mon_right_meter->setMode(RDSegMeter::Peak); mon_right_meter->setRange(-4600,-800); mon_right_meter->setHighThreshold(-1600); mon_right_meter->setClipThreshold(-1100); mon_right_meter->setLabel(tr("R")); }
DeckMon::DeckMon(QString station,unsigned channel, QWidget *parent,const char *name) : QFrame(parent,name) { mon_station=station; mon_channel=channel; setFrameStyle(Box|Raised); setLineWidth(1); setMidLineWidth(2); // // Generate Fonts // QFont small_font=QFont("Helvetica",6,QFont::Bold); small_font.setPixelSize(6); QFont label_font("Helvetica",12,QFont::Normal); label_font.setPixelSize(12); // // Station/Channel // mon_station_label=new QLabel(this,"mon_station_label"); mon_station_label->setFont(label_font); if((mon_channel>0)&&(mon_channel<(MAX_DECKS+1))) { mon_station_label-> setText(QString(). sprintf("%s : %uR",(const char *)mon_station,mon_channel)); } if((mon_channel>128)&&(mon_channel<(MAX_DECKS+129))) { mon_station_label-> setText(QString(). sprintf("%s : %uP",(const char *)mon_station,mon_channel-128)); } // // Monitor Button // mon_monitor_button=new QPushButton(this,"mon_monitor_button"); mon_monitor_button->setFont(small_font); mon_monitor_button->setText(tr("MON")); mon_monitor_palette=new QPalette(QColor(BUTTON_MONITOR_FLASHING_COLOR), backgroundColor()); if((mon_channel>128)&&(mon_channel<(MAX_DECKS+129))) { mon_monitor_button->hide(); } connect(mon_monitor_button,SIGNAL(clicked()), this,SLOT(monitorButtonData())); // // Abort Button // mon_abort_button=new QPushButton(this,"mon_abort_button"); mon_abort_button->setFont(small_font); mon_abort_button->setText(tr("ABORT")); mon_abort_button->setDisabled(true); connect(mon_abort_button,SIGNAL(clicked()),this,SLOT(abortButtonData())); // // Cut // mon_cut_label=new QLabel(this,"mon_cut_label"); mon_cut_label->setFont(label_font); // // Status // mon_status_label=new QLabel(tr("OFFLINE"),this,"mon_status_label"); mon_status_label->setFont(label_font); // // Audio Meter // mon_left_meter=new RDPlayMeter(RDSegMeter::Right,this,"mon_left_meter"); mon_left_meter->setMode(RDSegMeter::Peak); mon_left_meter->setRange(-4600,-800); mon_left_meter->setHighThreshold(-1600); mon_left_meter->setClipThreshold(-1100); mon_left_meter->setLabel(tr("L")); mon_right_meter=new RDPlayMeter(RDSegMeter::Right,this,"mon_right_meter"); mon_right_meter->setMode(RDSegMeter::Peak); mon_right_meter->setRange(-4600,-800); mon_right_meter->setHighThreshold(-1600); mon_right_meter->setClipThreshold(-1100); mon_right_meter->setLabel(tr("R")); }