OfficialIncubo / BeatDrop-Music-Visualizer

The Milkdrop2 Music Visualization Standalone, only for Windows
https://twitter.com/BeatDropVis
Other
34 stars 2 forks source link

Drag and Drop MilkDrop Preset (.milk) feature! #17

Closed OfficialIncubo closed 4 months ago

OfficialIncubo commented 9 months ago

Milkdrop2077 (a.k.a. serge000) posted a latest tweet that supports drag and drop feature of presets and custom shapes/waves code. If you drag and drop any files, such as .obj, .png .gdb etc, the Standalone Visualization gives an error (like Pixel Shader Error) that said "Error: Failed to load preset (.milk) or format. [.extension] not supported.".

All I need is to use 'case WM_DROPFILES' or drag and drop implementation technique like, and accept it to load .milk preset files.

OfficialIncubo commented 4 months ago

Welp. Almost worked, but I want BeatDrop to load a preset that I have dropped, not outputting the random chinese characters.

Here's a message box that I have dropped a preset to BeatDrop: Captură de ecran 2024-03-04 102053

The BeatDrop itself: Captură de ecran 2024-03-04 102120

OfficialIncubo commented 4 months ago

Well, the Drag and Drop implementation worked with an help of ChatGPT (told me on DMs by @milkdrop2077), but something happened when I load a preset with any files except .milk file.

The thing I'd say is:

The part of code that didn't work and needs to be modified:

    if (len < 5 || wcsicmp(convertedFileName + len - 5, L".milk") != 0)
        g_plugin.LoadPreset(convertedFileName, 0.0f);
    else
    {
        wchar_t buf[1024], tmp[128];
        swprintf(buf, L"Error: Failed to load dropped preset file: %s", wchar_t(convertedFileName), tmp, 128);
        g_plugin.AddError(buf, 5.0f, ERR_NOTIFY, true);
    }

https://github.com/OfficialIncubo/BeatDrop-Music-Visualizer/assets/74858188/b3f845fa-d8c4-49ef-9a8f-40eb0208861c

I'll close the issue after this fix. ;)

OfficialIncubo commented 4 months ago

The Drag and Drop MD Preset Feature now working than intended, but here are some issues:

In conclusion, this feature will remain as BETA. I'll close this issue for now because it's fully working.

https://github.com/OfficialIncubo/BeatDrop-Music-Visualizer/assets/74858188/2d5e2947-abfe-4bb3-86b4-026b06b3ff3d