| 63 | } |
| 64 | |
| 65 | void NoteChance::DrawModule() |
| 66 | { |
| 67 | if (Minimized() || IsVisible() == false) |
| 68 | return; |
| 69 | |
| 70 | mChanceSlider->Draw(); |
| 71 | mDeterministicCheckbox->Draw(); |
| 72 | |
| 73 | if (gTime - mLastAcceptTime > 0 && gTime - mLastAcceptTime < 200) |
| 74 | { |
| 75 | ofPushStyle(); |
| 76 | ofSetColor(0, 255, 0, 255 * (1 - (gTime - mLastAcceptTime) / 200)); |
| 77 | ofFill(); |
| 78 | ofRect(106, 2, 10, 7); |
| 79 | ofPopStyle(); |
| 80 | } |
| 81 | |
| 82 | if (gTime - mLastRejectTime > 0 && gTime - mLastRejectTime < 200) |
| 83 | { |
| 84 | ofPushStyle(); |
| 85 | ofSetColor(255, 0, 0, 255 * (1 - (gTime - mLastRejectTime) / 200)); |
| 86 | ofFill(); |
| 87 | ofRect(106, 9, 10, 7); |
| 88 | ofPopStyle(); |
| 89 | } |
| 90 | |
| 91 | mLengthSlider->SetShowing(mDeterministic); |
| 92 | mLengthSlider->Draw(); |
| 93 | mSeedEntry->SetShowing(mDeterministic); |
| 94 | mSeedEntry->Draw(); |
| 95 | mPrevSeedButton->SetShowing(mDeterministic); |
| 96 | mPrevSeedButton->Draw(); |
| 97 | mReseedButton->SetShowing(mDeterministic); |
| 98 | mReseedButton->Draw(); |
| 99 | mNextSeedButton->SetShowing(mDeterministic); |
| 100 | mNextSeedButton->Draw(); |
| 101 | |
| 102 | if (mDeterministic) |
| 103 | { |
| 104 | ofRectangle lengthRect = mLengthSlider->GetRect(true); |
| 105 | ofPushStyle(); |
| 106 | ofSetColor(0, 255, 0); |
| 107 | ofFill(); |
| 108 | float pos = fmod(TheTransport->GetMeasureTime(gTime) * TheTransport->GetTimeSigTop() / mLength, 1); |
| 109 | const float kPipSize = 3; |
| 110 | float moduleWidth, moduleHeight; |
| 111 | GetModuleDimensions(moduleWidth, moduleHeight); |
| 112 | ofRect(ofMap(pos, 0, 1, 0, moduleWidth - kPipSize), lengthRect.y - 5, kPipSize, kPipSize); |
| 113 | ofPopStyle(); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | void NoteChance::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation) |
| 118 | { |
nothing calls this directly
no test coverage detected