Beispiel #1
0
void ListNodes::RefreshList()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *item;

  list_list_view->clear();
  sql=QString().sprintf("select ID,HOSTNAME,DESCRIPTION,BASE_OUTPUT,TCP_PORT \
                         from SWITCHER_NODES \
                         where (STATION_NAME=\"%s\")&&(MATRIX=%d)",
			(const char *)list_matrix->station(),
			list_matrix->matrix());
  q=new RDSqlQuery(sql);
  while(q->next()) {
    item=new RDListViewItem(list_list_view);
    item->setId(q->value(0).toInt());
    item->setText(0,q->value(1).toString());
    item->setText(1,q->value(2).toString());
    if(q->value(3).toInt()==0) {
      item->setText(2,tr("[none]"));
    }
    else {
      item->setText(2,QString().sprintf("%d",q->value(3).toInt()));
    }
    item->setText(3,q->value(4).toString());
  }
  delete q;
}
void ListReplicatorCarts::refreshTimeoutData()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *item;

  sql=QString("select ")+
    "ID,"+
    "ITEM_DATETIME "+
    "from REPL_CART_STATE where "+
    "REPLICATOR_NAME=\""+RDEscapeString(list_replicator_name)+"\"";
  q=new RDSqlQuery(sql);
  while(q->next()) {
    item=(RDListViewItem *)list_view->firstChild();
    while(item!=NULL) {
      if(item->id()==q->value(0).toInt()) {
	item->setText(3,q->value(1).
		      toDateTime().toString("hh:mm:ss dd/MM/yyyy"));
	break;
      }
      item=(RDListViewItem *)item->nextSibling();
    }
  }
  delete q;
  list_refresh_timer->start(5000,true);
}
void ListLog::RefreshList()
{
    RDListViewItem *l;
    RDLogLine *logline;

    list_log_list->clear();
    l=new RDListViewItem(list_log_list);
    l->setText(5,tr("--- end of log ---"));
    l->setText(15,QString().sprintf("%d",END_MARKER_ID));
    l->setText(14,QString().sprintf("%d",list_log->size()));
    for(int i=list_log->size()-1; i>=0; i--) {
        if((logline=list_log->logLine(i))!=NULL) {
            l=new RDListViewItem(list_log_list);
            logline->setListViewItem(l);
        }
        RefreshItem(l,i);
    }
}
Beispiel #4
0
void DiskRipper::mediaChangedData()
{
  RDListViewItem *l;

  rip_isrc_read=false;
  rip_cutnames.clear();
  rip_end_track.clear();
  for(unsigned i=0;i<rip_wave_datas.size();i++) {
    delete rip_wave_datas[i];
  }
  rip_wave_datas.clear();
  rip_track_list->clear();
  rip_track=-1;
  rip_setcut_button->setDisabled(true);
  rip_setall_button->setDisabled(true);
  rip_setsingle_button->setDisabled(true);
  rip_cartlabel_button->setDisabled(true);
  rip_clear_button->setDisabled(true);
  for(int i=rip_cdrom->tracks();i>0;i--) {
    rip_cutnames.push_back(QString());
    rip_end_track.push_back(-1);
    rip_wave_datas.push_back(new RDWaveData());
    rip_wave_datas.back()->setTitle(tr("Track")+QString().sprintf(" %d",i+1));
    l=new RDListViewItem(rip_track_list);
    l->setText(0,QString().sprintf("%d",i));
    if(rip_cdrom->isAudio(i)) {
      l->setText(4,tr("Audio Track"));
    }
    else {
      l->setText(4,tr("Data Track"));
    }
    l->setText(1,RDGetTimeLength(rip_cdrom->trackLength(i)));
  }
  rip_cddb_record.clear();
  rip_cdrom->setCddbRecord(&rip_cddb_record);
  rip_cddb_lookup->setCddbRecord(&rip_cddb_record);
  rip_cddb_lookup->
    lookupRecord(rip_cdda_dir.path(),rdlibrary_conf->ripperDevice(),
		 rdlibrary_conf->cddbServer(),8880,
		 RIPPER_CDDB_USER,PACKAGE_NAME,VERSION);
}
Beispiel #5
0
void EditClock::RefreshList(int select_line)
{
  UpdateClock();
  RDListViewItem *prev_item=(RDListViewItem *)edit_clocks_list->selectedItem();

  if((prev_item!=NULL)&&(select_line>=0)) {
    select_line=prev_item->text(4).toInt();
  }
  RDListViewItem *item;
  RDEventLine *eventline;

  edit_clocks_list->clear();
  item=new RDListViewItem(edit_clocks_list);
  item->setText(2,tr("--- End of clock ---"));
  for(int i=edit_clock->size()-1;i>=0;i--) {
    if((eventline=edit_clock->eventLine(i))!=NULL) {
      item=new RDListViewItem(edit_clocks_list);
      item->setText(0,eventline->startTime().toString("mm:ss.zzz").left(7));
      item->setText(1,eventline->startTime().
		    addMSecs(eventline->length()).toString("mm:ss.zzz").
		    left(7));
      item->setText(3,RDGetTimeLength(eventline->length(),false,true));
      item->setText(2,QString().sprintf("%s [%s]",
		    (const char *)eventline->name(),
		    (const char *)eventline->properties()));
      item->setText(4,QString().sprintf("%d",i));
      if(eventline->color().isValid()) {
	item->setBackgroundColor(eventline->color());
      }
      if(i==select_line) {
	edit_clocks_list->setSelected(item,true);
      }
    }
  }
}
void ListReplicatorCarts::RefreshList()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *item;

  list_view->clear();
  sql=QString("select ")+
    "REPL_CART_STATE.ID,"+
    "CART.TYPE,"+
    "REPL_CART_STATE.CART_NUMBER,"+
    "CART.TITLE,"+
    "REPL_CART_STATE.ITEM_DATETIME,"+
    "REPL_CART_STATE.POSTED_FILENAME "+
    "from REPL_CART_STATE left join CART "+
    "on REPL_CART_STATE.CART_NUMBER=CART.NUMBER where "+
    "REPLICATOR_NAME=\""+RDEscapeString(list_replicator_name)+"\"";
  q=new RDSqlQuery(sql);
  while (q->next()) {
    item=new RDListViewItem(list_view);
    item->setId(q->value(0).toInt());
    item->setText(1,QString().sprintf("%06u",q->value(2).toUInt()));
    switch((RDCart::Type)q->value(1).toInt()) {
    case RDCart::Audio:
      item->setPixmap(0,*list_playout_map);
      break;

    case RDCart::Macro:
      item->setPixmap(0,*list_macro_map);
      break;

    case RDCart::All:
      break;
    }
    item->setText(2,q->value(3).toString());
    item->setText(3,q->value(4).toDateTime().toString("hh:mm:ss dd/MM/yyyy"));
    item->setText(4,q->value(5).toString());
  }
  delete q;
}
Beispiel #7
0
void ListUsers::RefreshList()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *item;

  list_users_view->clear();
  sql="select ADMIN_CONFIG_PRIV,LOGIN_NAME,FULL_NAME,DESCRIPTION from USERS";
  q=new RDSqlQuery(sql);
  while (q->next()) {
    item=new RDListViewItem(list_users_view);
    if(q->value(0).toString()=="Y") {
      item->setPixmap(0,*list_admin_map);
    }
    else {
      item->setPixmap(0,*list_user_map);
    }
    item->setText(1,q->value(1).toString());
    item->setText(2,q->value(2).toString());
    item->setText(3,q->value(3).toString());
  }
  delete q;
}
Beispiel #8
0
void ListAuxFields::RefreshList()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *item;

  list_list_view->clear();
  sql=QString().sprintf("select ID,VAR_NAME,CAPTION from AUX_METADATA \
                         where FEED_ID=%u order by CAPTION",list_feed_id);
  q=new RDSqlQuery(sql);
  while(q->next()) {
    item=new RDListViewItem(list_list_view);
    item->setId(q->value(0).toInt());
    item->setText(0,q->value(1).toString());
    item->setText(1,q->value(2).toString());
  }
  delete q;
}
void EditJack::RefreshList()
{
  RDListViewItem *l;

  edit_jack_client_view->clear();
  QString sql=QString().
    sprintf("select ID,DESCRIPTION,COMMAND_LINE from JACK_CLIENTS \
             where STATION_NAME=\"%s\" order by DESCRIPTION",
	    (const char *)edit_station->name());
  RDSqlQuery *q=new RDSqlQuery(sql);
  while(q->next()) {
    l=new RDListViewItem(edit_jack_client_view);
    l->setId(q->value(0).toInt());
    l->setText(0,q->value(1).toString());
    l->setText(1,q->value(2).toString());
  }
  delete q;
}
Beispiel #10
0
void EditSchedRules::importData()
{
  QString clockname = "";
  QString str;
  RDListViewItem *item;
  QString sql;
  RDSqlQuery *q;

  ListClocks *listclocks=new ListClocks(&clockname,this);
  listclocks->setCaption(tr("Import Rules from Clock"));
  if(listclocks->exec()<0) {
    delete listclocks;
    return;
  }
  delete listclocks;
  SchedRulesList *import_list=new SchedRulesList(clockname); 

  list_schedCodes_view->clear();
  for (int i=0; i<import_list->getNumberOfItems(); i++)  
    {
    item=new RDListViewItem(list_schedCodes_view);
    item->setId(i);
    item->setText(0,import_list->getItemSchedCode(i));
    str=QString().sprintf("%d",import_list->getItemMaxRow(i));
    item->setText(1,str);
    str=QString().sprintf("%d",import_list->getItemMinWait(i));
    item->setText(2,str);
    item->setText(3,import_list->getItemNotAfter(i));
    item->setText(4,import_list->getItemOrAfter(i));
    item->setText(5,import_list->getItemOrAfterII(i));
    item->setText(6,import_list->getItemDescription(i));
    }
  delete import_list;

  sql=QString().sprintf("select ARTISTSEP from CLOCKS where NAME=\"%s\"",(const char *)clockname); 
  q=new RDSqlQuery(sql);
  if (q->first())
    {
    *edit_artistsep = q->value(0).toUInt();
    artistSepSpinBox->setValue( *edit_artistsep );
    }
  delete q; 
  edit_modified=true;
}
Beispiel #11
0
void EditSchedRules::Load()
{
  QString str;
  RDListViewItem *item;

  list_schedCodes_view->clear();
  for (int i=0; i<sched_rules_list->getNumberOfItems(); i++) {
    item=new RDListViewItem(list_schedCodes_view);
    item->setId(i);
    item->setText(0,sched_rules_list->getItemSchedCode(i));
    str=QString().sprintf("%d",sched_rules_list->getItemMaxRow(i));
    item->setText(1,str);
    str=QString().sprintf("%d",sched_rules_list->getItemMinWait(i));
    item->setText(2,str);
    item->setText(3,sched_rules_list->getItemNotAfter(i));
    item->setText(4,sched_rules_list->getItemOrAfter(i));
    item->setText(5,sched_rules_list->getItemOrAfterII(i));
    item->setText(6,sched_rules_list->getItemDescription(i));
  }
}
void RDCutDialog::RefreshCarts()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *l;
  QString group=cut_group_box->currentText();

  if(!cut_cutname->isEmpty()) {
  }
  cut_cart_list->clear();
  if(group==QString(tr("ALL"))) {
    group="";
  }
  QString schedcode="";
  if(cut_schedcode_box->currentText()!=tr("ALL")) {
    schedcode=cut_schedcode_box->currentText();
  }
  sql=QString().sprintf("select CART.NUMBER,CART.TITLE,CART.GROUP_NAME,\
                         GROUPS.COLOR,CART.TYPE from CART left join GROUPS \
                         on CART.GROUP_NAME=GROUPS.NAME \
                         %s&&(CART.TYPE=%u)",
			(const char *)RDCartSearchText(cut_filter_edit->text(),
						       group,schedcode.utf8(),
						       false),
			RDCart::Audio);
  if(cut_exclude_tracks) {
    sql+="&&(CART.OWNER is null)";
  }
  if(cart_limit_box->isChecked()) {
    sql+=QString().sprintf(" limit %d",RD_LIMITED_CART_SEARCH_QUANTITY);
  }
  q=new RDSqlQuery(sql);
  int step=0;
  int count=0;
  cut_progress_dialog->setTotalSteps(q->size()/RDCUT_DIALOG_STEP_SIZE);
  cut_progress_dialog->setProgress(0);
  while(q->next()) {
    l=new RDListViewItem(cut_cart_list);
    switch((RDCart::Type)q->value(4).toUInt()) {
    case RDCart::Audio:
      l->setPixmap(0,*cut_playout_map);
      break;

    case RDCart::All:
    case RDCart::Macro:
      break;
    }
    l->setText(1,QString().sprintf("%06u",q->value(0).toUInt()));   // Number

    l->setText(2,q->value(1).toString());     // Title
    l->setText(3,q->value(2).toString());     // Group
    l->setTextColor(3,q->value(3).toString(),QFont::Bold);
    if(count++>RDCUT_DIALOG_STEP_SIZE) {
      cut_progress_dialog->setProgress(++step);
      count=0;
      qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
    }
  }
  cut_progress_dialog->reset();
  delete q;
  cut_search_button->setDisabled(true);
}
Beispiel #13
0
void TestImport::importData()
{
  RDListViewItem *item;
  int next_line=0;

  test_events_list->clear();
  if(!test_svc->import(test_src,test_date_edit->date(),test_svc->breakString(),
		       test_svc->trackString(test_src),QString().
		       sprintf("%s_TEST_IMP",
			       (const char *)test_svc->name()))) {
    QMessageBox::information(this,tr("Import Error"),
			     tr("There was an error during import\nplease check your settings and try again."));
    return;
  }
  QString sql=QString("select ")+
    "TYPE,"+           // 00
    "START_HOUR,"+     // 01
    "START_SECS,"+     // 02
    "EXT_CART_NAME,"+  // 03
    "LENGTH,"+         // 04
    "EXT_DATA,"+       // 05
    "EXT_EVENT_ID,"+   // 06
    "EXT_ANNC_TYPE,"+  // 07
    "TITLE,"+          // 08
    "TRANS_TYPE,"+     // 09
    "TIME_TYPE,"+      // 10
    "GRACE_TIME "+     // 11
    "from `"+RDEscapeString(test_svc->name())+"_TEST_IMP`";
  RDSqlQuery *q=new RDSqlQuery(sql);
  while(q->next()) {
    item=new RDListViewItem(test_events_list);
    item->setLine(next_line++);
    item->setText(0,RDSvc::timeString(q->value(1).toInt(),
                                     q->value(2).toInt()));
    item->setText(3,q->value(8).toString());
    switch((RDSvc::ImportType)q->value(0).toInt()) {
    case RDSvc::Cart:
    case RDSvc::Label:
      item->setText(1,q->value(3).toString());
      if(q->value(4).toInt()>=0) {
       item->setText(2,RDGetTimeLength(q->value(4).toInt(),false,false));
      }
      item->
       setText(4,RDLogLine::transText((RDLogLine::TransType)q->value(9).toInt()));
      if(q->value(10).toInt()==RDLogLine::Hard) {
       if(q->value(11).toInt()<0) {
         item->setText(5,tr("Make Next"));
       }
       else {
         item->setText(5,tr("Start Immediately"));
         if(q->value(11).toInt()>0) {
           item->setText(6,RDGetTimeLength(q->value(11).toInt(),true,false));
         }
       }
      }
      item->setText(7,q->value(5).toString());
      item->setText(8,q->value(6).toString());
      item->setText(9,q->value(7).toString());
      break;

    case RDSvc::Break:
      item->setText(2,RDGetTimeLength(q->value(4).toInt(),false,false));
      break;

    case RDSvc::Track:
      break;
    }
  }
  delete q;
  if(getenv(RD_DEBUG_KEEP_IMPORT_TABLE)==NULL) {
    sql=QString().sprintf("drop table `%s_TEST_IMP`",
                         (const char *)test_svc->name());
    q=new RDSqlQuery(sql);
    delete q;
  }
  else {
    printf("RDAdmin - IMPORT TABLE: %s_TEST_IMP\n",
          (const char *)test_svc->name());
  }
}
Beispiel #14
0
void RDCartDialog::RefreshCarts()
{
  QString sql;
  RDSqlQuery *q;
  RDListViewItem *l;

  cart_cart_list->clear();
  QString group=cart_group_box->currentText();
  if(group==QString(tr("ALL"))) {
    group="";
  }
  QString schedcode=cart_schedcode_box->currentText();
  if(group==QString(tr("ALL"))) {
    schedcode="";
  }
  if(cart_type==RDCart::All) {
    sql=QString("select ")+
      "CART.NUMBER,"+          // 00
      "CART.TITLE,"+           // 01
      "CART.ARTIST,"+          // 02
      "CART.CLIENT,"+          // 03
      "CART.AGENCY,"+          // 04
      "CART.USER_DEFINED,"+    // 05
      "CART.COMPOSER,"+        // 06
      "CART.CONDUCTOR,"+       // 07
      "CART.START_DATETIME,"+  // 08
      "CART.END_DATETIME,"+    // 09
      "CART.TYPE,"+            // 10
      "CART.FORCED_LENGTH,"+   // 11
      "CART.GROUP_NAME,"+      // 12
      "GROUPS.COLOR "+         // 13
      "from CART left join GROUPS "+
      "on CART.GROUP_NAME=GROUPS.NAME where "+
      GetSearchFilter(cart_filter_edit->text(),group,schedcode);
  }
  else {
    sql=QString("select ")+
      "CART.NUMBER,"+          // 00
      "CART.TITLE,"+           // 01
      "CART.ARTIST,"+          // 02
      "CART.CLIENT,"+          // 03
      "CART.AGENCY,"+          // 04
      "CART.USER_DEFINED,"+    // 05
      "CART.COMPOSER,"+        // 06
      "CART.CONDUCTOR,"+       // 07
      "CART.START_DATETIME,"+  // 08
      "CART.END_DATETIME,"+    // 09
      "CART.TYPE,"+            // 10
      "CART.FORCED_LENGTH,"+   // 11
      "CART.GROUP_NAME,"+      // 12
      "GROUPS.COLOR "+         // 13
      "from CART left join GROUPS "+
      "on CART.GROUP_NAME=GROUPS.NAME where "+
      "("+GetSearchFilter(cart_filter_edit->text(),group,schedcode)+")&&"+
      QString().sprintf("(TYPE=%d)",cart_type);
  }
  if(cart_limit_box->isChecked()) {
    sql+=QString().sprintf(" limit %d",RD_LIMITED_CART_SEARCH_QUANTITY);
  }
  q=new RDSqlQuery(sql);
  int step=0;
  int count=0;
  cart_progress_dialog->setTotalSteps(q->size()/RDCART_DIALOG_STEP_SIZE);
  cart_progress_dialog->setProgress(0);
  while(q->next()) {
    l=new RDListViewItem(cart_cart_list);
    l->setId(q->value(10).toUInt());
    switch((RDCart::Type)q->value(10).toUInt()) {
	case RDCart::Audio:
	  l->setPixmap(0,*cart_playout_map);
	  break;

	case RDCart::Macro:
	  l->setPixmap(0,*cart_macro_map);
	  break;

	default:
	  break;
    }
    l->setText(1,QString().sprintf("%06d",q->value(0).toUInt())); // Number
    l->setText(2,RDGetTimeLength(q->value(11).toInt(),false,true)); // Length
    l->setText(3,q->value(1).toString());                       // Title
    l->setText(4,q->value(2).toString());                       // Artist
    l->setText(5,q->value(12).toString());                      // Group
    l->setText(6,q->value(6).toString());                      // Composer
    l->setText(7,q->value(7).toString());                      // Conductor
    l->setTextColor(5,q->value(13).toString(),QFont::Bold);
    l->setText(8,q->value(3).toString());                       // Client
    l->setText(9,q->value(4).toString());                       // Agency
    l->setText(10,q->value(5).toString());                       // User Defined
    if(!q->value(8).toDate().isNull()) {
      l->setText(11,q->value(8).toDate().toString("MM/dd/yyyy"));  // Start Date
    }
    if(!q->value(10).toDate().isNull()) {
      l->setText(12,q->value(9).toDate().toString("MM/dd/yyyy"));  // End Date
    }
    else {
      l->setText(12,"TFN");
    }
    if(count++>RDCART_DIALOG_STEP_SIZE) {
      cart_progress_dialog->setProgress(++step);
      count=0;
      qApp->processEvents(QEventLoop::ExcludeUserInput);
    }
  }
  cart_progress_dialog->reset();
  delete q;
  cart_search_button->setDisabled(true);
}