本文整理汇总了C++中TrackPointer::getCanonicalLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackPointer::getCanonicalLocation方法的具体用法?C++ TrackPointer::getCanonicalLocation怎么用?C++ TrackPointer::getCanonicalLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrackPointer
的用法示例。
在下文中一共展示了TrackPointer::getCanonicalLocation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initSoundSource
SoundSourceProxy::SoundSourceProxy(const TrackPointer& pTrack)
: m_pTrack(pTrack),
m_url(QUrl::fromLocalFile(pTrack->getCanonicalLocation())),
m_soundSourceProviderRegistrations(findSoundSourceProviderRegistrations(m_url)),
m_soundSourceProviderRegistrationIndex(0) {
initSoundSource();
}
示例2: slotLoadTrack
void BaseTrackPlayer::slotLoadTrack(TrackPointer track, bool bPlay) {
// Before loading the track, ensure we have access. This uses lazy
// evaluation to make sure track isn't NULL before we dereference it.
if (!track.isNull() && !Sandbox::askForAccess(track->getCanonicalLocation())) {
// We don't have access.
return;
}
//Disconnect the old track's signals.
if (m_pLoadedTrack) {
// Save the loops that are currently set in a loop cue. If no loop cue is
// currently on the track, then create a new one.
int loopStart = m_pLoopInPoint->get();
int loopEnd = m_pLoopOutPoint->get();
if (loopStart != -1 && loopEnd != -1 &&
even(loopStart) && even(loopEnd) && loopStart <= loopEnd) {
Cue* pLoopCue = NULL;
QList<Cue*> cuePoints = m_pLoadedTrack->getCuePoints();
QListIterator<Cue*> it(cuePoints);
while (it.hasNext()) {
Cue* pCue = it.next();
if (pCue->getType() == Cue::LOOP) {
pLoopCue = pCue;
}
}
if (!pLoopCue) {
pLoopCue = m_pLoadedTrack->addCue();
pLoopCue->setType(Cue::LOOP);
}
pLoopCue->setPosition(loopStart);
pLoopCue->setLength(loopEnd - loopStart);
}
// WARNING: Never. Ever. call bare disconnect() on an object. Mixxx
// relies on signals and slots to get tons of things done. Don't
// randomly disconnect things.
// m_pLoadedTrack->disconnect();
disconnect(m_pLoadedTrack.data(), 0, m_pBPM, 0);
disconnect(m_pLoadedTrack.data(), 0, this, 0);
disconnect(m_pLoadedTrack.data(), 0, m_pKey, 0);
m_pReplayGain->slotSet(0);
// Causes the track's data to be saved back to the library database.
emit(unloadingTrack(m_pLoadedTrack));
}
m_pLoadedTrack = track;
// Listen for updates to the file's BPM
connect(m_pLoadedTrack.data(), SIGNAL(bpmUpdated(double)),
m_pBPM, SLOT(slotSet(double)));
connect(m_pLoadedTrack.data(), SIGNAL(keyUpdated(double)),
m_pKey, SLOT(slotSet(double)));
// Listen for updates to the file's Replay Gain
connect(m_pLoadedTrack.data(), SIGNAL(ReplayGainUpdated(double)),
this, SLOT(slotSetReplayGain(double)));
//Request a new track from the reader
emit(loadTrack(track, bPlay));
}