| 2381 | } |
| 2382 | |
| 2383 | OSCLogger::OSCLogger(FloatingTile* parent) : |
| 2384 | FloatingTileContent(parent), |
| 2385 | rm(scriptnode::routing::GlobalRoutingManager::Helpers::getOrCreate(parent->getMainController())), |
| 2386 | clearButton("clear", nullptr, *this), |
| 2387 | filterButton("filter", nullptr, *this), |
| 2388 | pauseButton("pause", nullptr, *this) |
| 2389 | { |
| 2390 | addAndMakeVisible(searchBox); |
| 2391 | |
| 2392 | GlobalHiseLookAndFeel::setTextEditorColours(searchBox); |
| 2393 | |
| 2394 | rm->oscListeners.addListener(*this, OSCLogger::updateConnection, false); |
| 2395 | |
| 2396 | updateConnection(*this, rm->lastData); |
| 2397 | |
| 2398 | clearButton.onClick = [this]() |
| 2399 | { |
| 2400 | oscLogList.clear(); |
| 2401 | triggerAsyncUpdate(); |
| 2402 | }; |
| 2403 | |
| 2404 | pauseButton.setToggleModeWithColourChange(true); |
| 2405 | pauseButton.setToggleStateAndUpdateIcon(true); |
| 2406 | |
| 2407 | searchBox.onReturnKey = [this]() |
| 2408 | { |
| 2409 | searchPattern = nullptr; |
| 2410 | |
| 2411 | auto content = searchBox.getText(); |
| 2412 | |
| 2413 | if (content.isNotEmpty()) |
| 2414 | { |
| 2415 | try |
| 2416 | { |
| 2417 | searchPattern = new OSCAddressPattern(content); |
| 2418 | } |
| 2419 | catch (String& e) |
| 2420 | { |
| 2421 | PresetHandler::showMessageWindow("OSC Address Pattern error", e, PresetHandler::IconType::Error); |
| 2422 | } |
| 2423 | } |
| 2424 | |
| 2425 | triggerAsyncUpdate(); |
| 2426 | }; |
| 2427 | |
| 2428 | filterButton.onClick = BIND_MEMBER_FUNCTION_0(OSCLogger::triggerAsyncUpdate); |
| 2429 | |
| 2430 | list.setColour(ListBox::ColourIds::backgroundColourId, Colours::transparentBlack); |
| 2431 | list.setModel(this); |
| 2432 | addAndMakeVisible(list); |
| 2433 | |
| 2434 | addAndMakeVisible(filterButton); |
| 2435 | addAndMakeVisible(clearButton); |
| 2436 | addAndMakeVisible(pauseButton); |
| 2437 | |
| 2438 | filterButton.setToggleModeWithColourChange(true); |
| 2439 | |
| 2440 | fader.addScrollBarToAnimate(list.getVerticalScrollBar()); |
nothing calls this directly
no test coverage detected