| 69 | } |
| 70 | |
| 71 | void SampleBrowser::DrawModule() |
| 72 | { |
| 73 | if (Minimized() || IsVisible() == false) |
| 74 | return; |
| 75 | |
| 76 | float fontSize = 13; |
| 77 | float stringWidth = gFont.GetStringWidth(mCurrentDirectory.toStdString(), fontSize); |
| 78 | float moduleWidth, moduleHeight; |
| 79 | GetModuleDimensions(moduleWidth, moduleHeight); |
| 80 | float textX = 3; |
| 81 | if (stringWidth > moduleWidth) |
| 82 | textX = moduleWidth - 3 - stringWidth; |
| 83 | gFont.DrawString(mCurrentDirectory.toStdString(), fontSize, textX, 15); |
| 84 | |
| 85 | for (size_t i = 0; i < mButtons.size(); ++i) |
| 86 | mButtons[i]->Draw(); |
| 87 | for (int i = 0; i < (int)mPlayButtons.size(); ++i) |
| 88 | { |
| 89 | mPlayButtons[i]->SetDisplayStyle(IsSamplePlaying(i) ? ButtonDisplayStyle::kStop : ButtonDisplayStyle::kPlay); |
| 90 | mPlayButtons[i]->Draw(); |
| 91 | } |
| 92 | mBackButton->Draw(); |
| 93 | mForwardButton->Draw(); |
| 94 | |
| 95 | int numPages = GetNumPages(); |
| 96 | if (numPages > 1) |
| 97 | DrawTextNormal(ofToString(mCurrentPage + 1) + "/" + ofToString(numPages), 40, mBackButton->GetPosition(true).y + 12); |
| 98 | } |
| 99 | |
| 100 | bool SampleBrowser::IsSamplePlaying(int index) const |
| 101 | { |
nothing calls this directly
no test coverage detected