~mr-unwell2006/mixxx/mixxx

« back to all changes in this revision

Viewing changes to mixxx/src/trackinfoobject.cpp

  • Committer: Raffitea
  • Date: 2011-12-28 12:17:39 UTC
  • Revision ID: raffitea-20111228121739-fb8c8qta7j6w48bn
Added code infrastrcture for bpm lock.

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
 
98
98
    m_bDirty = false;
99
99
    m_bLocationChanged = false;
 
100
 
100
101
}
101
102
 
102
103
void TrackInfoObject::populateLocation(QFileInfo& fileInfo) {
136
137
    m_dCreateDate = m_dateAdded = QDateTime::currentDateTime();
137
138
    m_Rating = 0;
138
139
    m_key = "";
 
140
    m_bBpmLock = false;
 
141
    m_bpmPluginKey = "";
139
142
 
140
143
    // parse() parses the metadata from file. This is not a quick operation!
141
144
    if (parseHeader) {
868
871
        setDirty(true);
869
872
}
870
873
 
 
874
void TrackInfoObject::setBpmLock(bool bpmLock){
 
875
    QMutexLocker lock(&m_qMutex);
 
876
    bool dirty = bpmLock != m_bBpmLock;
 
877
    m_bBpmLock = bpmLock;
 
878
    if (dirty)
 
879
        setDirty(true);
 
880
}
 
881
 
 
882
bool TrackInfoObject::hasBpmLock() const{
 
883
    QMutexLocker lock(&m_qMutex);
 
884
    return m_bBpmLock;
 
885
}
 
886
 
 
887
void TrackInfoObject::setBpmPluginKey(QString& pluginKey){
 
888
    QMutexLocker lock(&m_qMutex);
 
889
    bool dirty = pluginKey != m_bpmPluginKey;
 
890
    m_bpmPluginKey = pluginKey;
 
891
    if (dirty)
 
892
        setDirty(true);
 
893
}
 
894
 
 
895
QString TrackInfoObject::getBpmPluginKey() const{
 
896
    QMutexLocker lock(&m_qMutex);
 
897
    return m_bpmPluginKey;
 
898
}