MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / DropdownUpdated

Method DropdownUpdated

Source/ChaosEngine.cpp:686–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684}
685
686void ChaosEngine::DropdownUpdated(DropdownList* list, int oldVal, double time)
687{
688 if (list == mSongDropdown)
689 {
690 mProgressionMutex.lock();
691
692 if (mSongIdx == -1)
693 {
694 mChordProgression.clear();
695 mChordProgression.push_back(0);
696 mSectionDropdown->Clear();
697 }
698 else
699 {
700 const Song& song = mSongs[mSongIdx];
701
702 TheTransport->SetTimeSignature(song.mTimeSigTop, song.mTimeSigBottom);
703 TheTransport->SetTempo(song.mTempo);
704 TheScale->SetRoot(song.mScaleRoot);
705 TheScale->SetScaleType(song.mScaleType);
706
707 mChordProgression = song.mSections[0].mChords;
708
709 mSectionDropdown->Clear();
710 for (int i = 0; i < song.mSections.size(); ++i)
711 {
712 mSectionDropdown->AddLabel(song.mSections[i].mName.c_str(), i);
713 }
714
715 mChordProgressionIdx = -1;
716 mBeatsLeftToChordChange = -1;
717 mSectionIdx = 0;
718 }
719
720 mChordProgressionSlider->SetExtents(0, (int)mChordProgression.size() - 1);
721 mProgressionMutex.unlock();
722 }
723 if (list == mRootNoteList || list == mChordTypeList)
724 {
725 mDegree = TheScale->GetToneFromPitch(mInputChord.mRootPitch);
726 }
727}
728
729void ChaosEngine::ButtonClicked(ClickButton* button, double time)
730{

Callers

nothing calls this directly

Calls 9

SetTimeSignatureMethod · 0.80
SetTempoMethod · 0.80
SetRootMethod · 0.80
SetScaleTypeMethod · 0.80
sizeMethod · 0.80
GetToneFromPitchMethod · 0.80
ClearMethod · 0.45
AddLabelMethod · 0.45
SetExtentsMethod · 0.45

Tested by

no test coverage detected