Skip to content

Add ability to drag files to and from external applications #7849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 253 commits into
base: master
Choose a base branch
from

Conversation

AW1534
Copy link
Member

@AW1534 AW1534 commented Apr 16, 2025

Adds the ability to drag files in and out of LMMS. This required a bit more refactoring than I expected.

video2.mp4

I should note that this doesn't just work to and from the desktop, I've tested with firefox, CLion, dolphin and discord. It also works with more than just sample files (projects, presets, midis, vsts)

sakertooth and others added 30 commits February 4, 2025 16:16
Reducing the search space for performance is no longer a problem now, so there's no harm in allowing these directories to be considered (and we can avoid potential problems with how files are organized on users machines). Making sure to always check agaisnt the blacklist was also a bit error-prone since its possible to forget to check against it (like with how searching was implemented here, but it did not seem to matter at that point).
Most notable differences are that we cancel the search automatically in the destructor when closing the application, and we use a mutex to prevent ordering conflicts when beginning and ending searches.
Since we always cancel the search if one is already running before starting up a new one, theres no need for mutual exclsuion since the cancellation logic should provide that.
We shouldn't update the search indicator directly in the onSearch function because those updates may get out of order with the updates that are queued by the auxiliary thread, potentially resulting in inconsistent state.
# Conflicts:
#	include/MainWindow.h
#	src/gui/MainWindow.cpp
Co-authored-by: Sotonye Atemie <[email protected]>
Co-authored-by: Sotonye Atemie <[email protected]>
Copy link
Contributor

@szeli1 szeli1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this PR again, found some issues after the recent changes.

Copy link
Contributor

@szeli1 szeli1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this and I couldn't find any issues.

@headquarter8302
Copy link
Member

Tested on Windows 11 26100.4484, no issues here from the most common workflows (dragging samples in/out sidebar, dragging samples into Song-Editor track buttons, dragging samples into Song-Editor tracks itself).

Although I find the behaviour of overlapping samples in sample-track instead of overwriting them if there's zero space between the start of the track and the next sample a bit unexpected, because it's different from dragging a sample into the sample-track's track itself

@AW1534
Copy link
Member Author

AW1534 commented Jul 12, 2025

Although I find the behaviour of overlapping samples in sample-track instead of overwriting them if there's zero space between the start of the track and the next sample a bit unexpected, because it's different from dragging a sample into the sample-track's track itself

Could you please provide a video? I'm unclear on what you're describing. Also, is this behavior different to master?

@anytizer
Copy link
Contributor

Do you also drag/drop a project file (.mmpz, .mmp) into the MainWindow > Song? Or, did the video demo just missed it?

@AW1534
Copy link
Member Author

AW1534 commented Jul 13, 2025

Do you also drag/drop a project file (.mmpz, .mmp) into the MainWindow > Song? Or, did the video demo just missed it?

yes, anything thats currently draggable from the filebrowser will be draggable from external applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants