| 399 | } |
| 400 | |
| 401 | void IDrawableModule::Render() |
| 402 | { |
| 403 | if (!mShowing) |
| 404 | return; |
| 405 | |
| 406 | PreDrawModule(); |
| 407 | |
| 408 | if (mMinimized) |
| 409 | mMinimizeAnimation += ofGetLastFrameTime() * 5; |
| 410 | else |
| 411 | mMinimizeAnimation -= ofGetLastFrameTime() * 5; |
| 412 | mMinimizeAnimation = ofClamp(mMinimizeAnimation, 0, 1); |
| 413 | |
| 414 | float w, h; |
| 415 | GetDimensions(w, h); |
| 416 | |
| 417 | ofPushMatrix(); |
| 418 | ofPushStyle(); |
| 419 | |
| 420 | float titleBarHeight; |
| 421 | float highlight; |
| 422 | DrawFrame(w, h, true, titleBarHeight, highlight); |
| 423 | |
| 424 | if (Minimized() || IsVisible() == false) |
| 425 | DrawBeacon(30, -titleBarHeight / 2); |
| 426 | |
| 427 | ofPushStyle(); |
| 428 | const float kPipWidth = 8; |
| 429 | const float kPipSpacing = 2; |
| 430 | float receiveIndicatorX = w - (kPipWidth + kPipSpacing); |
| 431 | ofFill(); |
| 432 | |
| 433 | if (CanReceiveAudio()) |
| 434 | { |
| 435 | ofSetColor(GetColor(kModuleCategory_Audio)); |
| 436 | ofRect(receiveIndicatorX, -titleBarHeight - 2, kPipWidth, 3, 1.0f); |
| 437 | receiveIndicatorX -= kPipWidth + kPipSpacing; |
| 438 | } |
| 439 | if (CanReceiveNotes()) |
| 440 | { |
| 441 | ofSetColor(GetColor(kModuleCategory_Note)); |
| 442 | ofRect(receiveIndicatorX, -titleBarHeight - 2, kPipWidth, 3, 1.0f); |
| 443 | receiveIndicatorX -= kPipWidth + kPipSpacing; |
| 444 | } |
| 445 | if (CanReceivePulses()) |
| 446 | { |
| 447 | ofSetColor(GetColor(kModuleCategory_Pulse)); |
| 448 | ofRect(receiveIndicatorX, -titleBarHeight - 2, kPipWidth, 3, 1.0f); |
| 449 | receiveIndicatorX -= kPipWidth + kPipSpacing; |
| 450 | } |
| 451 | ofPopStyle(); |
| 452 | |
| 453 | if (IsResizable() && !Minimized()) |
| 454 | { |
| 455 | ofColor color = GetColor(mModuleCategory); |
| 456 | ofSetColor(color, 255); |
| 457 | if (mHoveringOverResizeHandle) |
| 458 | ofSetLineWidth(4); |
nothing calls this directly
no test coverage detected