void EditMetadataDialog::updateImageGrid() { AlbumArtList *albumArtList = albumArt->getImageList(); QSize size = coverart_grid->getImageItemSize(); for (int x = 0; x < albumArtList->size(); x++) { if (albumArtList->at(x)->embedded) continue; QPixmap *pixmap = createScaledPixmap(albumArtList->at(x)->filename, size.width(), size.height(), Qt::KeepAspectRatio); ImageGridItem *item = new ImageGridItem(AlbumArtImages::getTypeName(albumArtList->at(x)->imageType), pixmap, false, (void*) albumArtList->at(x)); coverart_grid->appendItem(item); } coverart_grid->setItemCount(albumArtList->size()); coverart_grid->recalculateLayout(); if (!albumArtList->empty()) gridItemChanged(coverart_grid->getItemAt(0)); coverart_grid->refresh(); }
void Metadata::setEmbeddedAlbumArt(AlbumArtList &albumart) { // add the images found in the tag to the ones we got from the DB if (!m_albumArt) m_albumArt = new AlbumArtImages(this); for (int x = 0; x < albumart.size(); x++) { m_albumArt->addImage(albumart.at(x)); } m_changed = true; }
void EditAlbumartDialog::updateImageGrid(void) { AlbumArtList *albumArtList = m_albumArt->getImageList(); m_coverartList->Reset(); for (int x = 0; x < albumArtList->size(); x++) { MythUIButtonListItem *item = new MythUIButtonListItem(m_coverartList, AlbumArtImages::getTypeName(albumArtList->at(x)->imageType), qVariantFromValue(albumArtList->at(x))); item->SetImage(albumArtList->at(x)->filename); QString state = albumArtList->at(x)->embedded ? "tag" : "file"; item->DisplayState(state, "locationstate"); } }