本文整理汇总了C++中Cue::getLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ Cue::getLabel方法的具体用法?C++ Cue::getLabel怎么用?C++ Cue::getLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cue
的用法示例。
在下文中一共展示了Cue::getLabel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: populateCues
void DlgTrackInfo::populateCues(TrackPointer pTrack) {
int sampleRate = pTrack->getSampleRate();
QList<Cue*> listPoints;
const QList<Cue*>& cuePoints = pTrack->getCuePoints();
QListIterator<Cue*> it(cuePoints);
while (it.hasNext()) {
Cue* pCue = it.next();
if (pCue->getType() == Cue::CUE || pCue->getType() == Cue::LOAD) {
listPoints.push_back(pCue);
}
}
it = QListIterator<Cue*>(listPoints);
cueTable->setSortingEnabled(false);
int row = 0;
while (it.hasNext()) {
Cue* pCue = it.next();
QString rowStr = QString("%1").arg(row);
// All hotcues are stored in Cue's as 0-indexed, but the GUI presents
// them to the user as 1-indexex. Add 1 here. rryan 9/2010
int iHotcue = pCue->getHotCue() + 1;
QString hotcue = "";
if (iHotcue != -1) {
hotcue = QString("%1").arg(iHotcue);
}
int position = pCue->getPosition();
double totalSeconds;
if (position == -1)
continue;
else {
totalSeconds = float(position) / float(sampleRate) / 2.0;
}
int fraction = 100*(totalSeconds - floor(totalSeconds));
int seconds = int(totalSeconds) % 60;
int mins = int(totalSeconds) / 60;
//int hours = mins / 60; //Not going to worry about this for now. :)
//Construct a nicely formatted duration string now.
QString duration = QString("%1:%2.%3").arg(
QString::number(mins),
QString("%1").arg(seconds, 2, 10, QChar('0')),
QString("%1").arg(fraction, 2, 10, QChar('0')));
QTableWidgetItem* durationItem = new QTableWidgetItem(duration);
// Make the duration read only
durationItem->setFlags(Qt::NoItemFlags);
m_cueMap[row] = pCue;
cueTable->insertRow(row);
cueTable->setItem(row, 0, new QTableWidgetItem(rowStr));
cueTable->setItem(row, 1, durationItem);
cueTable->setItem(row, 2, new QTableWidgetItem(hotcue));
cueTable->setItem(row, 3, new QTableWidgetItem(pCue->getLabel()));
row += 1;
}
cueTable->setSortingEnabled(true);
}