@@ -55,11 +55,11 @@ DlgPrefWaveform::DlgPrefWaveform(
5555 m_pTypeControl->forceSet (cfgTypeIndex);
5656
5757 // Populate waveform options.
58- WaveformWidgetFactory* factory = WaveformWidgetFactory::instance ();
58+ auto * pFactory = WaveformWidgetFactory::instance ();
5959 // We assume that the original type list order remains constant.
6060 // We will use the type index later on to set waveform types and to
6161 // update the combobox.
62- QVector<WaveformWidgetAbstractHandle> types = factory ->getAvailableTypes ();
62+ QVector<WaveformWidgetAbstractHandle> types = pFactory ->getAvailableTypes ();
6363 for (int i = 0 ; i < types.size (); ++i) {
6464 if (types[i].getType () == WaveformWidgetType::Empty) {
6565 continue ;
@@ -190,7 +190,7 @@ DlgPrefWaveform::DlgPrefWaveform(
190190 this ,
191191 &DlgPrefWaveform::slotSetOverviewMinuteMarkers);
192192
193- connect (factory ,
193+ connect (pFactory ,
194194 &WaveformWidgetFactory::waveformMeasured,
195195 this ,
196196 &DlgPrefWaveform::slotWaveformMeasured);
@@ -244,25 +244,24 @@ DlgPrefWaveform::DlgPrefWaveform(
244244
245245void DlgPrefWaveform::slotSetWaveformOptions (
246246 allshader::WaveformRendererSignalBase::Option option, bool enabled) {
247- auto * factory = WaveformWidgetFactory::instance ();
248- factory ->setWaveformOption (option, enabled);
247+ auto * pFactory = WaveformWidgetFactory::instance ();
248+ pFactory ->setWaveformOption (option, enabled);
249249 auto type = static_cast <WaveformWidgetType::Type>(
250250 waveformTypeComboBox->currentData ().toInt ());
251- factory ->setWidgetTypeFromHandle (
252- factory ->findHandleIndexFromType (type), true );
251+ pFactory ->setWidgetTypeFromHandle (
252+ pFactory ->findHandleIndexFromType (type), true );
253253}
254254
255255void DlgPrefWaveform::slotUpdate () {
256- WaveformWidgetFactory* factory = WaveformWidgetFactory::instance ();
257-
258- if (factory->isOpenGlAvailable () || factory->isOpenGlesAvailable ()) {
259- openGlStatusData->setText (factory->getOpenGLVersion ());
256+ auto * pFactory = WaveformWidgetFactory::instance ();
257+ if (pFactory->isOpenGlAvailable () || pFactory->isOpenGlesAvailable ()) {
258+ openGlStatusData->setText (pFactory->getOpenGLVersion ());
260259 useAccelerationCheckBox->setEnabled (true );
261260 bool isAccelerationEnabled =
262- factory ->getBackendFromConfig () != WaveformWidgetBackend::None;
261+ pFactory ->getBackendFromConfig () != WaveformWidgetBackend::None;
263262 useAccelerationCheckBox->setChecked (isAccelerationEnabled);
264263 } else {
265- openGlStatusData->setText (tr (" OpenGL not available" ) + " : " + factory ->getOpenGLVersion ());
264+ openGlStatusData->setText (tr (" OpenGL not available" ) + " : " + pFactory ->getOpenGLVersion ());
266265 useAccelerationCheckBox->setEnabled (false );
267266 useAccelerationCheckBox->setChecked (false );
268267 }
@@ -273,7 +272,7 @@ void DlgPrefWaveform::slotUpdate() {
273272 waveformTypeComboBox->setCurrentIndex (indexOfCurrentType);
274273 }
275274
276- auto type = factory ->getType ();
275+ auto type = pFactory ->getType ();
277276 bool useWaveform = type != WaveformWidgetType::Empty;
278277 useWaveformCheckBox->setChecked (useWaveform);
279278
@@ -284,34 +283,34 @@ void DlgPrefWaveform::slotUpdate() {
284283 updateWaveformGeneralOptionsEnabled ();
285284 updateStemOptionsEnabled ();
286285
287- frameRateSpinBox->setValue (factory ->getFrameRate ());
288- frameRateSlider->setValue (factory ->getFrameRate ());
289- endOfTrackWarningTimeSpinBox->setValue (factory ->getEndOfTrackWarningTime ());
290- endOfTrackWarningTimeSlider->setValue (factory ->getEndOfTrackWarningTime ());
291- synchronizeZoomCheckBox->setChecked (factory ->isZoomSync ());
292- allVisualGain->setValue (factory ->getVisualGain (BandIndex::AllBand));
293- lowVisualGain->setValue (factory ->getVisualGain (BandIndex::Low));
294- midVisualGain->setValue (factory ->getVisualGain (BandIndex::Mid));
295- highVisualGain->setValue (factory ->getVisualGain (BandIndex::High));
286+ frameRateSpinBox->setValue (pFactory ->getFrameRate ());
287+ frameRateSlider->setValue (pFactory ->getFrameRate ());
288+ endOfTrackWarningTimeSpinBox->setValue (pFactory ->getEndOfTrackWarningTime ());
289+ endOfTrackWarningTimeSlider->setValue (pFactory ->getEndOfTrackWarningTime ());
290+ synchronizeZoomCheckBox->setChecked (pFactory ->isZoomSync ());
291+ allVisualGain->setValue (pFactory ->getVisualGain (BandIndex::AllBand));
292+ lowVisualGain->setValue (pFactory ->getVisualGain (BandIndex::Low));
293+ midVisualGain->setValue (pFactory ->getVisualGain (BandIndex::Mid));
294+ highVisualGain->setValue (pFactory ->getVisualGain (BandIndex::High));
296295 // Round zoom to int to get a default zoom index.
297- defaultZoomComboBox->setCurrentIndex (static_cast <int >(factory ->getDefaultZoom ()) - 1 );
298- playMarkerPositionSlider->setValue (static_cast <int >(factory ->getPlayMarkerPosition () * 100 ));
299- beatGridAlphaSpinBox->setValue (factory ->getBeatGridAlpha ());
300- beatGridAlphaSlider->setValue (factory ->getBeatGridAlpha ());
296+ defaultZoomComboBox->setCurrentIndex (static_cast <int >(pFactory ->getDefaultZoom ()) - 1 );
297+ playMarkerPositionSlider->setValue (static_cast <int >(pFactory ->getPlayMarkerPosition () * 100 ));
298+ beatGridAlphaSpinBox->setValue (pFactory ->getBeatGridAlpha ());
299+ beatGridAlphaSlider->setValue (pFactory ->getBeatGridAlpha ());
301300
302- untilMarkShowBeatsCheckBox->setChecked (factory ->getUntilMarkShowBeats ());
303- untilMarkShowTimeCheckBox->setChecked (factory ->getUntilMarkShowTime ());
301+ untilMarkShowBeatsCheckBox->setChecked (pFactory ->getUntilMarkShowBeats ());
302+ untilMarkShowTimeCheckBox->setChecked (pFactory ->getUntilMarkShowTime ());
304303 untilMarkAlignComboBox->setCurrentIndex (
305304 WaveformWidgetFactory::toUntilMarkAlignIndex (
306- factory ->getUntilMarkAlign ()));
307- untilMarkTextPointSizeSpinBox->setValue (factory ->getUntilMarkTextPointSize ());
305+ pFactory ->getUntilMarkAlign ()));
306+ untilMarkTextPointSizeSpinBox->setValue (pFactory ->getUntilMarkTextPointSize ());
308307 untilMarkTextHeightLimitComboBox->setCurrentIndex (
309308 WaveformWidgetFactory::toUntilMarkTextHeightLimitIndex (
310- factory ->getUntilMarkTextHeightLimit ()));
309+ pFactory ->getUntilMarkTextHeightLimit ()));
311310
312- stemReorderLayerOnChangedCheckBox->setChecked (factory ->isStemReorderOnChange ());
313- stemOpacitySpinBox->setValue (factory ->getStemOpacity ());
314- stemOutlineOpacitySpinBox->setValue (factory ->getStemOutlineOpacity ());
311+ stemReorderLayerOnChangedCheckBox->setChecked (pFactory ->isStemReorderOnChange ());
312+ stemOpacitySpinBox->setValue (pFactory ->getStemOpacity ());
313+ stemOutlineOpacitySpinBox->setValue (pFactory ->getStemOutlineOpacity ());
315314
316315 OverviewType cfgOverviewType =
317316 m_pConfig->getValue <OverviewType>(kOverviewTypeCfgKey , OverviewType::RGB );
@@ -322,7 +321,7 @@ void DlgPrefWaveform::slotUpdate() {
322321 waveformOverviewComboBox->setCurrentIndex (cfgOverviewTypeIndex);
323322 }
324323
325- if (factory ->isOverviewNormalized ()) {
324+ if (pFactory ->isOverviewNormalized ()) {
326325 overview_scale_normalize->setChecked (true );
327326 } else {
328327 overview_scale_allReplayGain->setChecked (true );
@@ -349,23 +348,23 @@ void DlgPrefWaveform::slotApply() {
349348}
350349
351350void DlgPrefWaveform::slotResetToDefaults () {
352- WaveformWidgetFactory* factory = WaveformWidgetFactory::instance ();
351+ auto * pFactory = WaveformWidgetFactory::instance ();
353352
354353 int defaultIndex = waveformTypeComboBox->findData (
355354 WaveformWidgetFactory::defaultType ());
356355 if (defaultIndex != -1 && waveformTypeComboBox->currentIndex () != defaultIndex) {
357356 waveformTypeComboBox->setCurrentIndex (defaultIndex);
358357 }
359- factory ->setDefaultBackend ();
358+ pFactory ->setDefaultBackend ();
360359 useWaveformCheckBox->setChecked (true );
361360 waveformTypeComboBox->setEnabled (true );
362- updateWaveformAcceleration (factory ->defaultType ());
361+ updateWaveformAcceleration (pFactory ->defaultType ());
363362
364363 // Restore waveform backend and option setting instantly
365- factory ->resetWaveformOptions ();
364+ pFactory ->resetWaveformOptions ();
366365 updateWaveformTypeOptions (true );
367- factory ->setWidgetTypeFromHandle (
368- factory ->findHandleIndexFromType (
366+ pFactory ->setWidgetTypeFromHandle (
367+ pFactory ->findHandleIndexFromType (
369368 WaveformWidgetFactory::defaultType ()),
370369 true );
371370
@@ -420,7 +419,7 @@ void DlgPrefWaveform::slotSetWaveformType(int index) {
420419 }
421420 auto type = static_cast <WaveformWidgetType::Type>(
422421 waveformTypeComboBox->itemData (index).toInt ());
423- auto * factory = WaveformWidgetFactory::instance ();
422+ auto * pFactory = WaveformWidgetFactory::instance ();
424423
425424 // When setting the type, factory uses current 'use acceleration' state,
426425 // which may currently be off. However, with QOpenGL there are Simple and Stacked
@@ -431,46 +430,46 @@ void DlgPrefWaveform::slotSetWaveformType(int index) {
431430 // Store the value so it's available in factory. Same as
432431 // slotSetWaveformAcceleration(useAccelerationCheckBox->isChecked()) just
433432 // without the redundant actions
434- factory ->setAcceleration (useAccelerationCheckBox->isChecked ());
433+ pFactory ->setAcceleration (useAccelerationCheckBox->isChecked ());
435434
436435 // Now set the new type
437- factory ->setWidgetTypeFromHandle (factory ->findHandleIndexFromType (type));
436+ pFactory ->setWidgetTypeFromHandle (pFactory ->findHandleIndexFromType (type));
438437
439438 updateWaveformTypeOptions (true );
440439 updateEnableUntilMark ();
441440 updateStemOptionsEnabled ();
442441}
443442
444443void DlgPrefWaveform::slotSetWaveformEnabled (bool checked) {
445- auto * factory = WaveformWidgetFactory::instance ();
444+ auto * pFactory = WaveformWidgetFactory::instance ();
446445 if (!checked) {
447- factory ->setWidgetTypeFromHandle (
448- factory ->findHandleIndexFromType (WaveformWidgetType::Empty),
446+ pFactory ->setWidgetTypeFromHandle (
447+ pFactory ->findHandleIndexFromType (WaveformWidgetType::Empty),
449448 true );
450449 } else {
451450 auto type = static_cast <WaveformWidgetType::Type>(
452451 waveformTypeComboBox->currentData ().toInt ());
453- factory ->setWidgetTypeFromHandle (factory ->findHandleIndexFromType (type), true );
452+ pFactory ->setWidgetTypeFromHandle (pFactory ->findHandleIndexFromType (type), true );
454453 }
455454 slotUpdate ();
456455}
457456
458457void DlgPrefWaveform::slotSetWaveformAcceleration (bool checked) {
459- auto * factory = WaveformWidgetFactory::instance ();
460- factory ->setAcceleration (checked);
458+ auto * pFactory = WaveformWidgetFactory::instance ();
459+ pFactory ->setAcceleration (checked);
461460 auto type = static_cast <WaveformWidgetType::Type>(waveformTypeComboBox->currentData ().toInt ());
462- factory ->setWidgetTypeFromHandle (factory->findHandleIndexFromType (type), true );
461+ pFactory ->setWidgetTypeFromHandle (factory->findHandleIndexFromType (type), true );
463462 updateWaveformTypeOptions (true );
464463 updateEnableUntilMark ();
465464 updateStemOptionsEnabled ();
466465}
467466
468467void DlgPrefWaveform::updateWaveformAcceleration (WaveformWidgetType::Type type) {
469- auto * factory = WaveformWidgetFactory::instance ();
470- auto backend = factory ->getBackendFromConfig ();
468+ auto * pFactory = WaveformWidgetFactory::instance ();
469+ auto backend = pFactory ->getBackendFromConfig ();
471470
472- bool supportAcceleration = factory ->widgetTypeSupportsAcceleration (type);
473- bool supportSoftware = factory ->widgetTypeSupportsSoftware (type);
471+ bool supportAcceleration = pFactory ->widgetTypeSupportsAcceleration (type);
472+ bool supportSoftware = pFactory ->widgetTypeSupportsSoftware (type);
474473
475474 useAccelerationCheckBox->blockSignals (true );
476475
@@ -493,7 +492,7 @@ void DlgPrefWaveform::updateWaveformTypeOptions(bool useWaveform) {
493492 highDetailCheckBox->blockSignals (true );
494493
495494#ifdef MIXXX_USE_QOPENGL
496- WaveformWidgetFactory* factory = WaveformWidgetFactory::instance ();
495+ auto * pFactory = WaveformWidgetFactory::instance ();
497496
498497 auto type = static_cast <WaveformWidgetType::Type>(waveformTypeComboBox->currentData ().toInt ());
499498 auto backend = factory->getBackendFromConfig ();
@@ -522,10 +521,10 @@ void DlgPrefWaveform::updateEnableUntilMark() {
522521#ifndef MIXXX_USE_QOPENGL
523522 const bool enabled = false ;
524523#else
525- WaveformWidgetFactory* factory = WaveformWidgetFactory::instance ();
524+ auto * pFactory = WaveformWidgetFactory::instance ();
526525 const bool enabled =
527- factory ->widgetTypeSupportsUntilMark () &&
528- factory ->getBackendFromConfig () != WaveformWidgetBackend::None;
526+ pFactory ->widgetTypeSupportsUntilMark () &&
527+ pFactory ->getBackendFromConfig () != WaveformWidgetBackend::None;
529528#endif
530529 untilMarkShowBeatsCheckBox->setEnabled (enabled);
531530 untilMarkShowTimeCheckBox->setEnabled (enabled);
@@ -560,10 +559,10 @@ void DlgPrefWaveform::updateStemOptionsEnabled() {
560559#ifndef MIXXX_USE_QOPENGL
561560 const bool stemsSupported = false ;
562561#else
563- WaveformWidgetFactory* factory = WaveformWidgetFactory::instance ();
562+ auto * pFactory = WaveformWidgetFactory::instance ();
564563 const bool stemsSupported =
565- factory ->widgetTypeSupportsStems () &&
566- factory ->getBackendFromConfig () == WaveformWidgetBackend::AllShader;
564+ pFactory ->widgetTypeSupportsStems () &&
565+ pFactory ->getBackendFromConfig () == WaveformWidgetBackend::AllShader;
567566#endif
568567 bool enabled = useWaveformCheckBox->isChecked ();
569568 stemOpacityMainLabel->setEnabled (stemsSupported && enabled);
0 commit comments