本文整理汇总了C++中Metadata::CompilationArtist方法的典型用法代码示例。如果您正苦于以下问题:C++ Metadata::CompilationArtist方法的具体用法?C++ Metadata::CompilationArtist怎么用?C++ Metadata::CompilationArtist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Metadata
的用法示例。
在下文中一共展示了Metadata::CompilationArtist方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveDefaults
void ImportMusicDialog::saveDefaults(void)
{
Metadata *data = m_tracks->at(m_currentTrack)->metadata;
m_defaultCompilation = data->Compilation();
m_defaultCompArtist = data->CompilationArtist();
m_defaultArtist = data->Artist();
m_defaultAlbum = data->Album();
m_defaultGenre = data->Genre();
m_defaultYear = data->Year();
m_defaultRating = data->Rating();
m_haveDefaults = true;
}
示例2: fillWidgets
void ImportMusicDialog::fillWidgets()
{
if (m_tracks->size() > 0)
{
// update current
m_currentText->SetText(QString("%1 of %2")
.arg(m_currentTrack + 1).arg(m_tracks->size()));
Metadata *meta = m_tracks->at(m_currentTrack)->metadata;
m_filenameText->SetText(meta->Filename());
m_compilationCheck->SetCheckState(meta->Compilation());
m_compartistText->SetText(meta->CompilationArtist());
m_artistText->SetText(meta->Artist());
m_albumText->SetText(meta->Album());
m_titleText->SetText(meta->Title());
m_genreText->SetText(meta->Genre());
m_yearText->SetText(QString::number(meta->Year()));
m_trackText->SetText(QString::number(meta->Track()));
if (m_tracks->at(m_currentTrack)->isNewTune)
{
m_coverartButton->SetVisible(false);
m_statusText->SetText(tr("New File"));
}
else
{
m_coverartButton->SetVisible(true);
m_statusText->SetText(tr("Already in Database"));
}
}
else
{
// update current
m_currentText->SetText(tr("Not found"));
m_filenameText->Reset();
m_compilationCheck->SetCheckState(false);
m_compartistText->Reset();
m_artistText->Reset();
m_albumText->Reset();
m_titleText->Reset();
m_genreText->Reset();
m_yearText->Reset();
m_trackText->Reset();
m_statusText->Reset();
m_coverartButton->SetVisible(false);
}
}
示例3: entered
void DatabaseBox::entered(UIListTreeType *treetype, UIListGenericTree *item)
{
if (!item || !treetype)
return;
// Determin if this is a CD entry
bool cd = false;
if (dynamic_cast<CDCheckItem*>(item))
cd = true;
TreeCheckItem *item_ptr = dynamic_cast<TreeCheckItem*>(item);
if (item_ptr
&& item->childCount() == 0
&& item_ptr->getLevel() == "title")
{
int id = item_ptr->getID();
Metadata *mdata;
if (!cd)
{
mdata = gMusicData->all_music->getMetadata(id);
if (!mdata)
return;
}
else
{
// Need to allocate storage for CD Metadata
mdata = new Metadata;
if (!gMusicData->all_music->getCDMetadata(id, mdata))
{
delete mdata;
return;
}
}
unsigned int line = 0;
QString tmpstr;
if (mdata->Compilation())
{
tmpstr = tr("Compilation Artist:\t") + mdata->CompilationArtist();
if (m_lines.at(line))
m_lines.at(line++)->SetText(tmpstr);
}
tmpstr = tr("Artist:\t") + mdata->Artist();
if (m_lines.at(line))
m_lines.at(line++)->SetText(tmpstr);
tmpstr = tr("Album:\t") + mdata->Album();
if (m_lines.at(line))
m_lines.at(line++)->SetText(tmpstr);
tmpstr = tr("Title:\t") + mdata->Title();
if (m_lines.at(line))
m_lines.at(line++)->SetText(tmpstr);
if (m_lines.at(line))
{
int maxTime = mdata->Length() / 1000;
int maxh = maxTime / 3600;
int maxm = (maxTime / 60) % 60;
int maxs = maxTime % 60;
QString timeStr;
if (maxh > 0)
timeStr.sprintf("%02d:%02d:%02d", maxh, maxm, maxs);
else
timeStr.sprintf("%02d:%02d", maxm, maxs);
tmpstr = tr("Length:\t") + timeStr;
m_lines.at(line++)->SetText(tmpstr);
}
tmpstr = tr("Genre: ") + mdata->Genre();
if (m_lines.at(line))
{
m_lines.at(line)->SetText(tmpstr);
}
else
{
QString prevvalue = m_lines.at(line-1)->GetText();
tmpstr = prevvalue + " " + tmpstr;
m_lines.at(line-1)->SetText(tmpstr);
}
// Pre increment as not incremented from previous use.
while (++line < (unsigned) m_lines.size())
m_lines.at(line)->SetText("");
// Don't forget to delete the mdata storage if we allocated it.
if (cd)
delete mdata;
return;
}
//.........这里部分代码省略.........
示例4: ScanFinished
void Ripper::ScanFinished()
{
delete m_scanThread;
m_scanThread = NULL;
m_tracks->clear();
bool isCompilation = false;
bool newTune = true;
if (m_decoder)
{
QString label;
Metadata *metadata;
m_artistName.clear();
m_albumName.clear();
m_genreName.clear();
m_year.clear();
bool yesToAll = false;
bool noToAll = false;
for (int trackno = 0; trackno < m_decoder->getNumTracks(); trackno++)
{
RipTrack *ripTrack = new RipTrack;
metadata = m_decoder->getMetadata(trackno + 1);
if (metadata)
{
ripTrack->metadata = metadata;
ripTrack->length = metadata->Length();
ripTrack->active = true;
if (metadata->Compilation())
{
isCompilation = true;
m_artistName = metadata->CompilationArtist();
}
else if (m_artistName.isEmpty())
{
m_artistName = metadata->Artist();
}
if (m_albumName.isEmpty())
m_albumName = metadata->Album();
if (m_genreName.isEmpty() && !metadata->Genre().isEmpty())
m_genreName = metadata->Genre();
if (m_year.isEmpty() && metadata->Year() > 0)
m_year = QString::number(metadata->Year());
QString title = metadata->Title();
newTune = Ripper::isNewTune(m_artistName, m_albumName, title);
if (newTune)
{
m_tracks->push_back(ripTrack);
}
else
{
if (yesToAll)
{
deleteTrack(m_artistName, m_albumName, title);
m_tracks->push_back(ripTrack);
}
else if (noToAll)
{
delete ripTrack;
delete metadata;
continue;
}
else
{
DialogBox *dlg = new DialogBox(
GetMythMainWindow(),
tr("Artist: %1\n"
"Album: %2\n"
"Track: %3\n\n"
"This track is already in the database. \n"
"Do you want to remove the existing track?")
.arg(m_artistName).arg(m_albumName).arg(title));
dlg->AddButton("No");
dlg->AddButton("No To All");
dlg->AddButton("Yes");
dlg->AddButton("Yes To All");
DialogCode res = dlg->exec();
dlg->deleteLater();
dlg = NULL;
if (kDialogCodeButton0 == res)
{
delete ripTrack;
delete metadata;
}
else if (kDialogCodeButton1 == res)
{
noToAll = true;
delete ripTrack;
delete metadata;
//.........这里部分代码省略.........
示例5: run
void CDRipperThread::run(void)
{
if (!m_tracks->size() > 0)
return;
Metadata *track = m_tracks->at(0)->metadata;
QString tots;
if (track->Compilation())
{
tots = track->CompilationArtist() + " ~ " + track->Album();
}
else
{
tots = track->Artist() + " ~ " + track->Album();
}
QApplication::postEvent(
m_parent,
new RipStatusEvent(RipStatusEvent::kOverallTextEvent, tots));
QApplication::postEvent(
m_parent,
new RipStatusEvent(RipStatusEvent::kOverallProgressEvent, 0));
QApplication::postEvent(
m_parent,
new RipStatusEvent(RipStatusEvent::kTrackProgressEvent, 0));
QString textstatus;
QString encodertype = gCoreContext->GetSetting("EncoderType");
bool mp3usevbr = gCoreContext->GetNumSetting("Mp3UseVBR", 0);
m_totalSectors = 0;
m_totalSectorsDone = 0;
for (int trackno = 0; trackno < m_tracks->size(); trackno++)
{
m_totalSectors += getSectorCount(m_CDdevice, trackno + 1);
}
QApplication::postEvent(m_parent,
new RipStatusEvent(RipStatusEvent::kOverallStartEvent, m_totalSectors));
if (LCD *lcd = LCD::Get())
{
QString lcd_tots = QObject::tr("Importing ") + tots;
QList<LCDTextItem> textItems;
textItems.append(LCDTextItem(1, ALIGN_CENTERED,
lcd_tots, "Generic", false));
lcd->switchToGeneric(textItems);
}
Metadata *titleTrack = NULL;
QString outfile;
std::auto_ptr<Encoder> encoder;
for (int trackno = 0; trackno < m_tracks->size(); trackno++)
{
if (isCancelled())
break;
QApplication::postEvent(
m_parent,
new RipStatusEvent(RipStatusEvent::kStatusTextEvent,
QString("Track %1 of %2")
.arg(trackno + 1).arg(m_tracks->size())));
QApplication::postEvent(
m_parent,
new RipStatusEvent(RipStatusEvent::kTrackProgressEvent, 0));
track = m_tracks->at(trackno)->metadata;
if (track)
{
textstatus = track->Title();
QApplication::postEvent(
m_parent,
new RipStatusEvent(
RipStatusEvent::kTrackTextEvent, textstatus));
QApplication::postEvent(
m_parent,
new RipStatusEvent(RipStatusEvent::kTrackProgressEvent, 0));
QApplication::postEvent(
m_parent,
new RipStatusEvent(RipStatusEvent::kTrackPercentEvent, 0));
// do we need to start a new file?
if (m_tracks->at(trackno)->active)
{
titleTrack = track;
titleTrack->setLength(m_tracks->at(trackno)->length);
outfile = Ripper::filenameFromMetadata(track);
if (m_quality < 3)
{
if (encodertype == "mp3")
{
outfile += ".mp3";
encoder.reset(new LameEncoder(outfile, m_quality,
//.........这里部分代码省略.........
示例6: ScanFinished
void Ripper::ScanFinished()
{
delete m_scanThread;
m_scanThread = NULL;
m_tracks->clear();
bool isCompilation = false;
if (m_decoder)
{
QString label;
Metadata *metadata;
m_artistName.clear();
m_albumName.clear();
m_genreName.clear();
m_year.clear();
for (int trackno = 0; trackno < m_decoder->getNumTracks(); trackno++)
{
RipTrack *ripTrack = new RipTrack;
metadata = m_decoder->getMetadata(trackno + 1);
if (metadata)
{
ripTrack->metadata = metadata;
ripTrack->length = metadata->Length();
if (metadata->Compilation())
{
isCompilation = true;
m_artistName = metadata->CompilationArtist();
}
else if (m_artistName.isEmpty())
{
m_artistName = metadata->Artist();
}
if (m_albumName.isEmpty())
m_albumName = metadata->Album();
if (m_genreName.isEmpty() && !metadata->Genre().isEmpty())
m_genreName = metadata->Genre();
if (m_year.isEmpty() && metadata->Year() > 0)
m_year = QString::number(metadata->Year());
QString title = metadata->Title();
ripTrack->isNew = isNewTune(m_artistName, m_albumName, title);
ripTrack->active = ripTrack->isNew;
m_tracks->push_back(ripTrack);
}
else
delete ripTrack;
}
m_artistEdit->SetText(m_artistName);
m_albumEdit->SetText(m_albumName);
m_genreEdit->SetText(m_genreName);
m_yearEdit->SetText(m_year);
m_compilationCheck->SetCheckState(isCompilation);
if (!isCompilation)
m_switchTitleArtist->SetVisible(false);
else
m_switchTitleArtist->SetVisible(true);
}
BuildFocusList();
updateTrackList();
CloseBusyPopup();
}