| 684 | } |
| 685 | |
| 686 | void 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 | |
| 729 | void ChaosEngine::ButtonClicked(ClickButton* button, double time) |
| 730 | { |
nothing calls this directly
no test coverage detected