DamRsn / NeuralNote

Audio Plugin for Audio to MIDI transcription using deep learning.
Apache License 2.0
1.12k stars 61 forks source link

change-able window size #75

Closed RustoMCSpit closed 9 months ago

RustoMCSpit commented 9 months ago

dont have neuralnote be fixed to one size. weirdly enough updating the window size is the only way to refresh what the gui is displaying on linux with wine

RustoMCSpit commented 9 months ago

the "RECORD" button doesn't seem to do anything and the dropdowns don't show the updated selection until a full repaint of the settings window (by closing and opening it again). having it not be able to change size genuinely breaks the program on linux

DamRsn commented 9 months ago

I don't plan on making the UI resizable. But if someone knows a simple way to do it and wants to contribute, I'm open.

Also, please stop referring to issues you're having with Wine on Linux as it is not and will not be supported.

RustoMCSpit commented 9 months ago

I don't plan on making the UI resizable. But if someone knows a simple way to do it and wants to contribute, I'm open.

Also, please stop referring to issues you're having with Wine on Linux as it is not and will not be supported.

looking at the source code now, i think the neuralnotemainview is being repainted from memory over and over and thats what causing the bug. im too drunk and tired to actually know if thats whats happening and my understanding of c is shite so apologies if this is a witchhunt but there 100% is something wrong somewhere, i can screen record the bug if needed

RustoMCSpit commented 9 months ago

void NeuralNoteMainView::paint(Graphics& g) { // is this re-painting the display over and over again? auto background_image = juce::ImageCache::getFromMemory(BinaryData::background_png, BinaryData::background_pngSize);

RustoMCSpit commented 9 months ago

i think the image is being re-loaded from memory in the paint method using the juce::ImageCache::getFromMemory function. this means that every time the paint method is called, the image is retrieved from memory causing weird graphical issues in which only moving the program causes its display to update,

RustoMCSpit commented 9 months ago

im pretty sure but i dont understand this all well enough

RustoMCSpit commented 9 months ago

would something like this make more sense

// Initialize the background image to a default image currentBackgroundImage = juce::ImageCache::getFromMemory(BinaryData::background_png, BinaryData::background_pngSize);

// Use the currentBackgroundImage as the background // Reusing the loaded image, which was already loaded during object construction. g.drawImage(currentBackgroundImage, getLocalBounds().toFloat());

RustoMCSpit commented 9 months ago

if this is giibberish i apologise im not trying to waste your time apologies

RustoMCSpit commented 9 months ago

would something like this make more sense

by the way this is designed to allow for future modification of the image

// this is just pseudo-code and probably doesnt work but you get what im trying to say here juce::FileChooser fileChooser("Select a background image...", juce::File::getSpecialLocation(juce::File::userPicturesDirectory));

if (fileChooser.browseForFileToOpen()) { juce::File selectedImageFile = fileChooser.getResult(); currentBackgroundImage = juce::ImageFileFormat::loadFrom(selectedImageFile); }

// redraw new image repaint();

RustoMCSpit commented 9 months ago

if what i said makes no sense apologies, i can screen record the issue if you want to see for yourself

RustoMCSpit commented 9 months ago

tl;dr: i think but am not sure that the image is being re-loaded from memory in the paint method using the juce::ImageCache::getFromMemory function. this means that every time the paint method is called, the image is retrieved from memory causing weird graphical issues. i am trying to update the code to load the image once and reuse it in the paint method