void ScanManager::runStartupScan() { qDebug() << Q_FUNC_INFO; if ( !Database::instance() || ( Database::instance() && !Database::instance()->isReady() ) ) QTimer::singleShot( 1000, this, SLOT( runStartupScan() ) ); else runScan(); }
void ScanManager::scanTimerTimeout() { qDebug() << Q_FUNC_INFO; if ( !TomahawkSettings::instance()->watchForChanges() || !Database::instance() || ( Database::instance() && !Database::instance()->isReady() ) ) return; else runScan(); }
void Spectrometer_Control::scan(int start, int stop, int accuracy) { emit stepperMoving(); //qDebug() << "Current start value is: " << QString::number(start) << " and current MonoPos value is: " << QString::number(MonoPos); if(start != MonoPos) { //qDebug() << "Start is not in MonoPos, moving!"; int steps = fabs(MonoPos - start); bool dir = (start - MonoPos) >= 0; // emit moveStepperToTarget(steps, dir); moveStepper(steps, dir); } emit runScan(0, fabs(stop - start), accuracy); }
void ScanManager::onSettingsChanged() { if ( !TomahawkSettings::instance()->watchForChanges() && m_scanTimer->isActive() ) m_scanTimer->stop(); m_scanTimer->setInterval( TomahawkSettings::instance()->scannerTime() * 1000 ); if ( TomahawkSettings::instance()->hasScannerPaths() && m_currScannerPaths != TomahawkSettings::instance()->scannerPaths() ) { m_currScannerPaths = TomahawkSettings::instance()->scannerPaths(); runScan(); } if ( TomahawkSettings::instance()->watchForChanges() && !m_scanTimer->isActive() ) m_scanTimer->start(); }
static void MusicCallback(void *data, QString &selection) { (void) data; QString sel = selection.toLower(); if (sel == "music_create_playlist") startDatabaseTree(); else if (sel == "music_play") startPlayback(); else if (sel == "stream_play") startStreamPlayback(); else if (sel == "music_rip") { startRipper(); } else if (sel == "music_import") { startImport(); } else if (sel == "settings_scan") { runScan(); } else if (sel == "settings_general") { MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); GeneralSettings *gs = new GeneralSettings(mainStack, "general settings"); if (gs->Create()) mainStack->AddScreen(gs); else delete gs; } else if (sel == "settings_player") { MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); PlayerSettings *ps = new PlayerSettings(mainStack, "player settings"); if (ps->Create()) mainStack->AddScreen(ps); else delete ps; } else if (sel == "settings_rating") { MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); RatingSettings *rs = new RatingSettings(mainStack, "rating settings"); if (rs->Create()) mainStack->AddScreen(rs); else delete rs; } else if (sel == "settings_visualization") { MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); VisualizationSettings *vs = new VisualizationSettings(mainStack, "visualization settings"); if (vs->Create()) mainStack->AddScreen(vs); else delete vs; } else if (sel == "settings_import") { MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); ImportSettings *is = new ImportSettings(mainStack, "import settings"); if (is->Create()) mainStack->AddScreen(is); else delete is; } }