diff --git a/CMakeLists.txt b/CMakeLists.txt index 0623c86..87091ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,5 +44,7 @@ target_link_libraries(MonoSlicer PUBLIC juce::juce_recommended_config_flags juce::juce_recommended_lto_flags - juce::juce_recommended_warning_flags ) + +# Suppress JUCE / VST3 SDK warnings globally for all targets. +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-implicit-int-conversion-on-negation") diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 69c3a8c..36a5495 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -510,10 +510,9 @@ void MonoSlicerProcessor::refreshFolderList() if (!currentFile.existsAsFile()) return; auto dir = currentFile.getParentDirectory(); - juce::DirectoryIterator iter(dir, false, "*.wav;*.aiff;*.flac;*.ogg"); - while (iter.next()) + for (const auto& entry : juce::RangedDirectoryIterator(dir, false, "*.wav;*.aiff;*.flac;*.ogg")) { - auto f = iter.getFile(); + auto f = entry.getFile(); if (f.existsAsFile()) { folderFiles.add(f); diff --git a/Source/WaveformDisplay.cpp b/Source/WaveformDisplay.cpp index f82244b..11b1447 100644 --- a/Source/WaveformDisplay.cpp +++ b/Source/WaveformDisplay.cpp @@ -226,9 +226,11 @@ void WaveformDisplay::paint(juce::Graphics& g) drawSliceMarkers(g, waveArea); // Scrollbar at bottom - hScrollBar.setBounds(bounds.getBottomLeft().getX(), - bounds.getBottom() - scrollbarHeight, - bounds.getWidth(), scrollbarHeight); + hScrollBar.setBounds(juce::Rectangle( + static_cast(bounds.getBottomLeft().getX()), + static_cast(bounds.getBottom() - scrollbarHeight), + static_cast(bounds.getWidth()), + static_cast(scrollbarHeight))); } void WaveformDisplay::drawKeys(juce::Graphics& g, juce::Rectangle bounds) @@ -539,7 +541,7 @@ void WaveformDisplay::mouseDown(const juce::MouseEvent& e) if (e.getPosition().getX() < static_cast(keyArea.getWidth())) { float rowHeight = keyArea.getHeight() / 12.0f; - int row = static_cast((e.getPosition().getY() - keyArea.getY()) / rowHeight); + int row = static_cast((static_cast(e.getPosition().getY()) - keyArea.getY()) / rowHeight); row = juce::jlimit(0, 11, row); int midiNote = keyRowToMidiNote(row); @@ -664,9 +666,6 @@ void WaveformDisplay::mouseWheelMove(const juce::MouseEvent& e, const juce::Mous // Handle horizontal scrolling (trackpad 2-finger horizontal drag) if (std::abs(wheel.deltaX) > 0.001f) { - int total = getNumSamples(); - int visible = static_cast(static_cast(total) / zoomFactor); - float maxOffset = static_cast(juce::jmax(1, total - visible)); scrollOffset -= wheel.deltaX * 0.02f / zoomFactor; scrollOffset = juce::jlimit(0.0f, 1.0f, scrollOffset); syncScrollBar();