EncryptioNgSimliteDecryptor::EncryptioNgSimliteDecryptor(const Account &account, EncryptionProvider *provider, QObject *parent) : Decryptor(provider, parent), MyAccount(account) { connect(KeysManager::instance(), SIGNAL(keyAdded(Key)), this, SLOT(keyUpdated(Key))); connect(KeysManager::instance(), SIGNAL(keyUpdated(Key)), this, SLOT(keyUpdated(Key))); connect(KeysManager::instance(), SIGNAL(keyRemoved(Key)), this, SLOT(keyUpdated(Key))); updateKey(); }
void TrackInfoObject::setKeys(Keys keys) { QMutexLocker lock(&m_qMutex); setDirty(true); m_keys = keys; // Might be INVALID. We don't care. mixxx::track::io::key::ChromaticKey newKey = m_keys.getGlobalKey(); lock.unlock(); emit(keyUpdated(KeyUtils::keyToNumericValue(newKey))); emit(keysUpdated()); }
void TrackInfoObject::setKey(mixxx::track::io::key::ChromaticKey key, mixxx::track::io::key::Source source) { QMutexLocker lock(&m_qMutex); bool dirty = false; if (key == mixxx::track::io::key::INVALID) { m_keys = Keys(); dirty = true; } else if (m_keys.getGlobalKey() != key) { m_keys = KeyFactory::makeBasicKeys(key, source); } if (dirty) { setDirty(true); } // Might be INVALID. We don't care. mixxx::track::io::key::ChromaticKey newKey = m_keys.getGlobalKey(); lock.unlock(); emit(keyUpdated(KeyUtils::keyToNumericValue(newKey))); emit(keysUpdated()); }
void TrackInfoObject::setKeyText(QString key, mixxx::track::io::key::Source source) { QMutexLocker lock(&m_qMutex); Keys newKeys = KeyFactory::makeBasicKeysFromText(key, source); // We treat this as dirtying if it is parsed to a different key or if we // fail to parse the key, if the text value is different from the current // text value. bool dirty = newKeys.getGlobalKey() != m_keys.getGlobalKey() || (newKeys.getGlobalKey() == mixxx::track::io::key::INVALID && newKeys.getGlobalKeyText() != m_keys.getGlobalKeyText()); if (dirty) { m_keys = newKeys; setDirty(true); // Might be INVALID. We don't care. mixxx::track::io::key::ChromaticKey newKey = m_keys.getGlobalKey(); lock.unlock(); emit(keyUpdated(KeyUtils::keyToNumericValue(newKey))); emit(keysUpdated()); } }
EncryptioNgSimliteDecryptor::~EncryptioNgSimliteDecryptor() { disconnect(KeysManager::instance(), SIGNAL(keyAdded(Key)), this, SLOT(keyUpdated(Key))); disconnect(KeysManager::instance(), SIGNAL(keyUpdated(Key)), this, SLOT(keyUpdated(Key))); disconnect(KeysManager::instance(), SIGNAL(keyRemoved(Key)), this, SLOT(keyUpdated(Key))); }