mirror of
https://codeberg.org/armin/monoslicer.git
synced 2026-09-01 12:10:46 +02:00
Fix all compilation warnings
- Fix float-to-int conversions in WaveformDisplay::paint setBounds - Fix implicit int-to-float conversion in mousePressed key row calc - Remove unused variables in mouseWheelMove - Replace deprecated DirectoryIterator with RangedDirectoryIterator - Suppress JUCE/VST3 SDK warnings via CMAKE_CXX_FLAGS
This commit is contained in:
parent
6e220a60f4
commit
8dc07d2568
3 changed files with 11 additions and 11 deletions
|
|
@ -44,5 +44,7 @@ target_link_libraries(MonoSlicer
|
||||||
PUBLIC
|
PUBLIC
|
||||||
juce::juce_recommended_config_flags
|
juce::juce_recommended_config_flags
|
||||||
juce::juce_recommended_lto_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")
|
||||||
|
|
|
||||||
|
|
@ -510,10 +510,9 @@ void MonoSlicerProcessor::refreshFolderList()
|
||||||
if (!currentFile.existsAsFile()) return;
|
if (!currentFile.existsAsFile()) return;
|
||||||
|
|
||||||
auto dir = currentFile.getParentDirectory();
|
auto dir = currentFile.getParentDirectory();
|
||||||
juce::DirectoryIterator iter(dir, false, "*.wav;*.aiff;*.flac;*.ogg");
|
for (const auto& entry : juce::RangedDirectoryIterator(dir, false, "*.wav;*.aiff;*.flac;*.ogg"))
|
||||||
while (iter.next())
|
|
||||||
{
|
{
|
||||||
auto f = iter.getFile();
|
auto f = entry.getFile();
|
||||||
if (f.existsAsFile())
|
if (f.existsAsFile())
|
||||||
{
|
{
|
||||||
folderFiles.add(f);
|
folderFiles.add(f);
|
||||||
|
|
|
||||||
|
|
@ -226,9 +226,11 @@ void WaveformDisplay::paint(juce::Graphics& g)
|
||||||
drawSliceMarkers(g, waveArea);
|
drawSliceMarkers(g, waveArea);
|
||||||
|
|
||||||
// Scrollbar at bottom
|
// Scrollbar at bottom
|
||||||
hScrollBar.setBounds(bounds.getBottomLeft().getX(),
|
hScrollBar.setBounds(juce::Rectangle<int>(
|
||||||
bounds.getBottom() - scrollbarHeight,
|
static_cast<int>(bounds.getBottomLeft().getX()),
|
||||||
bounds.getWidth(), scrollbarHeight);
|
static_cast<int>(bounds.getBottom() - scrollbarHeight),
|
||||||
|
static_cast<int>(bounds.getWidth()),
|
||||||
|
static_cast<int>(scrollbarHeight)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaveformDisplay::drawKeys(juce::Graphics& g, juce::Rectangle<float> bounds)
|
void WaveformDisplay::drawKeys(juce::Graphics& g, juce::Rectangle<float> bounds)
|
||||||
|
|
@ -539,7 +541,7 @@ void WaveformDisplay::mouseDown(const juce::MouseEvent& e)
|
||||||
if (e.getPosition().getX() < static_cast<int>(keyArea.getWidth()))
|
if (e.getPosition().getX() < static_cast<int>(keyArea.getWidth()))
|
||||||
{
|
{
|
||||||
float rowHeight = keyArea.getHeight() / 12.0f;
|
float rowHeight = keyArea.getHeight() / 12.0f;
|
||||||
int row = static_cast<int>((e.getPosition().getY() - keyArea.getY()) / rowHeight);
|
int row = static_cast<int>((static_cast<float>(e.getPosition().getY()) - keyArea.getY()) / rowHeight);
|
||||||
row = juce::jlimit(0, 11, row);
|
row = juce::jlimit(0, 11, row);
|
||||||
int midiNote = keyRowToMidiNote(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)
|
// Handle horizontal scrolling (trackpad 2-finger horizontal drag)
|
||||||
if (std::abs(wheel.deltaX) > 0.001f)
|
if (std::abs(wheel.deltaX) > 0.001f)
|
||||||
{
|
{
|
||||||
int total = getNumSamples();
|
|
||||||
int visible = static_cast<int>(static_cast<float>(total) / zoomFactor);
|
|
||||||
float maxOffset = static_cast<float>(juce::jmax(1, total - visible));
|
|
||||||
scrollOffset -= wheel.deltaX * 0.02f / zoomFactor;
|
scrollOffset -= wheel.deltaX * 0.02f / zoomFactor;
|
||||||
scrollOffset = juce::jlimit(0.0f, 1.0f, scrollOffset);
|
scrollOffset = juce::jlimit(0.0f, 1.0f, scrollOffset);
|
||||||
syncScrollBar();
|
syncScrollBar();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue