~mattmik/mixxx/mic_modifications

« back to all changes in this revision

Viewing changes to mixxx/src/engine/cuecontrol.cpp

  • Committer: Matt Mikolay
  • Date: 2012-10-22 14:10:21 UTC
  • mfrom: (3255.1.46 mixxx-trunk)
  • Revision ID: mikolaym@yahoo.com-20121022141021-9hxxx5o4amaqqw80
MergingĀ fromĀ lp:mixxx

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
}
135
135
 
136
136
void CueControl::attachCue(Cue* pCue, int hotCue) {
137
 
    Q_ASSERT(hotCue >= 0 && hotCue < m_iNumHotCues);
 
137
    if (hotCue < 0 || hotCue >= m_iNumHotCues) {
 
138
        return;
 
139
    }
138
140
    HotcueControl* pControl = m_hotcueControl[hotCue];
139
141
    if (pControl->getCue() != NULL) {
140
142
        detachCue(pControl->getHotcueNumber());
149
151
}
150
152
 
151
153
void CueControl::detachCue(int hotCue) {
152
 
    Q_ASSERT(hotCue >= 0 && hotCue < m_iNumHotCues);
 
154
    if (hotCue < 0 || hotCue >= m_iNumHotCues) {
 
155
        return;
 
156
    }
153
157
    HotcueControl* pControl = m_hotcueControl[hotCue];
154
158
    Cue* pCue = pControl->getCue();
155
159
    if (!pCue)
161
165
}
162
166
 
163
167
void CueControl::loadTrack(TrackPointer pTrack) {
164
 
    Q_ASSERT(pTrack);
165
 
 
166
168
    QMutexLocker lock(&m_mutex);
167
169
    if (m_pLoadedTrack)
168
170
        unloadTrack(m_pLoadedTrack);
169
171
 
 
172
    if (!pTrack) {
 
173
        return;
 
174
    }
 
175
 
170
176
    m_pLoadedTrack = pTrack;
171
177
    connect(pTrack.data(), SIGNAL(cuesUpdated()),
172
178
            this, SLOT(trackCuesUpdated()),
376
382
void CueControl::hotcueGotoAndPlay(HotcueControl* pControl, double v) {
377
383
    if (!v)
378
384
        return;
379
 
    
 
385
 
380
386
    QMutexLocker lock(&m_mutex);
381
387
    if (!m_pLoadedTrack)
382
388
        return;
383
 
    
 
389
 
384
390
    Cue* pCue = pControl->getCue();
385
 
    
 
391
 
386
392
    // Need to unlock before emitting any signals to prevent deadlock.
387
393
    lock.unlock();
388
 
    
 
394
 
389
395
    if (pCue) {
390
396
        int position = pCue->getPosition();
391
397
        if (position != -1) {