MCPcopy Create free account
hub / github.com/audacity/audacity / UpdateForStateChange

Method UpdateForStateChange

src/MixerBoard.cpp:453–494  ·  view source on GitHub ↗

Update appearance to match the state of the track

Source from the content-addressed store, hash-verified

451
452// Update appearance to match the state of the track
453void MixerTrackCluster::UpdateForStateChange()
454{
455 const wxString newName = mTrack->GetName();
456 if (newName != GetName()) {
457 SetName( Verbatim( newName ) );
458 mStaticText_TrackName->SetLabel(newName);
459 mStaticText_TrackName->SetName(newName);
460#if wxUSE_TOOLTIPS
461 mStaticText_TrackName->SetToolTip(newName);
462#endif
463 mBitmapButton_MusicalInstrument->SetBitmapLabel(
464 *(mMixerBoard->GetMusicalInstrumentBitmap(mTrack.get())));
465 }
466
467 mToggleButton_Mute->SetAlternateIdx(mTrack->GetSolo() ? 1 : 0);
468 if (mTrack->GetMute())
469 mToggleButton_Mute->PushDown();
470 else
471 mToggleButton_Mute->PopUp();
472
473 bool bIsSolo = mTrack->GetSolo();
474 if (bIsSolo)
475 mToggleButton_Solo->PushDown();
476 else
477 mToggleButton_Solo->PopUp();
478 mToggleButton_Mute->SetAlternateIdx(bIsSolo ? 1 : 0);
479
480 if (!GetWave())
481 mSlider_Pan->Hide();
482 else
483 mSlider_Pan->Set(GetWave()->GetPan());
484
485 if (!GetWave())
486 mSlider_Volume->Hide();
487 else
488 mSlider_Volume->Set(GetWave()->GetVolume());
489
490 if (!GetNote())
491 mSlider_Velocity->Hide();
492 else
493 mSlider_Velocity->Set(GetNote()->GetVelocity());
494}
495
496namespace {
497size_t GetNumSamplesInView(const ChannelSampleView& view)

Callers 1

UpdateTrackClustersMethod · 0.80

Calls 15

VerbatimFunction · 0.85
SetAlternateIdxMethod · 0.80
GetPanMethod · 0.80
GetVolumeMethod · 0.80
GetNameMethod · 0.45
SetLabelMethod · 0.45
SetNameMethod · 0.45
SetToolTipMethod · 0.45
getMethod · 0.45
GetSoloMethod · 0.45
GetMuteMethod · 0.45

Tested by

no test coverage detected