示例#1
0
void PlaylistEdit::on_coverLoadButton_clicked()
{
	ppl6::CString Dir=wm->conf.LastCoverPath+"/";
	if (Dir.IsEmpty()) {
		Dir=QDir::homePath();
	}
	QString newfile = QFileDialog::getOpenFileName(this, tr("Select cover image"),
			Dir,
			tr("Images (*.png *.bmp *.jpg)"));
	if (newfile.isNull()) return;

	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
	wm->conf.LastCoverPath=ppl6::GetPath(newfile);
	wm->conf.Save();
	if (!Cover.load(newfile)) {
		QApplication::restoreOverrideCursor();
		QMessageBox::critical(this,tr("Error: could not load Cover"),
				tr("The specified file could not be loaded.\nPlease check if the file exists, is readable and contains an image format, which is supported by WinMusik (.png, .jpg or .bmp)")
				);
		return;
	} else {
		saveCover(Filename,Cover);
		QApplication::restoreOverrideCursor();
		updateCover();
	}
}
示例#2
0
void GMRemote::update_cover_display() {
  if (cover) {
    delete cover;
    cover=nullptr;
    }
  cover = GMCover::copyToImage(GMPlayerManager::instance()->getCoverManager()->getCover(),64);
  updateCover();
  }
示例#3
0
void PlaylistEdit::loadCover(const ppl6::CID3Tag &Tag)
{
	ppl6::CBinary cover;
	Tag.GetPicture(3,cover);
	if (cover.Size()>0) {
		Cover.loadFromData((const uchar*)cover.GetPtr(),cover.GetSize());
		updateCover();
	}
}
示例#4
0
// Destroy main window
GMRemote::~GMRemote(){
  volumeslider->setTarget(nullptr);
  volumeslider->setSelector(0);
  volumebutton->setMenu(nullptr);

  if (cover) {
    delete cover;
    cover=nullptr;
    }
  updateCover();
  }
示例#5
0
void PlaylistEdit::on_coverInsertButton_clicked()
{
	QClipboard *clipboard = QApplication::clipboard();
	if (!clipboard) return;
	if (clipboard->pixmap().isNull()) return;
	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
	Cover=clipboard->pixmap();
	saveCover(Filename,Cover);
	updateCover();
	QApplication::restoreOverrideCursor();
}
示例#6
0
void GMRemote::reset(){
  title_label->setText("Goggles Music Manager");
  title_label->setJustify(JUSTIFY_CENTER_X);
  title_label->setLayoutHints(LAYOUT_CENTER_Y|LAYOUT_FILL_X);
  title_label->setTipText(FXString::null);
  artistalbum_label->setText(FXString::null);
  artistalbum_label->setTipText(FXString::null);
  artistalbum_label->hide();
  time_label->setText("--:--");

  trackslider->disable();
  trackslider->setProgress(0);

  if (cover) {
    delete cover;
    cover=nullptr;
    }
  updateCover();

  recalc();
  layout();
  }
void CoverArtWidget::showEvent(QShowEvent *event) {
    updateCover();
    QDockWidget::showEvent(event);
}
void CoverArtWidget::trackChanged(DB_playItem_t *, DB_playItem_t *to) {
    if (isVisible())
        updateCover(to);
}