Esempio n. 1
0
ListLog::ListLog(LogPlay *log,RDCae *cae,int id,bool allow_pause,
                 QWidget *parent)
    : QWidget(parent)
{
    list_id=id;
    list_log=log;
    list_cae=cae;
    list_op_mode=RDAirPlayConf::LiveAssist;
    list_action_mode=RDAirPlayConf::Normal;
    list_time_mode=RDAirPlayConf::TwentyFourHour;
    list_scroll=true;
    list_pause_allowed=allow_pause;
    list_playbutton_mode=ListLog::ButtonDisabled;
    list_audition_head_playing=false;
    list_audition_tail_playing=false;

    //
    // Create Fonts
    //
    QFont list_font=QFont("Helvetica",12,QFont::Normal);
    list_font.setPixelSize(12);
    setFont(list_font);
    QFont label_font=QFont("Helvetica",12,QFont::Bold);
    label_font.setPixelSize(12);
    QFont font=QFont("Helvetica",14,QFont::Bold);
    font.setPixelSize(14);
    QFont name_font=QFont("Helvetica",18,QFont::Bold);
    name_font.setPixelSize(18);

    //
    // Create Icons
    //
    list_playout_map=new QPixmap(play_xpm);
    list_macro_map=new QPixmap(rml5_xpm);
    list_chain_map=new QPixmap(chain_xpm);
    list_track_cart_map=new QPixmap(track_cart_xpm);
    list_mic16_map=new QPixmap(mic16_xpm);
    list_notemarker_map=new QPixmap(notemarker_xpm);
    list_traffic_map=new QPixmap(traffic_xpm);
    list_music_map=new QPixmap(music_xpm);

    //
    // Create Palettes
    //
    QColor system_button_text_color = palette().active().buttonText();
    QColor system_button_color = palette().active().button();
    QColor system_mid_color = colorGroup().mid();
    list_from_color=
        QPalette(QColor(BUTTON_FROM_BACKGROUND_COLOR),QColor(system_mid_color));
    list_from_color.
    setColor(QColorGroup::ButtonText,QColor(BUTTON_FROM_TEXT_COLOR));

    list_to_color=
        QPalette(QColor(BUTTON_TO_BACKGROUND_COLOR),QColor(system_mid_color));
    list_to_color.
    setColor(QColorGroup::ButtonText,QColor(BUTTON_TO_TEXT_COLOR));
    list_list_to_color=palette();
    list_list_to_color.setColor(QPalette::Active,QColorGroup::Highlight,
                                BUTTON_TO_BACKGROUND_COLOR);
    list_list_to_color.setColor(QPalette::Active,QColorGroup::HighlightedText,
                                BUTTON_TO_TEXT_COLOR);
    list_list_to_color.setColor(QPalette::Inactive,QColorGroup::Highlight,
                                BUTTON_TO_BACKGROUND_COLOR);
    list_list_to_color.setColor(QPalette::Inactive,QColorGroup::HighlightedText,
                                BUTTON_TO_TEXT_COLOR);
    list_list_from_color=palette();
    list_list_from_color.setColor(QPalette::Active,QColorGroup::Highlight,
                                  BUTTON_FROM_BACKGROUND_COLOR);
    list_list_from_color.setColor(QPalette::Active,QColorGroup::HighlightedText,
                                  BUTTON_FROM_TEXT_COLOR);
    list_list_from_color.setColor(QPalette::Inactive,QColorGroup::Highlight,
                                  BUTTON_FROM_BACKGROUND_COLOR);
    list_list_from_color.
    setColor(QPalette::Inactive,QColorGroup::HighlightedText,
             BUTTON_FROM_TEXT_COLOR);
    list_scroll_color[0]=palette();
    list_scroll_color[0].setColor(QPalette::Active,QColorGroup::ButtonText,
                                  BUTTON_LOG_ACTIVE_TEXT_COLOR);
    list_scroll_color[0].setColor(QPalette::Active,QColorGroup::Button,
                                  BUTTON_LOG_ACTIVE_BACKGROUND_COLOR);
    list_scroll_color[0].setColor(QPalette::Active,QColorGroup::Background,
                                  system_mid_color);
    list_scroll_color[0].setColor(QPalette::Inactive,QColorGroup::ButtonText,
                                  BUTTON_LOG_ACTIVE_TEXT_COLOR);
    list_scroll_color[0].setColor(QPalette::Inactive,QColorGroup::Button,
                                  BUTTON_LOG_ACTIVE_BACKGROUND_COLOR);
    list_scroll_color[0].setColor(QPalette::Inactive,QColorGroup::Background,
                                  system_mid_color);
    list_scroll_color[1]=palette();
    list_scroll_color[1].setColor(QPalette::Active,QColorGroup::ButtonText,
                                  system_button_text_color);
    list_scroll_color[1].setColor(QPalette::Active,QColorGroup::Button,
                                  system_button_color);
    list_scroll_color[1].setColor(QPalette::Active,QColorGroup::Background,
                                  system_mid_color);
    list_scroll_color[1].setColor(QPalette::Inactive,QColorGroup::ButtonText,
                                  system_button_text_color);
    list_scroll_color[1].setColor(QPalette::Inactive,QColorGroup::Button,
                                  system_button_color);
    list_scroll_color[1].setColor(QPalette::Inactive,QColorGroup::Background,
                                  system_mid_color);

    //
    // Hour Selector
    //
    list_hour_selector=new HourSelector(this);
    list_hour_selector->setTimeMode(list_time_mode);
    connect(list_hour_selector,SIGNAL(hourSelected(int)),
            this,SLOT(selectHour(int)));
    list_hour_selector->hide();

    //
    // Log List
    //
    list_log_list=new LibListView(this);
    list_log_list->setFont(list_font);
    int y=0;
    int h=sizeHint().height()-60;
    if(rda->airplayConf()->showCounters()) {
        h-=60;
    }
    if(rda->airplayConf()->hourSelectorEnabled()) {
        y+=80;
        h-=80;
        list_hour_selector->setGeometry(0,0,sizeHint().width(),80);
        list_hour_selector->show();
    }
    list_log_list->setGeometry(0,y,sizeHint().width(),h);
    list_log_list->setAllColumnsShowFocus(true);
    list_log_list->setSelectionMode(QListView::Extended);
    list_log_list->setItemMargin(5);
    list_log_list->addColumn("");
    list_log_list->setColumnAlignment(0,Qt::AlignHCenter);
    list_log_list->addColumn(tr("EST TIME"));
    list_log_list->setColumnAlignment(1,Qt::AlignRight);
    list_log_list->addColumn(tr("LEN"));
    list_log_list->setColumnAlignment(2,Qt::AlignRight);
    list_log_list->addColumn(tr("TRANS"));
    list_log_list->setColumnAlignment(3,Qt::AlignHCenter);
    list_log_list->addColumn(tr("CART"));
    list_log_list->setColumnAlignment(4,Qt::AlignHCenter);
    list_log_list->addColumn(tr("TITLE"));
    list_log_list->setColumnAlignment(5,Qt::AlignLeft);
    list_log_list->addColumn(tr("ARTIST"));
    list_log_list->setColumnAlignment(6,Qt::AlignLeft);
    list_log_list->addColumn(tr("GROUP"));
    list_log_list->setColumnAlignment(7,Qt::AlignHCenter);
    list_log_list->addColumn(tr("TIME"));
    list_log_list->setColumnAlignment(8,Qt::AlignHCenter);
    list_log_list->addColumn(tr("ALBUM"));
    list_log_list->setColumnAlignment(9,Qt::AlignLeft);
    list_log_list->addColumn(tr("LABEL"));
    list_log_list->setColumnAlignment(10,Qt::AlignLeft);
    list_log_list->addColumn(tr("CLIENT"));
    list_log_list->setColumnAlignment(11,Qt::AlignLeft);
    list_log_list->addColumn(tr("AGENCY"));
    list_log_list->setColumnAlignment(12,Qt::AlignLeft);
    list_log_list->addColumn(tr("MARKER"));
    list_log_list->setColumnAlignment(13,Qt::AlignHCenter);
    list_log_list->addColumn(tr("LINE ID"));
    list_log_list->setColumnAlignment(14,Qt::AlignHCenter);
    list_log_list->addColumn(tr("COUNT"));
    list_log_list->setColumnAlignment(15,Qt::AlignHCenter);
    list_log_list->addColumn(tr("STATUS"));
    list_log_list->setColumnAlignment(16,Qt::AlignHCenter);
    list_log_list->setHardSortColumn(15);
    list_log_list->setFocusPolicy(QWidget::NoFocus);
    connect(list_log_list,SIGNAL(selectionChanged()),
            this,SLOT(selectionChangedData()));
    connect(list_log_list,
            SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),
            this,
            SLOT(doubleclickedData(QListViewItem *,const QPoint &,int)));
    connect(list_log_list,SIGNAL(cartDropped(int,RDLogLine *)),
            this,SLOT(cartDroppedData(int,RDLogLine *)));

    //
    // List Logs Dialog
    //
    list_logs_dialog=new ListLogs(list_log,this);

    //
    // Time Counter Section
    //
    QLabel *label=new QLabel(tr("Run Length"),this);
    label->setGeometry(372,sizeHint().height()-120,75,20);
    label->setFont(label_font);
    label->setAlignment(AlignCenter);
    label->setBackgroundColor(QColor(system_mid_color));
    if(!rda->airplayConf()->showCounters()) {
        label->hide();
    }

    //
    // Stop Time Counter
    //
    list_stoptime_edit=new QLineEdit(this);
    list_stoptime_edit->setGeometry(407,sizeHint().height()-100,70,18);
    list_stoptime_label=new QLabel(list_stoptime_edit,tr("Next Stop:"),this);
    list_stoptime_label->setGeometry(337,sizeHint().height()-100,65,18);
    list_stoptime_label->setFont(label_font);
    list_stoptime_label->setAlignment(AlignRight|AlignVCenter);
    list_stoptime_label->setBackgroundColor(QColor(system_mid_color));
    if(!rda->airplayConf()->showCounters()) {
        list_stoptime_edit->hide();
        list_stoptime_label->hide();
    }

    //
    // End Time Counter
    //
    list_endtime_edit=new QLineEdit(this);
    list_endtime_edit->setGeometry(407,sizeHint().height()-80,70,18);
    list_endtime_label=new QLabel(list_endtime_edit,tr("Log End:"),this);
    list_endtime_label->setGeometry(337,sizeHint().height()-80,65,18);
    list_endtime_label->setFont(label_font);
    list_endtime_label->setAlignment(AlignRight|AlignVCenter);
    list_endtime_label->setBackgroundColor(QColor(system_mid_color));
    if(!rda->airplayConf()->showCounters()) {
        list_endtime_edit->hide();
        list_endtime_label->hide();
    }

    //
    // Select Button
    //
    list_take_button=new QPushButton(this);
    list_take_button->setGeometry(10,sizeHint().height()-55,80,50);
    list_take_button->setFont(font);
    list_take_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
    list_take_button->setText(tr("Select"));
    list_take_button->setFocusPolicy(QWidget::NoFocus);
    connect(list_take_button,SIGNAL(clicked()),this,SLOT(takeButtonData()));
    list_take_button->hide();

    //
    // Audition Head Button
    //
    list_head_button=new QPushButton(this);
    list_head_button->setGeometry(10,sizeHint().height()-113,80,50);
    list_head_button->setFont(font);
    list_head_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
    list_head_button->setText(tr("Audition\nHead"));
    list_head_button->setFocusPolicy(QWidget::NoFocus);
    connect(list_head_button,SIGNAL(clicked()),this,SLOT(headButtonData()));
    if(!rda->airplayConf()->showCounters()) {
        list_head_button->hide();
    }

    //
    // Audition Tail Button
    //
    list_tail_button=new QPushButton(this);
    list_tail_button->setGeometry(90,sizeHint().height()-113,80,50);
    list_tail_button->setFont(font);
    list_tail_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
    list_tail_button->setText(tr("Audition\nTail"));
    list_tail_button->setFocusPolicy(QWidget::NoFocus);
    connect(list_tail_button,SIGNAL(clicked()),this,SLOT(tailButtonData()));
    if(!rda->airplayConf()->showCounters()) {
        list_tail_button->hide();
    }

    //
    // Play Button
    //
    list_play_button=new QPushButton(this);
    list_play_button->setGeometry(10,sizeHint().height()-55,80,50);
    list_play_button->setFont(font);
    list_play_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
    list_play_button->setText(tr("Start"));
    list_play_button->setDisabled(true);
    list_play_button->setFocusPolicy(QWidget::NoFocus);
    connect(list_play_button,SIGNAL(clicked()),this,SLOT(playButtonData()));

    //
    // Next Button
    //
    list_next_button=new QPushButton(this);
    list_next_button->setGeometry(90,sizeHint().height()-55,80,50);
    list_next_button->setFont(font);
    list_next_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
    list_next_button->setText(tr("Make\nNext"));
    list_next_button->setDisabled(true);
    list_next_button->setFocusPolicy(QWidget::NoFocus);
    connect(list_next_button,SIGNAL(clicked()),this,SLOT(nextButtonData()));

    //
    // Modify Button
    //
    list_modify_button=new QPushButton(this);
    list_modify_button->setGeometry(170,sizeHint().height()-55,80,50);
    list_modify_button->setFont(font);
    list_modify_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
    list_modify_button->setText(tr("Modify"));
    list_modify_button->setDisabled(true);
    list_modify_button->setFocusPolicy(QWidget::NoFocus);
    connect(list_modify_button,SIGNAL(clicked()),this,SLOT(modifyButtonData()));

    //
    // Scroll Button
    //
    list_scroll_button=new QPushButton(this);
    list_scroll_button->setGeometry(250,sizeHint().height()-55,80,50);
    list_scroll_button->setFont(font);
    list_scroll_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
    list_scroll_button->setText(tr("Scroll"));
    list_scroll_button->setFocusPolicy(QWidget::NoFocus);
    connect(list_scroll_button,SIGNAL(clicked()),this,SLOT(scrollButtonData()));
    list_scroll_button->setPalette(list_scroll_color[0]);

    //
    // Refresh Button
    //
    list_refresh_button=new QPushButton(this);
    list_refresh_button->setGeometry(330,sizeHint().height()-55,80,50);
    list_refresh_button->setFont(font);
    list_refresh_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
    list_refresh_button->setText(tr("Refresh\nLog"));
    list_refresh_button->setDisabled(true);
    list_refresh_button->setFocusPolicy(QWidget::NoFocus);
    connect(list_refresh_button,SIGNAL(clicked()),
            this,SLOT(refreshButtonData()));

    //
    // Log Load
    //
    list_load_button=new QPushButton(this);
    list_load_button->setGeometry(sizeHint().width()-90,sizeHint().height()-55,
                                  80,50);
    list_load_button->setFont(font);
    list_load_button->setPalette(QPalette(QColor(system_button_color),QColor(system_mid_color)));
    list_load_button->setText(tr("Select\nLog"));
    list_load_button->setFocusPolicy(QWidget::NoFocus);
    connect(list_load_button,SIGNAL(clicked()),this,SLOT(loadButtonData()));

    //
    // Edit Event Dialog
    //
    list_event_edit=new EditEvent(list_log,list_cae,this);

    //
    // Map Slots
    //
    connect(list_log,SIGNAL(reloaded()),this,SLOT(logReloadedData()));
    connect(list_log,SIGNAL(played(int)),this,SLOT(logPlayedData(int)));
    connect(list_log,SIGNAL(paused(int)),this,SLOT(logPausedData(int)));
    connect(list_log,SIGNAL(stopped(int)),this,SLOT(logStoppedData(int)));
    connect(list_log,SIGNAL(inserted(int)),this,SLOT(logInsertedData(int)));
    connect(list_log,SIGNAL(removed(int,int,bool)),
            this,SLOT(logRemovedData(int,int,bool)));
    connect(list_log,SIGNAL(transportChanged()),
            this,SLOT(transportChangedData()));
    connect(list_log,SIGNAL(modified(int)),this,SLOT(modifiedData(int)));
    connect(list_log,SIGNAL(refreshabilityChanged(bool)),
            this,SLOT(refreshabilityChangedData(bool)));
    connect(list_log,SIGNAL(auditionHeadPlayed(int)),
            this,SLOT(auditionHeadData(int)));
    connect(list_log,SIGNAL(auditionTailPlayed(int)),
            this,SLOT(auditionTailData(int)));
    connect(list_log,SIGNAL(auditionStopped(int)),
            this,SLOT(auditionStoppedData(int)));

    setBackgroundColor(QColor(system_mid_color));

    RefreshList();
    UpdateTimes();
}
Esempio n. 2
0
ButtonLog::ButtonLog(LogPlay *log,RDCae *cae,int id,RDAirPlayConf *conf,
		     bool allow_pause,QWidget *parent,const char *name)
  : QWidget(parent,name)
{
  log_id=id;
  log_log=log;
  log_cae=cae;
  log_action_mode=RDAirPlayConf::Normal;
  log_op_mode=RDAirPlayConf::LiveAssist;
  log_time_mode=RDAirPlayConf::TwentyFourHour;
  log_pause_enabled=allow_pause;

  QFont font=QFont("Helvetica",14,QFont::Bold);
  font.setPixelSize(14);

  //
  // Set Mappings
  //
  connect(log_log,SIGNAL(transportChanged()),
	  this,SLOT(transportChangedData()));
  connect(log_log,SIGNAL(modified(int)),this,SLOT(modifiedData(int)));
  connect(log_log,SIGNAL(played(int)),this,SLOT(playedData(int)));
  connect(log_log,SIGNAL(stopped(int)),this,SLOT(stoppedData(int)));
  connect(log_log,SIGNAL(paused(int)),this,SLOT(pausedData(int)));
  connect(log_log,SIGNAL(position(int,int)),this,SLOT(positionData(int,int)));

  //
  // Edit Event Dialog
  //
  log_event_edit=new EditEvent(log_log,log_cae,this,"list_event_edit");

  //
  // Line Boxes / Start Buttons
  //
  QSignalMapper *mapper=new QSignalMapper(this,"start_button_mapper");
  connect(mapper,SIGNAL(mapped(int)),
	  this,SLOT(startButton(int)));
  for(int i=0;i<BUTTON_PLAY_BUTTONS;i++) {
    log_line_box[i]=new LogLineBox(conf,this);
    log_line_box[i]->setMode(LogLineBox::Full);
    log_line_box[i]->setAcceptDrops(rdstation_conf->enableDragdrop());
    log_line_box[i]->setAllowDrags(rdstation_conf->enableDragdrop());
    log_line_box[i]->setGeometry(10+log_line_box[i]->sizeHint().height(),
			       (log_line_box[i]->sizeHint().height()+12)*i,
			       log_line_box[i]->sizeHint().width(),
			       log_line_box[i]->sizeHint().height());
    connect(log_line_box[i],SIGNAL(doubleClicked(int)),
	    this,SLOT(boxDoubleClickedData(int)));
    connect(log_line_box[i],SIGNAL(cartDropped(int,RDLogLine *)),
	    this,SLOT(cartDroppedData(int,RDLogLine *)));
    log_start_button[i]=new StartButton(allow_pause,this);
    log_start_button[i]->setGeometry(5,
			       (log_line_box[i]->sizeHint().height()+12)*i,
			       log_line_box[i]->sizeHint().height(),
			       log_line_box[i]->sizeHint().height());
    mapper->setMapping(log_start_button[i],i);
    connect(log_start_button[i],SIGNAL(clicked()),
	    mapper,SLOT(map()));
  }

  for(int i=BUTTON_PLAY_BUTTONS;i<BUTTON_TOTAL_BUTTONS;i++) {
    log_line_box[i]=new LogLineBox(conf,this);
    log_line_box[i]->setMode(LogLineBox::Half);
    log_line_box[i]->setAcceptDrops(rdstation_conf->enableDragdrop());
    log_line_box[i]->setAllowDrags(rdstation_conf->enableDragdrop());
    log_line_box[i]->setGeometry(10+log_line_box[0]->sizeHint().height(),
			       (log_line_box[0]->sizeHint().height()+12)*3+
			       (log_line_box[i]->sizeHint().height()+12)*(i-3),
			        log_line_box[i]->sizeHint().width(),
			        log_line_box[i]->sizeHint().height());
    connect(log_line_box[i],SIGNAL(doubleClicked(int)),
	    this,SLOT(boxDoubleClickedData(int)));
    connect(log_line_box[i],SIGNAL(cartDropped(int,RDLogLine *)),
	    this,SLOT(cartDroppedData(int,RDLogLine *)));
    log_start_button[i]=new StartButton(allow_pause,this);
    log_start_button[i]->setGeometry(5,
			       (log_line_box[0]->sizeHint().height()+12)*3+
			       (log_line_box[i]->sizeHint().height()+12)*(i-3),
			        log_line_box[0]->sizeHint().height(),
			        log_line_box[i]->sizeHint().height());
    mapper->setMapping(log_start_button[i],i);
    connect(log_start_button[i],SIGNAL(clicked()),
	    mapper,SLOT(map()));
  }
}