Compare commits

...

414 Commits

Author SHA1 Message Date
Your Name
c39da2f8cc vibefix disintegrator
Some checks failed
build / linux-arm64 (push) Has been cancelled
build / macos-arm64 (push) Has been cancelled
build / macos-x86_64 (push) Has been cancelled
build / mingw64 (push) Has been cancelled
checks / scripted-checks (push) Has been cancelled
build / linux-x86_64 (push) Has been cancelled
build / msvc-x64 (push) Has been cancelled
checks / shellcheck (push) Has been cancelled
build / windows-arm64 (push) Has been cancelled
checks / yamllint (push) Has been cancelled
2026-03-15 04:50:00 +01:00
Your Name
bec763a179 Merge branch 'disintegrator' 2026-03-15 03:20:19 +01:00
Kevin Zander
83313e737d Remove GUI menu items for global automation (#5230)
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: Fawn <rubiefawn@gmail.com>
2026-03-12 12:03:09 -06:00
Sotonye Atemie
a45a2b86a0 Refactor and improve Tap Tempo (#8098)
Improves the tap tempo algorithm and usage, as well refactoring the code for better maintainability.

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2026-03-10 23:31:37 -04:00
Yohanan
6c75b30dca Add search bar for the soundfont player (#8193) 2026-03-10 19:57:19 +01:00
Dalton Messmer
5916a0b477 Auto-quit rework (#8070)
This reworks the auto-quit feature by introducing a new AudioBuffer class which keeps track of which channels are currently silent as audio flows through the effects chain.

When track channels going into an effect's input are not marked as quiet, it is assumed a signal is present and the plugin needs to wake up if it is asleep due to auto-quit. After a plugin processes a buffer, the silence status is updated.

When the auto-quit setting is disabled (that is, when effects are always kept running), effects are always assumed to have input noise (a non-quiet signal present at the plugin inputs), which should result in the same behavior as before.

Benefits:

- The auto-quit system now closely follows how it is supposed to function by only waking plugins which have non-zero input rather than waking all plugins at once whenever an instrument plays a note or a sample track plays. This granularity better fits multi-channel plugins and pin connector routing where not all plugin inputs are connected to the same track channels. This means a sleeping plugin whose inputs are connected to channels 3/4 would not need to wake up if a signal is only present on channels 1/2.
- Silencing channels that are already known to be silent is a no-op
- Calculating the absolute peak sample value for a channel already known to be silent is a no-op
- The silence flags also could be useful for other purposes, such as adding visual indicators to represent how audio signals flow in and out of each plugin
- With a little more work, auto-quit could be enabled/disabled for plugins on an individual basis
- With a little more work, auto-quit could be implemented for instrument plugins
- AudioBuffer can be used with SharedMemory
- AudioBuffer could be used in plugins for their buffers

This new system works so long as the silence flags for each channel remain valid at each point along the effect chain. Modifying the buffers without an accompanying update of the silence flags could violate assumptions. Through unit tests, the correct functioning of AudioBuffer itself can be validated, but its usage in AudioBusHandle, Mixer, and a few other places where track channels are handled will need to be done with care.

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2026-03-09 02:32:45 -04:00
Lost Robot
f5688e9bad Add Frequency Shifter effect (not a pitch shifter) (#8140) 2026-03-01 09:04:51 -06:00
Lukas W
5d5f319942 Detachable windows (#3532)
Allows detaching a window from LMMS's main window, making things like working on multiple screens easier.

The behavior of detached windows can be customized in the Settings.

Closes #1259

---------

Signed-off-by: Dalton Messmer <messmer.dalton@gmail.com>
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
Co-authored-by: SpomJ <mihail_a_m@mail.ru>
2026-02-27 00:20:36 -05:00
Yohanan
6854a655a4 Fix empty value returned by FileRevealer::getSelectCommand() (#8281)
Changes `FileRevealer::getSelectCommand` to return an empty `QStringList` as a fallback, not an empty `std::optional`.
2026-02-25 09:04:25 -05:00
regulus79
f7acf0ed4b Add Info TextFloat for Piano Roll Knife Tool (and make cut notes auto selected) (#7953)
* Adds an informative "TextFloat::displayMessage" when the knife tool is enabled.
* Automatically selects short ends if shift is not held down.
2026-02-24 08:49:55 +01:00
Johannes Lorenz
d36f3f019e CMake: Check for PERL's List::MoreUtils (#8180) 2026-02-22 10:44:17 +01:00
Sotonye Atemie
a8423c1e4a Emit the playbackPositionJumped signal only when the active timeline jumps (#8256)
Only emit the playbackPositionJumped signal when the timeline responsible for the current play mode jumps.
2026-02-15 12:14:45 -05:00
Sotonye Atemie
441fd905be Improve performance when moving channels in the Mixer (#8235)
Improves performance when moving mixer channels to the left or right using simple Qt layout operations and swapping of values. This commit also addresses a deadlock in Mixer::mixToChannel by ensuring we lock and unlock the same channel regardless of any move operations occurring simultaneously on another thread.
2026-02-09 11:57:28 -05:00
regulus79
84f691cafc Fix PianoRoll Timeline Constantly Emitting positionJumped During Record-Play (#8252)
When #7454 was merged, Timelines were refactored to emit a positionJumped signal whenever their internal tick position was changed via Timeline::setTicks. This was meant as an easy way to account for all situations where the user might drag or click or somehow forcefully set the position of a timeline mid-playback.
However, the current way timeline syncing is implemented between the song editor and piano roll (when doing record-play in the piano roll) is by constantly calling setTicks on the piano roll's timeline whenever the song editor's timeline moves. This inadvertantly means that positionJumped is being emitted, even when the timeline is tracking smoothly.

This PR attempts to address this issue by adding an optional parameter to Timeline::setTicks which allows the caller to opt out of emitting positionJumped. Ideally, we would have a better system for syncing timelines together, one which does not rely on forcefully calling setTicks. But for now, this should work.

---------

Co-authored-by: Sotonye Atemie <satemiej@gmail.com>
2026-02-08 15:22:20 -05:00
WeakOstra
f35a1dfca8 Fix Pattern Editor UI updates when adjusting note volume via scrolling (#8196)
Closes #7806
2026-02-08 11:50:58 -05:00
ExternStat
a74339f89b Fix AutomatableSlider Creating Too Many Journal Entries (#8223)
---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2026-02-07 17:21:36 -05:00
regulus79
937c8b9d5d Increase Clip Resize Grip Width (#8169)
Requested by a user on the forum. Sometimes, it can get tricky when two clips are right next to each other, and you're trying to resize one of them. Either you resize the right one, or the other one starts resizing behind the other, so you end up having to move one over, then resize it, then move it back. And it's just not awesome.

However, this can be mitigated by simply increasing the clip resize grip width. Currently, it is at 4 px, but increasing it to 8 px makes it easier to specifically target which clip you want to resize. It also probably makes it easier to resize clips in general for users who may struggle to aim the mouse perfectly within that 4 pixel gap.
2026-02-07 13:57:43 -05:00
regulus79
ff9c29d189 Fix Hardcoded Max dB Value When Double-Clicking Knobs (#8189)
Partially addresses #8188

For some reason, when a knob is set to be a "volume knob", the max volume allowed via double-clicking and typing in a value is 6.0 dB. For knobs such as the amplifier knob in Audio File Processor which go up to 500% (~14 db), this is not enough.

This PR makes it so that the dialog shows the actual max dB value based on the underlying model's max value, instead of being hardcoded to 6.0 dB. This PR does not address the minimum value.
2026-02-07 13:57:00 -05:00
Petar Katić
7147caa37a Fix clips not retaining colors or names after using "Clear notes out of bounds" (#8234) 2026-02-07 13:08:04 -05:00
Andrew Wiltshire
c62b42a7c9 Clarify VST support to VST2 and mention LV2 support in README (#8233)
* Clarify VST support to VST2 in README

Updated VST support mention from VST(i) to VST2 in features section for clarity.

* Update README.md

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* mention LV2 support

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2026-02-02 23:10:39 +01:00
Sotonye Atemie
c14a327d31 Refactor PortAudio backend (#7444)
Refactors the PortAudio backend to fix issues with DirectSound and MME crackling and not loading properly, as well as to improve code quality and maintainability.

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2026-02-01 14:23:44 -05:00
regulus79
f504204ef1 Fix Pitch Bending, Strum, and Knife Tools Affecting Per-Note Velocity/Panning (#8243) 2026-02-01 12:55:26 -05:00
regulus79
eb46e6f8de Fix Right-click Remove Node Precision with Pitch Bending (#8242) 2026-02-01 12:53:57 -05:00
Yohanan
ed1e29adfd Fix velocity/panning change affecting unselected notes (#8201)
Fixes #8200. Scrolling to change velocity/panning can affect unselected notes if hovering over them in the bottom section of the piano roll. This PR addresses that.
2026-02-01 11:00:27 -05:00
Sotonye Atemie
e076446fd3 Set file format combo box unconditionally (#8237) 2026-01-31 23:39:34 +01:00
Sotonye Atemie
13ea2ee480 Refactor ExportProjectDialog (#8215)
This refactors the export dialog to no longer use the export_project.ui file and moves it into standard C++ Qt code. This also brings minor changes to the dialog, such as horizontal labels instead of vertical ones.
2026-01-22 19:07:25 -05:00
Andrey
64c346d513 Vibed: fixed regression caused by fastRandInc (#8225) 2026-01-21 21:24:21 -05:00
Yohanan
a4d252186f AudioFileProcessor: update amp model when new sample is loaded (#8198) 2026-01-19 10:58:14 -05:00
Itreza2
f4f85e1f33 Avoid adding journal checkpoints when initially creating volume knobs (#8214)
* reimplement getter and setter of FloatModelEditorBase::m_volumeKnob to avoid undo checkpoint creation

* convert FloatModelEditorBase::m_volumeKnob from BoolModel to bool

* clean up

* remove unnecessary inline keywords and fix formatting

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2026-01-19 10:53:10 -05:00
Daniel Kristiansson
dab06be491 Bump project year (#8207) 2026-01-18 14:57:11 -05:00
Fawn
5e3a67c9d1 Improve lmms::fastRand() and use it instead of std::rand() (#7741) 2026-01-15 17:12:04 -07:00
Itreza2
b390fa414a Add Horizontal Scroll Bar to the File Browser (#8184) 2026-01-14 14:39:59 -05:00
Dalton Messmer
248acbf9a4 Improve strum tool LMB event (#8195) 2026-01-08 13:52:39 -05:00
regulus79
d4cabd5650 Fix Sample Clip Loop Exporting (#8192)
Fixes #8190

When #7454 was merged, I added a check before emitting playbackPositionJumped to only emit when the song was playing, to prevent LFOs from being reset when the user dragged the timeline while the song was paused. However, I used Song::isPlaying(), which only returns true when the song is not exporting. This caused sample clips to not be updated when the playback position jumped back every loop, which means they just kept playing, ignoring the loop. To fix this, I have changed it to use m_playing, which is true for both exporting and normal playing.
2026-01-06 06:34:38 -05:00
Sotonye Atemie
ed0f288c8a Remove SampleLoader (#8186)
Removes `SampleLoader`. File dialog functions were moved into `FileDialog`. Creation functions were moved into `SampleBuffer`.

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2026-01-04 21:18:37 -05:00
regulus79
11b4a9bddc Pitch Bending Directly in the Piano Roll (#7759)
This PR modifies how the Detuning tool works in the piano roll to let the user modify the automation curve right on the notes. This is actually fairly simple, as automation clips already contain the functions for dragging and removing points like in the Automation Editor. So essentially all that's being done is calculating the relative pos of the mouse to the nearest note, and setting the drag value in the automation clip to that position and key.

You can still access the old automation editor version by shift-click

messmerd asked if the code could be made general for any future note parameter besides detuning, in preparation for CLAP per-note parameter automation. I have refactored the relevant functions to accept an enum type for the kind of note parameter, although currently only detuning is supported.

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
Co-authored-by: Sotonye Atemie <satemiej@gmail.com>
Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
2026-01-04 14:18:06 -05:00
regulus79
2db75bd5d9 Fix Sample Clips Getting Out of Sync (#8183)
Fixes #8182

When #7454 was merged, the frameOffset variable inside Song::PlayPos which kept track of the actual frame position which the song was playing at relative to the last tick, was moved to Timeline. In the process, the type was inadvertently changed from float to f_cnt_t.

This caused the frame offset to be truncated ever time it was updated in Song::processNextBuffer, causing the song playback to slowly drift back ever so slightly, just a handful of frames every bar. This caused any new sample clips spawned to be created slightly late, becoming out of sync with any existing playing samples.

This PR fixes the issue by reverting the frameOffset variable type to be float again, allowing it to track sub-sample offsets over time.
2025-12-29 09:29:19 -05:00
Alex
e731231c62 Update translations (#8149)
* Pull translations from Transifex
2025-12-27 17:58:05 +05:30
regulus79
5e8f220b9c Fix AudioFileProcessor Wrong Beat Length Depending on Sample Rate (#8176)
Fixes #8138

Essentially, when playing beat notes in the pattern editor, technically, they have an internal length of 0. However, when the NotePlayHandle is created and recieves that value of 0, it realizes it's supposed to be a beat note, so it asks the instrument track what the default length of note should be. For most instruments, that defaults to whatever the length of the envelope is (no matter whether the envelope is enabled or not. Is that a good system? I don't know.) However, AudioFileProcessor does it custom and returns the length of its sample in frames.

However, the frame count it returned did not take into account that the sample rate of lmms could be different from the sample rate of the sample. This PR fixes that issue by multiplying by the correct sample rate ratio.
2025-12-23 14:59:17 -05:00
szeli1
69f7c3243d Fix knob linking / refactor linking (#7883)
Closes #7869

This PR aims to fix linking bugs and it aims to make linking code faster. In the future I would like to replace controller and automation code with linked models, so it is essential for this feature to work as efficiently as possible.

Before this PR:

- AutomatableModels store a list of AutomatableModels that they are linked to.
- setValue() and other functions make recursive calls to themself resulting in the #7869 crash.
- Each AutomatableModel can unlink from other AutomatableModels, unlinking is the inverse operation to linking.

After this PR:

- AutomatableModels store a pointer to an other AutomatableModel making a linked list. The end is connected to the first element resulting in a "ring".
- setValue() and others are now recursion free, the code runs for every linked model, more efficiently than before.
- Each AutomatableModel can NOT unlink form other AutomatableModels, unlinking is NOT the inverse operation to linking. AutomatableModels can unlink themself from the linked list, they can not unlink themself from single models.

---------

Co-authored-by: allejok96 <allejok96@gmail.com>
2025-12-22 17:37:40 -05:00
regulus79
c92741f567 Fix Pattern Editor Not Updating (#8175)
The TrackContentWidgets in the pattern editor rely on the positionChanged signal to be sent when the pattern index changes so that they know when to update. This signal was removed in #7454, but this PR puts it back.
2025-12-17 18:04:07 -05:00
regulus79
0fe7d6f679 Refactor to move positionChanged signal to Timeline (#7454)
Previously, this PR simply added a new signal to the Timeline class and had it emitted by the TimeLineWidget class in order to solve #7351.

However, as messmerd pointed out in his review comments, that was quite a hacky solution, and ideally the positionChanged signal would be solely managed by the backend Timeline class, while the frontend TimeLineWidget class would connect to those signals, instead of the other way around.

This PR is no longer a simple bugfix, but instead a refactoring of the Timeline/TimeLineWidget signal/slots.

Changes
- The positionChanged signal and updatePosition slot were removed from TimeLineWidget and moved to Timeline.
- Removed PlayPos, and instead store the timeline position in a TimePos along with a separate frame offset counter variable. The functions to set the ticks/timepos in Timeline emit the positionChanged signal. (Also, may emit positionJumped signal if the ticks were forcefully set--see below)
- The pos() method and PlayPos m_pos were removed from TimeLineWidget;
- The constructor for TimeLineWidget no longer requires a PlayPos reference.
- Since each TimeLineWidget stores a reference to its Timeline, a new method was added, timeline(), for other classes to access it.
- Removed array of PlayPos'es in Song. Now each Timeline holds their respective TimePos.
- Song's methods for getPlayPos were changed to return the TimePos of the respective Timeline. The non-const versions of the methods were removed because Timeline does not expose its TimePos to write.
- All of the places where Timelines are used were updated, along with their calls to access/modify the PlayPos. For example, occurrences of m_timeline->pos() were replaced with m_timeline->timeline()->pos(), and calls to m_timeline->pos().setTicks(ticks) were changed to m_timeline->timeline()->setTicks(ticks).
- ALSO: Removed m_elapsedMilliseconds, m_elapsedBars, and m_elapsedTicks from Song. The elapsed milliseconds is now handled individually by each Timeline.
- NEW: The m_jumped variable has been removed from Timeline. Now jumped events emit Timeline::positionJumped automatically whenever the ticks are forcefully set. This means it is no longer necessary to call timeline->setJumped(true) or timeline->setFrameOffset(0) whenever the playhead position is forcefully set. Many places in the codebase were already missing these calls, so this may fix some unknown bugs.

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
Co-authored-by: saker <sakertooth@gmail.com>
Co-authored-by: Alex <allejok96@gmail.com>
2025-12-17 06:31:36 -05:00
Andrew Wiltshire
8a33dd7afe Add help message & icon to empty automation editor (#8171)
This PR brings the changes from #8148 into the automation editor

---------

Co-authored-by: Andrew Wiltshire <AW1534@users.noreply.github.com>
2025-12-17 05:30:30 -05:00
jefrecantuledesma
ec8efde28a Fix Shift+Space corrupting playback state when used on stopped editors (#8154)
* Fix Shift+Space corrupting playback state when used on stopped editors

Shift+Space (togglePause) was allowing state corruption by modifying
m_playing and m_paused without checking m_playMode. This created an
impossible state where m_playing=true while m_playMode=None, causing
the regular Space key to stop working.

Added a guard to ensure togglePause() only operates when something is
actually playing (m_playMode != PlayMode::None). This prevents the
corrupted state and maintains proper play/pause/stop behavior.

Fixes #8036

---------

Co-authored-by: regulus79 <117475203+regulus79@users.noreply.github.com>
2025-12-15 20:42:35 -05:00
Alex
0ffcfe3bff Allow PianoRoll to open empty again, but with a help icon (#8148)
Fixes #8152

Revert PianoRoll closing when empty (caused issues with detached windows)
Remove TextFloat warning when there are no instruments/multiple clips (showed up when reloading project)
(Keep clip creation for empty projects)
Add an icon and updated message in empty PianoRoll.
Mark PianoRollWindow invalid when there is no clip, making buttons impossible to click

---------

Co-authored-by: Fawn <rubiefawn@gmail.com>
2025-12-14 08:40:35 -05:00
Andrew Wiltshire
8627616175 Make playhead red when recording (#7847)
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
Co-authored-by: Fawn <rubiefawn@gmail.com>
Co-authored-by: Andrew Wiltshire <AW1534@users.noreply.github.com>
2025-12-12 10:02:25 -05:00
Lisa Magdalena Riedler
f0cb32ff08 Fix AFP reverse mode desync on new sample load (#8158)
Previously, loading a new sample in an AFP instance with reverse enabled would desync the button from the model, such that the button would indicate the sample was reversed despite the new sample not actually being reversed.

This commit fixes this behavior so that samples loaded into an AFP instance with reverse enabled are actually reversed.
2025-12-08 16:17:47 -07:00
Lisa Magdalena Riedler
dd9afe7c23 Fix unknown arch+os info in versioninfo (#8159) 2025-12-08 16:07:33 -07:00
jefrecantuledesma
f12c54ca9e Fix truncated OGG exports (#8156)
This fixes a regression in commit f44aa3e that caused OGG exports to not flush any remaining data properly when finalizing the export, leading to truncated outputs with a different duration.

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-12-07 02:44:50 -05:00
jefrecantuledesma
02a0367a4b Fix Clang compiler misidentification in About dialog (#8153)
Clang was incorrectly displayed as 'GCC Clang' because __GNUC__ is
defined by Clang for compatibility. Reordered preprocessor checks in
versioninfo.h to test for __clang__ before __GNUC__.

Fixes #8120
2025-12-07 01:44:29 -05:00
regulus79
0187e64ceb Fix Track Moving not Updating PatternClipView (#8155)
This bug was noticed when testing out #7559, but the PR had been open for over a year, so it was decided to merge it and fix it in this one.

Basically, when adding or removing a track, the TrackContainer sends out signals such as trackAdded or trackRemoved which PatternClipView uses to know when to update.

However, it does not send out a signal when a track has been moved.

This is because for some reason, it's done by the GUI TrackContainerView instead of the core TrackContainer.

This PR changes that by moving the core code to the core where it probably belongs, adding an appropriate trackMoved signal to TrackContainer, and connecting that to PatternClipView to update properly.

---------

Co-authored-by: Fawn <rubiefawn@gmail.com>
2025-12-03 16:29:12 -05:00
regulus79
94f3b9704a Add Beat Preview to PatternClipView (#7559)
This PR changes the way PatternClips are drawn in include a simple "beat preivew," where each note in any non-empty instrument tracks within the pattern are drawn as short little rectangles on the ClipView. SampleClips and AutomationClips within patterns are not currently supported.

The height of the note boxes changes depending on how many tracks there are in the pattern, and how many of them actually have notes (empty tracks are only drawn half as tall).

There is also some padding at the top and bottom along with a little bit of spacing between each note, both vertically and horizontally. This can be edited in the css, along with the note color.

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
Co-authored-by: Fawn <rubiefawn@gmail.com>
2025-12-02 17:34:50 -05:00
Jan125
58a4a8a909 Add platform identifier to save files (#8116)
Adds `creatorplatform` and `creatorplatformtype` attributes to save files, which is useful for troubleshooting among other things.
2025-12-02 13:37:44 -07:00
Petar Katić
91517282c8 Fix missing icon in Slew Distortion help window (#8151) 2025-11-30 21:55:24 -05:00
regulus79
b01980d2fb Add Setting for Default Autoscroll State (#7851)
Previously, the autoscroll state of the song editor and piano roll (continuous, stepped, none) was not saved. This can be an issue for users who want to permanently set their autoscroll settings, without having to change them every time they start up LMMS.

This PR adds an option in the settings window to change the default autoscroll state.
2025-11-30 15:11:57 -05:00
Lost Robot
f0b3c2e251 Fix help menu crashes upon program close in Xpressive and Slew Distortion (#8150) 2025-11-30 11:08:30 -08:00
Lost Robot
f50b047684 Fix untoggleable buttons not updating models (#8144) 2025-11-28 19:55:13 -07:00
Sotonye Atemie
69e1db58a8 Fix mute/solo icons not matching initial mixer channel state
Correct the button initialization order so mixer channels show the proper mute and solo states when they first appear. This applies to channels loaded from a project and channels created during the session, ensuring the UI reflects the actual underlying state properly.
2025-11-28 20:33:53 -05:00
Fawn
bfa04c987d Centralize standard LMMS plugin logo (#8124)
* Centralize standard LMMS plugin logo

Previously, every single plugin would have its own copy of this image.
Now, these plugins pull it from the theme. I'm not sure it's valuable
for this to be themeable, but AFAIK it's the place all the other
non-plugin resources are stored, so that's where it goes for now.
2025-11-23 13:23:08 -05:00
regulus79
f093bde60c Fix Note Quantization Resetting Clip Length (#8131)
Fixes an issue where quantizing notes in a midi clip with auto-resize disabled would cause the length to be reset, in cases where there is only a single note in the clip. This was due to how quantization removes and re-adds each note, so for a moment, the clip would be empty, thus treated as a beat clip. Beat clips were mistakenly always automatically resized no matter whether auto-resize was enabled or not. This PR fixes that by only auto-resizing beat clips when they have auto-resize enabled.

Co-authored-by: Fawn <rubiefawn@gmail.com>

---------

Co-authored-by: Fawn <rubiefawn@gmail.com>
2025-11-23 12:34:41 -05:00
Fawn
eb41051bc5 Make arrow "stepper" buttons themeable and use SVG assets (#8123)
* SVG-ify arrow buttons

These buttons are used in the instrument window, Vestige, and VST
effects. Separate versions of the arrow icons are used for the classic
theme.

* Fix some unrelated SVG formatting and metadata

* Revert accidental change to classic border radius

* Add some XML stuff back to appease Github

LMMS renders these SVGs just fine, but apparently the removal of the
XML declaration completely breaks Github's ability to render the image,
so I am adding these back for the sake of those who want to actually
look at the diff on the website lmao

* Attempt to fix Github SVG previews again (`xmlns`)

* Fix crossover eq band mute button icon size

You may ask, "what does this have to do with the arrow buttons?" and you
would be right to assume this is unrelated. However, I'm already
touching the relevant lines of the stylesheet so I may as well sneak it
in there.

* Add missing metadata to fader_knob.svg

And fix mixed indentation in headphones.svg

* Add missing `xmlns` to fader_knob.svg

GRADIENTS!!!!!!!!!!!!

* Fix classic theme arrow buttons

The originals were right angle chevrons

* Remove unused getters
2025-11-21 01:26:00 -05:00
Fawn
31f86bc282 Use SVG asset for knife tool icon (#8128)
See lmms/lmms-artwork#23

Co-authored-by: Spekular <Spekular@users.noreply.github.com>
2025-11-19 19:14:39 -05:00
Fawn
dc2a461922 Fix microtuning warning text widening instruments (#7805)
The culprit was the little text warning under the instrument tuning view informing the user that MIDI-based instruments do not support the microtuner. The entire instrument window was expanding horizontally to accommodate this. This commit solves this by setting the width of the other tabs to be no wider than the instrument they belong to.
2025-11-13 13:01:32 -07:00
Tres Finocchiaro
db4523aa5d Make apprun-hooks POSIX compliant (#8121)
Remove bash-ishms, make apprun-hooks POSIX compliant per #8105
2025-11-11 13:00:10 -05:00
Dalton Messmer
478f5345dd Bump minimum Qt version to 5.15 (#8129) 2025-11-11 12:57:14 -05:00
Alex
c79d6af3ab Only show Piano Roll when editable (#6295)
- Display a message when a user attempts to open the piano roll in a project with no MIDI clips instead of opening a non-functional piano roll.
- Create a MIDI clip in the first instrument track when the piano roll is opened in an empty project.
2025-11-07 15:36:45 -07:00
Tres Finocchiaro
51529cefb1 Add Qt6 Support (#7339)
* Rebase against master

Co-authored-by: michaelgregorius <michael.gregorius.git@arcor.de>
Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>

* Fix Qt6 DMG on Apple (#7240)

- Fix linking issues with Qt Framework files
- Fix qmake detection

* Fixes after rebase

* Fix embed.cpp compilation

Fix implicit conversion from int when using QString.arg(...)

* Fix Qt6 signature change for nativeEventFilter (#7254)

* Adds win32EventFilter a wrapper for nativeEventFilter on Windows
* win32EventFilter is currently used to intercept top-level Window events (currently, to avoid VSTs setting transparency of the parent application)

* fix broken signal slot connections (#7274)

QComboBox activated() replaced with textActivated() since Qt 5.14

* Enabled VSTs on Qt 6 (#7273)

* enabled VST support for Qt 6 builds
* Note : Embedding on QT6 will be buggy on linux as a result of using qt embedding, which unfortunately is a qt bug which hasn't been resolved.

* Changed bar lines to follow snap size (#7034)

* Added lines in between bars
* Changed bar lines to follow snap size
* Changed default zoom and quantization value
* Added constants for line widths
* Added QSS configuration for new grid line colors
* Tied line widths to QSS properties
* Changed default quantization to 1/4
* Removed clear() from destructor model
* Removed destructor in ComboBoxModel.h
* Changed member set/get functions to pass by value
* Updated signal connection with newer syntax

* Fix compilation

* Fix MSVC builds

* fix nullptr deref in AudioFileProcessor (qt6 branch) (#7532)

* ensured mouse event != nullptr before deref

* separation of concerns: AFP WaveView updateCursor

extract check to pointerCloseToStartEndOrLoop()

* marked some function parameters as const

* Remove Core5Compat usage

* Fix bad merge

* Fixes after rebase

* Simplify QTX_WRAP_CPP call

* Remove comments that are obvious to a developer

* Whitespace

* Try using Qt 6 for MSVC CI

I chose Qt 6.5 because it's the last Qt LTS release with declared
support for Visual Studio 2019. Once we upgrade to Visual Studio 2022,
we could upgrade Qt as well.

* Fix MSVC build

Also fixes two memory leaks in MidiWinMM

* Fix GuiApplication on MSVC

* Fix interpolateInRgb

* Try building with patched Calf

* Fix submodule

* Fix OpulenZ build

* Try to fix zyn

* Fix comment

* Ty to fix zyn (again)

* Ty to fix RemotePluginBase

* Revert "Ty to fix RemotePluginBase"

This reverts commit 92dac44ffb11e19d1d5a21d9155369f017bd59e9.

* Update plugins/ZynAddSubFx/CMakeLists.txt

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Fix vertical & horizontal scroll wheel in SongEditor

* AppImage: Fix finding of Qt6 libs

* Fix implicit QString --> QFileInfo conversion

* Point submodule to lmms

* Fix multiple deprecation warnings

* Fix for Clang compiler

* Build with latest Qt LTS version now that we use MSVC 2022

* Update jurplel/install-qt-action to v4.3.0

* Bump minimum Qt6 version for MSVC

* Fix incorrect Qt version checks

Some comparisons were using ">" rather than ">="

* `QSize()` != `QSize(0, 0)`

* Fix more deprecation warnings

* Fix style

* Simplify Spectrum Analyzer mouse events

The Qt bug that used to be present appears to have been fixed, so the
workaround can be removed

* Minor changes

* Fix deprecated QCheckBox signal

* Fix setContent helper functions

* Remove QMultiMap usage from ControlLayout

* Remove SIGNAL and SLOT macros

* Revert TrackView.cpp changes

* Remove Q_DISABLE_MOVE usage since it does not seem to be available in Qt6

---------

Co-authored-by: michaelgregorius <michael.gregorius.git@arcor.de>
Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>
Co-authored-by: BoredGuy1 <66702733+BoredGuy1@users.noreply.github.com>
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: Lisa Magdalena Riedler <git@riedler.wien>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-11-03 11:58:15 -06:00
Jan125
fcb356df3d PathUtil: Serialization and Formatting (#8103)
PathUtil: Serialization and Formatting
* Serialize all operations to use / instead of platform specific paths.
* Formatting changes for consistency.
* Reorder functions, add serialization enforcement to the other two functions.
2025-10-31 12:06:34 -04:00
Fawn
0fe697c4e5 Remove fastMemCpy() from RemotePluginBase (#8114) 2025-10-29 16:32:29 -07:00
Fawn
6cec90cabb Use system cursors instead of embedded raster images where possible (#7838)
Given these changes, the knife tool now uses `Qt::SplitHCursor`, but `Qt::IBeamCursor` is also a a viable option. I am noting this should substantial concern arise over the appearance of `Qt::SplitHCursor` due to cursor themes, such as the default one applied to applications running under WSL.
2025-10-28 13:14:46 -06:00
Fawn
b1e6d180c7 Make portsmf a git submodule (#7755)
Instead of including the files directly in plugins/MidiImport/portsmf,
that path is now a git submodule (https://github.com/portsmf/portsmf).

Several other changes have been made to clean up MidiImport as well.
2025-10-24 16:24:46 -06:00
Sotonye Atemie
0c69da7233 Improve search behavior in the file browser (#7679) 2025-10-24 10:10:34 -04:00
Fawn
0fcd67f911 Use length-bounded string/memory functions (#7709)
Resolves #3949 by replacing all calls to sprintf() and strcpy() in first-party code with calls to snprintf() or some other reasonable alternative.
2025-10-23 13:58:32 -06:00
Sotonye Atemie
44a68b8b01 Fix audio resampling functionality (#7858)
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-10-22 08:34:07 -04:00
Tres Finocchiaro
38ceac80dd Remove custom winebuild task (#8077)
Remove custom winebuild task; leverage wine 10.14+ directly instead

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-10-21 11:19:52 -04:00
luzpaz
8c12e47b11 Fix several typos (#8090)
This cleans up typos in source comments and some user-facing strings.

Found via `codespell -q 3 -S "./plugins,./src/3rdparty,./data/locale,*.in,*.xpf" -L continous,currenty,globaly,inports,localy,nd,ot,sie,te,trough`
2025-10-20 22:20:01 -04:00
Petar Katić
872426bfc9 Added opening samples in SlicerT from the file browser (#8100)
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-10-20 16:07:47 -07:00
Dalton Messmer
4d10474d91 Update macOS runner image and XCode version (#8092) 2025-10-17 19:58:23 -04:00
Lost Robot
a809c03f87 Add SlewDistortion effect and oversampling support (#7641) 2025-10-13 12:18:34 -07:00
Tres Finocchiaro
807751dc4d AppImage: Un-pollute /usr/lib (#8053)
Refactor to un-pollute `$APP/usr/lib`
* Adds `usr/lib/suil-0` and `usr/lib/lmms/32` to `--deploy-deps-only` flags
* Simplifies libjack handling
* Removes outdated `LMMS_EXCLUDE_LADSPA` entry (carla no longer shares a parent folder with LADSPA plugins)
2025-10-06 11:03:16 -04:00
Dalton Messmer
db6fc2948c Fix null pointer deref when getting VST window size (#8051)
* Fix null pointer deref when getting VST window size
2025-09-28 00:25:10 -04:00
Dalton Messmer
912f4c2c50 Set minimum deployment target for macOS builds (#8004)
Set minimum deployment target for macOS builds
- Calculates MACOSX_DEPLOYMENT_TARGET based on qmake's minos value
- Echo's Lowest SDK supported for information purposes
---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
2025-09-23 10:46:50 -04:00
Alex
2eea79bdd3 Glue all notes if none are selected (#8018) 2025-09-09 23:37:39 -04:00
crystalreef22
04b27eee50 Allow Tempo Sync Knobs and Bars to be logarithmic (#8058)
* Allow Tempo Sync Knobs to be logarithmic

* Allow Tempo Sync Bars to be logarithmic
2025-09-08 00:37:31 -04:00
Fastigium
fbac56fdcc Fix VST crashes on Linux (#7987)
Pass winebuild param to disable dynamicbase/aslr
Requires bleeding-edge wine version
See also https://gitlab.winehq.org/wine/wine/-/merge_requests/8786

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
2025-08-27 14:03:46 -04:00
SameExpert
dec6a04574 OpulenZ: Fix compilation error (#8040)
This patch fixes the error: "invalid conversion from 'const unsigned char*' to 'unsigned char*'".
2025-08-18 04:05:37 -04:00
Fastigium
4aed2a8e5b Disable ASLR when building RemoteVstPlugin on Windows (#7976)
Disable ASLR when building RemoteVstPlugin executables on Windows in order to fix crashes when using certain VSTs

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-08-14 16:07:45 -04:00
regulus79
981e266613 Refactor Global Spacebar Play (#7926)
This PR simplifies #7762 by removing the editor-specific code from MainWindow and m_lastPlayMode from Song, and instead uses a static variable in Editor which keeps track of the last played editor.

This PR also removes the spacebar shortcut from MixerChannelView for changing the volume, as multiple users have noticed that it clashes with their intuition after getting used to the spacebar working everywhere else.
2025-08-14 10:08:04 -04:00
Monospace-V
0d6cbbdf5e Fix crash01, cello01, and e-organ01 sample lengths (#7948) 2025-08-11 00:44:07 -04:00
Alex
4dc7784331 PianoRoll: fix getKey and remove dead code (#8008)
- Fixes: when right clicking on a piano key close to the lower edge of the screen, "Mark semitone" will mark the wrong key because it uses the upper edge of the context menu as reference.
- Fixes: getKey() is off by 2 pixels
- Introduces: yCoordOfKey() which is the reverse of getKey()
- Removes: section of code that can never be reached

---------

Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com>
2025-08-09 15:37:15 -04:00
Michael Gregorius
ab050b88e5 Fix several problems (#8032)
## Fix problems with lifetime of `QByteArray`

Fix a problem with the lifetime of a `QByteArray` in
`attemptToReconnectOutput` and `attemptToReconnectInput`.

The method `constData` was called on a temporary which gets destroyed
before `targetName` and `sourceName` are used, thus leading to undefined
behavior.

## Fix index checks

Fix index checks in `attemptToReconnectOutput` and
`attemptToReconnectInput`.

The previous code would have allowed an index to be `size` of the
underlying vector which would access out-of-bounds memory.

## Braces for one-liner if statements

Add braces for one-liner if statements.
2025-08-07 12:12:18 +02:00
Michael Gregorius
88ed51edb9 Fix a segfault if JACK libs are missing (#8026)
Fix a segmentation fault that occurs if the JACK libraries are not
installed. In that case `jack_client_open` which is called through
`lib_weakjack` will return a `nullptr` for the client. Subsequent calls
to `jack_client_open` do not check for `nullptr` in the library so we
have to do this ourselves to prevent the segmentation fault. The check
is added to `AudioJack::setupWidget::getAudioPortNames`.

Extract the printing of the JACK status into the function
`printJackStatus` as its functionality is needed several times.

Print a warning and the status in `AudioJack::setupWidget::setupWidget`.

## Code review changes

Use `std::printf` and `std::fprintf`and print to `stderr` whenever fitting.

---------

Co-authored-by: Andrew Wiltshire <62200778+AW1534@users.noreply.github.com>
2025-08-06 18:12:56 +02:00
Dalton Messmer
dabfe6f95b Audio buffer view improvements (#8016)
- Add `SampleType` concept
- Make `channels()` static when possible
- Add `dataSizeBytes()` and `dataView()` to `InterleavedBufferView`
- Support conversions between `std::span<SampleFrame>` and `InterleavedBufferView<float, 2>`
- Support iteration over frames of `InterleavedBufferView`
- Add `subspan` method
- Add `AudioBufferView` concept

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-08-06 04:01:21 -04:00
Dalton Messmer
c86fe784c7 Remove the Gate knob from effects (#8011)
Major changes:
- Remove Gate knob from effects, effectively hard coding its value to zero
- Replace effect RMS calculations with a more efficient way of detecting silent buffers
- Only perform silent buffer detection when `ProcessStatus::ContinueIfNotQuiet` is returned from a plugin AND auto-quit is enabled

Minor changes:
- Remove gate from presets
- Remove gate from .mmp projects
- Move `Effect::processorCount()` to `LadspaEffect`
- Rename `Effect::checkGate` to `Effect::handleAutoQuit`
- Adjust silence threshold for better compatibility with old RMS calculations
- Remove some unnecessary methods from `Effect`
- Reset quiet buffer count in `stopRunning`
- Use positive name for auto-quit boolean
- Simplify `m_autoQuitEnabled` initialization
2025-07-22 17:01:48 -04:00
Johannes Lorenz
71ce49d7ba Remove lots of useless/misplaced includes (#7999)
Follow-Up of 7db3fa94a1 .

This was done by setting `CMAKE_C_INCLUDE_WHAT_YOU_USE` and
`CMAKE_CXX_INCLUDE_WHAT_YOU_USE` to (broken down into multiple lines here,
note, all below `FL/x.h` is not required for C):

```
include-what-you-use;
    -Xiwyu;--mapping_file=/usr/share/include-what-you-use/qt5_11.imp;
    -Xiwyu;--keep=*/xmmintrin.h;
    -Xiwyu;--keep=*/lmmsconfig.h;
    -Xiwyu;--keep=*/weak_libjack.h;
    -Xiwyu;--keep=*/sys/*;
    -Xiwyu;--keep=*/debug.h;
    -Xiwyu;--keep=*/SDL/*;
    -Xiwyu;--keep=*/alsa/*;
    -Xiwyu;--keep=*/FL/x.h;
    -Xiwyu;--keep=*/MidiApple.h;
    -Xiwyu;--keep=*/MidiWinMM.h;
    -Xiwyu;--keep=*/AudioSoundIo.h;
    -Xiwyu;--keep=*/OpulenZ/adplug/*;
    -Xiwyu;--keep=QPainterPath;
    -Xiwyu;--keep=QtTest
```

FAQ:

* Q: Does this speed-up a completely fresh compile?
* A: No, I measured it.

* Q: Does it speed up anything else?
* A: Yes. If you change one header, it can reduce the number of CPP files
     that your compiler needs to recompile, or your IDE has to re-scan.

* Q: What other reasons are for this PR?
* A: It's idiomatic to only include headers if you need them. Also, it will
     reduce output for those who want to use IWYU for new PRs.

Background:

This is just a remainder PR of what I planned. My original idea was to setup
a CI which warns you of useless includes (but not of all issues that IWYU
complains about). However, I could not see that this was favored on Discord.
A full IWYU CI also has the problem that it (possibly??) needs to compile
with `make -j 1`, which would make CI really slow.

However, for that plan, I had to fix the whole code base to be IWYU
compliant - which it now is.
2025-07-21 23:39:17 +02:00
regulus79
e79945ffc5 Remove m_resizable from Clips (#7954)
Minor refactor of `Clip` methods related to resizing
2025-07-21 09:39:14 -04:00
Michael Gregorius
997764a0dc Inputs and Outputs Selection for Jack Driver (#7919)
# GUI

## Present inputs/outputs in hierarchical menu

Present the available inputs and outputs in a hierarchical sorted menu
which shows clients with their ports.

The heavy lifting of creating the menu for the tool button is done in the
new method `buildMenu`.

It takes the input/output names in Jack's "Client name:Port name" format.
If an input/output name can be successfully split into the client name
and port name then a sub menu with the client name is created (if it was
not already created before) and the port name is added as an entry.

If the name cannot be split into exactly two components then it is simply
added to the top level menu as is.

Ports of the LMMS client are filtered out to prevent loops.

The menu starts with the client's sub menus in alphabetical order. Then
the top level entries are added in alphabetical order as well.

The callbacks for the `QAction` instances are implemented with lambdas
because MOC does not support nested classes like the setup widget is. For
now the used lambda only sets the text of the `QToolButton` as these are
used for persisting the configuration anyway.

## Disconnected state

Add the option to keep inputs/outputs disconnected.

The disconnected state is represented by the string "-" which is also
what is saved into the configuration in this case. For now the
representation in the GUI and of the save state is the same as it has the
advantage that no translation is necessary and thus not mapping between
display text and save state is necessary.

## Show technical output/input names

Show the technical output and input port names used by LMMS in the setup
dialog. Note: these are the names that are shown in tools like `qjackctl`
or `qpwgraph`.

This was proposed in a review. Personally I like the non-technical names
better but let's see what's accepted.

## Let the tool buttons use available space

Let the tool buttons stretch so that they look uniform and use all the
available space.

# Driver

## Reconnect inputs and outputs

Attempt to reconnect the inputs and outputs from the configuration during
startup of the Jack driver. Nothing will be done for inputs and outputs
that are not available at startup. Example: the users might have saved
some inputs when a device was available. The device is then disconnected
and LMMS restarted. The stored inputs cannot be used anymore. To give the
users the least surprise nothing is done.

`AudioJack::attemptToConnect` does the actual reconnection and also
prints some information for now.

`attemptToReconnectOutput` and `attemptToReconnectInput` delegate to
`attemptToConnect` with the right parameters.

# Technical details

## Generalized number of inputs/outputs

Generalize the number of inputs and outputs by using for loops. This
affects the number of widgets that are created and the amount of
configuration that is stored.

This change is a result of a code review discussion. In my opinion it
adds unnecessary complexity to something that should later be implemented
completely different anyway. It is for example now necessary to compute
the key names that are used during the saving of the configuration based
on the channel number. The commit exists so that its changes can be
discussed further. It might be reverted in one of the next commits.

## Collecting input and output names

Add `AudioJack::setupWidget::getAudioPortNames` which takes the type of
port and then collects all port names which match. Make
`getAudioOutputNames` and `getAudioInputNames` delegate to that method
with the appropriate type. This also hides the different terminologies a
bit.

## Separate Jack client in the GUI

The separate Jack client is necessary because the setup dialog does not
have any access to the actual driver. So a new client is created when the
dialog is opened and deleted when it is closed, i.e. when the dialog is
deleted itself.

## Repeated strings

Repeatedly used hard-coded strings are defined as static constant
variables in the anonymous namespace. This should prevent subtle mistakes
when working with the configuration values of the Jack driver.

## Saving the settings

`AudioJack::setupWidget::saveSettings` saves the selections that have
been made from the widgets right into the configuration.
2025-07-16 22:31:01 +02:00
Alex
344fdd5b1f Remove currentPatternChanged() that has no effect (#7989) 2025-07-15 09:17:51 +02:00
Sotonye Atemie
48f3a84206 Set the sample rate for MP3 exports (#7998)
Sets the MP3 export sample rate to that of the engine's rate.


Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-07-10 05:55:45 -04:00
Dalton Messmer
1641f5f95f Use C++20 in RemoteVstPlugin (#7916)
- Build RemoteVstPlugin in C++20 mode
- Avoids using std::wstring due to strange issues with it when built
with wineg++. See https://bugs.winehq.org/show_bug.cgi?id=58465
- Fix some memory leaks + minor cleanup of RemoteVstPlugin code
- Rename `F_OPEN_UTF8` to `fopenUtf8`
- Use C++20 in our `determine_version_from_source` CMake function
- Update ZynAddSubFX submodule
2025-07-10 02:08:42 -04:00
Michael Gregorius
4c3f8191af Remove Knob::setHtmlLabel (#7993)
* Remove Knob::setHtmlLabel

Remove the unused method `Knob::setHtmlLabel` and its associated members.
This removes some unnecessary complexity from the code.

* Public label methods

Make `Knob::setLabel` public. Add `Knob::getLabel` for completeness.

* Delegate in KnobControl::setText

Make `KnobControl::setText` delegate to the `Knob` instance now that `Knob::setLabel` is public again.
2025-07-07 20:16:24 -04:00
Abel Umenhoffer
a1da660741 Fix Carla breaking GUI on Wayland #7582 (#7966) 2025-07-06 21:08:31 -04:00
Michael Gregorius
5c7131aa45 Allow export of only the selected notes (#7991)
Users can now choose if they only want to export the selected notes when
exporting a MIDI clip as an `xpt` or `xptz` file in the piano roll. The
export file dialog now shows a checkbox with the label "Export only
selected notes".

## Technical details
Add the new public method `exportToXML` to `MidiClip`. Compared to
`saveSettings` it has an additional parameter `onlySelectedNotes` which
controls which notes are exported. The default is to export all notes.
The method `saveSettings` now simply delegates to `exportToXML` using the
default.

`PianoRollWindow::exportMidiClip` now adds a check box to the export
dialog which lets users select if they only want to export the selected
notes or all notes. The default is to export all notes. The method now
uses the new method `exportToXML` for the export and passes the state of
the check box into the method.
2025-07-06 08:42:54 +02:00
Michael Gregorius
05a5264870 Fix import of xpt and xptz files (#7986) (#7990)
Fix the import of `xpt` and `xptz` files by adding upgrade code to
`DataFile::type`. The new code maps the old textual representation
"pattern" to the enum `Type::MidiClip`.

Without the extra upgrade code the text "pattern" is mapped to
`Type::Unknown`. This then leads to problems at the end of
`DataFile::loadData` where the enum representation is mapped back to the
textual representation again to retrieve the root element from the
upgraded XML.

So without the upgrade it's:
* Map "pattern" to `Type::Unknown`
* Upgrade XML from "pattern" to "midiclip"
* `Type::Unknown` does not map to "midiclip" and fetching the root
  element fails.

With the upgrade it's:
* Map "pattern" to `Type::MidiClip`
* Upgrade XML from "pattern" to "midiclip"
* `Type::MidiClip` is mapped to "midiclip" and fetching the root element
  succeeds.
2025-07-05 19:03:05 +02:00
regulus79
00d5abc930 Recording logarithmic automation hotfix (#7621)
When you record an automation clip with a logarithmic knob (for example, a freq knob in the equalizer) the recorded values in the automation editor are correct.....

....But, for whatever reason, lmms tries to scale the recorded values back to linear when playing the automation, which causes the recorded frequency to be much lower.

This pr does not fix the underlying issue, but instead just scales the recorded values so that everything works.
2025-07-04 11:52:04 -04:00
regulus79
bbdfeff5e1 Add Playhead and Timeline to Pattern Editor (#7794)
Adds a visual indicator to show the pattern editor playing, along with a timeline widget to allow the user to skip forward/backward in a pattern.
2025-07-02 18:04:16 -04:00
Fawn
186beec156 Fix effect gate logic (#7971)
Reverts a mistake from #7696
2025-06-25 16:17:53 -04:00
Alex
346ee60cd2 Update clip length after clearing all notes (#7960)
When clearing notes from a long melody clip in pattern editor, it looks like the clip becomes short, but it actually remains the same length (despite empty), and that affects the length of the whole pattern. This PR fixes this issue.
2025-06-21 20:53:34 -04:00
Fawn
2806a31e4c Use vector assets for Dispersion plugin (#7773) 2025-06-15 20:23:52 -06:00
Alex
76dddd8c66 Don't undo zoom! (#7943)
Makes it so that editor zoom, automation tension, along with quantization, note length, and all other combo boxes are not added to the undo history.

---------

Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
2025-06-15 14:41:23 -04:00
regulus79
45ab56dd71 Fix Auto Resize when Dragging Sample Files onto Sample Clips (#7952)
Changes things so that only sample clips with auto-resize enabled will automatically resize to the sample length when dragging-dropping a sample from the sidebar onto a sample clip. Non-auto-resize clips will keep their original length, but still update so that their start time offset is 0.
2025-06-13 21:30:11 -04:00
Alex
a505f570e9 Fix TextFloat flickering (#7942)
Fixes TextFloat flickering which occurs when scrolling on knobs, faders, and note volume in the piano roll.

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-06-10 19:04:45 -04:00
Dalton Messmer
53d30d8b91 Audio buffer views (#7945)
Adds two non-owning views for audio buffers: `InterleavedBufferView` and `PlanarBufferView`.

The channel count can be specified at either compile-time or runtime. Specifying at compile-time provides both performance and space optimizations. The way this works is the same as `std::span` except this uses the new `DynamicChannelCount` constant rather than `std::dynamic_extent`.
2025-06-08 20:15:16 -04:00
Petar Katić
0dfd2d5597 Init commit (#7940)
Fixes a bug where the "Init" button in LOMM visually behaves as a toggle button instead of a push button.
2025-06-07 20:09:54 -06:00
Sotonye Atemie
3a18276136 Use complete basename in PathUtil::cleanName instead of basename (#7934)
Use `completeBaseName()` in `PathUtill::cleanName` instead of the `baseName()`. Needed for handling filenames with periods correctly.
2025-06-06 16:55:26 -04:00
Bimal Poudel
889a2f8aac Fix quick access letter conflict with Export and Export Tracks (#7927)
Update shortcut `T` for exporting Tracks, so that `x` is default export.

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
Co-authored-by: Andrew Wiltshire <62200778+AW1534@users.noreply.github.com>
2025-06-05 08:32:38 -04:00
regulus79
ce3439b079 Fix Piano Roll key events from leaking to other instrument windows (#7915) 2025-06-04 21:26:41 -04:00
regulus79
8acc4ed3ae Fix Position Line gradient appearing in all editors no matter which one is playing (#7882) 2025-06-03 23:10:13 -04:00
Michael Gregorius
2c1d402255 Flanger: connect "Invert" to model (#7929)
Connect the Flanger's "Invert" check box to the model.

Before this commit it was a placebo effect. ;)
2025-06-03 16:51:30 -04:00
regulus79
25e8b640d8 Update Sample Length when Loading New Sample via Double-Click (#7898)
This PR makes it so that when you double-click on a sample clip and select a new sample, it will automatically update the length of the clip, as long as the clip has auto-resize enabled.
2025-06-02 00:42:02 -04:00
Andrew Wiltshire
2747b402a0 Rename some include guards (#7924)
---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-06-01 12:19:34 -04:00
Andrew Wiltshire
fd1a4c1b6e Move FileRevealer into the lmms::gui namespace (#7923) 2025-06-01 09:46:00 -04:00
Sotonye Atemie
2d2c26d501 Remove m_inBuf from AudioJack (#7922)
Extra variable in `AudioJack` that can be removed, as `m_inputFrameBuffer` is currently being used instead.
2025-06-01 04:45:43 -04:00
Andrew Wiltshire
3f8b86a559 Ignore "Keep plugin windows on top" setting when on wayland (#7901)
Fix a crash that occurs when running under Wayland and when loading a VST
plugin with the option "Keep plugin windows on top when not embedded"
enabled.
2025-05-31 19:58:08 +02:00
mmeeaallyynn
352ef8c25e Sample Track Recording with Jack backend (#7567)
Enable the `AudioJack` to take recorded input and push it to the `AudioEngine`. This adds functionality for `AudioJack` which already exists for `AudioSdl` and `AudioPortAudio`. Note that sample track recording in the LMMS core is not completed before #7786 .

This PR also removes the reading and saving of the channel number configuration in several places as it will default to `DEFAULT_CHANNELS` all the time anyway.

Co-authored-by: Johannes Lorenz <j.git@lorenz-ho.me>
Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
2025-05-31 12:49:14 +02:00
Michael Gregorius
b6d6509068 Individual knob labels rendered using the widget's font size (#7525)
Adjust the `Knob` class so that it defaults to taking the font size of
the knob's font into account when rendering its label. This allows to
use labels of different sizes for different knobs. Previously all knob
labels throughout the whole application were rendered with the same fixed
font size. Hence it was not possible to adjust the label size for a
single knob because this would have affected all other knobs as well.

The new implementation also allows the knobs to pick up CSS rules.

To be able to control the knob behavior two new constructors have been
added to the `Knob` class. Both constructors are concerned with creating
knobs with labels and therefore they directly take the label text as a
parameter. This removes numerous explicit calls to `setLabel` in the
code.

There is only one constructor that allows to switch between the new
behavior of taking the widget's font size into account and the old legacy
behavior of always rendering with the same fixed font size of
`SMALL_FONT_SIZE`. The parameter was modelled as an enum to make it
easier to find the remaining knob instances that use the legacy behavior.
This makes it easier to find them in case they should be removed as well.
In that case the string `LegacyFixedFontSize` can be searched.

The other new constructor allows to directly set the knob's (and
therefore the label's) font size to a pixel value.

Corresponding constructors have been added to `TempoSyncKnob`. The
constructors of `KnobControl` and `CustomTextKnob` have been adjusted to
take advantage of the new constructors. An usused constructor was removed
in `CustomTextKnob`.

The method `Knob::setLabel` has been made protected because labels should
now be set through the new constructors.

A new property called `m_fixedFontSizeLabelRendering` was added to the
`Knob` class. It controls how the labels are rendered. Fixed font size
legacy rendering can be activated by calling the protected method
`setFixedFontSizeLabelRendering`. The current setting can be queried via
`fixedFontSizeLabelRendering`.

## Changes in the plugins

Some plugins have been switched to using layouts to organize their
widgets so that they can accommodate for knobs with label sizes set by
the application font.

The fixed font size (legacy) rendering mode is still used in the
following places:
* EnvelopeAndLfoView
* InstrumentSoundShapingView
* InstrumentFunctionViews
* EffectView
* InstrumentTrackView
* SampleTrackView
* Delay plugin
* Carla plugin


# individual commit messages

What follows are the individual commit messages of the commits that have been squashed into one commit. They might help in case of more detailed investigations of how things came to be.

* Knob with correct label rendering

Enable the knob to render the label correctly at arbitrary sizes if it's configured to do so. Otherwise it will render like before. The used mode is determined when a label is set for the knob because as long as the label is not set a knob does not have one anyway.

The painting code now always renders the label with the font that's set for the widget.

The are now two methods to set the label text. The new method `setLabelLegacy` renders the label as before albeit in a slightly adjusted implementation. It now sets the widget font to a fixed pixel size font and then calculates the new widget size as before, i.e. not really taking the size of the font into account. This might lead to overlaps if the font of the knob is large.

The method `setLabel` now has an additional (temporary) parameter called `legacyMode`. It is by default set to `true` so that all knobs still render like they did before. This is implemented by delegating to `setLabelLegacy` if it's set to `true`. Otherwise the method calculates the new size of the widget by taking the pixmap and the label with the current font into account.

Please note that as of now you must set the knob font before calling any of the methods that sets the label. This is because the new size is only calculated via these code paths. However, this is already much better than only being able to use one hard-coded label size for all knobs.

* Switch from `setLabel` to `setLabelLegacy`

Switch all callers of `setLabel` to `setLabelLegacy` so that it becomes
obvious in which places the old knob implementation is used.

* Remove parameter `legacyMode` from `setLabel`

Remove the parameter `legacyMode` from `setLabel`. Add the member
`m_legacyMode` as it is needed in `Knob::changeEvent` so that we do not
switch the behavior when the knob is enabled/disabled.

* Extract methods

Extract `setLegacyMode` and `updateFixedSize`. Also add the getter `legacyMode`.

* Introduce legacy knob builders

Introduce legacy knob builders and apply them to the plugins. There are three new methods which encapsulate how to create a corresponding legacy knob:
* `Knob::buildLegacyKnob`
* `CustomTextKnob::buildLegacyKnob`
* `TempoSyncKnob::buildLegacyKnob`

These methods set the knob they build to legacy mode and also set a label in legacy mode. The idea is to concentrate the relevant legacy code in these methods. They will later also be useful to quickly find all the places in the application where legacy knobs are used.

The three methods are applied to the plugins directory. Most plugins use the build methods to build their knobs which also enables the removal of the explicit calls to `setLabelLegacy` from their code.

For some plugins their implementations were adjusted so that they can deal with showing the labels in the applicaiton font, i.e. in the font size of the widget their are contained in. Most of the times this involved removing the fixed size and putting the elements in a layout (while also removing move calls). The following LMMS plugins use the application font now and are thus better readable:
* Amplifier
* BassBooster
* Dispersion
* Flanger
* Peak Controller
* ReverbSC
* StereoEnhancer Effect

The Vectorscope now shows the "Persist." label in the same size as the label of the check boxes.

Setting an empty label was removed for Lb302.

* Legacy knob builders in GUI

Apply the legacy knob builders in the GUI components. Most components use the legacy knobs until they can be redesigned:
* Effect view ("W/D", "DECAY", "GATE")
* LFO Controller
* Instrument window

Everything related to the instrument window is for now kept to use the legacy knobs and should be adjusted at a later point to be more flexible:
* Envelope and LFO
* Functions
* Sound Shaping

The Instrument and sample track both use the legacy knobs for the "VOL" and "PAN" knobs. This might be adjusted later.

The following components now render the labels of their knobs with the application font size:
* MIDI CC Rack
* The class `LadspaControlView`, which is not in used anymore

Some vertical spacing was added to the MIDI CC Rack for slightly improved separation of the elements. The knobs are center aligned in the layout so that the transition between element under and over "CC 100" is cleaner. Setting the models in an explicit loop was removed and is now done when the knobs are created.

## Technical details
Extend `Knob::buildLegacyKnob` with the option to also set the name of the knob. This is needed for some changes in this PR.

The method `KnobControl::setText` now needs to distinguish between legacy mode and non-legacy mode.

* Remove `Knob::setLabelLegacy`

Remove `Knob::setLabelLegacy`. Instead make sure that the `Knob` updates its size in the following situations:
* The label is set.
* The font changes.
* Legacy mode is set or unset (already implemented).

The handling of font changes has been added to `Knob::changeEvent`. The update in case of a changed label is added to `Knob::setLabel`.

Every client that called `setLabelLegacy` now also sets the legacy font in size `SMALL_FONT_SIZE` as this was previously done in `setLabelLegacy`. The label is set via `setLabel` now. Both actions should result in an up-to-date size.

The method `KnobControl::setText` now only sets the label via `setLabel`, assuming that the wrapped knob was already configured correctly to either be a legacy knob or not.

* Use descent to calculate base line

Use the descent of the font to calculate the distance of the base line from the bottom of the knob widget if we are not in legacy mode. In legacy mode we still assume the descent to have a value of 2, i.e. the base line will always have a distance of 2 from the bottom of the knob widget regardless of the used font.

Also refactor the code a bit to make it more manageable.

* Extract `Knob::drawLabel`

Extract the method `Knob::drawLabel` which draws the label. It is called from `paintEvent`.

* Use non-legacy knobs for instrument and sample track

Use non-legacy knobs for the "VOL" and "PAN" knobs of the instrument and sample track. This gives a bit more separation between the knob and the label but to make this work the font size had to be decreased by one pixel.

* Introduce `buildKnobWithSmallPixelFont`

Introduce the builder method `buildKnobWithSmallPixelFont` in `Knob` and `TempoSyncKnob`. It creates a non-legacy knob with a small pixel sized font, i.e. it still uses the small font but with a corrected size computation and corrected space between the knob and the label. It is mostly used in places with manual layouts where there's enough space to have the bit of extra space between the knob and the label.

The following plugins use these knobs:
* Bitcrush
* Crossover EQ
* Dual Filter
* Dynamics Processor
* Multitap Echo
* Spectrum analyzer
* Mallets
* Waveshaper
* ZynAddSubFx

The "IN" and "OUT" label of the Bitcrush plugin use the default fixed font size now because the plugin uses a pixel based layout. Using the point based application font looked off.

They are also used in the following component:
* Effect view, i.e. the "W/D", "DECAY", "GATE" knobs of an effect
* LFO Controller

* Non-legacy knobs for VSTs

Use non-legacy knobs with small pixel fonts for the parameter lists of VST instruments and effects.

This is accomplished by renaming `CustomTextKnob::buildLegacyKnob` to `buildKnobWithSmallPixelFont` and removing the call to `setLegacyMode`.

* Fix styled knobs

Fix the handling of styled knobs which are created in non-legacy mode. Styled knobs do not use pixmaps and have no labels. Their size is set from the outside and they are painted within these limits. Hence we should not compute a new size from a pixmap and/or label in `Knob::updateFixedSize`.

This fixes the following plugins:
* FreeBoy
* Kicker
* Monstro
* Nescaline
* Opulenz
* Organic
* Sf2 Player
* sfxr
* SID
* SlicerT
* Triple
* Watsyn
* Xpressive

The functionality broke with commit defa8c0180e.

An alternative would have been to check for a styled knob in the contructor or `initUI` method and to set the legacy flag for these.

The best solution would likely be to create an own class for styled knobs and to pull that functionality out of `Knob` because they somewhat clash in their handling.

* Code review changes

Parameter whitespaces in the builder methods of `Knob`.

Use `adjustedToPixelSize` in `InstrumentTrackView` and `SampleTrackView`.

* Code review changes

Make the code that computes the new fixed size in legacy more readable
even if it is just legacy code that's was not touched. Add some code
documentation.

Other cosmetic changes:
* Whitespace adjustments
* Remove unused parameter in `paintEvent`
* Rename `knob_num` to `knobNum`

* Add documentation for legacy mode

Add some documentation which explains what the effects of legacy mode
are.

* Code review

Remove unnecessary dereference.

Also remove unncessary code repetition by introducing
`currentParamModel`.

* Decrease the label size of some knobs

Decrease the size of the following knob labels to 8 pixels:
* "VOL" and "PAN" in the instrument and sample track views
* "W/D", "DECAY" and "GATE" in the effect view

Technically this is accomplished by introducing
`Knob::buildKnobWithFixedPixelFont` and
`TempoSyncKnob::buildKnobWithFixedPixelFont`.

Both versions of `buildKnobWithSmallPixelFont` now also delegate to
the new methods.

* Adjustments to CrossoverEQControlDialog

Commit the adjustments that were done to `CrossoverEQControlDialog` which I had forgotten to add after fixing the merge.

* Fix formatting of CrossoverEQControlDialog

Fix the formatting of `CrossoverEQControlDialog` which got messed up after copying the code from the current version on GitHub.

* Code review changes

Use `std::max` instead of `qMax`. Remove some unnecessary whitespace.

* Protected legacy mode methods

Make `legacyMode` and `setLegacyMode` protected to ensure that legacy knobs can only be built using the factory method `buildLegacyKnob`. In the long term legacy mode should be removed.

* Code review: remove indexed access

The original request in the code review was to use `size_t` instead of
`uint32_t` in the for-loop. However it is possible to completely remove
the indexed access and to turn it into a simple iterated for-loop.

Also remove code repetition in the calculation of the maximum knob width
of the group. Use std::max instead of manual management.

* Fix u_int16_t to uint16_t

This should hopefully fix the WIndows builds.

* Fix AudioFileProcessor knobs

Fix a problem with the `AudioFileProcessorWaveView::knob` which is caused
by the fact the this knob uses the pixmap based knob type `Bright26`
without a label. Most other knobs that inherit from `Knob` set their knob
type to `Styled` which means that no pixmap is used to render the knob.

In the specific case the knob instance is created and the contructor
runs. In the constructor the AFP knob is set to a fixed size of (37,47).
However, at a later point the method `Knob::changeEvent` is triggered by
Qt due to a font change. This in turn calls `Knob::updateFixedSize` which
then recomputes the fixed size and effectively changes the width of the
knob to the width of the pixmap which is 27. Because the knob previously
was rendered centered with a width of 37 this means that the knob is now
effectively shifted by five pixels to the left.

This commit counters this effect by moving the affected AFP knobs five
pixels to the right. A visual difference between the fixed version and
the current master showed no differences. So this should fix the problem.

Because setting the knob to a fixed size of (37,47) does not have any
lasting effect anyway the code is removed from the constructor of the AFP
knob.

* Use legacy knobs in EffectView

* Legacy knobs for instrument & sample

Use legacy knobs for the instrument and sample track view ("VOL", "PAN").

* Add documentation to Knob builder methods

Add some documentation to the `Knob` builder methods. Mark `buildLegacyKnob` as deprecated and note that it should not be used in new code.

* Ensure legancy rendering for legacy knobs

Ensure that legacy knobs are always rendered at a size of 12 pixels,
i.e. `SMALL_FONT_SIZE`.

The previous implementation used the font metrics of the knob's current
font to compute the new fixed size and to render the label. It assumed
that the knob was created using `Knob::buildLegacyKnob` and that
therefore the font is set to 12 pixels. However, this meant that legacy
knobs can still be affected by style sheet settings. The following CSS
rule for example resulted in legacy knobs with a larger font size:
```
* { font-size: 18px; }
```

The fix is to use a font with a size of `SMALL_FONT_SIZE` when
calculating the fixed size of the `Knob` widget and when rendering it if
we are in legacy mode. This ensures that a legacy knob is unaffected by
CSS rules.

The non-legacy knob still uses the widget's font size and therefore it is
affected by CSS rules. However, this is a feature and not a bug because
when for example using a rule like the one above the knob does exactly
what it's asked to do.

* Remove unused constructor

Remove an unused constructor from CustomTextKnob

* Remove Knob::buildKnobWithSmallPixelFont

Remove the builder method `Knob::buildKnobWithSmallPixelFont` and replace
it with an equivalent new contstructor which takes the same arguments as
the build method.

* Remove Knob::buildKnobWithFixedPixelFont

Remove `Knob::buildKnobWithFixedPixelFont` as it is not used anymore.
Previously it was delegated to by the now removed method
`Knob::buildKnobWithSmallPixelFont`.

* Constructor for knobs with pixel size labels

Remove `TempoSyncKnob::TempoSyncKnob` and add an equivalent constructor.

Make `buildKnobWithSmallPixelFont` use the new constructor.

* Remove TempoSyncKnob::buildKnobWithSmallPixelFont

Remove `TempoSyncKnob::buildKnobWithSmallPixelFont` and make clients use
the new constructor.

* Remove CustomTextKnob::buildKnobWithSmallPixelFont

Remove `CustomTextKnob::buildKnobWithSmallPixelFont` and extend the
constructor so that it also takes a label. Previously all constructions
went through the build method and now all constructions use the extended
constructor.

* Knob constructors whichKnob constructors which take labels

Add constructors for `Knob` and `TempoSyncKnob` which also take the label
text. Make setLabel protected as most knobs should know their labels at
construction time.

This prevents "chatty" code like the following example:
```
Knob* knob = new Knob(KnobType::Bright26, this);
knob->setLabel("My label");
```

This now becomes a simple a one-liner:
```
Knob* knob = new Knob(KnobType::Bright26, "My label", this);
```

The constructor of `KnobControl` also had to be extended with the label
text because it cannot access the setLabel of the Knob that it manages.
However, it can pass the text during construction. Its implementation of
the virtual method `Control::setText` becomes empty due to this. The
`KnobControl` is currently only used in `Lv2ViewProc::Lv2ViewProc`. Here
the `KnobControl` is created by passing the port name into the
constructor. However, the virtual method `setText` is still called in
line 91 for all other implementations.

Add documentation for the constructors.

* Remove Knob::buildLegacyKnob

Remove `Knob::buildLegacyKnob` by extending the very similar constructor
with an enum that indicates whether the constructed `Knob` should be in
legacy mode or not. The default is to build a non-legacy `Knob`.

Wherever `Knob::buildLegacyKnob` was called the constructor is now called
with `Knob::Mode::Legacy` as the parameter. In some places where the
onject name is set `Knob::Mode::NonLegacy` has to be added explicitly.

* Remove TempoSyncKnob::buildLegacyKnob

Remove `TempoSyncKnob::buildLegacyKnob` by extending the very similar
constructor with an enum that indicates whether the constructed
`TempoSyncKnob` should be in legacy mode or not. The default is to
build a non-legacy `TempoSyncKnob`.

Wherever `TempoSyncKnob::buildLegacyKnob` was called the constructor is
now called with `Knob::Mode::Legacy` as the parameter.

* Vertical spacing for Peak Controller

Add a vertical spacing of 10 pixel between the knobs of the Peak Controller.

* Peak Controller: use default margins

Remove the specific call to `setContentsMargins` from the Peak Controller so that the main layout uses Qt's default margins.

Also remove the spacing again.

* Rename the enum `Knob::Mode`

Rename the enum `Knob::Mode` and its values so that they better describe
what they influence.

`Knob::Mode` is renamed to `Knob::LabelRendering` to indicate that its
value affects the label rendering.

The value `NonLegacy` is now called `WidgetFont` to indicate that the
knob uses the font settings of the widget when rendering the label.

The value `Legacy` is now called `LegacyFixedFontSize` to indicate that
it's a legacy behavior which uses a fixed font size that does not adhere
to the font size that's set for the widget's font.

Adjust all callers accordingly.

* Add TempoSyncKnob documentation

Document the constructor of `TempoSyncKnob` that can be used to set the
label rendering to lecacy mode.

* Name adjustments and parameter removal

Rename `m_legacyMode` to `m_fixedFontSizeLabelRendering`.

Rename the method `legacyMode` to `fixedFontSizeLabelRendering`.

Rename `setLegacyMode` to `setFixedFontSizeLabelRendering`. Also remove
the boolean parameter from the method as it was only called with `true`
anyway.
2025-05-29 19:35:48 +02:00
regulus79
7e02795f47 Don't copy DetuningHelper in Note copy constructor (#7888)
Reworks how note detuning copying works so as not to perform a clip duplication and allocation by default in the constructors

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-05-28 19:28:13 -04:00
Dalton Messmer
cb84fce599 Upgrade to Windows 2022 / Visual Studio 2022 (#7897)
Upgrade to Windows 2022 build runner and Visual Studio 2022 for MSVC builds.

Continue installing Qt 5.15.2 with the Visual Studio 2019 option since it doesn't provide a VS 2022 option.
2025-05-20 12:04:46 -04:00
regulus79
6bde3fb492 Fix Crash when Reversing Empty MIDI Clip (#7893) 2025-05-15 22:45:17 -04:00
Petar Katić
e50f312818 Add option to clear all notes in SlicerT (#7850) 2025-05-05 19:03:53 -04:00
regulus79
61736a97b6 Ensure clips have auto-resizing enabled by default (#7874)
A follow up to #7477, which ensures clips have auto-resizing enabled by default. This is needed because auto-resizing was the default behavior, but the code tried to use this newly added attribute with a default of 0 (i.e., auto resizing is not enabled).
2025-05-04 16:42:43 -04:00
regulus79
06d897bc4d Fix crash when playing Pattern Editor without Pattern Track (#7862)
Fixes a crash that occurs when attempting to play within the Pattern Editor with no Pattern Track created.

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-05-04 15:59:16 -04:00
regulus79
1c62638696 Fix issue with Mixer key events and Track Label Button focus (#7870)
A follow up to #7762 to fix various issues involving key events and focus grabbing problems.
2025-05-04 15:50:33 -04:00
cyberrumor
41093efcbe Revert "Fix PeakController attack/decay (#7566)" (#7871)
Prior to commit b5de1d50e, audible zipper artifacts were present when
using the PeakController on a bus to control the volume of another bus
for sidechain compression. The bus that had its volume reduced was the
one which produced audible artifacts.

Commit b5de1d50e introduced LERP to PeakController to smooth out its
signal, which eliminated the zipper artifacts. However, this had the
side effect of increased latency even when both attack and decay
settings were set to zero.

Until a more robust solution is implemented, reverting this change
eliminates the latency by eliminating the lerp, but reintroduces audible
zipper artifacts.
2025-05-02 11:04:47 -04:00
Tres Finocchiaro
928b72ab36 Add Windows arm64 builds (#7848)
* Add Windows arm64 builds
2025-04-30 15:26:35 -04:00
regulus79
679f9b848e Add splitting (and resizing) to all types of clips (#7477)
Allow for splitting and resizing all types of clips (automation, MIDI, sample, pattern, etc) using the knife tool in the Song Editor.

---------

Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-04-29 17:56:13 -04:00
Michael Gregorius
c91c81eee7 Update src/3rdparty/qt5-x11embed to latest version (#7825)
Update the submodule https://github.com/Lukas-W/qt5-x11embed.git to commit 499d737c8e8.

This is done to enable LMMS to build with CMake 4 and newer.
2025-04-28 19:21:20 +02:00
Andrew Wiltshire
d403a54140 Add option to favorite items in the file browser (#7753)
Added the ability to favorite items. This gets added to its own tab named "My Favorites".

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-04-27 21:34:37 -04:00
regulus79
510fbf6ffc Global Spacebar Play (#7762)
This PR refactors how the spacebar is handled by the editors and the MainWindow to allow it to play/stop (Shift+Space for play/pause) the last played editor, no matter if it is in focus or not.

---------

Co-authored-by: Fawn <rubiefawn@gmail.com>
Co-authored-by: Sotonye Atemie <satemiej@gmail.com>
2025-04-26 18:26:26 -04:00
Petar Katić
8b5297f914 Zyn filter FREQ brought back to 64, fix lowpass issues (#7844) 2025-04-22 07:06:06 +02:00
regulus79
32c427eab4 Add Midi Reversing (#7606)
Adds the ability to reverse the selected midi notes in the PianoRoll.

The tool is located under the wrench icon in the PianoRoll and can also be triggered with Shift-R.

---------

Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
2025-04-19 15:40:21 -04:00
regulus79
cb8badc0bb Fix Clip Creation Quantization in Song Editor (#7763)
Previously, clicking on a track or dragging in a sample would always create a clip on the closest/previous bar, no matter what the Song Editor's snap size was. This fixes that issue by using the Song Editor's quantization when placing new clips, so for example if the snap size is 1/4 bar, the clip will be added at the closest/previous 1/4 bar mark.
2025-04-19 15:08:15 -04:00
TgeorgeT
d06c5941f2 Fix memory leak in RemoteVstPlugin::loadPresetFile (#7827) 2025-04-19 11:08:23 -04:00
Cas Pascal
64053342d8 [Follow up] Improve performance when rendering sample waveforms (#7695)
A follow up to 786088baec to fix rendering issues and crashes.

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-04-15 23:40:16 -04:00
Fawn
795d513c7f Add clangd cache to .gitignore (#7846)
* Add /.cache/ to .gitignore

Normally clangd's .cache exists in /build/, which is already in the .gitignore, but if cmake is run in the repository root instead of /build/ the cache is in turn generated in the repository root.

* Also add compile_commands.json to .gitignore
2025-04-15 11:52:43 -04:00
Andrew Wiltshire
c2912b89ee Auto assign MIDI device when track is created (#7835)
Newly created MIDI tracks were not automatically assigned to the desired MIDI device when the option to do so was specified in settings. This commit fixes that.
2025-04-12 23:42:15 -04:00
Tres Finocchiaro
3f0044dc7f Handle SIGINT (#7698)
Handle SIGINT
Allows Ctrl + C to close LMMS for unix-like environments that 
---------

Co-authored-by: Fawn Sannar <rubiefawn@gmail.com>
2025-04-11 10:25:27 -04:00
Fawn
17215343e4 Upgrade Stereo Matrix plugin assets to SVG (#7803)
Upgrade Stereo Matrix plugin assets to SVG
* Use QHBoxLayout for StereoMatrix
2025-04-05 22:45:40 -04:00
qnebra
2482842daa Vestige and VST Effect assets replacement (#7791)
Replace VST instrument and effect assets with SVG
2025-04-02 15:16:59 -04:00
SpomJ
9cb3ae7de1 Add build flags to output of lmms --version (#7780) 2025-03-31 10:36:29 -04:00
Dalton Messmer
16296c1dfb Fix Vestige file browser filter (#7816)
- Remove pointless *.exe option
- Add an "All VST files" option on Linux when there is both LinuxVST and Wine VST support
- Remove *.dll option from Linux builds without Wine VST support (i.e. LinuxVST-only builds)
2025-03-26 21:31:38 -04:00
Fawn
8afe95aeaf Fix track operations button alignment, size, and style (#7779)
Make the track ops button consistently sized and style it and the solo & mute buttons using CSS instead of SVG assets
2025-03-25 19:02:08 -06:00
Sotonye Atemie
1d5f2c0050 Add ability to change sample rate in the settings menu (#7719)
Add a slider in the audio settings menu to allow users to select a few standard sample rates, those being 44100, 48000, 88200, 96000, and 192000.
2025-03-25 16:27:00 -04:00
Tres Finocchiaro
498315ef48 Make buttons automatable on macOS (#7813) 2025-03-24 13:34:28 -04:00
Rossmaxx
7367750823 [Code Cleanup] Cleaned up some header files and move a bit of debugging logic to cmake (#7677)
* Renamed lmms_basics.h to LmmsTypes.h and scoped it down for that purpose.

* Shifted the LMMS_STRINGIFY macro to it's own header.

* Removed the debug.h header file and use cmake to handle the macro logic.

* Remove some unused headers and include directives
2025-03-24 19:07:46 +05:30
regulus79
db9ccbeb56 Add Strum Tool to Piano Roll (#7725)
Adds a complex strum tool to the Piano Roll, allowing the user to take a selection of chords, and drag around the notes to shape the strum exactly how they want it.

---------

Co-authored-by: szeli1 <143485814+szeli1@users.noreply.github.com>
Co-authored-by: Sotonye Atemie <satemiej@gmail.com>
2025-03-22 05:54:40 -04:00
Fawn
91233e6a73 Enable CMAKE_EXPORT_COMPILE_COMMANDS (#7804)
This setting instructs CMake to generate compile_commands.json for use
with clangd.
2025-03-21 23:32:49 -04:00
Fawn
6af3ab5875 Fix missing update to mixer channel name when created (#7795)
Fixes a regression from 07baf9e27a, in
which a channel that was created through a tracks "Assign track to new
mixer channel" context menu would display an incorrect name until it was
renamed by a user.
2025-03-21 06:07:15 -04:00
StakeoutPunch
23efcf456b Update Classic Theme (#7799)
Created and replaced missing/mismatched assets, fixed mixer send arrows causing mixer height to be wrong, tweaked CSS stylesheet to fix active mixer channel being black
2025-03-20 12:20:03 -04:00
Fawn
953f6b7351 Rework Crossover EQ plugin GUI (#7781)
* Switches to SVG assets
* Fixes layout issues
* Refactors redundant code

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
2025-03-20 01:30:29 -04:00
regulus79
b9cb343d8b Revert "Change tooltip window flags (#7613)" (#7761)
This reverts commit b21a2696a9.
2025-03-19 21:29:44 -04:00
Fawn
f09d56cdd0 Upgrade Dual Filter plugin PNG assets to SVG (#7774) 2025-03-19 15:16:05 -04:00
Fawn
fc29682b90 Upgrade Bitcrusher plugin PNG assets with SVG (#7772) 2025-03-19 15:12:00 -04:00
cyberrumor
fd32158861 Fix crash when switching opened projects (#7797)
* Fix crash when switching opened projects #7793

When the DAW is already running with an open project and you attempt to
open another project via File > Open, a segfault used to occur.

The crash seems to have been caused by model()->value(), which was
called in Fader::getModelValueAsDbString(). The model() function
looked like it should return a pointer to an AutomatableModel.

I suspect that when a model was dropped in favor of loading models for
a new project, the AutomatableModel pointer became a null pointer.

Add a check to the AutomatableModel pointer so getModelValueAsDbString
returns early (before accessing member functions) if the pointer is
null. This fixes the crash.
2025-03-19 13:23:53 -04:00
Fawn
5960a4e792 Upgrade Peak Controller plugin PNG assets to SVG (#7776) 2025-03-18 23:28:22 -04:00
Fawn
0b709dc1af Upgrade Flanger plugin PNG assets to SVG (#7775) 2025-03-18 23:15:26 -04:00
Fawn
953c6843cd Upgrade ReverbSC plugin PNG assets to SVG (#7777) 2025-03-18 23:07:02 -04:00
Fawn
10c428b7a0 Upgrade Bass Booster plugin PNG assets with SVG (#7771) 2025-03-18 23:04:10 -04:00
szeli1
f72ae32fd3 Ensure hidden full-screen windows are restored in the correct position (#7752)
Fix bug introduced with #7595 where drag-moving the MDI canvas background would break the show/hide behavior of a fullscreen window.

Closes #7751
2025-03-17 15:35:28 -04:00
Fawn
919f9a1c0a Upgrade Amplifier plugin PNG assets with SVG (#7770)
Replaces the .png raster assets for the native Amplifier plugin with .svg vector assets.
2025-03-16 18:04:53 -06:00
Johannes Lorenz
d4fe398fff Update CALF to 0.90.4 (#7783) 2025-03-15 22:15:31 +01:00
Andrew Wiltshire
b0f9480d3c Fix SVG Scaling; Allow SVGs to be rendered at sizes other than their natural size. (#7769)
Allow embed.cpp to load SVG assets at screen DPI by leveraging QPixmap::setDevicePixelRatio

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
Co-authored-by: Fawn <rubiefawn@gmail.com>
2025-03-14 15:05:45 -04:00
John Hunt
2cd4810755 Optimize PNG images using ImageOptim (#7384) 2025-03-13 16:08:41 -04:00
Fawn
91f750d2c2 Fix track operations widget vertical alignment (#7765)
In #7708, the track operations widget was given a centered vertical alignment in order to fix an aesthetic layout issue. This is being reverted, since it is possible to resize tracks, and all the other track interface elements are top-aligned.
2025-03-13 11:12:33 -06:00
Tres Finocchiaro
768b3b253b Fix stk/rawwaves for msys2 (#7736) 2025-03-12 22:30:26 -04:00
Fawn
7f2761df9b Fix incorrect graph step size behavior (#7703)
The y-axis quantization for graph values was being calculated
incorrectly. This would have gone unnoticed since the only step sizes
currently used are 0 (continuous) or 1. Any other values produce
"sloped" quantization. This fix prevents this error from affecting
any future uses of graphModel.
2025-03-11 16:53:29 -06:00
Fawn
6233c5b9e4 Update mute and solo buttons, add them to instrument windows (#7708)
* Add mute and solo buttons to instrument windows
* Change mute and solo buttons to optimized CC0 SVG assets
* Icons provided by @StakeoutPunch, button backgrounds provided by
@RebeccaDeField

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
Co-authored-by: Rebecca Noel Ati <contactme@rebeccadefield.com>
Co-authored-by: Stakeout Punch <StakeoutPunch@users.noreply.github.com>
2025-03-11 14:30:04 -04:00
Michael Gregorius
8821d88c09 InstrumentSoundShaping refactoring (#7229)
* Accessors for volume, cutoff, resonance

Add private accessors for the volume, cutoff and resonance parameters (envelope and LFO).

This makes the code less technical and more readable as it for example removes lots of static casts. The casts are now done in a special helper method that returns the parameters for a given target.

* Remove EnvelopeAndLfoParameters array

Remove the `EnvelopeAndLfoParameters` array and use explicit instances for volume, cutoff, resonance. This simplifies construction and initialization of the instances.

Besides the array this also removes the `Target` enum and the `NumTargets` value.

To simplify storage and retrieval of the parameters three private methods have been added which provide the node names of the volume, cutoff and resonance parameters.

Adjust `InstrumentSoundShapingView` to the removed `NumTargets` property.

* Use references instead of pointers

Use references to the volume, cutoff and resonance parameters instead of pointers.

* Remove friend relationship

Remove the friend relationship between `InstrumentSoundShaping` and its related view by providing the models via getters.

* Get rid of targetNames

Get rid of `InstrumentSoundShaping::targetNames` by using translations and strings directly. Move the remaining stuff into `InstrumentSoundShapingView` until it is removed there as well.

* Explicit EnvelopeAndLfoViews

Remove the array of EnvelopeAndLfoViews and use dedicated instances instead.

This also enables the final removal of the remaining `targetNames`.

* Move the code of some getters

Move the code of some getters into the header file.

* Several code review changes

Apply some code review proposals.

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-03-09 11:25:00 +01:00
Sotonye Atemie
f44aa3edc3 Refactor OGG export and always use VBR (#7697)
Refactors `AudioFileOgg`, a class used to export to OGG files. There were problems reported of the exported OGG file failing to be played back on some systems. To fix this issue as well as to improve code quality, the class was refactored. In addition, VBR (variable bit rate) is always used, with the quality of the export being determined by a ratio of the selected bit rate and the maximum bit rate allowed. This change naturally occurred when refactoring, though the libvorbisenc documentation recommend VBR for improved audio quality.
2025-03-07 10:23:30 -05:00
regulus79
c12fd571f5 Allow cutting multiple notes at once in Piano Roll (#7715)
Adds the ability to cut multiple notes at once in the Piano Roll. Users can select the Knife tool and create a cut line by holding the mouse and dragging it across the notes that should be cut. This also allows cutting the notes at an angle. When releasing the mouse, the Shift key can be pressed to remove the shorter end of the notes that were cut. If any notes are selected, only they will be considered for the cut, even if the cut line covers more notes.
2025-03-02 18:29:29 -05:00
szeli1
5fa01e7dbc Navigate workspace in the main window by dragging the mouse (#7595)
The scroll bars shown in the main window were removed in favor of a new navigation feature that utilizes dragging the mouse instead. Users can now hold the mouse down on an empty part of the workspace and drag the mouse around to navigate where necessary.
2025-03-02 18:03:37 -05:00
Oskar Wallgren
ef1d86fa41 ExportProjectDialog: Remove arbitrary loop count limit (#7724)
Increases the number of max loops when exporting above 99
2025-03-02 20:37:26 +01:00
Andrew Wiltshire
9159533814 FileBrowser: "Open containing folder" automatically selects file in the OS's file manager (#7700)
Introduces a new class FileRevealer to manage file selection across different platforms (Windows, macOS, Linux, and other *nix operating systems with xdg). Includes methods to open and select files or directories using the default file manager on the respective platform.

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-03-01 19:38:51 -05:00
Rossmaxx
050df381b0 Fix Clang warning due to implicit conversion from int to float for the RAND_MAX macro (#7717)
* fix compiler warning due to implicit conversion

* fix warnings from plugins too
2025-03-01 16:48:37 -05:00
Michael Gregorius
3c3441bb0c Faders with a dB scale (instead of linear/percentage) (#7636)
* Use dbFS scale for the faders

Make the faders use a linear dbFS scale. They now also change position on first click and can then be dragged.

The `Fader` class now has a new property called `m_faderMinDb`. It's the minimum value before the amplification drops down fully to 0. It is needed because we cannot represent a scale from -inf to maxDB.

Rename `knobPosY` to `calculateKnobPosYFromModel` and move the implementation into the cpp file. The method now first converts the model's current amplification value to dbFS and then computes a ratio based on that values and the minimum and maximum dbFS values.

Add the method `setVolumeByLocalPixelValue` which takes a local y coordinate of the widget and sets the amplification of the model based on a dbFS scale.

Adjust `mousePressEvent` and `mouseMoveEvent` so that they mostly take the local y coordinate of the event and use that to adjust the model via `setVolumeByLocalPixelValue`.

Remove `m_moveStartPoint` and `m_startValue` and they are not needed anymore.

* Apply curve to faders

Apply a curve, i.e. the cube function and its inverse, to the fader
positions to that we have more space to work with in the "interesting"
areas around 0 dB and less space in the area where we tend to "-inf dB".

Set the minimum dB value of the fader to -120 dB to increase the potential
headroom.

* Support for dB models

Add support for models that are in dB.

There's a new member `m_modelIsLinear` which can be set via the
constructor. The default value in the constructor is `true`.

Add the method `modelIsLinear` which can be used to query the parameter.
It is used in `calculateKnobPosYFromModel` and
`setVolumeByLocalPixelValue`. Both methods got extended to deal with
models in dB. They were also refactored to extract code that is common
for both cases.

Ensure that the constructor of `Fader` is called with `false` for
`CrossoverEQControlDialog` and `EqFader` because these use models that
are in dB.

* Show current dB value of fader in tool tip

Show the current value of the fader in its tool tip. Please note that
this value is always shown in dB because the goal should be to get rid
of the linear values for the faders.

Some of the code is extracted into the new method
`Fader::getModelValueAsDbString` which is shared by
`Fader::modelValueChanged` (also new) and `Fader::updateTextFloat`.

Please note that `getModelValueAsDbString` will use "dB" instead of
"dBFS" as the unit and that it will format "-inf dB" instead of "-∞ dB".
These changes will also be visible in the text float that is used to
show the new values as the fader is being dragged.

* Let users enter values in dB

Let users enter values in dB in the dialog that opens with a double
click.

The minimum value that can be entered is the minimum value that the
fader allows to set, i.e. -120 dB. The maximum value is the maximum
value of the model converted to dB. As of now this is ~6 dB. The
current value is converted to dB. If it corresponds to "-inf dB", i.e.
if the amplification is 0 then the minimum value is used.

* Remove option "Display volume as dBFS"

Remove the option "Display volume as dBFS" from the settings dialog and
the check box option "Volume as dBFS" from the "View" menu. Volumes are
now always treated as dB, i.e. all evaluations of the property
"displaydbfs" have been removed which results in assuming that this
option is always true.

The upgrade code in `ConfigManager::upgrade_1_1_91` was left as is.
However, a note was added which informs the reader that the value of
"displaydbfs" is not evaluated anymore.

* Extend Fader::wheelEvent

Extend `Fader::wheelEvent` for the case where the model is not a dB
model (`modelIsLinear() == true`), e.g. for the mixer faders. In that
case it works as follows. Each step increments or decrements by 1 dB if
no modifier is pressed. With "Shift" pressed the increment value is 3 dB.
With "STRG" ("CTRL") pressed the increment value is reduced to 0.1 dB. If
the value goes below the minimum positive dB value that is allowed by the
fader then the fader is set to "-inf dB", i.e. zero amplification. If the
fader is set to "-inf dB" and the users want to increase the value then
it is first set to the minimum positive value that is allowed by the
fader.

If the model is a dB model then the same behavior as before is used.
Although it should be considered to adjust this case as well. These
models are used by the faders of the Crossover Equalizer, Equalizer,
Compressor and Delay and they are not very usable with the mouse wheel.

* Adjust the wheel behavior for faders with dB models

Make the faders of the Crossover Equalizer, Equalizer, Compressor and
Delay behave like the mixer faders, i.e. step in sizes of 3 dB, 1dB and
0.1 dB depending on whether a modifier key is pressed or not.

Extract some common code to do so and add some `const` keywords.

* Less "jumpy" knobs

Implement a more stable knob behavior.

Remove the jumping behavior if the users directly click on a volume
knob. By storing the offset from the knob center and taking it into
account during the changes it now also feels like the users are
dragging the knob.

Changes to the amplification are now only applied when the mouse is
moved. This makes the double click behavior much more stable, i.e. if
users click on the knob when it is at 0 dB the dialog will also show
0 dB and not something like 0.3 dB because the first click is already
registered as a change of volume.

If the users click next to the knob the amplification will still be
changed immediately to that value.

## Technical details

To make the knobs more stable a variable called `m_knobCenterOffset` was
introduced. It stores the offset of the click from the knob center so
that this value can be taken into account for in the method
`setVolumeByLocalPixelValue`.

* Make MSVC happy

Add an indication that a float value is assigned to a float variable.

* Introduce constexpr for scaling exponent

Introduce the `constexpr c_dBScalingExponent` which describes the
scaling exponent that's used to scale the dB scale in both directions.
This will simplify potential adjustments by keeping the values
consistent everywhere.

* Draw fader ticks

Draw fader ticks in case the model is a linear one. This means that for
now they should only be painted for the mixer faders but not for the
faders of the Compressor, Delay, etc.

Extract the computation of the scaled ratio between the maximum model dB
value and the minimum supported fader dB value into the new private
method `computeScaledRatio`. This is necessary because it is needed to
paint the fader knob at the correct position (using the knob bottom as
the reference) and to paint the fader ticks at the correct position
(using the knob center).

Introduce the private method `paintFaderTicks` which paints the fader
ticks.

Note: to paint some non-evenly spaced fader ticks replace the `for`
expression in `paintFaderTicks` with something like the following:
```
for (auto & i : {6.f, 0.f, -6.f, -12.f, -24.f, -36.f, -48.f, -60.f, -72.f, -84.f, -96.f, -108.f, -120.f})
```

* Fader adjustments via keyboard

Allow the adjustment of the faders via the keyboard. Using the up or
plus key will increment the fader value whereas the down or minus key
will decrement it. The same key modifiers as for the wheel event apply:
* No modifier: adjust by 1 dB
* Shift: adjust by 3 dB
* Control: adjust by 0.1 dB

Due to the very similar behavior of the mouse wheel and key press
handling some common functionality was factored out:
* Determinination of the (absolute) adjustment delta value by
  insprecting the modifier keys of an event. Factored into
  `determineAdjustmentDelta`.
* Adjustment of the model by a given dB delta value. Factored into
  `adjustModelByDBDelta`.

* Move the fader of the selected channel

Move the fader of the selected channel instead of the fader that has
focus when the up/plus or down/minus keys are pressed. Doing so also
feels more natural because users can already change the selected
channel via the left and right keys and now they can immediately adjust
the volume of the currently selected channel while doing so.

Key events are now handled in `MixerView::keyPressEvent` instead of
`Fader::keyPressEvent` and the latter is removed. `MixerChannelView`
now has a method called `fader` which provides the associated fader.
This is needed so that the event handler of `MixerView` can act upon
the currently selected fader.

## Changes in Fader
The `Fader` class provides two new public methods.

The `adjust` method takes the modifier key(s) and the adjustment
direction and then decides internally how the modifier keys are mapped
to increment values. This is done to keep the mapping between modifier
keys and increment values consistent across different clients, e.g. the
key event of the `MixerView` and the wheel event of the `Fader` itself.
The direction is provided by the client because the means to determine
the direction can differ between clients and cases, e.g. a wheel event
determines the direction differently than a key event does.

The method `adjustByDecibelDelta` simply adjusts the fader by the given
delta amount. It currently is not really used in a public way but it
still makes sense to provide this functionality in case a parent class
or client wants to manipulate the faders by its very own logic.

Because the `Fader` class does not react itself to key press events
anymore the call to `setFocusPolicy` is removed again.

* Enter fader value when space key pressed

Let the users enter the fader value via dialog when the space key is
pressed.

Extract the dialog logic into the new method `adjustByDialog` and call
it from `MixerView::keyPressEvent`.

Make `Fader::mouseDoubleClickEvent` delegate to `adjustByDialog` and
also fix the behavior by accepting the event.

* More prominent fader ticks around 0 dB

Make the fader ticks around 0 dB more prominent but drawing them
slightly wider and with a more opaque color.

* Work around a Qt bug

Work around a Qt bug in conjunction with the scroll wheel and the Alt
key. Simply return 0 for the fader delta as soon as Alt is pressed.

* Fix wheel events without any modifier

Fix the handling of wheel events without any modifier key being pressed.

Commit ff435d551b accidentally tested against Alt using a logical OR
instead of an AND.

* Code review changes

First set of code review changes:
* Use Doxygen style documentation comments
* Remove comment about `displaydbfs` from upgrade routine
* White-space changes for touched lines.

* Make minimum dB value a constexpr

Make the minimum dB value a constexpr in the implementation file because
currently it's an implementation detail that should not be of any
interest to any other client.

So `m_faderMinDb` becomes `c_faderMinDb`.

* More flexible painting of fader ticks

Paint the fader ticks in a more systematic and flexible way. This also
removes some "magic numbers", e.g. by using `c_faderMinDb` instead of
`-120.f` as the lower limit.

The upper limit, i.e. the "starting point" is now also computed using
the maximum value of the model so that the fader will still paint
correctly if it ever changes.

* Make the zero indicator bolder

Make the zero indicator tick of the fader bolder.

* Make rendering of fader ticks a preference

Make rendering of fader ticks a preference which is off by default.

Introduce the new option "Show fader ticks" to the setup dialog and save
it to the UI attribute `showfaderticks`.

The configuration value is currently evaluated in `Fader::paintEvent`.
If this leads to performance problems it might be better to introduce a
boolean member to the `Fader` class which caches that value.

* Move constexprs to anonymous namespace
2025-03-01 20:08:04 +01:00
regulus79
3417dfe86d Fix Envelope and LFO Graph Size on Resizeable Instruments (#7738) 2025-02-28 22:13:00 -05:00
Johannes Lorenz
3aa1a5dafa Rename AudioPort -> AudioBusHandle (#7712)
No functional changes.
2025-02-28 23:44:58 +01:00
regulus79
cf4b492292 Fix logarithmic behavior when dragging knobs and sliders (#7647)
* Initial fix

* Remove stray m_leftOver reference

* Fix shift-dragging

* Revert to relative mouse control. I realize now that the maths don't actually change.

* Change qRound to std::round

* Fix scrolling behavior

* Fix mouse relative position buildup at values < minValue

* Use approximatelyEqual
2025-02-28 17:02:52 -05:00
superpaik
a4c91f8ba0 Recursively unmute channels when soloing in the mixer (#6746)
* unmute related FX channels

When soled one FX channel, unmute send and receive channels, to allow complex FX channel routing (BUS, SENDs, etc.)

* Comment change

* SEND channels

Activate also SEND channels recursively

* Remove unnecessary whitespace

* Encapsulate mixer channel index

Make the mixer channel index `m_channelIndex` private and add getters and
setters. Also add a method to determine if the channel is the master
channel.

Move `m_channelIndex` to the end of the initialization list of the
`MixerChannel` constructor because it is now the last member in the
header.

Adjust all clients to make use of the new methods.

* Replace const int& getIndex() with int index() const

* Format changes

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-02-28 09:52:41 -05:00
Kevin Zander
9b04e29c4e Remove song import global automation (#5229)
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
2025-02-22 14:24:29 +05:30
Tres Finocchiaro
055e0ba576 Fix additional warnings when Carla is missing (#7722)
Fix additional warnings when Carla is missing
Adds new env var LMMS_EXCLUDE_LADSPA

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-02-21 00:56:04 -05:00
Sotonye Atemie
ea02b3aba0 Do not set Qt::WA_OpaquePaintEvent (#7643)
Attempts to fix child widgets -- such as clips from the song editor -- drawing on top on other
2025-02-19 19:24:27 -05:00
Tres Finocchiaro
b440a029df Update FLTK in the AppImage (#7710)
Bump fltk 1.3.x->1.4.1
Closes #5386
2025-02-18 18:41:28 -05:00
Tres Finocchiaro
24bda4fa58 AppImage: Initial support for wayland (#7704)
Adds opt-in wayland support to the AppImage
2025-02-18 03:31:12 -05:00
Tres Finocchiaro
7725d0024e Allow plugins to be skipped at runtime (#7691)
Allows plugins (such as carla) to be skipped when not installed
2025-02-18 01:37:54 -05:00
Tres Finocchiaro
bfacdd29f7 VersionInfo: Mimic github's hash styling (#7694) 2025-02-18 01:22:54 -05:00
Tres Finocchiaro
d145f78332 AppImage: Use fully qualified path when calling appimagetool (#7707)
AppImage: Use fully qualified path when calling appimagetool
2025-02-13 17:01:40 -05:00
Fawn
e328a136fc Use C++20 std::numbers, std::lerp() (#7696)
* use c++20 concepts and numbers for lmms_constants.h

* replace lmms::numbers::sqrt2 with std::numbers::sqrt2

* replace lmms::numbers::e with std::numbers::e
Also replace the only use of lmms::numbers::inv_e with a local constexpr instead

* remove lmms::numbers::pi_half and lmms::numbers::pi_sqr
They were only used in one or two places each

* replace lmms::numbers::pi with std::numbers::pi

* add #include <numbers> to every file touched so far
This is probably not needed for some of these files. I'll remove those later

* Remove lmms::numbers

Rest in peace lmms::numbers::tau, my beloved

* Add missing #include <numbers>

* replace stray use of F_EPSILON with approximatelyEqual()

* make many constants inline constexpr
A lot of the remaining constants in lmms_constants.h are specific to
SaProcessor. If they are only used there, shouldn't they be in SaProcessor.h?

* ok then, it's allowed to be signed

* remove #include "lmms_constants.h" for files that don't need it
- And also move F_EPSILON into lmms_math.h
- And also add an overload for fast_rand() to specify a higher and lower bound
- And a bunch of other nonsense

* ok then, it's allowed to be inferred

* ok then, it can accept an integral

* fix typo

* appease msvc

* appease msvc again

* Replace linearInterpolate with std::lerp()

As well as time travel to undo several foolish decisions and squash tiny
commits together

* Fix msvc constexpr warnings

* Fix msvc float to double truncation warning

* Apply two suggestions from code review

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Apply suggestions from code review

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* fix silly mistake

* Remove SlicerT's dependence on lmms_math.h

* Allow more type inference on fastRand() and fastPow10f()

* Apply suggestions from code review

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Clean up fastRand() a little bit more

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-02-13 13:15:08 -05:00
Tres Finocchiaro
e615046d78 Add VST64 targets for Linux ARM64 (#7687)
Initial support for winegcc on ARM64
2025-02-13 01:23:37 -05:00
Dalton Messmer
7d271e4f39 Fix vcpkg builds (#7702)
* Try to fix MSVC linker error related to lilv

* Remove temporary workaround

* Temporary debugging messages

* oops

* Temporary debugging

* Try to find FluidSynth using Config mode first

* Try again to fix lilv

* Fix FluidSynth installed with vcpkg on Windows

* Fix lilv from vcpkg

* Remove debug flag

* Fix for when lilv is not found (*-NOTFOUND evaluates to false)

* Use lowercase package name for lv2

* Try using only pkg_check_modules for lv2

* Use Lilv::lilv

* Add pkg-config guard back in

* Fix package name

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>

* Fix Lilv_INCLUDE_DIRS

* Rename vcpkg cache key

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
2025-02-12 20:19:13 -05:00
Tres Finocchiaro
67d4a1ca61 Improve Qt5 detection on macOS (#7699)
* Improve Qt5 detection on macOS
2025-02-10 02:06:21 -05:00
Tres Finocchiaro
30216aac51 macOS: Change drag copy shortcut from Command to Option (#7325)
macOS: Replace Command + Drag shortcut key with Option + Drag
Add new header `KeyboardShortcuts.h` for platform-specific keyboard mappings

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
2025-02-09 02:50:38 -05:00
Fawn
4a089a19dc Update math functions to C++ standard library (#7685)
* use c++ std::* math functions
This updates usages of sin, cos, tan, pow, exp, log, log10, sqrt, fmod, fabs, and fabsf,
excluding any usages that look like they might be part of a submodule or 3rd-party code.
There's probably some std math functions not listed here that haven't been updated yet.

* fix std::sqrt typo

lmao one always sneaks by

* Apply code review suggestions
- std::pow(2, x) -> std::exp2(x)
- std::pow(10, x) -> lmms::fastPow10f(x)
- std::pow(x, 2) -> x * x, std::pow(x, 3) -> x * x * x, etc.
- Resolve TODOs, fix typos, and so forth

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>

* Fix double -> float truncation, DrumSynth fix

I mistakenly introduced a bug in my recent PR regarding template
constants, in which a -1 that was supposed to appear outside of an abs()
instead was moved inside it, screwing up the generated waveform. I fixed
that and also simplified the function by factoring out the phase domain
wrapping using the new `ediv()` function from this PR. It should behave
how it's supposed to now... assuming all my parentheses are in the right
place lol

* Annotate magic numbers with TODOs for C++20

* On second thought, why wait?

What else is lmms::numbers for?

* begone inline

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>

* begone other inline

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>

* Re-inline function in lmms_math.h

For functions, constexpr implies inline so this just re-adds inline to
the one that isn't constexpr yet

* Formatting fixes, readability improvements

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Fix previously missed pow() calls, cleanup

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Just delete ediv() entirely lmao

No ediv(), no std::fmod(), no std::remainder(), just std::floor().
It should all work for negative phase inputs as well. If I end up
needing ediv() in the future, I can add it then.

* Simplify DrumSynth triangle waveform

This reuses more work and is also a lot more easy to visualize.

It's probably a meaningless micro-optimization, but it might be worth changing it back to a switch-case and just calculating ph_tau and saw01 at the beginning of the function in all code paths, even if it goes unused for the first two cases. Guess I'll see if anybody has strong opinions about it.

* Move multiplication inside abs()

* Clean up a few more pow(x, 2) -> x * x

* Remove numbers::inv_pi, numbers::inv_tau

* delete spooky leading 0

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

---------

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-02-08 23:50:02 -05:00
Dominic Clark
cb7c6d16cb Reload stylesheet when CSS file changes (#6331)
* Reload stylesheet when CSS file changes

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
2025-02-08 23:33:44 -05:00
Cas Pascal
786088baec Improve performance when rendering sample waveforms (#7366)
This PR attempts a number of improvements to the sample rendering (in the song editor, automation editor, AudioFileProcessor, SlicerT, etc) in LMMS:

Thumbnails: Samples are aggregated into a set of thumbnails of multiple resolutions. The smallest larger thumbnail is then chosen for rendering during sample drawing. Each set of thumbnails is stored with its sample file metadata in an unordered_map, so that duplicate samples will use the same set of thumbnails.

Partial rendering: additionally, this PR only renders the portions of the sample clips visible to the viewer to save rendering time.

* Experimental sample thumbnail

* Rename some classes and type aliases. Make some type declarations explicit

* Use a combination of audioFile name and shared_ptrs to track samples; refactor some loops

* That weird line at the end of the sample is now gone

* Small changes to the code; Add comments

* Add missing word to comment; Fix typo

* Track `SharedSampleThumbnailList`s instead

* Major refactor; implement thumbnailing for SlicerT, AFP and Automation editor

* Code clean up, renames and documenting

* Add the namespace lmms comments

* More code updates and documentation

* Fix error in comment

* Comment out `qDebug`s

* Fix formatting

* Use alternative initialization of `SampleThumbnailVisualizeParameters`

* Remove commented code

* Fix style and simplify code

* Use auto

* Draw lines using floating point

* Merge the classes into one nested class
+ Replace while loop with std::find_if

* Fix comparison of different signedness

* Include memory header

* Fix a logic error when selecting samples; Rename a const

* Fix more issues with signedness

* Fix sample drawing error in `visualizeOriginal`

* Only render regions in view of the sample

* Allow partial repaints of sample clips

* Remove unused variable

* Limit most of the painting to the visible region

* Revert back to using rect() in some places

* Partial rendering for AutomationEditor

* Don't redraw painted regions; allowHighResolution; remove `visualizeOriginal`; Remove s_sampleThumbnailCacheMap

* Add s_sampleThumbnailCacheMap back for testing convenience

* Minor change to the way `thumbnailSizeDivisor` is calculated

* Extend update region by an amount

* forgot about this

* Adapt to master; Redesign VisualizeParameters; Don't rely entirely on needsUpdate()

* Don't try to preserve painted regions

* Allow for a bit more thumbnails; Fix incorrect rendering when vertically scrolling

* Fix missing include statement

* Remove the unused variable

* Code optimization; Remove RMS member from Bit; Rename viewRect to drawRect

* More code optimizations

* Fix formatting

* Use begin instead of cbegin

* Improve generation of thumbnails

* Improve expressiveness of the draw code

* Add support for reversing

* Fix drawing code

* Fix draw code (part 2)

* Apply more fixes and simplifications

* Undo some out of scope changes

* Remove SampleWaveform

* Improve documentation

* Use size_t for some counters

* Change width parameter to be size_t

* Remove temporary aggregated peak variable

* Bump up AggregationPerZoomStep to 10

* Zoom out only requested range of thumbnail instead of clipping it separately

* Rename targetSampleWidth to targetThumbnailWidth

* Handle reversing for AFP; Iterate in reverse instead of reversing the entire thumbnail

* Change names to be more accurate

* Improve implementation of sample thumbnail cache map

* Move AggregationPerZoomStep back down to 2, do not cap smallest thumbnail width to display width
To improve performance with especially long
samples (~20 minutes)

* Simplify sample thumbnail cache handling in constructor

* Call drawLines instead of drawLine in a loop

QPainter::drawLine calls drawLines with a line count of 1. Therefore, calling drawLine in a loop means we are simply calling drawLines a lot more times than necessary.

* Bump up AggregationPerZoomStep to 10 again
Thought using 2 would help performance (when rendering). Maybe it does, but it's still quite slow when rendering a bunch of thumbnails at once.

* Fix off-by-one error when constructing Thumbnail from buffer

* Fix crash when viewport is not in bounds

* Apply performance improvements

Performance in the zoomOut function was bad because of the dynamic memory allocation. Huge chunks of memory were being allocated quite often, casuing a ton of cache misses and all around slower performance. To fix this, all the necessary downsampling is now done within the for loop and handled one pixel after another, instead of all at once.

To further avoid allocations in the draw call, the change to use drawLines has been reverted.

We now pass VisualizeParameters by value (it is only 64 bytes, which will fit quite nicely in a cache line, which is more benefical than reaching for that data by reference to some other part of the code).

After applying these changes, we are now practically only bounded by the painting done by Qt (according to profiling done by Valgrind). Proper use of OpenGL could resolve this issue, which should finally make the performance quite optimal in  variety of situations.

* Apply minor changes

Update copyright and unused functions. Move in newly created thumbnail into the cache instead of copying it.

* Use C++20's designated initializers

* Create param right before visualizing

* Fix regressions with reversing

* Fix incorrect rendering in AFP and SlicerT

* Move MaxSampleThumbnailCacheSize and AggregationPerZoomStep into implementation file

* Remove static keyword

* Remove getter and setter for peak data

---------

Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-02-08 20:05:19 -05:00
Tres Finocchiaro
fe0e8ba379 Remove libgallium from the appimage (#7693)
* Remove libgallium from the appimage
* Remove "optional" directory from AppImage
2025-02-08 17:13:07 -05:00
Tres Finocchiaro
c81d497cda Fix libjack.so.0 detection for openSUSE (#7690)
Fix libjack.so.0 detection for openSUSE
Add libdb-5.so to optional as symlink
2025-02-08 15:11:55 -05:00
Tres Finocchiaro
6a0a4cd2b2 AppImage: Don't set LD_LIBRARY_PATH (#7686)
Don't set LD_LIBRARY_PATH
Move launch_lmms.sh to dedicated apprun-hooks
2025-02-05 12:22:08 -05:00
firewall1110
516b8dbca8 Fix dropout with SID instrument when used for the first time (#7673)
Co-authored-by: Sotonye Atemie <sakertooth@gmail.com>
2025-02-03 19:02:06 -05:00
Tres Finocchiaro
f38c649923 SharedMemory: Make key optional, default to shorter UID on macOS (#7681)
* SharedMemory: Make key optional, shorter on macOS
* Add getters for shared memory size
* macOS: Fix linking regression for RemoteZynAddSubFx introduced with #7252 

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-02-03 14:18:02 -05:00
Tres Finocchiaro
36c1deae42 CI: Switch mingw64 to Ubuntu 24.04 (#7682)
Switch mingw64 from Ubuntu 20.04 to Ubuntu 24.04
2025-02-03 12:52:33 -05:00
Fawn
9aa937d391 Use templates for common geometric constants (#7558)
* add templates for common geometric constants

* oops missed one

* LD_2PI -> LD_PI

i re-added the wrong constant ffs

* CamelCase names and also verify compilation without -DLMMS_MINIMAL

* C++20 stuff

Updated to account for `<numbers>` and C++20:
- Marked all `lmms_constants.h` constants with an exact equivalent in `<numbers>` as deprecated
- Removed all `lmms_constants.h` constants where no variant is currently in use
- Using `inline constexpr`
- Using `std::floating_point` concept instead of `typename`

* add lmms::numbers namespace

* Remove panning_constants.h

Moves the four constants in panning_constants.h into panning.h, then
removes panning.h.

* Use std::exp(n) instead of powf(numbers::e, n)

* Use C++ std math functions

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>

* Use overloaded std math functions

An attempt to fix compiler warnings on some platforms

* Remove uses of __USE_XOPEN

And also update two functions I missed from the previous commit

* Missed a few

* Fix ANOTHER std math function use

Of course there's another one

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-02-03 11:52:13 -05:00
Tres Finocchiaro
fc125bc7ba CI: Switch linux-x86_64 to Ubuntu 22.04 (#7678)
Switches nightly builds from 20.04 to 22.04
Switches from container to actions-native runner
2025-02-03 02:03:41 -05:00
Tres Finocchiaro
10bdf122f8 CPack: Refactor AppImage and Apple DMG Generation (#7252)
* CPack: Refactor AppImage and Apple DMG Generation
* Switch from linuxdeployqt to linuxdelpoy
* Add ARM64 AppImage support
* Add support for `.run` installers using `makeself`, an alternative to AppImage
* Refactor BashCompletion.cmake
* Enable CPack debugging via `WANT_DEBUG_CPACK`
* Add `download_binary`, `create_symlink` macros
* Qt6: Fix @rpath bug on macOS
* Detect and bundle LV2 UI Suil modules (Related #7201)
* Allow remote plugins to honor `LMMS_PLUGIN_DIR`
* Add .github/workflows/deps-ubuntu-24.04-gcc.txt
* Fix waveforms FileDialog

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2025-02-01 04:02:19 -05:00
Sotonye Atemie
77ca0f8994 Improve mono compatibility with LADSPA plugins (#7674) 2025-01-31 00:58:37 -05:00
Tres Finocchiaro
2c674eca3a Fix icons in Spectrum Analyzer (#7667)
Make Qt::Svg mandatory; bundle svg libraries
2025-01-27 21:58:15 -05:00
slidey-wotter
6259561fc7 Add VST support for Gentoo linux (#7665)
Gentoo wine uses the eselect system; support /etc/eselect/wine/bin
2025-01-25 13:59:58 -05:00
Michael Gregorius
501011e573 Vectorscope render fix (#7652)
* Fix rendering for Vectorscope

The rendering of the Vectorscope is broken on Wayland if the size of the
Vectorscope is increased. This is caused by using a `QImage` to render
the scope traces which is then scaled up.

Introduce a new way to paint the vector scope (goniometer) which simply
paints lines or points that progressively get dimmer and which does not
make use of a QImage anymore.

It supports the following features:
* Log mode
* Zooming
* Rendering the drawing performance
* Selecting a different color for the traces

It does not support:
* HQ Mode: The new implementation provides a performance that's
  equivalent to Non-HQ mode and look similar or better than the HQ mode.
* Blurring of old data
* Persistence: Might be implemented by using a factor for the dimming

Rendering of the samples/trances uses the composition mode "Plus" so
that overlapping elements will appear like adding brightness. Painting
the grid and lines is done using the normal composition mode "Source
Over" so that it simply replaces existing pixels.

Painting of the lines/points and the grids and lines is done in a
"signal space", i.e. a transform where elements in the interval of
[-1, 1] feel "natural". The text is painted in "widget space".

* Remove old implementation

Remove HQ mode and persistence. Also remove the legacy option again.
This removes the models, loading, saving and the GUI controls.

Remove all unnecessary members from `VectorView`, adjust the
constructor. Move the implementation of `paintLinesMode` into
`paintEvent`. Remove methods `paintLegacyMode` and `paintLinesMode`.

* Move colors into VectorView

Move the colors out of `VecControls` into `VectorView` as they are
related to presentation.

* Remove friend relationship to VectorView

Remove a friend relationship to `VectorView` from `VecControls` by
introducing  const getters for the models.

* Remove VectorView::m_visible

Remove the unnecessary member `m_visible` from `VectorView`. It was not
initialized and only written to but never read.

* Make Vectorscope themeable

Make the Vectorscope themeable by introducing Qt properties for the
relevant colors.

The default theme gets the values from the code whereas the classic
theme gets a trace with amber color.

* Rename m_colorFG

Rename `m_colorFG` to `m_colorTrace`. Adjust the Qt property
accordingly.

Remove local variable `traceColor` from paint method and use member
`m_colorTrace` directly.

* Remove m_colorOutline

Remove unused member `m_colorOutline`.

* Fix horizontal lines on silence

Fix the horizontal lines that are rendered on silence. They seem to be
produced when rendering lines that start and end at the same point.

Therefore we only draw a point if the current and last point are the
same.

* Add some margin to the VectorView

Add some margin to the rendering of the `VectorView` so that the circle
does not touch the bounary of the widget.

* Clean up the layout of the Vectorscope

Clean up the layout of the Vectorscope. The checkboxes are not put on
top of the vector view anymore but are organized in a horizontal layout
beneath it. This gives a much tidier look.
2025-01-22 22:40:17 +01:00
Rossmaxx
80a46d3c76 Add gprof profiling support. (#7547) 2025-01-20 11:20:04 +05:30
regulus79
b21a2696a9 Change tooltip window flags (#7613)
* Change tooltip window flags
2025-01-17 07:35:43 +05:30
Daniel Iisak Mikael Kristiansson
0b0833bf54 Bump project year (#7645) 2025-01-10 19:34:21 +05:30
Tres Finocchiaro
3ee0afb2a1 Add support for MSYS2 CLANGARM64
Adds initial Windows ARM64 support
2025-01-09 23:34:33 -05:00
Michael Gregorius
303215f8b1 Maximize button for resizable instruments (#7514)
* Maximize button for resizable instruments

Show the maximize button for resizable instruments.

Most other changes have the character of refactorings and code
reorganizations.

Remove the negation in the if condition for resizable instruments to
make the code better readable.

Only manipulate the system menu if the instrument is not resizable.

Add a TODO to the special code that sets a size.

* Fix rendering of maximized sub windows

In `SubWindow::paintEvent` don't paint anything if the sub window is
maximized . Otherwise some gradients are visible behind the maximized
child content.

In `SubWindow::adjustTitleBar` hide the title label and the buttons if the
sub window is maximized. Always show the title and close button if not
maximized. This is needed to reset the state correctly after
maximization.

* Add SubWindow::addTitleButton

Add the helper method `SubWindow::addTitleButton` to reduce code
repetition in the constructor.

* Only disable the minimize button

Disable the minimize button by taking the current flags and removing
the minimize button hint from them instead of giving a list which might
become incomplete in the future. So only do what we want to do.

* Remove dependency on MdiArea

Remove a dependency on the `MdiArea` when checking if the sub window is
the active one. Query its own window state to find out if it is active.

* Clear Qt::MSWindowsFixedSizeDialogHint

Clear the `Qt::MSWindowsFixedSizeDialogHint` flag for resizable
instruments (symmetric to the `else` case).

* Update the sub window title bar of exchanged instruments

Update the title bar of an instrument's sub window if the model changes, e.g. if an instrument is exchanged via drag & drop.

The main fix is to call the new method `updateSubWindowState` in `InstrumentTrackWindow::modelChanged`. It contains mostly the code that was previously executed in the constructor of `InstrumentTrackWindow`. The constructor now simply calls this method after it has put the constructed instance into a sub window.

With the current implementation the sub window needs to be explicitly triggered to update its title bar once the flags have been adjusted in `updateSubWindowState`. This is done with the new public method `SubWindow::updateTitleBar`. Please note that such an explicit update is not needed if the instrument windows are managed by a `QMdiSubWindow` instead of a `SubWindow`. This means that the implementation of `SubWindow` is still missing something that `QMdiSubWindow` does. However, debugging also showed that setting the window flags of the sub window does not seem to lead to an event that could be caught in `SubWindow::changeEvent`. This was found out by simply dumping the event types of all events that arrive in that method and exchanging an instrument.

The method `updateSubWindowState` uses the added method `findSubWindowInParents` to find the sub window it is contained in. The latter method should be considered to be moved into a templated helper class because it might be useful in other contexts as well.

## Technical details

If you want to experiment with using QMdiSubWindows then simply add the following method to `MainWindow` (right next to `addWindowedWidget`):
```
QMdiSubWindow* MainWindow::addQMdiSubWindow(QWidget *w, Qt::WindowFlags windowFlags)
{
	// wrap the widget in our own *custom* window that patches some errors in QMdiSubWindow
	auto win = new QMdiSubWindow(m_workspace->viewport(), windowFlags);
	win->setAttribute(Qt::WA_DeleteOnClose);
	win->setWidget(w);

	m_workspace->addSubWindow(win);
	return win;
}
```

Then call that method instead of `addWindowedWidget` in the constructor of `InstrumentTrackWindow`:
```
QMdiSubWindow* subWin = getGUI()->mainWindow()->addQMdiSubWindow( this );
```

You can then comment out the cast and the call of `updateTitleBar` in `updateSubWindowState` and everything will still work.

* Update the system menu

Show or hide the "Size" and "Maximize" entries in the system menu
depending on whether the instrument view is resizable or not.

* Show non-resizable instruments as normal

Show the sub windows of non-resizable instruments as normal if the sub
window is maximized because it was previously used with a resizable
instrument.

* Fix typo

* Rename updateSubWindowState

Rename `updateSubWindowState` to `updateSubWindow`.
2025-01-01 14:25:40 +01:00
Niyonkuru-AI-Crazy
3fcbb4ca77 Fix 3 minor typos (#7635) 2024-12-26 18:34:06 +00:00
Rossmaxx
23db892d55 Remove 32 bit CI support for windows builds (#7619)
* remove 32 bit from msvc ci

* remove 32 bit from mingw builds

* remove fail fast
2024-12-24 18:06:18 +05:30
saker
6b494bd7a3 Revert "Major German translation rework (01/12/2024) (#7612)" (#7628) 2024-12-20 17:30:39 -05:00
Petar Katić
99ab0e2070 Update Zyn submodule (#7625) 2024-12-19 09:52:58 -05:00
Wuzzy
088a2cbcfd Major German translation rework (01/12/2024) (#7612) 2024-12-19 07:46:54 -05:00
saker
248b6b92d9 Downgrade RemoteVstPlugin build back to C++17 (#7624) 2024-12-18 16:20:34 -05:00
regulus79
7590bc03d7 Revise README (#7545)
* Initial revision of README.md

* Make logo and link placements more professional (thanks to thismoon), along with otehr minor changes
2024-12-08 08:37:28 +05:30
Dalton Messmer
d9737881cf Revert pkgconf removal (#7605)
* Revert "Remove pkg-config from Brewfile (#7593)"

This reverts commit 72b30b1d00.

* Replace pkg-config with pkgconf
2024-12-01 13:33:17 -05:00
regulus79
f579750608 Fix coarse gridlines being half as wide every 8 bars (#7610) 2024-12-01 08:19:00 +05:30
Oskar Wallgren
3562bbed3c Open up some gui elements to theming (#7314)
* Theming for current step note

* Theming for EnvelopeGraph

* Theming for LfoGraph

* curStepNoteColor - don't break old themes

* EnvelopeGraph - don't break old themes

* LfoGraph - don't break old themea

* currentStepNoteColor
2024-11-30 19:24:45 +05:30
regulus79
e311832ffb Fix styling on message boxes (#7608) 2024-11-29 23:05:18 -05:00
saker
5acc7965c2 Disable focus for new channel button in Mixer (#7597) 2024-11-27 17:14:35 -05:00
SpomJ
95a0518085 Remove obsolete workaround for Qt4 (#7590) 2024-11-23 20:37:07 +05:30
Dalton Messmer
c21a7cd487 Upgrade to C++20 (#7554)
* Compile in C++20 mode

* Fix implicit lambda captures of `this` by `[=]`

Those implicit captures were deprecated in C++20

* Silence MSVC atomic std::shared_ptr warning

Unfortunately std::atomic<std::shared_ptr> (P0718R2) is not supported by
GCC until GCC 12 and still is not supported by Clang or Apple Clang, so
it looks like we will continue using std::atomic_load for the time being

* Use C++20 in RemoteVstPlugin

* Simplification

* Add comment

* Fix bitwise operations between different enumeration types

* Revert "Fix bitwise operations between different enumeration types"

This reverts commit d45792cd72.

* Use a helper function to combine keys and modifiers

* Remove AnalyzeTemporaryDtors from .clang-tidy

AnalyzeTemporaryDtors was deprecated in clang-tidy 16 and fully removed
in clang-tidy 18

* Use C++20 in .clang-format

* Use bitwise OR

Prevents issues if any enum flags in `args` have bits in common
2024-11-22 23:11:39 -05:00
Dalton Messmer
72b30b1d00 Remove pkg-config from Brewfile (#7593)
* Update pkg-config to pkgconf

* Remove pkg-config/pkgconf

Should already be installed by GitHub Actions runner image
2024-11-22 22:47:37 -05:00
Arash Partow
bf54568ac6 Update ExprTk (#7571) 2024-11-22 10:15:46 -05:00
Rossmaxx
26d5241dd7 Optimise usage of pow using fast equivalent and exp2 (#7548)
* replace std::pow with better performing equivalents

* revert one instance where I swapped to fastPow10f

* Negative slope instead of multiplying -1

Co-authored-by: saker <sakertooth@gmail.com>

---------

Co-authored-by: saker <sakertooth@gmail.com>
2024-11-21 14:29:51 +05:30
SpomJ
7e65a87ba8 Fix unrestricted splash screen geometry (#7588) 2024-11-20 14:08:27 -05:00
Rossmaxx
0d7749d944 Fix the MSVC CI fail happening due to outdated vcpkg (#7589)
* switch to version 1 for msvc-dev-cmd github action

* bump msvc build year

* try refreshing vcpkg cache msvc

* Revert "try refreshing vcpkg cache msvc"

This reverts commit e8814f8cbd.

* try updating vcpkg manually

* Revert "bump msvc build year"

This reverts commit a95c75ee95.

* messmerd's review comments

* revert the version bump for msvc-dev-cmd

* Fix `cd` command

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2024-11-20 13:33:58 -05:00
Kapandaria
ada836c989 Fix crash on Xpressive when using integrate function (#7499)
* Fixed a bug in the integrate function, that was caused by warning fixes session.

* Xpressive - fixed code style issues.
2024-11-08 16:15:34 -05:00
Dalton Messmer
e36463ce77 Update macOS CI (#7572)
* Use macOS 13

See: https://github.com/actions/runner-images/issues/10721

* Upgrade to XCode 15.2

XCode 15.2 is the default on macOS 13

* Fix unqualified call to std::move warning

* Fix sprintf deprecated warnings

* Upgrade macOS 14 ARM64 builds to XCode 15.4

See: https://github.com/actions/runner-images/issues/10703

* Fix unused lambda capture warnings in Fader.cpp

* Fix unused variable warnings

* Fix formatting warning

Cannot format `const void*` as a string

* Force lambda conversion to function pointer
2024-11-06 17:46:12 -05:00
saker
07baf9e27a Tidy up MixerChannelView (#7527) 2024-11-03 02:13:55 -05:00
Rossmaxx
9912fd88e3 Add member variable for base sample rate and inline sample rate getter functions (#7552)
Co-authored-by: saker <sakertooth@gmail.com>
2024-10-30 19:55:11 -04:00
cyberrumor
b5de1d50e1 Fix PeakController attack/decay, use linear interpolation between samples (#7566)
Historically, the PeakController has had issues like attack/decay knobs
acting like on/off switches, and audio artifacts like buzzing or
clicking. This patch aims to address those issues.

The PeakController previously used lerp (linear interpolation) when
looping through the sample buffer, which was in updateValueBuffer. This
lerp utilized attack/decay values from control knobs. This is not the
correct place to utilize attack/decay because the only temporal data
available to the function is the frame and sample size. Therefore the
coefficient should simply be the sample rate instead.

Between each sample, processImpl would set m_lastSample to the RMS
without any sort of lerp. This resulted in m_lastSample producing
stair-like patterns over time, rather than a smooth line.

For context, m_lastSample is used to set the value of whatever is
connected to the PeakController. The basic lerp formula is:

m_lastSample = m_lastSample + ((1 - attack) * (RMS - m_lastSample))

This is useful because an attack of 0 sets m_lastSample to RMS, whereas
an attack of 1 would set m_lastSample to m_lastSample. This means our
attack/decay knobs can be used on a range from "snap to the next value
immediately" to "never stray from the last value".

* Remove attack/decay from PeakController frame lerp.
* Set frame lerp coefficient to 100.0 / sample_rate to fix buzzing.
* Add lerp between samples for PeakController to fix stairstep bug.
* The newly added lerp utilizes (1 - attack or decay) as the
  coefficient, which means the knobs actually do something now.
2024-10-28 15:01:08 -04:00
saker
1f37c9ba7c Inline TimePos and TimeSig functions to improve performance (#7549)
* Inline TimeSig functions

* Inline TimePos functions
2024-10-26 12:41:46 -04:00
Dalton Messmer
e6776bcfe5 Remove usage of QTextCodec in Hydrogen Import plugin (#7562)
* Remove QTextCodec

QTextCodec was removed from Qt6 and is only available through the
Qt5Compat module.

QTextCodec was only used by the HydrogenImport plugin when importing old
Hydrogen files that were saved using TinyXML before it supported UTF-8.
HydrogenImport would use QTextCodec to try to get the current encoding
from the locale, and then use that as a best guess for interpreting the
XML data in the unspecified encoding it was saved in. None of this was
ever reliable, since the encoding of the computer that saved the
Hydrogen file might not be the same as the computer running LMMS and
importing that file.

There is no good solution here, so I decided to simply assume the old
Hydrogen files are UTF-8 encoded. The worst that can happen is someone's
ancient Hydrogen files containing non-ASCII text of some random encoding
becomes mojibake'd after importing into LMMS, which is something that
already could have happened.

* Clean up a little
2024-10-23 13:17:14 -04:00
Lost Robot
b8b1dae407 Optimize dBFS/amplitude conversion functions (#7535)
* Optimize dBFS <-> amplitude functions
2024-10-15 17:59:47 +05:30
Johannes Lorenz
97b61bbd9a Make PluginView::isResizable a virtual (#7541)
Remove the member `PluginView::m_isResizable` and it's associated method `setResizable`. Turn `isResizable` into a virtual method.

The reasoning is that whether or not an effect can be resized depends on its implementation. Therefore does not make sense to have a method like `setResizable`. If the underlying implementation does not support resizing then it would not make sense to call `setResizable(true)`. So `isResizable` now describes the underlying ability of a plugin to resize. It's then up to the clients of that method to decide how to treat the result of `isResizable`, i.e. if they want to make use of the ability to resize or not.
2024-10-12 10:39:42 +02:00
Michael Gregorius
fb5516cfdc Track operations widget with layout (#7537)
Put the elements of the `TrackOperationsWidget` into layouts. These are:
* The grip that can be used to move tracks
* The gear icon that opens the operations menu
* The mute button
* The solo button

The grip that can be used to move tracks around is extracted into its own class called `TrackGrip`. This has several advantages:
* It can be put into a layout.
* It can render itself at arbitrary sizes by simply repeating its pattern pixmap.
* It can be used in a much more object-oriented way because it emits signals when it is grabbed and released.
* It is responsible for locally updating its cursor state.

The default cursor of the grip now is an open hand which indicates to the users that it can be grabbed. While being grabbed the cursor now is a closed hand.

## Technical details
The class `TrackOperationsWidget` now holds an instance of `TrackGrip` and provides a getter to retrieve it. This getter is used by `TrackView` to connect to the two new signals `grabbed` and `released`. The method `TrackOperationsWidget::paintEvent` now only paints the background as it does not need to paint the grip anymore.

The `TrackView` now handles the grabbing and release of the grip in `TrackView::onTrackGripGrabbed` and `TrackView::onTrackGripReleased`. Because the events and cursor states are now handled by `TrackGrip` this code could be removed from `TrackView::mousePressEvent`.

There was a comment in `TrackView` which indicated that the `TrackOperationsWidget` had to be updated when the track is moved and released because it would hide some elements during the move. The comment and the corresponding code was removed because the operations widget does not hide its elements during moves (this was already the state before the changes made by this commit).

Adjust the style sheets of the classic and default themes with regards to the `QPushButton` that's used to show the gear menu in the `TrackOperationsWidget`. The `>` has been removed because the `QPushButton` is not a direct decendent of the `TrackOperationsWidget` anymore.

### Wrapping of `PixmapButton` in `QWidget`
The PixmapButtons that are used in `TrackOperationsWidget` current have to be wrapped into a `QWidget`. This is necessary due to some strange effect where the PixmapButtons are resized to a size that's larger than their minimum/fixed size when the method `show` is called in `TrackContainerView::realignTracks`. Specifically, with the default theme the buttons are resized from their minimum size of (16, 14) to (26, 26). This then makes them behave not as expected in layouts.

The resizing is not done for QWidgets. Therefore we wrap the PixmapButton in a QWidget which is set to a fixed size that will be able to show the active and inactive pixmap. We can then use the QWidget in layouts without any disturbances.

The resizing only seems to affect the track view hierarchy and is triggered by Qt's internal mechanisms. For example the buttons in the mixer view do not seem to be affected.

If you want to debug this simply override "PixmapButton::resizeEvent" and trigger a break point in there, e.g. whenever the new size is not (16, 14).

### More layout-friendly PixmapButton

Make the `PixmapButton` more friendly for layouts by implementing `minimumSizeHint`. It returns a size that accommodate to show the active and the inactive pixmap.

Also make `sizeHint` return the minimum size hint. The previous implementation would have made layouts jump when the pixmap is toggled with pixmaps of different sizes.
2024-10-12 10:02:56 +02:00
Michael Gregorius
378ff8bab0 Fix the maximization of sub windows (#7530)
## Fix rendering of maximized sub windows

### Adjustments in paintEvent
In `SubWindow::paintEvent` don't paint anything if the sub window is
maximized . Otherwise some gradients are visible behind the maximized
child content.

### Adjustments in adjustTitleBar
In `SubWindow::adjustTitleBar` hide the title label and the buttons if the
sub window is maximized. Always show the title and close button if not
maximized. This is needed to reset the state correctly after
maximization.

Remove some calls to `isMaximized` where we already know that the sub
window is not maximized, i.e. where these calls would always return
`false`.

One adjustment would have resulted in a call to `setHidden(false)`. This
was changed to `setVisible(true)` to get rid of the double negation.

The other `false` would have gotten in an or statement and thus could be
removed completely.

### Add method addTitleButton
Add the helper method `SubWindow::addTitleButton` to reduce code
repetition in the constructor.

### Other changes
Remove a dependency on the `MdiArea` when checking if the sub window is
the active one. Query its own window state to find out if it is active.

When calling `setWindowFlags` in the constructor only adjust the existing
flags with the changes that we actually want to do. It was ensured that
all other flags that have been set before still apply with this change.
2024-10-10 10:36:25 +02:00
Steffen Baranowsky
066f6b5e95 Align the rename line edit for tracks (#7414)
Align the rename line edit for tracks.

Make sure that the rename line edit of the `TrackLabelButton` has the
same font size as the widget itself. Because the font size is defined
via style sheets the font size of the line edit has to be set when the
actual renaming starts and not in the constructor. The reason is that
style sheets are set after the constructor has run.

Rename the local variable `txt` to the more speaking name `trackName`.

Ensure that the line edit is moved to the correct place for different
icon sizes by taking the icon size into account. To make this work this
also has to be done in the `rename` method.

## Other changes

Streamline the default style sheet of `TrackLabelButton` by removing
repeated properties that are inherited from the "main" style sheet, i.e.
that are already part of `lmms--gui--TrackLabelButton`.

Interestingly, the `background-color` property had to be repeated for
`lmms--gui--TrackLabelButton:hover`.

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
2024-10-07 13:25:11 +02:00
Rossmaxx
79eac411a0 Removed dead code using #if 0 (#7521)
Removed code that's has been deactivated using `#if 0`.
2024-10-07 13:21:18 +02:00
firewall1110
639e122efe Fix empty editor windows (#7515)
Fix the problem with empty windows as described in issue #7412.

The `refocus` method in `MainWindow` is made public so that it can be called from `Editor::closeEvent`. It has also been refactored for better readability.

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2024-10-07 13:15:07 +02:00
regulus79
7dbc80926d Adding proportional scrolling (#7476)
Add proportional scrolling to the song editor, piano roll and automation editor. Proportional scrolling means that if for example a certain measure is on the right side of the song editor then it will take a certain number of mouse wheel moves to get it to the left side of the editor. It is the same number of wheel moves regardless of the zoom level.
2024-10-06 21:27:39 +02:00
Lisa Magdalena Riedler
0363ee6d16 fix various AudioFileProcessor bugs (#7533)
* fix out-of-bounds crash in AudioFileProcessor

by correctly setting m_from and m_to without them interfering with each other

* fixed flattened wave caused by inaccurate math

see PR for before/after

* simply stop drawing AFP waveform when there's no more data

this fixes the single point at the end of waveforms that sometimes shows up

* fixed seemingly insignificant type confusion (?)

execution seemed fine but my debugger started freaking out,
and if gdb is telling me I got a negative-sized vector,
I'd rather fix this issue than speculate "it's probably fine"

* fixed data offset for AFP waveform vis

the data itself isn't reversed, so we have to account for that
2024-10-06 11:26:57 +02:00
LMMS Service
e0ae8a1cec locale: Update translations 2024-10-02 10:57:13 -06:00
liushuyu
a83130f8c9 .tx/config: migrate the configuration to v2 format 2024-10-02 10:57:13 -06:00
Dalton Messmer
121d608c3a Reintroduce fast math functions (#7495)
* Add fast fma functions

* Use fast fma functions

* Add fast pow function

* Use fast pow function

* Fix build

* Remove fastFma

* Avoid UB in fastPow

On GCC with -O1 or -O2 optimizations, this new implementation generates
identical assembly to the old union-based implementation
2024-10-01 14:35:15 -04:00
saker
860749a8a1 Reformat MixerChannelView classes (#7431) 2024-09-30 19:32:21 -04:00
Rossmaxx
729593c022 Fix hardcoded fonts scaling issues (#7493)
* changed font sizes to better values

* rename gui_templates.h to FontHelper.h

* replace hardcoded values with constants

* make knob labels use small font

* code review from michael

* more consolidation

* Fix text problem in Vectorscope

Fix a problem with cutoff text in Vectorscope. During the constructor
call of `LedCheckBox` the method `LedCheckBox::onTextUpdated` is
triggered which sets a fixed size that fits the pixmap and the text.
After instantiating the two instances in `VecControlsDialog` the
constructor then set a minimum size which overrode the fixed size that
was previously set. This then led to text that was cutoff.

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
2024-09-28 13:18:02 +05:30
saker
6a7b23b278 Partially revert #7453 (#7519) 2024-09-26 08:56:34 -04:00
Dalton Messmer
18252088ba Refactor Effect processing (#7484)
* Move common effect processing code to wrapper method

- Introduce `processImpl` and `sleepImpl` methods, and adapt each effect
plugin to use them
- Use double for RMS out sum in Compressor and LOMM
- Run `checkGate` for GranularPitchShifterEffect
- Minor changes to LadspaEffect
- Remove dynamic allocations and VLAs from VstEffect's process method
- Some minor style/formatting fixes

* Fix VstEffect regression

* GranularPitchShifterEffect should not call `checkGate`

* Apply suggestions from code review

Co-authored-by: saker <sakertooth@gmail.com>

* Follow naming convention for local variables

* Add `MAXIMUM_BUFFER_SIZE` and use it in VstEffect

* Revert "GranularPitchShifterEffect should not call `checkGate`"

This reverts commit 67526f0ffe.

* VstEffect: Simplify setting "Don't Run" state

* Rename `sleepImpl` to `processBypassedImpl`

* Use `MAXIMUM_BUFFER_SIZE` in SetupDialog

* Pass `outSum` as out parameter; Fix LadspaEffect mutex

* Move outSum calculations to wrapper method

* Fix Linux build

* Oops

* Apply suggestions from code review

Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: saker <sakertooth@gmail.com>

---------

Co-authored-by: saker <sakertooth@gmail.com>
Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com>
2024-09-20 20:00:36 -04:00
saker
1d7ed16dc9 Make the send button and receive arrow occupy the same space in mixer channels (#7503) 2024-09-19 12:53:40 -04:00
saker
c952d56591 Restore some whitespace to the mixer channel layout (#7507) 2024-09-19 12:00:16 -04:00
saker
01294192c8 Fix Lb302 silence (#7504)
This problem seem to arise due to casting _n->framesLeft() and _n->offset() from an unsigned type (size_t) to a signed type (int). The fix is to use size_t as the type for std::max across the board.
2024-09-18 11:25:47 -04:00
saker
4803bbb73a Shrink mixer channel strip (#7502)
Remove all content margins and spacing between child widgets for each mixer channel strip.
2024-09-18 04:45:46 -04:00
DanielKauss
7d35d4225e SlicerT UI update (#7453)
* Update SlicerT UI

* Style review

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>

* Style fixes

---------

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>
2024-09-17 11:35:01 +05:30
Lost Robot
588aab3389 Replace Compressor infinite ratio icons (#7501) 2024-09-15 21:40:05 +05:30
regulus79
48314959b8 Fix sample clip position when reversing (#7446) 2024-09-13 18:54:00 -04:00
saker
d703f39153 Process metronome every MIDI tick (#7483) 2024-09-04 12:58:36 -04:00
Grzegorz Pruchniakowski
b81f806d63 Fix: unnecessary space in Update EqControlsDialog.cpp (#7485)
* Fix: unnecessary space in Update EqControlsDialog.cpp

Fix: unnecessary space in Update EqControlsDialog.cpp

Greetings,
Gootector

* Style fix from Ross

---------

Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>
2024-09-03 18:00:28 +05:30
Grzegorz Pruchniakowski
9a76d31732 Fix typo in DataFile.cpp (#7478) 2024-09-02 10:44:44 -04:00
Rossmaxx
35f350eeff Remove Noise class from flanger (#7473) 2024-08-28 15:46:48 -04:00
Rossmaxx
a992019626 Cleanup lmms_math.h (#7382)
* simplified fraction and absfraction functions

* removed unused fastSqrt() and fastPow()  
functions

* unused absMin() and absMax()

* move roundAt to math header

* Code review from saker

Co-authored-by: saker <sakertooth@gmail.com>

* use std::trunc()

* fixup after fixing merge conflicts

* remove unused fastFma and fastFmal functions.

* remove lmms_basics include, not needed

* use signedPowf from lmms_math in NES

* removed fastRand function, unused

* remove unused sinc function

* cleanup signedPowf

* code review

* further simplify random number math

* removed static from lmms_math file

---------

Co-authored-by: saker <sakertooth@gmail.com>
2024-08-28 12:48:56 +05:30
saker
ff8c47062f Continue processing Song even when no tracks are found (#7458) 2024-08-20 14:32:46 -04:00
Michael Gregorius
88ee83bb4a Do not save MIDI connections in presets (#7445)
Ensure that no MIDI information (connected inputs, outputs, etc.) is
stored in presets. This main fix can be found in
`InstrumentTrack::saveTrackSpecificSettings` where the state of the
MIDI ports are now only saved if we are not in preset mode.

The remaining changes are concered with a refactoring of the code
that's related to saving and loading presets.

The refactoring mainly revolves around the removal of the member
`m_simpleSerializingMode` and the method `setSimpleSerializing` in
`Track`.

This is accomplished by introducing two new methods `saveTrack` and
`loadTrack`. These methods have a similar interface to `saveSettings`
and `loadSettings` but they additionally contain a boolean which
indicates if a preset is saved/loaded or a whole track. Both new
methods contain the previous code of `saveSettings` and `loadSettings`.
The latter two now only delegate to the new methods assuming that the
full track is to be stored/loaded if called via the overridden methods
`saveSettings` and `loadSettings`.

The methods `savePreset` and `loadPreset` are added as well. They call
`saveTrack` and `loadTrack` with the preset boolean set to `true`.
These methods are now used by all places in the code where presets are
saved or loaded which makes the code more readable. Clients also do not
need to know any implementation details of `Track`, e.g. like having to
call `setSimpleSerializing`.

Adjust `saveTrackSpecificSettings` so that it also passes information
of whether a preset or a whole track is stored. This leads to changes
in the interfaces of `AutomationTrack`, `InstrumentTrack`,
`PatternTrack` and `SampleTrack`. Only the implementation of
`InstrumentTrack` uses the new information though.
2024-08-20 19:50:39 +02:00
szeli1
5e697f01c8 Fix zooming and sliding of the waveform view in AudioFileProcessor (#7377) 2024-08-19 13:20:19 -04:00
Alex
58ce9b476a Fix track handles dissapearing (#6338) 2024-08-16 22:20:39 +05:30
szeli1
bda1a9c37e Add input dialog to the mixer channel LCD spin box (#7399)
Co-authored-by: saker <sakertooth@gmail.com>
2024-08-11 11:14:43 -04:00
Michael Gregorius
d8e4d8c115 Remove support for SDL1 (#7443)
Remove the fallback code in `CMakeLists.txt`. Keep the message that's shown when SDL is wanted but not found. Remove the specific `LMMS_HAVE_SDL2` define.

Just print "OK" if SDL is found.

Remove several ifdefs which check for SDL2 or SDL1. Remove all code related to SDL1.
2024-08-11 12:20:02 +02:00
regulus79
0e96c267cd Fix bug with continuous autoscrolling when smooth scrolling is enabled (#7433) 2024-08-10 22:39:55 -04:00
Michael Gregorius
74c73e5848 SDL driver's input and output device configuration via combo box (#7421)
* Enable configuration of input device for SDL

Up to now the SDL audio driver attempted to use the default recording
device. This might not be what users want or expect, especially since the
actually used device is not visible anywhere. So if recording does not
work for the users they have no way to find out what's wrong.

Extend the settings screen of the SDL driver with a combo box that allows
to select the input device to be used. Store the selected device name in
a new attribute called "inputdevice" in the "audiosdl" section of the
configuration file.

Use the information from the configuration when attempting to inialize
the input device. Fall back to the default device if that does not work.

(cherry picked from commit 33139b9f4c)

* Provide a setting for system default input

Provide the setting "[System Default]" which instructs the SDL driver to
use the default device of the system as the input device. In the
configuration file this option is represented as an empty string. This
should play well with the current existing configuration of the users.

(cherry picked from commit 29c43c2bb6)

* Configuration of output device for SDL

Let users configure the output device that's used by the SDL driver.
Code-wise the implementation is very similar to the input device
configuration.

Use a `QComboBox` instead of a `QLineEdit` for `m_device` and rename it
to `m_playbackDeviceComboBox`.

Rename `s_defaultInputDevice` to `s_systemDefaultDevice` because it is
used in the context of playback and input devices.

(cherry picked from commit 1ab45e4994)

* Ensure label visibility

Make sure that labels are always shown by setting the row wrap policy of
the form layout to wrap long rows.

(cherry picked from commit a123d0e3cb)

* Rename "Device"

Rename "Device" to "Playback device" to make clear what the setting
refers to.

(cherry picked from commit 1f0cda4983)

* Remove repeated strings

Introduce const expressions to get rid of repeated strings with a risk
of typos.

(cherry picked from commit f9ea9705b8)

* Apply some more changes

Apply some more changes that have been made to `AudioSdl` in the
recording branch.

* Conditional ternary operator

Also use a conditional ternary operator for the input device setup.

* Methods for population of combo boxes

Move the population of the input and playback device combo boxes into
the methods `populatePlaybackDeviceComboBox` and
`populateInputDeviceComboBox`.

* Sort devices in combo box

Sort the devices names alphabetically in the input and playback combo
boxes. The default devices is always shown as the first entry.

* Code review fixes

Use `AudioDeviceSetupWidget` instead of `QObject` to translate "[System
Default]".

Fix copy/paste error in comment.

* Simplify some constexpr statements
2024-08-10 22:33:52 +02:00
Johannes Lorenz
44a8b038f5 Fix #5851: Implement EffectRackView::sizeHint() (#7428)
* Fix #5851: Implement `EffectRackView::sizeHint()`

This fixes `EffectRackView` to have a permanent size hint instead of
resizing the widget once in `InstrumentTrackWindow`. The size hint tells
the `InstrumentTrackWindow` to not increase with a growing number of
effects in the `EffectRackView`.
2024-08-10 09:00:06 +05:30
saker
632966caee Do not put the main thread in realtime or high priority (#7436) 2024-08-07 13:12:37 -04:00
Rossmaxx
6c7fecd8d7 Fix build regression from #7380 (#7437) 2024-08-06 23:23:17 -04:00
Rossmaxx
828cefb4ea Remove typeInfo struct from lmms_basics.h (#7380)
* remove typeInfo struct from lmms_basics.h

* Code review

Co-authored-by: saker <sakertooth@gmail.com>

* converted epsilon to a constant

* renamed to approximatelyEqual and moved to top

---------

Co-authored-by: saker <sakertooth@gmail.com>
2024-08-07 07:33:10 +05:30
szeli1
c16616cca4 Fix duplication of solo state when cloning tracks (#7391) 2024-08-05 07:16:03 -04:00
saker
5b366cfe3c Revert "Switch to libsamplerate's callback API in Sample (#7361)" (#7410)
This reverts commit 2f5f12aaae.
2024-08-04 11:01:26 -04:00
Johannes Lorenz
735e483d9f Fix memleaks in help/version (#7423)
* Fix memleaks in help/version

These memory leaks caused help and version to crash at the end, due to
rpmalloc's memleak detection.
2024-08-04 19:51:34 +05:30
Johannes Lorenz
1f224ad765 Add yamllint checks (#7424) 2024-08-04 15:47:43 +02:00
Michael Gregorius
b7548b7b7a Warn about LADSPA problems (#7267)
Introduce a method which checks if a file that's loaded has the LADSPA
controls saved in an old format that was written with a version before
commit e99efd541a.

The method is run at the end so that problems in all file versions are
detected. If a real upgrade was to be implemented it would have to run
between `DataFile::upgrade_0_4_0_rc2` and `DataFile::upgrade_1_0_99`.

See #5738 for more details.

If a problematic file is encountered a warning dialog that provides the number of affected LADSPA plugins is shown.
2024-08-04 15:30:42 +02:00
regulus79
ce17c95636 Add Continuous Auto-Scrolling (#7396)
* Initial Commit

* Refactor code and add new icons

* Fix logical error

* Add smooth scrolling to Song Editor

* Remove unused variable

* Fix scrolling speed and scrollbar width

* Remove QDebug and re-add a newline I deleted in an unrelated file

* Forgot to add files to commit

* Remove unused variable

* Fix Styling

* Fix Styling Again

* Fix Styling Again

* Fix Styling Again

* Add icons for classic theme

* Accidentally committed varying scroll speed with zoom -- removing

* Change abs to std::abs

Co-authored-by: saker <sakertooth@gmail.com>

* Change qMax to std::max and use static_cast

Co-authored-by: saker <sakertooth@gmail.com>

* Simplify stepped auto scrolling

Co-authored-by: saker <sakertooth@gmail.com>

* Remove unnecessary parentheses

* Remove return statement causing the play head line to stop

* Add specific tooltips to auto scrolling button states

* Remove `== true` from SongEditor.cpp

Co-authored-by: saker <sakertooth@gmail.com>

* Make tooltips translatable

Co-authored-by: Dominic Clark <mrdomclark@gmail.com>

* Fix zooming position calculation

* Rename bars to ticks

* Fix rubberband rect size

---------

Co-authored-by: saker <sakertooth@gmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
2024-08-04 10:30:42 +02:00
Johannes Lorenz
1c865843f7 Lv2: Improve plugin description (#7357) 2024-07-28 15:55:41 +02:00
Johannes Lorenz
0d3c43d237 Fixup of #7381 (#7401)
Fixup of commit 9c0fc8fc69
2024-07-28 15:54:17 +02:00
Dominic Clark
627209ad1d Apply warning flags to RemoteVstPlugin too (#7389) 2024-07-27 17:23:34 +01:00
Michael Gregorius
592da1cac7 Fix include of array in BasicFilters.h (#7398)
Fix a missing include of `array` in `BasicFilters.h`.
2024-07-27 18:02:05 +05:30
szeli1
99c30ea1ab Fixed alt + left or right causing a crash in PianoRoll (#7390) 2024-07-24 19:00:28 -04:00
saker
2f5f12aaae Switch to libsamplerate's callback API in Sample (#7361) 2024-07-24 18:50:47 -04:00
Dominic Clark
851c884f58 Re-enable disabled GCC warnings where possible (#7379) 2024-07-21 22:34:34 +01:00
Petar Katić
9c0fc8fc69 Made it so ZynAddSubFx isn't lowpassed by default (#7381)
In this repo, the only changes made are updating the according submodule
and changing the FREQ knob in ZynAddSubFx's LMMS GUI.
2024-07-20 13:06:51 +02:00
Rossmaxx
12632e6b5e Remove BufferManager::clear (#7378) 2024-07-13 17:01:31 -04:00
saker
1420a1f7e8 Define fpp_t and f_cnt_t to be of size_t (#7363)
Defines `fpp_t` and `f_cnt_t` to be of `size_t` within `lmms_basics.h`.  Most of the codebase used `fpp_t` to represent the size of an array of sample frames, which is incorrect, given that `fpp_t` was only 16 bits when sizes greater than 32767 are very possible. `f_cnt_t` was defined as `size_t` as well for consistency.

---------

Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
2024-07-09 06:27:33 -04:00
Johannes Lorenz
f2c815b214 Remove term "blacklist" (#7365)
About the PR:

* We use "blocked" as an abstract term, when there may be different reasons
* If there is a concrete reason, we use a more concrete word like "unstable"
  or "not useful"
* Double negations like "don't block" or "block unstable" are avoided

Besides this, this PR

* Lets `Lv2Manager` hide the full `std::set` of plugin URIs
* Fixes occurences of "BuffersizeLessThan32" - it is less or equal
* Moves `enableBlockedPlugins` from Engine to `ConfigManager`
2024-07-08 23:02:49 +02:00
Dominic Clark
bdd94ec215 Run CMake with -Werror=dev in CI (#7322) 2024-07-06 14:14:51 +01:00
Michael Gregorius
0384813ae4 Fix buzz in Monstro's 2nd oscillator (#7334) (#7368)
Fix a buzzing sound in Monstro's 2nd oscillator. It was introduced with
commit c2f2b7e0d7.

The problem was caused by checking if `len_r` is not equal to 0 instead of
checking `pd_r`.
2024-07-05 20:17:44 +05:30
saker
538572a3c5 Change fpp_t usage in SampleFrame to use size_t instead (#7362) 2024-07-02 12:02:34 -04:00
saker
449e669067 Revert "Reduce Memory Leaks (#7345)" (#7360)
This reverts commit 0bc911e266.
2024-07-01 13:43:05 -04:00
Andrew Wiltshire
0bc911e266 Reduce Memory Leaks (#7345) 2024-07-01 10:29:15 -04:00
Andrew Wiltshire
fb5268ebae Adds "Show Hidden Content" checkbox (#7309)
* Adds "Show Hidden Content Dialogue"

* Update FileBrowser.cpp

* Automatically rearrange layout to fit check boxes

* check if files are hidden in a cross platform manner

* put the hidden files checkbox below the user and factory check boxes at all times

* removed layout rearrangement code

* moved checkbox code to FileBrowser

* Removed unused include

* Cleanup in FileBrowser

Move the method `addContentCheckBox` to the other private methods.
Remove the method parameters because it can use the members.

Remove the conditional when adding the "Hidden content" checkbox because
it was always true.

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
2024-06-30 22:23:19 +02:00
FyiurAmron
edf6bf8dfe Remove mingw-std-threads from 3rd party deps and use native libs/headers instead (#7283)
* Remove mingw-std-threads from 3rd party deps

 and use native libs/headers instead

* switch MinGW to POSIX in CI
2024-06-30 15:49:06 -04:00
saker
13a05b99d3 Use recursive mutex for requestChangeInModel/doneChangeInModel (#7359)
* Make model change mutex recursive

* Initialize s_renderingThread
2024-06-30 14:54:20 -04:00
Michael Gregorius
286e62adf5 Simplify sample frame operations (make it a class) (#7156)
* Remove the struct StereoSample

Remove the struct `StereoSample`. Let `AudioEngine::getPeakValues` return a `sampleFrame` instead.

Adjust the calls in `Mixer`  and `Oscilloscope`.

* Simplify AudioEngine::getPeakValues

* Remove surroundSampleFrame

Some code assumes that `surroundSampleFrame` is interchangeable with `sampleFrame`. Thus, if the line `#define LMMS_DISABLE_SURROUND` is commented out in `lmms_basics.h` then the code does not compile anymore because `surroundSampleFrame` now is defined to be an array with four values instead of two. There also does not seem to be any support for surround sound (four channels instead of two) in the application. The faders and mixers do not seem to support more that two channels and the instruments and effects all expect a `sampleFrame`, i.e. stereo channels. It therefore makes sense to remove the "feature" because it also hinders the improvement of `sampleFrame`, e.g. by making it a class with some convenience methods that act on `sampleFrame` instances.

All occurrences of `surroundSampleFrame` are replaced with `sampleFrame`.

The version of `BufferManager::clear` that takes a `surroundSampleFrame` is removed completely.

The define `SURROUND_CHANNELS` is removed. All its occurrences are replaced with `DEFAULT_CHANNELS`.

Most of the audio devices classes, i.e. classes that inherit from `AudioDevice`, now clamp the configuration parameter between two values of `DEFAULT_CHANNELS`. This can be improved/streamlined later.

`BYTES_PER_SURROUND_FRAME` has been removed as it was not used anywhere anyway.

* Make sampleFrame a class

Make `sampleFrame` a class with several convenience methods. As a first step and demonstration adjust the follow methods to make use of the new functionality:
* `AudioEngine::getPeakValues`: Much more concise now.
* `lmms::MixHelpers::sanitize`: Better structure, better readable, less dereferencing and juggling with indices.
* `AddOp`, `AddMultipliedOp`, `multiply`: Make use of operators. Might become superfluous in the future.

* More operators and methods for sampleFrame

Add some more operators and methods to `sampleFrame`:
* Constructor which initializes both channels from a single sample value
* Assignment operator from a single sample value
* Addition/multiplication operators
* Scalar product

Adjust some more plugins to the new functionality of `sampleFrame`.

* Adjust DelayEffect to methods in sampleFrame

* Use composition instead of inheritance

Using inheritance was the quickest way to enable adding methods to `sampleFrame` without having to reimpement much of `std::array`s interface.

This is changed with this commit. The array is now a member of `sampleFrame` and the interface is extended with the necessary methods `data` and the index operator.

An `average` method was added so that no iterators need to be implemented (see changes in `SampleWaveform.cpp`).

* Apply suggestions from code review

Apply Veratil's suggestions from the code review

Co-authored-by: Kevin Zander <veratil@gmail.com>

* Fix warnings: zeroing non-trivial type

Fix several warnings of the following form:

Warnung: »void* memset(void*, int, size_t)« Säubern eines Objekts von nichttrivialem Typ »class lmms::sampleFrame«; use assignment or value-initialization instead [-Wclass-memaccess]

* Remove unnecessary reinterpret_casts

Remove some unnecessary reinterpret_casts with regards to `sampleFrame` buffers.

`PlayHandle::m_playHandleBuffer` already is a `sampleFrame*` and does not need a reinterpret_cast anymore.

In `LadspaEffect::processAudioBuffer` the `QVarLengthArray` is now directly initialized as an array of `sampleFrame` instances.

I guess in both places the `sampleFrame` previously was a `surroundSampleFrame` which has been removed.

* Clean up zeroSampleFrames code

* Fix warnings in RemotePlugin

Fix some warnings related to calls to `memcpy` in conjunction with`sampleFrame` which is now a class.

Add the helper functions `copyToSampleFrames` and `copyFromSampleFrames` and use them. The first function copies data from a `float` buffer into a `sampleFrame` buffer and the second copies vice versa.

* Rename "sampleFrame" to "SampleFrame"

Uppercase the name of `sampleFrame` so that it uses UpperCamelCase convention.

* Move SampleFrame into its own file

Move the class `SampleFrame` into its own class and remove it from `lmms_basics.h`.

Add forward includes to all headers where possible or include the `SampleFrame` header if it's not just referenced but used.

Add include to all cpp files where necessary.

It's a bit surprising that the `SampleFrame` header does not need to be included much more often in the implementation/cpp files. This is an indicator that it seems to be included via an include chain that at one point includes one of the headers where an include instead of a forward declaration had to be added in this commit.

* Return reference for += and *=

Return a reference for the compound assignment operators `+=` and `-=`.

* Explicit float constructor

Make the  constructor that takes a `float` explicit.

Remove the assignment operator that takes a `float`. Clients must use the
explicit `float` constructor and assign the result.

Adjust the code in "BitInvader" accordingly.

* Use std::fill in zeroSampleFrames

* Use zeroSampleFrames in sanitize

* Replace max with absMax

Replace `SampleFrame::max` with `SampleFrame::absMax`.

Use `absMax` in `DelayEffect::processAudioBuffer`. This should also fix
a buggy implementation of the peak computation.

Add the function `getAbsPeakValues`. It  computes the absolute peak
values for a buffer.

Remove `AudioEngine::getPeakValues`. It's not really the business of the
audio engine. Let `Mixer` and `Oscilloscope` use `getAbsPeakValues`.

* Replace scalarProduct

Replace the rather mathematical method `scalarProduct` with
`sumOfSquaredAmplitudes`. It was always called on itself anyway.

* Remove comment/TODO

* Simplify sanitize

Simplify the `sanitize` function by getting rid of the `bool found` and
by zeroing the buffer as soon as a problem is found.

* Put pointer symbols next to type

* Code review adjustments

* Remove "#pragme once"
* Adjust name of include guard
* Remove superfluous includes (leftovers from previous code changes)

---------

Co-authored-by: Kevin Zander <veratil@gmail.com>
2024-06-30 20:21:19 +02:00
Lost Robot
a0fbd7e7b4 Initialize LOMM arrays (#7355)
Fixes LOMM distortion and delay bug.
2024-06-30 17:07:38 +05:30
FyiurAmron
118ca4e9a2 Cleanup of MinGW-related scripts (#7327)
Consolidate and simplify mingw-related scripts.
Remove support for outdated Ubuntu versions.
2024-06-28 11:16:44 -04:00
Andrew Wiltshire
7c74fbc8c5 Capitalise root sidebar widget (#7350)
Co-authored-by: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com>
2024-06-27 20:59:33 +05:30
Lost Robot
f2fbcecc50 Fix bad Granular Pitch Shifter init values (#7354) 2024-06-26 22:18:24 -07:00
Lost Robot
9a0db6a17c Fix pitch shifter glide 0 division (#7348) 2024-06-26 11:41:54 -07:00
Lost Robot
6634cec127 Add Granular Pitch Shifter effect (#7328) 2024-06-26 11:00:27 +05:30
Lost Robot
1036144738 Fix uninitialized compressor values (#7343) 2024-06-24 09:17:48 -07:00
Rossmaxx
aaca5fbd0e Remove MemoryHelper (#7335)
* remove memory helper and replace alignedMalloc with stl version

* it's aligned_alloc

* forgot about destructor

* switch to unique pointers

Co-authored-by: saker <sakertooth@gmail.com>

* compile fix

---------

Co-authored-by: saker <sakertooth@gmail.com>
2024-06-24 21:22:19 +05:30
Dominic Clark
a1f7753a94 Fix MSVC warnings up to level 2 (#7329)
* Fix MSVC warnings up to /W2

* Fix large shift UB warning
2024-06-22 02:05:14 -04:00
Monospace-V
26646c653c Style format DrumSynth (#7189)
Co-authored-by: saker <sakertooth@gmail.com>
2024-06-22 10:38:01 +05:30
Dominic Clark
39b7d16f15 Fix caching for macOS CI jobs (#7326)
* Add architecture to macOS cache keys

* Only save Homebrew cache if lock file has changed
2024-06-18 16:56:19 -04:00
notaz
e400d81ecc set "child subreaper" process attribute on Linux (#7315)
When launching the wine VST process various wrappers may be involved,
when they exit the VST process becomes orphaned. This breaks the
PollParentThread mechanism which is responsible for cleaning up
processes in case of a crash. Because of this 64bit VST process exits
prematurely, in other words 64bit VST is currently broken in a typical
wine configuration.

A solution suggested by Lukas W is to set the PR_SET_CHILD_SUBREAPER
flag which makes the kernel reparent such process to lmms and
PollParentThread then works as intended.

Co-authored-by: Lukas W <lukaswhl@gmail.com>
2024-06-18 14:51:07 +05:30
Dominic Clark
e76a99ee76 Suppress warnings in third-party code (#7319) 2024-06-17 22:48:04 +01:00
szeli1
2adbb166b5 arpeggiator sorted mode fixed (#7025)
Fixes an issue where sorted arpeggios over multiple notes used a largely
unusable algorithm. piano-octave-arp instead of octave-arp-piano.

Fixes #6499
Fixes #4491
2024-06-17 16:11:55 +02:00
saker
01ffa95578 Use src_set_ratio to fix artifacts within Sample playback (#7321) 2024-06-15 18:34:10 -04:00
Rossmaxx
68ea3f5bf2 Remove debian folder (#7311)
* removed debian folder

* removed debian entries from check-strings

* fixup verify script too
2024-06-15 08:29:14 +05:30
Michael Gregorius
beedbc18a6 Add support for "factorysample:" prefix / Fix "bassloopes" typo (#7236)
## Add support for "factorysample:" prefix
Add support to upgrade files with `src` tags that are prefixed with "factorysample:".

## Fix "bassloopes" typo
Fix projects that still reference files with the typo "bassloopes" in their name.

The upgrade is implemented in its own method because it is unrelated to the BPM renaming even if it is technically very similar in its solution.

Introduce the helper method `mapSrcAttributeInElementsWithResources` which replaces the `src` attribute in elements with resources (samples and AFP) if it can be found in a map.
2024-06-14 16:22:39 +02:00
Lost Robot
b1ee626633 Fix noise generator (#7318)
This noise generator doesn't work properly when multiple noise sources are being generated simultaneously.
2024-06-13 15:18:36 -07:00
Rossmaxx
43fbcca9cb Modernize compiler and linker flags (#7255) 2024-06-02 10:52:51 +01:00
Andrew Wiltshire
969943b335 Change the wording of Instrument Plugin Dialogue (#7301)
Drag an instrument into either the Song Editor, the Pattern Editor or ~~into~~ an existing instrument track.

The word "into" seems redundant
2024-06-01 11:23:21 -04:00
Michael Gregorius
042f8ac325 Add peak indicators (#7295)
Add peak indicators to the mixer strips. They show the maximum peak value
that was observed and can be reset by clicking on them.

## Implementation details
The implementation works via a signal/slot mechanism. The `Fader` class
has a new signal `peakChanged` which reports peak values as
amplifications. A new class `PeakIndicator` is added which has a slot
`updatePeak` which is connected to the new signal in `Fader`.

The `PeakIndicator` inherits from `QLabel` and mainly deals with updating
the label text from the current peak value.

Add a `PeakIndicator` instance to `MixerChannelView`. Add a `reset`
method to `MixerChannelView` so that the mixer channel can be reset on
the loading of new projects, etc. The current implementation resets the
peak indicator back to -inf dbFS. The `reset` method is called in
`MixerView::clear`.

Remove the clamping in `Fader::setPeak` so that all peaks are reported.
Emit the new signal if the peak changes.
2024-06-01 12:09:47 +02:00
Michael Gregorius
4e93f51b75 Adjust rendering of BarModelEditor (#7299)
Adjust the rendering of BarModelEditor to make it respect logarithmic
and linear models. The code now uses `inverseScaledValue` instead of
`value` just like the `Knob` class does when calculating the angle.
2024-05-31 23:39:09 +02:00
Michael Gregorius
37795ae20a Resizable mixer channels/strips (#7293)
## Make mixer channels resizable
Make the mixer channels resizable within the mixer view.

Remove the setting of the size policy from `MixerChannelView`. Add the
`Fader` widget with a stretch factor so that it is resized within the
layout of the mixer channel/strip. Remove the stretch that was added to
the layout because the fader now stretches.

In `MixerView` remove the top alignments when widgets are added to the
layout so that they can resize. Set the channel layout to align to the
left so that it behaves correctly when it is resized by the scroll area
it is contained in. Make the widget resizable in the scroll area so that
it always fills the space. Set the minimum height of the scroll area to
the minimum size of the widget plus the scrollbar height so that the
channel strips are never overlapped by the scrollbar.

Set the size policy of the "new channel" button so that it grows
vertically with the mixer view. Set a fixed size so that it is as wide as
a mixer strip.

## Enable maximization for mixer view

Enable the maximize button for the mixer view now that it is fully
resizable.
2024-05-31 13:11:45 +02:00
BoredGuy1
94b1a382dd fixed position line disappearing when zoomed out (#7296) 2024-05-31 08:19:34 +02:00
Tres Finocchiaro
a85c98648c Add macOS arm64 builds (#7285)
Add macOS arm64 builds
2024-05-30 22:41:26 -04:00
Raine M. Ekman
6ec1ced49c Don't recalculate the song length for every added TCO while loading (#5236)
Don't make LMMS calculate the song length for every added TCO when a new project is created or a project is loaded. Instead do it only once afterwards. This is accomplished by preventing any calculations in `Song::updateLength` if a song is currently loaded. `Song::updateLength` is then called immediately after the loading flag has been set to `false` in both cases.

---------

Co-authored-by: IanCaio <iancaio_dev@hotmail.com>
2024-05-30 18:37:08 +02:00
saker
bfeb781dc0 Redesign file browser searching (#7130) 2024-05-29 21:46:58 -04:00
FyiurAmron
e82e3f573a update veal submodule 2024-05-30 00:53:51 +02:00
Dalton Messmer
7197f1de39 Update upload-artifacts actions (#7263) 2024-05-29 20:47:25 +01:00
Raine M. Ekman
a262956ed3 Update CPU to Pentium 4 for win32 builds (#6155)
The CPU feature requirements for any currently supported 32-bit version of Windows (8.1 and 10) are PAE, NX and SSE2. That should mean a green light for bumping the CPU we build for to the minimum one with SSE2.
2024-05-29 17:46:35 +05:30
FyiurAmron
948bb4ac69 Fix to allow NSIS packaging to work for non-MSVC Windows builds (#7287) 2024-05-28 19:28:58 -04:00
FyiurAmron
d1a15e5ff8 Fix for Werror=self-move in test for GCC >= 13 (#7288) 2024-05-28 16:39:38 -04:00
Oskar Wallgren
4033406430 Automation Editor - Fix automation point forced snapping to integer value. (#7282)
* Revert "Fix glitch with automation points (#7269)"

This reverts commit d60fd0d022.

* Fix glitch in Automation Editor. This reverts the earlier fix and tries to solve the issue by instead rounding off the values of the top/bottom levels before comparison with the automation point value.

---------

Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2024-05-28 14:31:09 +02:00
Oskar Wallgren
0a93e1777b Bump SWH submodule to fix a crash with Reverse Delay (#7277) 2024-05-24 14:24:10 -04:00
Dalton Messmer
2e6545328c Update MinGW CI to Ubuntu 20.04 (#7259)
Update MinGW CI to Ubuntu 20.04
* Use ghcr.io/lmms/linux.mingw:20.04
* Fix deprecation in ClipView.cpp
* Fix ccache and simplify git configuration
* Apply patch by @DomClark for MinGW's SDL2 target
* Update excludelist-win
2024-05-23 13:21:57 -04:00
Rossmaxx
e9848dbbbb A few accessibility changes in default theme (#7202)
* some css tweaks for accessibility

* suggestions from review

* classic theme focus

* fix bug where button color disappears on focus

* More scrollbar color changes on hover.

* Commented the hover effect for now.

* Remove handle "hover" effect.

* scrollbar

* revert button active state
2024-05-23 17:46:15 +05:30
Rossmaxx
b803e92d63 Add menu option and hotkeys to move controllers/effects (#7139)
* added controller rack modules

* remove this-> from setFocusPolicy() and obsolete comment

Co-authored-by: saker <sakertooth@gmail.com>

* Use std::swap

Co-authored-by: saker <sakertooth@gmail.com>

* some more cleanup

Co-authored-by: saker <sakertooth@gmail.com>

* Replace slots with function pointers

Co-authored-by: saker <sakertooth@gmail.com>

* Apply fixes

---------

Co-authored-by: ejaaskel <esa.jaaskela@suomi24.fi>
Co-authored-by: saker <sakertooth@gmail.com>
2024-05-23 17:38:47 +05:30
Tres Finocchiaro
bd2362a8c0 FindWine improvements (#7268)
Improve WineHQ detection
Closes #7169 

---------

Co-authored-by: Rossmaxx <mrroshan127@gmail.com>
2024-05-23 01:25:18 -04:00
Tres Finocchiaro
c66af602ad Fix fftw linking when cross-compiling (#7276) 2024-05-22 23:52:53 -04:00
Johannes Lorenz
fa5f2aa41a Lv2Proc: Fix all code-style issues with {} 2024-05-23 00:34:00 +02:00
Tres Finocchiaro
32fe3e50e7 Add "natural" scrolling support for trackpads (#5510)
Adds QWheelEvent::inverted() support to spinboxes, knobs, sliders
2024-05-21 11:32:28 -04:00
Michael Gregorius
75d6be2eac Fix missing initialization (#7271)
Fix the missing initialization of some variables in `TrackContentWidget`.
This led to some performances issues when the widget was painted because
a for loop was executed for which the variable started at a very large
negative number and was then incremented.
2024-05-20 18:46:52 +02:00
BoredGuy1
a527427abf Changed bar lines to follow snap size (#7034)
* Added lines in between bars
* Changed bar lines to follow snap size
* Changed default zoom and quantization value
* Added constants for line widths
* Added QSS configuration for new grid line colors
* Tied line widths to QSS properties
* Changed default quantization to 1/4
* Removed clear() from destructor model
* Removed destructor in ComboBoxModel.h
* Changed member set/get functions to pass by value
* Updated signal connection with newer syntax
2024-05-20 12:37:18 +02:00
Oskar Wallgren
d60fd0d022 Fix glitch with automation points (#7269)
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2024-05-20 00:18:11 +02:00
szeli1
76d8f65485 Fix lost connections when restoring automation clip (#7002) 2024-05-19 22:03:07 +01:00
Pascal
0071cb6f63 Fix UI freeze when zooming in on long samples (#7253) 2024-05-19 22:36:30 +02:00
wujekbrezniew
ca109f94f4 Migrate to new LV2 header paths (#6990) 2024-05-19 14:39:20 +01:00
Pascal
0ee05f5ad8 Fix crash in AFP when playing with loop while no sample is loaded (#7266) 2024-05-18 18:40:29 -04:00
Bimal Poudel
f891bb30eb Update widths of combo boxes (#7262)
* Update widths of combo boxes

* Update src/gui/editors/PianoRoll.cpp

no space right after brace

Co-authored-by: saker <sakertooth@gmail.com>

* Update src/gui/editors/PianoRoll.cpp

Co-authored-by: saker <sakertooth@gmail.com>

* Update src/gui/editors/PianoRoll.cpp

Co-authored-by: saker <sakertooth@gmail.com>

* Update src/gui/editors/PianoRoll.cpp

Co-authored-by: saker <sakertooth@gmail.com>

---------

Co-authored-by: saker <sakertooth@gmail.com>
2024-05-17 21:32:59 -04:00
Tres Finocchiaro
7859f1c72d Fix macOS CI builds (#7261) 2024-05-16 16:23:32 -04:00
Rossmaxx
321b2b4167 Remove the missing spoken.flac file in unfa - Spoken (#7208)
Remove spoken.flac using LMMS 1.0.3
---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
2024-05-16 15:51:46 -04:00
Tres Finocchiaro
a66d212221 Fix native linux VST on ARM64 (#7257) 2024-05-16 15:05:12 -04:00
Rossmaxx
36786dd83d Enable LADSPA plugins on MSVC (#6973)
Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
2024-05-13 08:44:42 +01:00
Dominic Clark
95e5f97150 Revamp resource embedding (#7241) 2024-05-12 17:38:14 +01:00
Tres Finocchiaro
6d100d1bba Remove support for msys2 (#7251) 2024-05-12 01:35:10 -04:00
Alexander Medvedev
acdf05f347 Update zynaddsubfx (#7250)
Update instrument submodule
2024-05-11 15:40:54 -04:00
Oskar Wallgren
b71d4f2aab Remove demo project Greshz-CoolSnip.mmpz (#7248) 2024-05-09 15:25:51 +02:00
Dalton Messmer
d71116b82a Update Linux CI to Ubuntu 20.04 (#7015)
- Switch to Ubuntu 20.04 Docker image ghcr.io/lmms/linux.gcc:20.04
- Linux packages have migrated from Docker Hub to https://github.com/orgs/lmms/packages
- Built using the Dockerfiles from Update Linux images lmms-ci-docker#15
- Updated the veal submodule to the latest commit on the default ladspa branch
- Fixed an error when catching a polymorphic type with GCC 9. See: LMMS/veal@0ae9287
- Added GCC flag -Wno-format-truncation for ZynAddSubFx build.
- Adds GCC flag -Wno-format-overflow for calf/veal build.

Closes #6993
2024-05-08 13:06:54 -04:00
Tres Finocchiaro
acefd06f9b Bump veal submodule (#6771)
- Add MSVC support
- Sync upstream changes
2024-05-08 01:06:03 -04:00
saker
20102c4ae4 Replace processingSampleRate with outputSampleRate in Lb302 (#7239) 2024-05-05 05:44:25 -04:00
saker
9b6e33aa5c Remove global oversampling (#7228)
Oversampling can have many different effects to the audio signal such as latency, phase issues, clipping, smearing, etc, so this should really be an option on a per-plugin basis, not globally across all of LMMS (which, in some places, shouldn't really need to oversample at all but were oversampled anyways).
2024-05-05 04:37:43 -04:00
Michael Gregorius
9bdc8adf33 Inform effects about changes in enabled model (#7237)
Add the virtual method `Effect::onEnabledChanged` which can be overridden by effects so that they can react to state changes with regards to being enabled or bypassed. The call of this methods is connected to state changes of the enabled model in the constructor of `Effect`.

Implement the method in `DualFilterEffect` by resetting the history of the two filters. This is done to prevent pops that have been reported in #4612.
2024-05-05 10:05:22 +02:00
Pascal
d5f5d00a6f Fix shifting of sample waveform during zoom (#7222)
The original code was doing division in `int`, which causes lost of accuracy and results in the waveform randomly shifting when zooming in and out.

This should fix it by casting variables to `float` before dividing, as well as keeping the values in `float` type.

The pull request also changes some type declaration to explicit to increase readability
2024-05-01 20:13:55 -04:00
Michael Gregorius
9ca9143f5b Fix upgrade routine for BPM renamings (#7235)
Fix the upgrade routine that was introduced with pull request #6747 which added the BPM value to some file names.

This also simplifies the implementation by using a map.

Note: this also removes the code about the prefix `factorysample:`. If it is used in some files these entries will also have to be added to the map.
2024-05-01 18:03:35 +02:00
Michael Gregorius
bb6a77aa0f Only set sample clips for valid files (#7224)
Check if a non-empty buffer was loaded and only set the sample clip if that's the case.

## Other changes

Move setting the song to modified towards the core in the context of `SampleClip`. Previously the `SampleClipView` did this but it's none of it's business.

Introduce `SampleClip::changeLengthToSampleLength` which changes the length of the clip to the length of the sample. This was also previously done by the view which is again the wrong place to do the necessary calculations. An unnecessary `static_cast` was removed while carrying over the code.

Add the method `SampleClip::hasSampleFileLoaded` which checks if the loaded sample corresponds to a given file name.

Fix code formatting.
2024-04-29 19:22:37 +02:00
Michael Gregorius
c0a4df49a2 Lb302: Consistent decay in time (#7230)
The previous implementation of Lb302`s decay used a fixed decay factor that was multiplied with the signal until the minimum threshold of 1/65536 was crossed. This fixed factor resulted in different lengths in time for different sample rates.

This is fixed by computing the decay factor by taking the sample rate into account as well. The new static method `computeDecayFactor` computes the factor that is needed to make a signal decay from 1 to a given attenuation over a given time.

The parameters used in the call to that method in `Lb302Synth::process` have been fine-tuned such that, at a sample rate of 44.1 kHz, they result in a factor very close to the previous hard-coded factor of 0.99897516.
2024-04-29 16:47:17 +02:00
Michael Gregorius
86363819c5 Fix Kicker's release stage (#7226)
When applying its release stage Kicker did not take the frames before the release into account but instead always applied the release to the full buffer. This potentially lead to a jump in the attenuation values instead of a clean linear decay.

See #7225 for more details.
2024-04-27 21:17:12 +02:00
Michael Gregorius
5c0db46a60 Streamline instrument flags (#7227)
## Instrument flags as a property of an instrument
The instruments flags (single streamed, MIDI based, not bendable) are properties of an instrument that do not change over time. Therefore the flags are made a property of the instrument which is initialized at construction time.

Adjust the constructors of all instruments which overrode the `flags` method to pass their flags into the `Instrument` constructor.

## Add helper methods for flags
Add helper methods for the flags. This makes the code more concise and readable and clients do not need to know the technical details on how to evaluate a flag.

## Remove the flags methods
Remove the flags methods to make it an implementation detail on how the flags are managed.
2024-04-27 17:45:55 +02:00
Rossmaxx
6c846684cd Replace call QT5_WRAP_UI with CMAKE_AUTOUIC (#7200) 2024-04-27 16:21:09 +01:00
saker
a53e5ba2f6 Remove high quality mode from codebase (#7219)
Many, many years ago (93a456c), high quality mode was merely disabled after it was noted that it can be problematic rather than being completely removed. Remove it from the codebase so we can get rid of some code and clean things up a bit.
2024-04-27 07:59:02 -04:00
Michael Gregorius
71dd300f43 Instrument release time in milliseconds (#7217)
Make instruments report their release time in milliseconds so that it becomes independent of the sample rate and sounds the same at any sample rate.

Technically this is done by removing the virtual keyword from `desiredReleaseFrames` so that it cannot be overridden anymore. The method now only serves to compute the number of frames from the given release time in milliseconds.

A new virtual method `desiredReleaseTimeMs` is added which instruments can override. The default returns 0 ms just like the default implementation previously returned 0 frames.

The method `computeReleaseTimeMsByFrameCount` is added for instruments that still use a hard coded release in frames. As of now this is only `SidInstrument`.

Add the helper method `getSampleRate` to `Instrument`.

Adjust several instruments to report their release times in milliseconds. The times are computed by taking the release in frames and assuming a sample rate of 44.1 kHz. In most cases the times are rounded to a "nice" next value, e.g.:
*  64 frames -> 1.5 ms (66 frames)
* 128 frames -> 3.0 ms (132 frames)
* 512 frames -> 12. ms (529 frames)
* 1000 frames -> 23 ms (1014 samples)

In parentheses the number of frames are shown which result from the rounded number of milliseconds when converted back assuming a sample rate of 44.1 kHz. The difference should not be noticeable in existing projects.

Remove the overrides for instruments that return the same value as the base class `Instrument` anyway. These are:
* GigPlayer
* Lb302
* Sf2Player

For `MonstroInstrument` the implementation is adjusted to behave in a very similar way. First the maximum of the envelope release times is computed. These are already available in milliseconds. Then the maximum of that value and 1.5 ms is taken and returned as the result.
2024-04-24 20:23:36 +02:00
Kevin Zander
62e2a39a7e SlicerT::findSlices - check if lower_bound did not find anything 2024-04-23 17:02:23 -05:00
Dominic Clark
bda042e1eb Add native system semaphore and Windows shared memory (#7212) 2024-04-20 23:21:29 +01:00
Rossmaxx
df11a98902 Bump Qt minimum version to 5.9 (#7204)
* bump qt minimum version to 5.9

* cleanup cmake checks

* Remove the obsoleted check.

* Missed this while removing the check.
2024-04-17 21:51:58 -04:00
Michael Gregorius
d5e1d9e853 Move icon determination into TrackLabelButton again (#7209)
Move icon determination into TrackLabelButton again

Fully undo the changes made in commit 88e0e94dcd because the intermediate revert made in commit 04ecf73395 seems to have led to a performance problem due to the icon being set over and over again in `TrackLabelButton::paintEvent`.

The original intention of the changes made in pull request #7114 was to remove the painting code that dynamically determines the icon over and over again. Ideally the icon that is used by an instrument should be somewhat of a "static" property that should be known very early on when an instrument view is created. There should not be any need to dynamically resolve the icon over and over, especially not in a button class very far down in the widget hierarchy. However, due to technical reasons this is not the case in the current code. See pull request #7132 for more details.
2024-04-17 19:21:23 +02:00
Robert Daniel Black
88ea50dd3e Optimize 2020-12-27 20:10:19 -07:00
Robert Daniel Black
5384c5d286 Fix more stuff 2020-12-27 20:05:58 -07:00
Robert Daniel Black
5665902ce0 Fix Amount knob units 2020-12-27 11:59:32 -07:00
Robert Daniel Black
1235e419d3 Fix stuff 2020-12-27 11:21:51 -07:00
Hyunjin Song
fa0f436683 Apply suggestions from code review 2020-12-10 13:18:48 +09:00
root
ee0420a67f Make effect work correctly with sample rate changes 2020-04-19 08:21:23 -06:00
root
7e231b8b2d Remove newline in untouched file 2020-04-18 14:50:16 -06:00
root
624b2f24df Put some duplicate code into for loops 2020-04-18 14:48:29 -06:00
root
89f05018c3 Resolve code/style reviews 2020-04-18 14:43:26 -06:00
Lost Robot
06024b85e7 Fix knob ranges 2019-11-23 18:06:03 -07:00
Lost Robot
d2cb54f6e6 Hippity hoppity squash and merge hides this probably 2019-11-23 17:45:19 -07:00
Lost Robot
ee442e8fdc Merge branch 'master' into disintegrator 2019-11-23 17:40:28 -07:00
root
02b9a2e6d6 Minor CPU boost I missed 2019-09-03 21:12:45 -06:00
root
4556151c03 Clip modulator at 0db for self-modulation mode 2019-08-30 12:00:45 -06:00
root
6b09fce36d Add self-modulation mode 2019-08-30 11:31:26 -06:00
root
328c7654ab Increase buffer size to correct amount 2019-08-30 10:23:30 -06:00
root
5a4670eac2 Changed filters to use BasicFilters.h, fixed crashing bug (caused by last commit). 2019-08-30 07:34:36 -06:00
root
6a44a51b5a Resolve code/style reviews 2019-08-29 21:08:52 -06:00
root
2fce224480 Added comments, removed unnecessary detuneWithOctaves function. 2019-08-29 20:44:49 -06:00
root
a630f32f21 Add Disintegrator effect 2019-08-29 19:59:24 -06:00
root
e83d44a56e Add Disintegrator effect 2019-08-29 19:59:03 -06:00
Lost Robot
a332d471c9 Merge pull request #12 from LMMS/master
Master
2019-08-29 19:47:29 -06:00
Lost Robot
0bb50a8604 Merge pull request #11 from LMMS/master
Master
2019-08-07 08:29:09 -06:00
Lost Robot
7f1c954f5a Merge pull request #8 from LMMS/master
Master
2019-06-21 15:09:34 -06:00
1703 changed files with 503301 additions and 477743 deletions

View File

@@ -1,7 +1,7 @@
---
# Language
Language: Cpp
Standard: Cpp11 # Cpp14 and Cpp17 are not supported by clang 11
Standard: c++20
# Indentation
TabWidth: 4

View File

@@ -20,7 +20,6 @@ Checks: >
readability-simplify-boolean-expr
WarningsAsErrors: ''
HeaderFilterRegex: '' # don't show errors from headers
AnalyzeTemporaryDtors: false
FormatStyle: none
User: user
CheckOptions:

1
.github/FUNDING.yml vendored
View File

@@ -1 +1,2 @@
---
custom: https://lmms.io/get-involved/#donate

View File

@@ -78,7 +78,8 @@ body:
label: Screenshots / Minimum Reproducible Project
description: |
- Upload any screenshots showing the bug in action.
- If possible, also include a .mmp/.mmpz project containing the simplest possible setup needed to reproduce the bug.
- If possible, also include a .mmp/.mmpz project containing the simplest possible
setup needed to reproduce the bug.
***Note:** To upload a project file to GitHub, it will need to be placed in a .zip archive.*
- type: checkboxes

View File

@@ -1,4 +1,5 @@
---
contact_links:
- name: Get help on Discord
url: https://lmms.io/chat/
about: Need help? Have a question? Reach out to other LMMS users on our Discord server!
- name: Get help on Discord
url: https://lmms.io/chat/
about: Need help? Have a question? Reach out to other LMMS users on our Discord server!

View File

@@ -10,7 +10,8 @@ body:
label: Enhancement Summary
description: |
- Briefly describe the enhancement.
- Explain why you believe the proposed enhancement to be a good idea, and (if applicable) how it helps overcome a limitation of LMMS you are currently facing.
- Explain why you believe the proposed enhancement to be a good idea, and (if applicable) how it helps
overcome a limitation of LMMS you are currently facing.
validations:
required: true
- type: textarea

View File

@@ -1,2 +1,3 @@
---
# Label requiring a response
responseRequiredLabel: "response required"

View File

@@ -5,30 +5,49 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
name: linux
runs-on: ubuntu-latest
container: lmmsci/linux.gcc:18.04
linux-x86_64:
name: linux-x86_64
runs-on: ubuntu-22.04
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
-DWANT_DEBUG_CPACK=ON
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j2
steps:
- name: Update and configure Git
run: |
add-apt-repository ppa:git-core/ppa
apt-get update
apt-get --yes install git
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Configure git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Clone fltk
uses: actions/checkout@v4
with:
repository: fltk/fltk
path: fltk
ref: 27d991f046bdebb12bfd58f7c05a19f135979c29
fetch-depth: 1
- name: Configure winehq
run: |
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings
wget -O - https://dl.winehq.org/wine-builds/winehq.key | \
sudo gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -
sudo wget -NP /etc/apt/sources.list.d/ \
https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources
- name: Install packages
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends \
$(xargs < .github/workflows/deps-ubuntu-24.04-gcc.txt)
sudo apt-get install -y --install-recommends g++-multilib gcc-multilib winehq-devel wine-devel-dev
sudo apt-get install -y --install-recommends \
$(xargs < .github/workflows/deps-ubuntu-24.04-fltk.txt)
- name: Cache ccache data
uses: actions/cache@v3
with:
@@ -37,12 +56,21 @@ jobs:
ccache-${{ github.job }}-${{ github.ref }}-
ccache-${{ github.job }}-
path: ~/.ccache
- name: Configure fltk
run: |
cmake -S fltk -B fltk/build -DFLTK_BUILD_SHARED_LIBS=ON -DFLTK_BACKEND_WAYLAND=ON \
-DFLTK_USE_LIBDECOR_GTK=OFF -DFLTK_BUILD_TEST=OFF -DFLTK_BUILD_GL=OFF
- name: Install fltk
run: |
cmake --build fltk/build
sudo cmake --install fltk/build --prefix /usr
- name: Configure
run: |
ccache --zero-stats
source /opt/qt5*/bin/qt5*-env.sh || true
mkdir build && cd build
cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install
cmake -S . \
-B build \
$CMAKE_OPTS
- name: Build
run: cmake --build build
- name: Run tests
@@ -51,10 +79,9 @@ jobs:
ctest --output-on-failure -j2
- name: Package
run: |
cmake --build build --target install
cmake --build build --target appimage
cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linux
path: build/lmms-*.AppImage
@@ -62,23 +89,115 @@ jobs:
run: |
ccache --cleanup
echo "[ccache config]"
ccache --print-config
ccache --show-config
echo "[ccache stats]"
ccache --show-stats
env:
CCACHE_MAXSIZE: 500M
linux-arm64:
name: linux-arm64
runs-on: ubuntu-24.04-arm
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
-DWANT_DEBUG_CPACK=ON
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j2
DEBIAN_FRONTEND: noninteractive
steps:
- name: Configure git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Clone fltk
uses: actions/checkout@v4
with:
repository: fltk/fltk
path: fltk
ref: 27d991f046bdebb12bfd58f7c05a19f135979c29
fetch-depth: 1
- name: Install system packages
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends \
$(xargs < .github/workflows/deps-ubuntu-24.04-gcc.txt)
sudo apt-get install -y --install-recommends \
$(xargs < .github/workflows/deps-ubuntu-24.04-fltk.txt)
- name: Cache ccache data
uses: actions/cache@v3
with:
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
ccache-${{ github.job }}-${{ github.ref }}-
ccache-${{ github.job }}-
path: ~/.ccache
- name: Configure fltk
run: |
cmake -S fltk -B fltk/build -DFLTK_BUILD_SHARED_LIBS=ON -DFLTK_BACKEND_WAYLAND=ON \
-DFLTK_USE_LIBDECOR_GTK=OFF -DFLTK_BUILD_TEST=OFF -DFLTK_BUILD_GL=OFF
- name: Install fltk
run: |
cmake --build fltk/build
sudo cmake --install fltk/build --prefix /usr
- name: Configure
run: |
ccache --zero-stats
cmake -S . \
-B build \
$CMAKE_OPTS
- name: Build
run: cmake --build build
- name: Run tests
run: |
cd build/tests
ctest --output-on-failure -j2
- name: Package
run: |
cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux-arm64
path: build/lmms-*.AppImage
- name: Trim ccache and print statistics
run: |
ccache --cleanup
echo "[ccache config]"
ccache --show-config
echo "[ccache stats]"
ccache --show-stats
env:
CCACHE_MAXSIZE: 500M
macos:
name: macos
runs-on: macos-12
strategy:
fail-fast: false
matrix:
arch: [ x86_64, arm64 ]
include:
- arch: x86_64
os: macos-15-intel
xcode: "16.4"
- arch: arm64
os: macos-15
xcode: "16.4"
name: macos-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
env:
CMAKE_OPTS: >-
-Werror=dev
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j3
DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
- name: Check out
uses: actions/checkout@v3
@@ -88,19 +207,21 @@ jobs:
- name: Clean up Homebrew download cache
run: rm -rf ~/Library/Caches/Homebrew/downloads
- name: Restore Homebrew download cache
id: cache-homebrew
uses: actions/cache/restore@v3
with:
key: n/a - only restore from restore-keys
restore-keys: |
homebrew-
homebrew-${{ matrix.arch }}-
path: ~/Library/Caches/Homebrew/downloads
- name: Cache ccache data
uses: actions/cache@v3
with:
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\
-${{ github.run_id }}"
restore-keys: |
ccache-${{ github.job }}-${{ github.ref }}-
ccache-${{ github.job }}-
ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}-
ccache-${{ github.job }}-${{ matrix.arch }}-
path: ~/Library/Caches/ccache
- name: Install dependencies
run: |
@@ -114,11 +235,11 @@ jobs:
- name: Configure
run: |
ccache --zero-stats
source .github/workflows/macos-env.sh
mkdir build
cmake -S . \
-B build \
-DCMAKE_INSTALL_PREFIX="../target" \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \
$CMAKE_OPTS \
-DUSE_WERROR=OFF
- name: Build
@@ -129,12 +250,11 @@ jobs:
ctest --output-on-failure -j3
- name: Package
run: |
cmake --build build --target install
cmake --build build --target dmg
cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: macos
name: macos-${{ matrix.arch }}
path: build/lmms-*.dmg
- name: Trim ccache and print statistics
run: |
@@ -146,20 +266,20 @@ jobs:
env:
CCACHE_MAXSIZE: 500MB
- name: Save Homebrew download cache
if: ${{ steps.cache-homebrew.outputs.cache-matched-key != env.key }}
uses: actions/cache/save@v3
with:
key: homebrew-${{ hashFiles('Brewfile.lock.json') }}
key: ${{ env.key }}
path: ~/Library/Caches/Homebrew/downloads
env:
key: "homebrew-${{ matrix.arch }}\
-${{ hashFiles('Brewfile.lock.json') }}"
mingw:
strategy:
fail-fast: false
matrix:
arch: ['32', '64']
name: mingw${{ matrix.arch }}
name: mingw64
runs-on: ubuntu-latest
container: lmmsci/linux.mingw${{ matrix.arch }}:18.04
env:
CMAKE_OPTS: >-
-Werror=dev
-DUSE_WERROR=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
@@ -167,12 +287,14 @@ jobs:
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j2
steps:
- name: Update and configure Git
- name: Configure apt
run: |
add-apt-repository ppa:git-core/ppa
apt-get update
apt-get --yes install git
git config --global --add safe.directory "$GITHUB_WORKSPACE"
sudo sh -c 'echo "deb http://ppa.launchpad.net/tobydox/mingw-w64/ubuntu focal main" > \
/etc/apt/sources.list.d/tobydox-mingw-w64.list'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 72931B477E22FEFD47F8DECE02FE5F12ADDE29B2
sudo apt-get update -y
- name: Configure git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check out
uses: actions/checkout@v3
with:
@@ -181,44 +303,45 @@ jobs:
- name: Cache ccache data
uses: actions/cache@v3
with:
key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\
key: "ccache-${{ github.job }}-64-${{ github.ref }}\
-${{ github.run_id }}"
restore-keys: |
ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}-
ccache-${{ github.job }}-${{ matrix.arch }}-
ccache-${{ github.job }}-64-${{ github.ref }}-
ccache-${{ github.job }}-64-
path: ~/.ccache
- name: Install dependencies
run: |
sudo apt-get install -y --no-install-recommends \
$(xargs < .github/workflows/deps-ubuntu-24.04-mingw.txt)
- name: Configure
run: |
ccache --zero-stats
mkdir build && cd build
../cmake/build_win${{ matrix.arch }}.sh
cmake -S . \
-B build \
-DCMAKE_TOOLCHAIN_FILE="./cmake/toolchains/MinGW-W64-64.cmake" \
$CMAKE_OPTS
- name: Build
run: cmake --build build
- name: Package
run: cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: mingw${{ matrix.arch }}
name: mingw64
path: build/lmms-*.exe
- name: Trim ccache and print statistics
run: |
ccache --cleanup
echo "[ccache config]"
ccache --print-config
ccache --show-config
echo "[ccache stats]"
ccache --show-stats
env:
CCACHE_MAXSIZE: 500M
msvc:
strategy:
fail-fast: false
matrix:
arch: ['x86', 'x64']
name: msvc-${{ matrix.arch }}
runs-on: windows-2019
name: msvc-x64
runs-on: windows-2022
env:
qt-version: '5.15.2'
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
steps:
@@ -231,41 +354,34 @@ jobs:
id: cache-deps
uses: actions/cache@v3
with:
key: vcpkg-${{ matrix.arch }}-${{ hashFiles('vcpkg.json') }}
key: vcpkg-msvc-x86_64-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ matrix.arch }}-
vcpkg-msvc-x86_64-
path: build\vcpkg_installed
- name: Cache ccache data
uses: actions/cache@v3
with:
key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\
# yamllint disable rule:line-length
key: "ccache-${{ github.job }}-x64-${{ github.ref }}\
-${{ github.run_id }}"
restore-keys: |
ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}-
ccache-${{ github.job }}-${{ matrix.arch }}-
ccache-${{ github.job }}-x64-${{ github.ref }}-
ccache-${{ github.job }}-x64-
path: ~\AppData\Local\ccache
# yamllint enable rule:line-length
- name: Install tools
run: choco install ccache
- name: Install 64-bit Qt
if: matrix.arch == 'x64'
uses: jurplel/install-qt-action@b3ea5275e37b734d027040e2c7fe7a10ea2ef946
- name: Install Qt
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
with:
version: ${{ env.qt-version }}
arch: win64_msvc2019_64
version: '6.8.*'
arch: "win64_msvc2022_64"
archives: qtbase qtsvg qttools
cache: true
- name: Install 32-bit Qt
uses: jurplel/install-qt-action@b3ea5275e37b734d027040e2c7fe7a10ea2ef946
with:
version: ${{ env.qt-version }}
arch: win32_msvc2019
archives: qtbase qtsvg qttools
cache: true
set-env: ${{ matrix.arch == 'x86' }}
- name: Set up build environment
uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89
with:
arch: ${{ matrix.arch }}
arch: x64
- name: Configure
run: |
ccache --zero-stats
@@ -274,10 +390,13 @@ jobs:
-B build `
-G Ninja `
--toolchain C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-Werror=dev `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DWANT_QT6=ON `
-DUSE_COMPILE_CACHE=ON `
-DVCPKG_TARGET_TRIPLET="${{ matrix.arch }}-windows" `
-DVCPKG_HOST_TRIPLET="${{ matrix.arch }}-windows" `
-DUSE_WERROR=ON `
-DVCPKG_TARGET_TRIPLET="x64-windows" `
-DVCPKG_HOST_TRIPLET="x64-windows" `
-DVCPKG_MANIFEST_INSTALL="${{ env.should_install_manifest }}"
env:
should_install_manifest:
@@ -291,9 +410,9 @@ jobs:
- name: Package
run: cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: msvc-${{ matrix.arch }}
name: msvc-x64
path: build\lmms-*.exe
- name: Trim ccache and print statistics
run: |
@@ -304,3 +423,68 @@ jobs:
ccache --show-stats --verbose
env:
CCACHE_MAXSIZE: 500MB
msys2:
name: windows-arm64
runs-on: windows-11-arm
defaults:
run:
shell: msys2 {0}
env:
CMAKE_OPTS: >-
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DUSE_COMPILE_CACHE=ON
-DCPACK_NSIS_EXECUTABLE=/clang64/bin/makensis.exe
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j2
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Cache msys2 dependencies
id: cache-deps
uses: actions/cache@v3
with:
key: windows-arm64-${{ hashFiles('.github/workflows/deps-msys2-clangarm64.txt') }}
restore-keys: |
windows-arm64-
path: \msys64\var\cache\pacman\pkg
- name: Install msys2
uses: msys2/setup-msys2@v2
with:
msystem: CLANGARM64
update: true
- name: Install dependencies
run: pacman --needed --noconfirm -S - < .github/workflows/deps-msys2-clangarm64.txt
- name: Cache ccache data
uses: actions/cache@v3
with:
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
ccache-${{ github.job }}-${{ github.ref }}-
ccache-${{ github.job }}-
path: ~\AppData\Local\ccache
- name: Configure
run: |
/clang64/bin/ccache.exe --zero-stats
cmake -B build $CMAKE_OPTS
- name: Build
run: cmake --build build
- name: Package
run: cmake --build build --target package
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows-arm64
path: build\lmms-*.exe
- name: Trim ccache and print statistics
run: |
/clang64/bin/ccache.exe --cleanup
echo "[ccache config]"
/clang64/bin/ccache.exe --show-config
echo "[ccache stats]"
/clang64/bin/ccache.exe --show-stats --verbose
env:
CCACHE_MAXSIZE: 500MB

View File

@@ -31,3 +31,10 @@ jobs:
$(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in") \
doc/bash-completion/lmms \
buildtools/update_locales
yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Run yamllint
run: for i in $(git ls-files '*.yml'); do yamllint $i; done

View File

@@ -0,0 +1,25 @@
base
base-devel
filesystem
git
mingw-w64-clang-aarch64-SDL2
mingw-w64-clang-aarch64-ccache
mingw-w64-clang-aarch64-clang
mingw-w64-clang-aarch64-cmake
mingw-w64-clang-aarch64-fftw
mingw-w64-clang-aarch64-fltk
mingw-w64-clang-aarch64-fluidsynth
mingw-w64-clang-aarch64-libgig
mingw-w64-clang-aarch64-libsamplerate
mingw-w64-clang-aarch64-libsndfile
mingw-w64-clang-aarch64-lilv
mingw-w64-clang-aarch64-lv2
mingw-w64-clang-aarch64-qt5-base
mingw-w64-clang-aarch64-qt5-svg
mingw-w64-clang-aarch64-suil
mingw-w64-clang-aarch64-stk
mingw-w64-clang-x86_64-nsis
mingw-w64-clang-x86_64-ccache
msys2-runtime
perl-List-MoreUtils
perl-XML-Parser

View File

@@ -0,0 +1,3 @@
libcairo2-dev
libpango1.0-dev
wayland-protocols

View File

@@ -0,0 +1,52 @@
binutils
ca-certificates
ccache
cmake
file
fluid
gcc
git
gpg
g++
libasound2-dev
libc6-dev
libfftw3-dev
libfluidsynth-dev
libgig-dev
libgtk2.0-0
libjack-jackd2-dev
liblilv-dev
liblist-moreutils-perl
libmp3lame-dev
libogg-dev
libqt5svg5-dev
libqt5x11extras5-dev
libsamplerate0-dev
libsdl2-dev
libsndfile1-dev
libsoundio-dev
libstk-dev
libsuil-dev
libvorbis-dev
libx11-xcb-dev
libxcb-keysyms1-dev
libxcb-util0-dev
libxft-dev
libxinerama-dev
libxml2-utils
libxml-perl
lsb-release
lv2-dev
make
perl
portaudio19-dev
qt5-qmake
qtbase5-dev
qtbase5-dev-tools
qtbase5-private-dev
qttools5-dev-tools
qtwayland5
software-properties-common
ssh-client
stk
wget

View File

@@ -0,0 +1,32 @@
binutils-mingw-w64
ccache
cmake
fftw-mingw-w64
file
flac-mingw-w64
fltk-mingw-w64
fluidsynth-mingw-w64
g++-mingw-w64-i686
g++-mingw-w64-x86-64
gcc-mingw-w64
gcc-mingw-w64-i686
gcc-mingw-w64-x86-64
git
glib2-mingw-w64
lame-mingw-w64
libgig-mingw-w64
liblist-moreutils-perl
libsamplerate-mingw-w64
libsndfile-mingw-w64
libsoundio-mingw-w64
libvorbis-mingw-w64
libxml-parser-perl
libz-mingw-w64-dev
mingw-w64-tools
nsis
portaudio-mingw-w64
qt5base-mingw-w64
qt5svg-mingw-w64
qttools5-dev-tools
sdl2-mingw-w64
stk-mingw-w64

121
.github/workflows/macos-env.sh vendored Executable file
View File

@@ -0,0 +1,121 @@
#!/usr/bin/env bash
# Calculate macOS-specific environment variables
# 1. Sets the value of MACOSX_DEPLOYMENT_TARGET by matching another binary on the system.
#
# Usage:
# source macos-env.sh [package_manager] [package_name] [package_version]
#
# Example:
# source macos-env.sh brew qt 5
# source macos-env.sh port wget
set -e
unset package_manager package_name package_version
# Obtain the package manager
if [ -n "$1" ]; then
# Set package manager to first parameter
package_manager="$1"
case "$package_manager" in
"homebrew")
package_manager="brew"
;;
"macports")
package_manager="port"
;;
esac
# Test the command
if ! command -v "$package_manager" &> /dev/null; then
echo "ERROR: Command '$package_manager' was not found, aborting." 1>&2
exit 1
fi
else
# Try to guess the package manager
if command -v brew &> /dev/null; then
package_manager="brew"
elif command -v port &> /dev/null; then
package_manager="port"
else
echo "WARNING: A compatible package manager wasn't found, we'll search for '$package_name' on \$PATH instead" 1>&2
fi
fi
# Obtain the package name
if [ -n "$2" ]; then
package_name="$2"
else
package_name="qt"
fi
# Special fallback handling for when package_name != binary_name, adjust as needed
if [ "$package_name" = "qt" ]; then
binary_name="qmake"
elif [ "$package_name" = "fltk" ]; then
binary_name="fluid"
else
# Assume the binary_name is the package_name
binary_name="$package_name"
fi
# Obtain the package version
if [ -n "$3" ]; then
package_version="$3"
else
if [ "$package_name" = "qt" ]; then
# Sane fallback for qt, adjust as needed
package_version="5"
fi
fi
# Format $package_name to include $package_version
if [ -n "$package_version" ]; then
# Specify qt version in package name
case "$package_manager" in
"port")
case "$package_name" in
"qt")
# Special handling for "qt5-qtbase"
package_name="$package_name${package_version}-${package_name}base"
;;
*)
package_name="$package_name$package_version"
;;
esac
;;
"brew" | *)
package_name="$package_name@$package_version"
;;
esac
fi
# Determine MACOSX_DEPLOYMENT_TARGET
if [ -n "$package_manager" ]; then
# Specify qt version in package name
case "$package_manager" in
"port")
binary_path="$(port contents "$package_name" |grep "bin/${binary_name}\$" |head -1 |sed -e 's/^[[:space:]]*//')"
;;
"brew" | *)
binary_path="$("$package_manager" --prefix "$package_name")/bin/$binary_name"
;;
esac
otool_out="$(otool -l "$binary_path")"
else
otool_out="$(otool -l "$(which "$binary_name")")"
fi
echo "Using '$binary_name' (from $package_manager) to calculate the macOS deployment target..."
min_ver="$(echo "$otool_out" |grep "minos" || echo "$otool_out" |grep -A 2 "LC_VERSION_MIN_MACOS"|grep "version")"
MACOSX_DEPLOYMENT_TARGET="$(echo "$min_ver"|awk '{print $2}')"
# Echo the lowest target macOS version supported by this SDK
sdk_settings="$(xcrun --sdk macosx --show-sdk-path)/SDKSettings.plist"
sdk_min="$(plutil -extract SupportedTargets.macosx.MinimumDeploymentTarget raw "$sdk_settings")"
echo "- Lowest SDK supported by this environment is '$sdk_min' based on $sdk_settings"
# Echo the sane target macOS version based on another build dependency
export MACOSX_DEPLOYMENT_TARGET
echo "- Exporting 'MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET' based on $binary_name"

2
.gitignore vendored
View File

@@ -10,3 +10,5 @@
/plugins/ZynAddSubFx/zynaddsubfx/doc/gen/Makefile
/data/locale/*.qm
Brewfile.lock.json
/.cache/
compile_commands.json

7
.gitmodules vendored
View File

@@ -16,6 +16,7 @@
[submodule "plugins/Xpressive/exprtk"]
path = plugins/Xpressive/exprtk
url = https://github.com/ArashPartow/exprtk
branch = release
[submodule "plugins/LadspaEffect/swh/ladspa"]
path = plugins/LadspaEffect/swh/ladspa
url = https://github.com/swh/ladspa
@@ -25,9 +26,6 @@
[submodule "src/3rdparty/weakjack/weakjack"]
path = src/3rdparty/weakjack/weakjack
url = https://github.com/x42/weakjack.git
[submodule "src/3rdparty/mingw-std-threads"]
path = src/3rdparty/mingw-std-threads
url = https://github.com/meganz/mingw-std-threads.git
[submodule "doc/wiki"]
path = doc/wiki
url = https://github.com/lmms/lmms.wiki.git
@@ -49,3 +47,6 @@
[submodule "src/3rdparty/hiir/hiir"]
path = src/3rdparty/hiir/hiir
url = https://github.com/LostRobotMusic/hiir
[submodule "plugins/MidiImport/portsmf"]
path = plugins/MidiImport/portsmf
url = https://github.com/portsmf/portsmf

View File

@@ -1,11 +1,10 @@
[main]
host = https://www.transifex.com
host = https://app.transifex.com
minimum_perc = 51
#Need to finish at least 51% before merging back
[lmms.lmms]
[o:lmms:p:lmms:r:lmms]
file_filter = data/locale/<lang>.ts
source_file = data/locale/en.ts
source_lang = en
type = QT
type = QT

3
.yamllint Normal file
View File

@@ -0,0 +1,3 @@
rules:
line-length:
max: 120 # be conforming to LMMS coding rules

View File

@@ -13,7 +13,7 @@ brew "libsoundio"
brew "libvorbis"
brew "lilv"
brew "lv2"
brew "pkg-config"
brew "pkgconf"
brew "portaudio"
brew "qt@5"
brew "sdl2"

View File

@@ -1,4 +1,5 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
SET(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Set the given policy to NEW. If it does not exist, it will not be set. If it
# is already set to NEW (most likely due to predating the minimum required CMake
@@ -15,8 +16,7 @@ function(enable_policy_if_exists id)
endif()
endfunction()
# Needed for the SWH Ladspa plugins. See below.
enable_policy_if_exists(CMP0074) # find_package() uses <PackageName>_ROOT variables.
enable_policy_if_exists(CMP0092) # MSVC warning flags are not in CMAKE_<LANG>_FLAGS by default.
# Needed for ccache support with MSVC
enable_policy_if_exists(CMP0141) # MSVC debug information format flags are selected by an abstraction.
@@ -43,10 +43,11 @@ INCLUDE(AddFileDependencies)
INCLUDE(CheckIncludeFiles)
INCLUDE(FindPkgConfig)
INCLUDE(GenerateExportHeader)
include(StaticDependencies)
STRING(TOUPPER "${CMAKE_PROJECT_NAME}" PROJECT_NAME_UCASE)
SET(PROJECT_YEAR 2024)
SET(PROJECT_YEAR 2026)
SET(PROJECT_AUTHOR "LMMS Developers")
SET(PROJECT_URL "https://lmms.io")
@@ -102,7 +103,11 @@ option(WANT_DEBUG_ASAN "Enable AddressSanitizer" OFF)
option(WANT_DEBUG_TSAN "Enable ThreadSanitizer" OFF)
option(WANT_DEBUG_MSAN "Enable MemorySanitizer" OFF)
option(WANT_DEBUG_UBSAN "Enable UndefinedBehaviorSanitizer" OFF)
option(WANT_DEBUG_GPROF "Enable gprof profiler" OFF)
OPTION(BUNDLE_QT_TRANSLATIONS "Install Qt translation files for LMMS" OFF)
option(WANT_DEBUG_CPACK "Show detailed logs for packaging commands" OFF)
option(WANT_CPACK_TARBALL "Request CPack to create a tarball instead of an installer" OFF)
option(WANT_QT6 "Build with experimental Qt6 support" OFF)
IF(LMMS_BUILD_APPLE)
@@ -145,16 +150,6 @@ ELSE(LMMS_BUILD_WIN32)
SET(STATUS_WINMM "<not supported on this platform>")
ENDIF(LMMS_BUILD_WIN32)
# TODO: Fix linking issues with msys debug builds
IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(WANT_GIG OFF)
SET(WANT_STK OFF)
SET(WANT_SWH OFF)
SET(STATUS_GIG "not built as requested")
SET(STATUS_STK "not built as requested")
ENDIF()
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
CHECK_INCLUDE_FILES(pthread.h LMMS_HAVE_PTHREAD_H)
@@ -164,6 +159,7 @@ CHECK_INCLUDE_FILES(sys/types.h LMMS_HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES(sys/ipc.h LMMS_HAVE_SYS_IPC_H)
CHECK_INCLUDE_FILES(sys/time.h LMMS_HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES(sys/times.h LMMS_HAVE_SYS_TIMES_H)
CHECK_INCLUDE_FILES(sys/prctl.h LMMS_HAVE_SYS_PRCTL_H)
CHECK_INCLUDE_FILES(sched.h LMMS_HAVE_SCHED_H)
CHECK_INCLUDE_FILES(sys/soundcard.h LMMS_HAVE_SYS_SOUNDCARD_H)
CHECK_INCLUDE_FILES(soundcard.h LMMS_HAVE_SOUNDCARD_H)
@@ -179,30 +175,45 @@ check_library_exists(rt shm_open "" LMMS_HAVE_LIBRT)
LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")
FIND_PACKAGE(Qt5 5.6.0 COMPONENTS Core Gui Widgets Xml REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS LinguistTools QUIET)
if(WANT_QT6)
set(QT_VERSION_MAJOR 6)
if(MSVC)
set(LMMS_QT_MIN_VERSION 6.8.0)
else()
set(LMMS_QT_MIN_VERSION 6.0.0)
endif()
set(STATUS_QT6 "Enabled")
else()
set(QT_VERSION_MAJOR 5)
set(LMMS_QT_MIN_VERSION 5.15.0)
set(STATUS_QT6 "Disabled")
endif()
INCLUDE_DIRECTORIES(
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS}
find_package(Qt${QT_VERSION_MAJOR} ${LMMS_QT_MIN_VERSION} COMPONENTS Core Gui Widgets Xml Svg REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools QUIET)
include_directories(SYSTEM
${Qt${QT_VERSION_MAJOR}Core_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Gui_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Widgets_INCLUDE_DIRS}
${Qt${QT_VERSION_MAJOR}Xml_INCLUDE_DIRS}
)
SET(QT_LIBRARIES
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Xml
set(QT_LIBRARIES
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Xml
Qt${QT_VERSION_MAJOR}::Svg
)
IF(LMMS_BUILD_LINUX AND WANT_VST)
IF(LMMS_BUILD_LINUX AND WANT_VST AND NOT WANT_QT6)
FIND_PACKAGE(Qt5 COMPONENTS X11Extras REQUIRED)
LIST(APPEND QT_LIBRARIES Qt5::X11Extras)
ENDIF()
# Resolve Qt5::qmake to full path for use in packaging scripts
GET_TARGET_PROPERTY(QT_QMAKE_EXECUTABLE "${Qt5Core_QMAKE_EXECUTABLE}" IMPORTED_LOCATION)
# Resolve qmake to full path for use in packaging scripts
get_target_property(QT_QMAKE_EXECUTABLE Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION)
# Find the location of Qt translation files
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_TRANSLATIONS
@@ -215,8 +226,8 @@ IF(EXISTS "${QT_TRANSLATIONS_DIR}")
ADD_DEFINITIONS("-DQT_TRANSLATIONS_DIR=\"${QT_TRANSLATIONS_DIR}\"")
ENDIF()
FIND_PACKAGE(Qt5Test)
SET(QT_QTTEST_LIBRARY Qt5::Test)
FIND_PACKAGE(Qt${QT_VERSION_MAJOR}Test)
SET(QT_QTTEST_LIBRARY Qt${QT_VERSION_MAJOR}::Test)
# check for libsndfile
FIND_PACKAGE(SndFile REQUIRED)
@@ -245,29 +256,28 @@ if(LMMS_BUILD_APPLE)
endif()
find_package(Perl)
IF(WANT_LV2)
IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(LV2 lv2)
PKG_CHECK_MODULES(LILV lilv-0)
ENDIF()
IF(NOT LV2_FOUND AND NOT LILV_FOUND)
UNSET(LV2_FOUND CACHE)
UNSET(LILV_FOUND CACHE)
FIND_PACKAGE(LV2 CONFIG)
FIND_PACKAGE(LILV CONFIG)
IF(LILV_FOUND)
SET(LILV_LIBRARIES "lilv::lilv")
ENDIF()
ENDIF()
IF(LV2_FOUND AND LILV_FOUND)
SET(LMMS_HAVE_LV2 TRUE)
SET(STATUS_LV2 "OK")
ELSE()
SET(STATUS_LV2 "not found, install it or set PKG_CONFIG_PATH appropriately")
ENDIF()
ELSE(WANT_LV2)
SET(STATUS_LV2 "not built as requested")
ENDIF(WANT_LV2)
if(WANT_LV2)
if(PKG_CONFIG_FOUND)
pkg_check_modules(LV2 lv2)
endif()
find_package(Lilv)
if(Lilv_FOUND)
set(LILV_LIBRARIES Lilv::lilv)
endif()
# Ensure both dependencies are found
if(NOT LV2_FOUND)
set(STATUS_LV2 "not found, install lv2 or set PKG_CONFIG_PATH appropriately")
elseif(NOT Lilv_FOUND)
set(STATUS_LV2 "not found, install lilv or set PKG_CONFIG_PATH appropriately")
else()
set(LMMS_HAVE_LV2 TRUE)
set(STATUS_LV2 "OK")
endif()
else()
set(STATUS_LV2 "not built as requested")
endif()
IF(WANT_SUIL)
IF(PKG_CONFIG_FOUND)
@@ -275,6 +285,7 @@ IF(WANT_SUIL)
IF(SUIL_FOUND)
SET(LMMS_HAVE_SUIL TRUE)
SET(STATUS_SUIL "OK")
find_package(SuilModules)
ELSE()
SET(STATUS_SUIL "not found, install it or set PKG_CONFIG_PATH appropriately")
ENDIF()
@@ -347,37 +358,14 @@ IF(WANT_SDL)
FIND_PACKAGE(SDL2)
IF(SDL2_FOUND)
SET(LMMS_HAVE_SDL TRUE)
SET(LMMS_HAVE_SDL2 TRUE)
SET(STATUS_SDL "OK, using SDL2")
SET(STATUS_SDL "OK")
SET(SDL2_LIBRARY "SDL2::SDL2")
SET(SDL_INCLUDE_DIR "")
SET(SDL_LIBRARY "")
ELSE()
SET(STATUS_SDL "not found, please install libsdl2-dev (or similar) if you require SDL support")
SET(SDL2_LIBRARY "")
ENDIF()
ENDIF()
# fallback to SDL1
IF(WANT_SDL AND NOT LMMS_HAVE_SDL2)
# Fallback to SDL1.2
SET(SDL_BUILDING_LIBRARY TRUE)
FIND_PACKAGE(SDL)
IF(SDL_FOUND)
SET(LMMS_HAVE_SDL TRUE)
SET(STATUS_SDL "OK, using SDL1.2")
# fix mingw since 53abd65
IF(NOT SDL_INCLUDE_DIR)
SET(SDL_INCLUDE_DIR "${CMAKE_FIND_ROOT_PATH}/include")
ENDIF()
ELSE()
SET(STATUS_SDL "not found, please install libsdl2-dev (or similar) "
"if you require SDL support")
SET(SDL_INCLUDE_DIR "")
SET(SDL_LIBRARY "")
ENDIF()
ENDIF()
# check for Sid
if(WANT_SID)
if(PERL_FOUND)
@@ -420,7 +408,7 @@ IF(WANT_SOUNDIO)
IF(SOUNDIO_FOUND)
SET(LMMS_HAVE_SOUNDIO TRUE)
SET(STATUS_SOUNDIO "OK")
INCLUDE_DIRECTORIES("${SOUNDIO_INCLUDE_DIR}")
include_directories(SYSTEM "${SOUNDIO_INCLUDE_DIR}")
ELSE(SOUNDIO_FOUND)
SET(SOUNDIO_INCLUDE_DIR "")
SET(STATUS_SOUNDIO "not found, please install libsoundio if you require libsoundio support")
@@ -501,11 +489,9 @@ ENDIF(NOT LMMS_HAVE_ALSA)
IF(WANT_JACK)
IF(WANT_WEAKJACK)
SET(LMMS_HAVE_WEAKJACK TRUE)
SET(WEAKJACK_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/3rdparty/weakjack/weakjack)
SET(JACK_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/3rdparty/jack2/common)
SET(STATUS_JACK "OK (weak linking enabled)")
# use dlsym instead
SET(JACK_LIBRARIES ${CMAKE_DL_LIBS})
set(JACK_INCLUDE_DIRS "")
set(JACK_LIBRARIES weakjack)
SET(LMMS_HAVE_JACK TRUE)
SET(LMMS_HAVE_JACK_PRENAME TRUE)
SET(JACK_FOUND TRUE)
@@ -625,6 +611,9 @@ if(WANT_VST)
else()
set(STATUS_VST "No hosts selected and available")
endif()
if(WINE_ASLR_ENABLED)
set(STATUS_VST_64 "${STATUS_VST_64}\n\tWARNING: You are using wine ${WINE_VERSION} which cannot disable ASLR, please consider upgrading to wine 10.14 or higher. ASLR may cause crashes with older VSTs.")
endif()
endif()
IF(WANT_DEBUG_FPE)
@@ -638,31 +627,20 @@ ELSE()
SET (STATUS_DEBUG_FPE "Disabled")
ENDIF(WANT_DEBUG_FPE)
if(WANT_DEBUG_CPACK)
if((LMMS_BUILD_WIN32 AND CMAKE_VERSION VERSION_LESS "3.19") OR WANT_CPACK_TARBALL)
set(STATUS_DEBUG_CPACK "Wanted but disabled due to unsupported configuration")
else()
set(CPACK_DEBUG TRUE)
set(STATUS_DEBUG_CPACK "Enabled")
endif()
else()
set(STATUS_DEBUG_CPACK "Disabled")
endif()
# check for libsamplerate
FIND_PACKAGE(Samplerate 0.1.8 MODULE REQUIRED)
# set compiler flags
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
SET(WERROR_FLAGS "-Wall -Werror=unused-function -Wno-sign-compare -Wno-strict-overflow")
OPTION(USE_WERROR "Add -werror to the build flags. Stops the build on warnings" OFF)
IF(${USE_WERROR})
SET(WERROR_FLAGS "${WERROR_FLAGS} -Werror")
ENDIF()
# Due to a regression in gcc-4.8.X, we need to disable array-bounds check
IF (CMAKE_COMPILER_IS_GNUCXX AND ((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "4.8.0") OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0") OR LMMS_BUILD_WIN32))
SET(WERROR_FLAGS "${WERROR_FLAGS} -Wno-array-bounds -Wno-attributes")
ENDIF()
ELSEIF(MSVC)
# Remove any existing /W flags
STRING(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
SET(WERROR_FLAGS "/W2")
IF(${USE_WERROR})
SET(WERROR_FLAGS "${WERROR_FLAGS} /WX")
ENDIF()
ENDIF()
IF(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
@@ -671,16 +649,23 @@ IF(NOT CMAKE_BUILD_TYPE)
"MinSizeRel" "RelWithDebInfo")
ENDIF()
SET(CMAKE_C_FLAGS "${WERROR_FLAGS} ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${WERROR_FLAGS} ${CMAKE_CXX_FLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLMMS_DEBUG")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLMMS_DEBUG")
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(NDEBUG)
SET(STATUS_ASSERTIONS "Disabled")
else()
remove_definitions(-DNDEBUG)
SET(STATUS_ASSERTIONS "Enabled")
endif()
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16")
set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "true")
else()
set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "echo")
endif()
if(STRIP)
# TODO CMake 3.19: Now that CONFIG generator expressions support testing for
# multiple configurations, combine the OR into a single CONFIG expression.
@@ -714,17 +699,30 @@ ENDIF()
# we somehow have to make LMMS-binary depend on MOC-files
ADD_FILE_DEPENDENCIES("${CMAKE_BINARY_DIR}/lmmsconfig.h")
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
IF(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
ENDIF(WIN32)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -DPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
elseif(MSVC)
# Use UTF-8 as the source and execution character set
add_compile_options("/utf-8")
ENDIF()
# gcc builds support gprof for profiling
# clang too seems to support gprof, but i couldn't get it working.
# if needed, change the if condition to "GNU|CLANG"
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(STATUS_GPROF ", NOT SUPPORTED BY THIS COMPILER")
set(WANT_DEBUG_GPROF OFF)
endif()
if(WANT_DEBUG_GPROF)
add_compile_options(-pg)
add_link_options(-pg)
set(STATUS_GPROF "OK")
else()
set(STATUS_GPROF "Disabled ${STATUS_GPROF}")
endif()
# add enabled sanitizers
function(add_sanitizer sanitizer supported_compilers want_flag status_flag)
if(${want_flag})
@@ -749,6 +747,8 @@ add_sanitizer(memory "Clang" WANT_DEBUG_MSAN STATUS_DEBUG_MSAN -fno-omit-frame-p
# not being found by PeakController
add_sanitizer(undefined "GNU|Clang" WANT_DEBUG_UBSAN STATUS_DEBUG_UBSAN -fno-sanitize=vptr)
# Add warning and error flags
include(ErrorFlags)
# use ccache
include(CompileCache)
@@ -786,7 +786,7 @@ IF(LMMS_BUILD_LINUX)
"${CMAKE_BINARY_DIR}/lmmsconfig.h"
"${CMAKE_BINARY_DIR}/lmmsversion.h"
"${CMAKE_SOURCE_DIR}/src/gui/embed.cpp"
DESTINATION "${CMAKE_INSTALL_PREFIX}/include/lmms/")
DESTINATION "include/lmms/")
ENDIF(LMMS_BUILD_LINUX)
#
@@ -890,6 +890,10 @@ MESSAGE(
"* Debug using ThreadSanitizer : ${STATUS_DEBUG_TSAN}\n"
"* Debug using MemorySanitizer : ${STATUS_DEBUG_MSAN}\n"
"* Debug using UBSanitizer : ${STATUS_DEBUG_UBSAN}\n"
"* Debug packaging commands : ${STATUS_DEBUG_CPACK}\n"
"* Profile using GNU profiler : ${STATUS_GPROF}\n"
"* Debug assertions : ${STATUS_ASSERTIONS}\n"
"* Experimental Qt6 support : ${STATUS_QT6}\n"
)
MESSAGE(

View File

@@ -1,58 +1,57 @@
# ![LMMS Logo](https://raw.githubusercontent.com/LMMS/artwork/master/Icon%20%26%20Mimetypes/lmms-64x64.svg) LMMS
[![Build status](https://github.com/LMMS/lmms/actions/workflows/build.yml/badge.svg)](https://github.com/LMMS/lmms/actions/workflows/build.yml)
[![Latest stable release](https://img.shields.io/github/release/LMMS/lmms.svg?maxAge=3600)](https://lmms.io/download)
[![Overall downloads on Github](https://img.shields.io/github/downloads/LMMS/lmms/total.svg?maxAge=3600)](https://github.com/LMMS/lmms/releases)
[![Join the chat at Discord](https://img.shields.io/badge/chat-on%20discord-7289DA.svg)](https://discord.gg/3sc5su7)
[![Localise on transifex](https://img.shields.io/badge/localise-on_transifex-green.svg)](https://www.transifex.com/lmms/lmms/)
<div align="center">
<h1>
<img src="https://raw.githubusercontent.com/LMMS/artwork/master/Icon%20%26%20Mimetypes/lmms-64x64.svg" alt="LMMS Logo"><br>LMMS
</h1>
<p>Cross-platform music production software</p>
<p>
<a href="https://lmms.io/">Website</a>
⦁︎
<a href="https://github.com/LMMS/lmms/releases">Releases</a>
⦁︎
<a href="https://github.com/LMMS/lmms/wiki">Developer wiki</a>
⦁︎
<a href="https://lmms.io/documentation">User manual</a>
⦁︎
<a href="https://lmms.io/showcase/">Showcase</a>
⦁︎
<a href="https://lmms.io/lsp/">Sharing platform</a>
</p>
<p>
<a href="https://github.com/LMMS/lmms/actions/workflows/build.yml"><img src="https://github.com/LMMS/lmms/actions/workflows/build.yml/badge.svg" alt="Build status"></a>
<a href="https://lmms.io/download"><img src="https://img.shields.io/github/release/LMMS/lmms.svg?maxAge=3600" alt="Latest stable release"></a>
<a href="https://github.com/LMMS/lmms/releases"><img src="https://img.shields.io/github/downloads/LMMS/lmms/total.svg?maxAge=3600" alt="Overall downloads on Github"></a>
<a href="https://discord.gg/3sc5su7"><img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Join the chat at Discord"></a>
<a href="https://www.transifex.com/lmms/lmms/"><img src="https://img.shields.io/badge/localise-on_transifex-green.svg"></a>
</p>
</div>
What is LMMS?
--------------
LMMS is a free cross-platform alternative to commercial programs like
FL Studio®, which allow you to produce music with your computer. This includes
the creation of melodies and beats, the synthesis and mixing of sounds, and
arranging of samples. You can have fun with your MIDI-keyboard and much more;
all in a user-friendly and modern interface.
[Homepage](https://lmms.io)<br>
[Downloads/Releases](https://github.com/LMMS/lmms/releases)<br>
[Developer Wiki](https://github.com/LMMS/lmms/wiki)<br>
[Artist & User Wiki/Documentation](https://lmms.io/documentation)<br>
[Sound Demos](https://lmms.io/showcase/)<br>
[LMMS Sharing Platform](https://lmms.io/lsp/) Share your songs!
LMMS is an open-source cross-platform digital audio workstation designed for music production. It includes an advanced Piano Roll, Beat Sequencer, Song Editor, and Mixer for composing, arranging, and mixing music. It comes with 15+ synthesizer plugins by default, along with VST2 and SoundFont2 support.
Features
---------
* Song-Editor for composing songs
* Song-Editor for arranging melodies, samples, patterns, and automation
* Pattern-Editor for creating beats and patterns
* An easy-to-use Piano-Roll for editing patterns and melodies
* A Mixer with unlimited mixer channels and arbitrary number of effects
* Many powerful instrument and effect-plugins out of the box
* Full user-defined track-based automation and computer-controlled automation sources
* Compatible with many standards such as SoundFont2, VST(i), LADSPA, GUS Patches, and full MIDI support
* Compatible with many standards such as SoundFont2, VST2 (instruments and effects), LADSPA, LV2, GUS Patches, and full MIDI support
* MIDI file importing and exporting
Building
---------
See [Compiling LMMS](https://github.com/LMMS/lmms/wiki/Compiling) on our
wiki for information on how to build LMMS.
See [Compiling LMMS](https://github.com/LMMS/lmms/wiki/Compiling)
Join LMMS-development
----------------------
If you are interested in LMMS, its programming, artwork, testing, writing demo
songs, (and improving this README...) or something like that, you're welcome
to participate in the development of LMMS!
If you are interested in LMMS, its programming, artwork, testing, writing demo songs, (and improving this README...) or something like that, you're welcome to participate in the development of LMMS!
Information about what you can do and how can be found in the
[wiki](https://github.com/LMMS/lmms/wiki).
Information about what you can do and how can be found in the [wiki](https://github.com/LMMS/lmms/wiki).
Before coding a new big feature, please _always_
[file an issue](https://github.com/LMMS/lmms/issues/new) for your idea and
suggestions about your feature and about the intended implementation on GitHub,
or ask in one of the tech channels on Discord and wait for replies! Maybe there are different ideas, improvements, or hints, or
maybe your feature is not welcome/needed at the moment.
Before coding a new big feature, please _always_ [file an issue](https://github.com/LMMS/lmms/issues/new) for your idea and suggestions about your feature and about the intended implementation on GitHub, or ask in one of the tech channels on Discord and wait for replies! Maybe there are different ideas, improvements, or hints, or maybe your feature is not welcome/needed at the moment.

View File

@@ -14,10 +14,14 @@ ENDIF()
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME_UCASE}")
SET(CPACK_SOURCE_GENERATOR "TBZ2")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}")
IF(NOT DEFINED WIN32)
SET(CPACK_STRIP_FILES "bin/${CMAKE_PROJECT_NAME};${PLUGIN_DIR}/*.so")
SET(CPACK_PACKAGE_EXECUTABLES "${CMAKE_PROJECT_NAME}" "${PROJECT_NAME_UCASE} binary")
ENDIF()
SET(CPACK_PACKAGE_EXECUTABLES "${CMAKE_PROJECT_NAME}" "${PROJECT_NAME_UCASE} binary")
# Disable strip for Debug|RelWithDebInfo
if(CMAKE_BUILD_TYPE MATCHES "Deb")
unset(CPACK_STRIP_FILES)
else()
set(CPACK_STRIP_FILES TRUE)
endif()
IF(LMMS_BUILD_WIN32)
ADD_SUBDIRECTORY(nsis)

View File

@@ -1,35 +1,38 @@
SET(MACOSX_BUNDLE_ICON_FILE "icon.icns")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_NAME_UCASE}")
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION}")
SET(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME_UCASE}")
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION}")
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${VERSION}")
SET(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT}")
SET(MACOSX_BUNDLE_MIMETYPE "application/x-lmms-project")
SET(MACOSX_BUNDLE_MIMETYPE_ICON "project.icns")
SET(MACOSX_BUNDLE_MIMETYPE_ID "io.lmms")
SET(MACOSX_BUNDLE_PROJECT_URL "${PROJECT_URL}")
SET(MACOSX_BUNDLE_DMG_TITLE "${MACOSX_BUNDLE_BUNDLE_NAME} ${MACOSX_BUNDLE_LONG_VERSION_STRING}")
IF(CMAKE_OSX_ARCHITECTURES)
SET(DMG_ARCH "${CMAKE_OSX_ARCHITECTURES}")
ELSEIF(IS_ARM64)
# Target arch is host arch
SET(DMG_ARCH "arm64")
ELSE()
# Fallback to Intel
SET(DMG_ARCH "x86_64")
ENDIF()
# FIXME: appdmg won't allow volume names > 27 char
# See also https://github.com/LinusU/node-appdmg/issues/48
STRING(SUBSTRING "${MACOSX_BUNDLE_DMG_TITLE}" 0 27 MACOSX_BUNDLE_DMG_TITLE)
# Standard CPack options
set(CPACK_GENERATOR "External" PARENT_SCOPE)
set(CPACK_EXTERNAL_ENABLE_STAGING TRUE PARENT_SCOPE)
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-mac${APPLE_OS_VER}-${DMG_ARCH}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}" PARENT_SCOPE)
set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/MacDeployQt.cmake" PARENT_SCOPE)
# disable cpack's strip: causes missing symbols on macOS
set(CPACK_STRIP_FILES_ORIG "${CPACK_STRIP_FILES}" PARENT_SCOPE)
set(CPACK_STRIP_FILES FALSE PARENT_SCOPE)
CONFIGURE_FILE("lmms.plist.in" "${CMAKE_BINARY_DIR}/Info.plist")
CONFIGURE_FILE("install_apple.sh.in" "${CMAKE_BINARY_DIR}/install_apple.sh" @ONLY)
CONFIGURE_FILE("package_apple.json.in" "${CMAKE_BINARY_DIR}/package_apple.json" @ONLY)
# DMG creation target
SET(DMG_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-mac${APPLE_OS_VER}.dmg")
FILE(REMOVE "${DMG_FILE}")
ADD_CUSTOM_TARGET(removedmg
COMMAND touch "\"${DMG_FILE}\"" && rm "\"${DMG_FILE}\""
COMMENT "Removing old DMG")
ADD_CUSTOM_TARGET(dmg
COMMAND appdmg "\"${CMAKE_BINARY_DIR}/package_apple.json\"" "\"${DMG_FILE}\""
DEPENDS "${CMAKE_BINARY_DIR}/package_apple.json"
COMMENT "Generating DMG")
ADD_DEPENDENCIES(dmg removedmg)
# see also ../postinstall/CMakeLists.txt
# Custom vars to expose to Cpack
# must be prefixed with "CPACK_" per https://stackoverflow.com/a/46526757/3196753)
set(CPACK_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
set(CPACK_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)
set(CPACK_BINARY_DIR "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
set(CPACK_SOURCE_DIR "${CMAKE_SOURCE_DIR}" PARENT_SCOPE)
set(CPACK_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}" PARENT_SCOPE)
set(CPACK_CARLA_LIBRARIES "${CARLA_LIBRARIES}" PARENT_SCOPE)
set(CPACK_PROJECT_NAME "${PROJECT_NAME}" PARENT_SCOPE)
set(CPACK_PROJECT_VERSION "${VERSION}" PARENT_SCOPE)
set(CPACK_PROJECT_NAME_UCASE "${PROJECT_NAME_UCASE}" PARENT_SCOPE)
set(CPACK_PROJECT_URL "${PROJECT_URL}" PARENT_SCOPE)
set(CPACK_SUIL_MODULES "${Suil_MODULES}" PARENT_SCOPE)
set(CPACK_SUIL_MODULES_PREFIX "${Suil_MODULES_PREFIX}" PARENT_SCOPE)
if(CMAKE_VERSION VERSION_LESS "3.19")
message(WARNING "DMG creation requires at least CMake 3.19")
endif()

View File

@@ -0,0 +1,175 @@
# Create a macOS .dmg desktop installer using macdeployqt
#
# Copyright (c) 2025, Tres Finocchiaro, <tres.finocchiaro@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Variables must be prefixed with "CPACK_" to be visible here
set(lmms "${CPACK_PROJECT_NAME}")
set(APP "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/${CPACK_PROJECT_NAME_UCASE}.app")
# Toggle command echoing & verbosity
# 0 = no output, 1 = error/warning, 2 = normal, 3 = debug
if(DEFINED ENV{CPACK_DEBUG})
set(CPACK_DEBUG "$ENV{CPACK_DEBUG}")
endif()
if(NOT CPACK_DEBUG)
set(VERBOSITY 1)
set(COMMAND_ECHO NONE)
else()
set(VERBOSITY 2)
set(COMMAND_ECHO STDOUT)
endif()
# Detect release|debug build
if(NOT CPACK_STRIP_FILES_ORIG)
# -use-debug-libs implies -no-strip
if(CPACK_QMAKE_EXECUTABLE MATCHES "/homebrew/|/usr/local")
message(STATUS "Homebrew does not provide debug qt libraries, replacing \"-use-debug-libs\" with \"-no-strip\" instead")
set(USE_DEBUG_LIBS -no-strip)
else()
set(USE_DEBUG_LIBS -use-debug-libs)
endif()
endif()
# Cleanup CPack "External" json, txt files, old DMG files
file(GLOB cleanup "${CPACK_BINARY_DIR}/${lmms}-*.json"
"${CPACK_BINARY_DIR}/${lmms}-*.dmg"
"${CPACK_BINARY_DIR}/install_manifest.txt")
list(SORT cleanup)
file(REMOVE ${cleanup})
# Create bundle structure
file(MAKE_DIRECTORY "${APP}/Contents/MacOS")
file(MAKE_DIRECTORY "${APP}/Contents/Frameworks")
file(MAKE_DIRECTORY "${APP}/Contents/Resources")
# Fix layout
file(RENAME "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/lib" "${APP}/Contents/lib")
file(RENAME "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/share" "${APP}/Contents/share")
file(RENAME "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/bin" "${APP}/Contents/bin")
# Move binaries into Contents/MacOS
file(RENAME "${APP}/Contents/bin/${lmms}" "${APP}/Contents/MacOS/${lmms}")
file(RENAME "${APP}/Contents/lib/${lmms}/RemoteZynAddSubFx" "${APP}/Contents/MacOS/RemoteZynAddSubFx")
file(REMOVE_RECURSE "${APP}/Contents/bin")
file(REMOVE_RECURSE "${APP}/Contents/share/man1")
file(REMOVE_RECURSE "${APP}/Contents/include")
# Copy missing files
# Convert https://lmms.io to io.lmms
string(REPLACE "." ";" mime_parts "${CPACK_PROJECT_URL}")
string(REPLACE ":" ";" mime_parts "${mime_parts}")
string(REPLACE "/" "" mime_parts "${mime_parts}")
list(REMOVE_AT mime_parts 0)
list(REVERSE mime_parts)
list(JOIN mime_parts "." MACOS_MIMETYPE_ID)
configure_file("${CPACK_CURRENT_SOURCE_DIR}/lmms.plist.in" "${APP}/Contents/Info.plist" @ONLY)
file(COPY "${CPACK_CURRENT_SOURCE_DIR}/project.icns" DESTINATION "${APP}/Contents/Resources")
file(COPY "${CPACK_CURRENT_SOURCE_DIR}/icon.icns" DESTINATION "${APP}/Contents/Resources")
file(RENAME "${APP}/Contents/Resources/icon.icns" "${APP}/Contents/Resources/${lmms}.icns")
# Copy Suil modules
if(CPACK_SUIL_MODULES)
set(SUIL_MODULES_TARGET "${APP}/Contents/Frameworks/${CPACK_SUIL_MODULES_PREFIX}")
file(MAKE_DIRECTORY "${SUIL_MODULES_TARGET}")
file(COPY ${CPACK_SUIL_MODULES} DESTINATION "${SUIL_MODULES_TARGET}")
endif()
# Make all libraries writable for macdeployqt
file(CHMOD_RECURSE "${APP}/Contents" PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_WRITE GROUP_READ
WORLD_READ)
# Qt6: Fix @rpath bug https://github.com/orgs/Homebrew/discussions/2823
include(CreateSymlink)
get_filename_component(QTBIN "${CPACK_QMAKE_EXECUTABLE}" DIRECTORY)
get_filename_component(QTDIR "${QTBIN}" DIRECTORY)
create_symlink("${QTDIR}/lib" "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/lib")
# Replace @rpath with @loader_path for Carla
execute_process(COMMAND install_name_tool -change
"@rpath/libcarlabase.dylib"
"@loader_path/libcarlabase.dylib"
"${APP}/Contents/lib/${lmms}/libcarlapatchbay.so"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
execute_process(COMMAND install_name_tool -change
"@rpath/libcarlabase.dylib"
"@loader_path/libcarlabase.dylib"
"${APP}/Contents/lib/${lmms}/libcarlarack.so"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
# Build list of executables to inform macdeployqt about
# e.g. -executable=foo.dylib -executable=bar.dylib
file(GLOB LIBS "${APP}/Contents/lib/${lmms}/*.so")
# Inform macdeployqt about LADSPA plugins; may depend on bundled fftw3f, etc.
file(GLOB LADSPA "${APP}/Contents/lib/${lmms}/ladspa/*.so")
# Inform macdeployqt about remote plugins
file(GLOB REMOTE_PLUGINS "${APP}/Contents/MacOS/*Remote*")
# Collect, sort and dedupe all libraries
list(APPEND LIBS ${LADSPA})
list(APPEND LIBS ${REMOTE_PLUGINS})
list(APPEND LIBS ${CPACK_SUIL_MODULES})
list(REMOVE_DUPLICATES LIBS)
list(SORT LIBS)
# Construct macdeployqt parameters
foreach(_lib IN LISTS LIBS)
if(EXISTS "${_lib}")
list(APPEND EXECUTABLES "-executable=${_lib}")
endif()
endforeach()
# Call macdeployqt
get_filename_component(QTBIN "${CPACK_QMAKE_EXECUTABLE}" DIRECTORY)
message(STATUS "Calling ${QTBIN}/macdeployqt ${APP} [... executables]")
execute_process(COMMAND "${QTBIN}/macdeployqt" "${APP}" ${EXECUTABLES}
-verbose=${VERBOSITY}
${USE_DEBUG_LIBS}
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
# Cleanup symlink
file(REMOVE "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/lib")
# Remove dummy carla libs, relink to a sane location (e.g. /Applications/Carla.app/...)
# (must be done after calling macdeployqt)
file(GLOB CARLALIBS "${APP}/Contents/lib/${lmms}/libcarla*")
foreach(_carlalib IN LISTS CARLALIBS)
foreach(_lib "${CPACK_CARLA_LIBRARIES}")
set(_oldpath "../../Frameworks/lib${_lib}.dylib")
set(_newpath "Carla.app/Contents/MacOS/lib${_lib}.dylib")
execute_process(COMMAND install_name_tool -change
"@loader_path/${_oldpath}"
"@executable_path/../../../${_newpath}"
"${_carlalib}"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
file(REMOVE "${APP}/Contents/Frameworks/lib${_lib}.dylib")
endforeach()
endforeach()
# Call ad-hoc codesign manually (CMake offers this as well)
execute_process(COMMAND codesign --force --deep --sign - "${APP}"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
# Create DMG
# appdmg won't allow volume names > 27 char https://github.com/LinusU/node-alias/issues/7
find_program(APPDMG_BIN appdmg REQUIRED)
string(SUBSTRING "${CPACK_PROJECT_NAME_UCASE} ${CPACK_PROJECT_VERSION}" 0 27 APPDMG_VOLUME_NAME)
# We'll configure this file twice (again in MacDeployQt.cmake once we know CPACK_TEMPORARY_INSTALL_DIRECTORY)
configure_file("${CPACK_CURRENT_SOURCE_DIR}/appdmg.json.in" "${CPACK_CURRENT_BINARY_DIR}/appdmg.json" @ONLY)
execute_process(COMMAND "${APPDMG_BIN}"
"${CPACK_CURRENT_BINARY_DIR}/appdmg.json"
"${CPACK_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.dmg"
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)

View File

@@ -0,0 +1,9 @@
{
"title": "@APPDMG_VOLUME_NAME@",
"background": "@CPACK_SOURCE_DIR@/cmake/apple/background.png",
"icon-size": 128,
"contents": [
{ "x": 139, "y": 200, "type": "file", "path": "@CPACK_TEMPORARY_INSTALL_DIRECTORY@/@CPACK_PROJECT_NAME_UCASE@.app" },
{ "x": 568, "y": 200, "type": "link", "path": "/Applications" }
]
}

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

View File

@@ -1,104 +0,0 @@
#!/bin/bash
# Creates Apple ".app" bundle for @PROJECT_NAME_UCASE@
# Note:
# Examine linkings using `otool -L somelib.so`
# Debug the loading of dynamic libraries using `export DYLD_PRINT_LIBRARIES=1`
set -e
# Place to create ".app" bundle
APP="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.app"
MSG_COLOR='\x1B[1;36m'
COLOR_RESET='\x1B[0m'
echo -e "$MSG_COLOR\n\nCreating App Bundle \"$APP\"...$COLOR_RESET"
qtpath="$(dirname "@QT_QMAKE_EXECUTABLE@")"
export PATH="$PATH:$qtpath"
# Remove any old .app bundles
rm -Rf "$APP"
# Copy/overwrite Info.plist
command cp "@CMAKE_BINARY_DIR@/Info.plist" "@CMAKE_INSTALL_PREFIX@/"
# Create .app bundle containing contents from CMAKE_INSTALL_PREFIX
mkdir -p "$APP/Contents/MacOS"
mkdir -p "$APP/Contents/Frameworks"
mkdir -p "$APP/Contents/Resources"
cd "@CMAKE_INSTALL_PREFIX@"
cp -R ./* "$APP/Contents"
cp "@CMAKE_SOURCE_DIR@/cmake/apple/"*.icns "$APP/Contents/Resources/"
# Make all libraries writable for macdeployqt
cd "$APP"
find . -type f -print0 | xargs -0 chmod u+w
lmmsbin="MacOS/@CMAKE_PROJECT_NAME@"
zynbin="MacOS/RemoteZynAddSubFx"
# Move lmms binary
mv "$APP/Contents/bin/@CMAKE_PROJECT_NAME@" "$APP/Contents/$lmmsbin"
# Fix zyn linking
mv "$APP/Contents/lib/lmms/RemoteZynAddSubFx" "$APP/Contents/$zynbin"
# Replace @rpath with @loader_path for Carla
# See also plugins/CarlaBase/CMakeLists.txt
# This MUST be done BEFORE calling macdeployqt
install_name_tool -change @rpath/libcarlabase.dylib \
@loader_path/libcarlabase.dylib \
"$APP/Contents/lib/lmms/libcarlapatchbay.so"
install_name_tool -change @rpath/libcarlabase.dylib \
@loader_path/libcarlabase.dylib \
"$APP/Contents/lib/lmms/libcarlarack.so"
# Link lmms binary
_executables="${_executables} -executable=$APP/Contents/$zynbin"
# Build a list of shared objects in target/lib/lmms
for file in "$APP/Contents/lib/lmms/"*.so; do
_thisfile="$APP/Contents/lib/lmms/${file##*/}"
_executables="${_executables} -executable=$_thisfile"
done
# Build a list of shared objects in target/lib/lmms/ladspa
for file in "$APP/Contents/lib/lmms/ladspa/"*.so; do
_thisfile="$APP/Contents/lib/lmms/ladspa/${file##*/}"
_executables="${_executables} -executable=$_thisfile"
done
# Finalize .app
# shellcheck disable=SC2086
macdeployqt "$APP" $_executables
# Carla is a standalone plugin. Remove library, look for it side-by-side LMMS.app
# This MUST be done AFTER calling macdeployqt
#
# For example:
# /Applications/LMMS.app
# /Applications/Carla.app
carlalibs=$(echo "@CARLA_LIBRARIES@"|tr ";" "\n")
# Loop over all libcarlas, fix linking
for file in "$APP/Contents/lib/lmms/"libcarla*; do
_thisfile="$APP/Contents/lib/lmms/${file##*/}"
for lib in $carlalibs; do
_oldpath="../../Frameworks/lib${lib}.dylib"
_newpath="Carla.app/Contents/MacOS/lib${lib}.dylib"
# shellcheck disable=SC2086
install_name_tool -change @loader_path/$_oldpath \
@executable_path/../../../$_newpath \
"$_thisfile"
rm -f "$APP/Contents/Frameworks/lib${lib}.dylib"
done
done
# Cleanup
rm -rf "$APP/Contents/bin"
# Codesign
codesign --force --deep --sign - "$APP"
echo -e "\nFinished.\n\n"

View File

@@ -7,13 +7,13 @@
<string>English</string>
<key>CFBundleIconFile</key>
<string>@MACOSX_BUNDLE_ICON_FILE@</string>
<string>@CPACK_PROJECT_NAME@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ @MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
<string>@CPACK_PROJECT_NAME_UCASE@ @CPACK_PROJECT_VERSION@</string>
<!--
#############################################################
@@ -29,38 +29,38 @@
#############################################################
-->
<key>CFBundleSignature</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@</string>
<string>@CPACK_PROJECT_NAME_UCASE@</string>
<key>CFBundleExecutable</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@</string>
<string>@CPACK_PROJECT_NAME@</string>
<key>CFBundleVersion</key>
<string>@MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
<string>@CPACK_PROJECT_VERSION@</string>
<key>CFBundleShortVersionString</key>
<string>@MACOSX_BUNDLE_LONG_VERSION_STRING@</string>
<string>@VERSIONCPACK_PROJECT_VERSION@</string>
<key>CFBundleName</key>
<string>@MACOSX_BUNDLE_BUNDLE_NAME@</string>
<string>@CPACK_PROJECT_NAME_UCASE@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIdentifier</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ID@</string>
<string>@MACOS_MIMETYPE_ID@</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mmpz</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
<string>project</string>
<key>CFBundleTypeName</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project</string>
<string>@CPACK_PROJECT_NAME_UCASE@ Project</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>mmpz</string>
@@ -69,19 +69,19 @@
<string>Editor</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>@MACOSX_BUNDLE_MIMETYPE@</string>
<string>application/x-@CPACK_PROJECT_NAME@-project</string>
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mmp</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
<string>project</string>
<key>CFBundleTypeName</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project (uncompressed)</string>
<string>@CPACK_PROJECT_NAME_UCASE@ Project (uncompressed)</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>mmp</string>
@@ -90,23 +90,23 @@
<string>Editor</string>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>@MACOSX_BUNDLE_MIMETYPE@</string>
<string>application/x-@CPACK_PROJECT_NAME@-project</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ID@.mmpz</string>
<string>@MACOS_MIMETYPE_ID@.mmpz</string>
<key>UTTypeReferenceURL</key>
<string>@MACOSX_BUNDLE_PROJECT_URL@</string>
<string>@CPACK_PROJECT_URL@</string>
<key>UTTypeDescription</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project</string>
<string>@CPACK_PROJECT_VERSIONPROJECT_NAME_UCASE@ Project</string>
<key>UTTypeIconFile</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
<string>project</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
@@ -122,13 +122,13 @@
<dict>
<key>UTTypeIdentifier</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ID@.mmp</string>
<string>@MACOS_MIMETYPE_ID@.mmp</string>
<key>UTTypeReferenceURL</key>
<string>@MACOSX_BUNDLE_PROJECT_URL@</string>
<string>@CPACK_PROJECT_URL@</string>
<key>UTTypeDescription</key>
<string>@MACOSX_BUNDLE_GUI_IDENTIFIER@ Project (uncompressed)</string>
<string>@CPACK_PROJECT_NAME_UCASE@ Project (uncompressed)</string>
<key>UTTypeIconFile</key>
<string>@MACOSX_BUNDLE_MIMETYPE_ICON@</string>
<string>project</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>

View File

@@ -1,9 +0,0 @@
{
"title": "@MACOSX_BUNDLE_DMG_TITLE@",
"background": "@CMAKE_SOURCE_DIR@/cmake/apple/dmg_branding.png",
"icon-size": 128,
"contents": [
{ "x": 139, "y": 200, "type": "file", "path": "@CMAKE_BINARY_DIR@/@MACOSX_BUNDLE_BUNDLE_NAME@.app" },
{ "x": 568, "y": 200, "type": "link", "path": "/Applications" }
]
}

View File

@@ -1,40 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Accomodate both linux windows mingw locations
if [ -z "$ARCH" ]; then
ARCH=32
fi
MINGW=/mingw$ARCH
if [ -z "$MSYSCON" ]; then
MINGW=/opt$MINGW
DISTRO=$(lsb_release -si)
DISTRO_VERSION=$(lsb_release -sr)
if [ "$DISTRO" != "Ubuntu" ]; then
echo "This script only supports Ubuntu"
exit 1
fi
if [ "$DISTRO_VERSION" == "14.04" ]; then
TOOLCHAIN="$DIR/toolchains/Ubuntu-MinGW-X-Trusty-$ARCH.cmake"
else
TOOLCHAIN="$DIR/toolchains/Ubuntu-MinGW-W64-$ARCH.cmake"
fi
else
TOOLCHAIN="$DIR/toolchains/MSYS-$ARCH.cmake"
fi
export PATH=$MINGW/bin:$PATH
export CXXFLAGS="$CFLAGS"
if [ "$ARCH" == "32" ]; then
export CFLAGS="-march=pentium3 -mtune=generic -mpreferred-stack-boundary=5 -mfpmath=sse"
fi
CMAKE_OPTS="-DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
# shellcheck disable=SC2086
cmake "$DIR/.." -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN" $CMAKE_OPTS

View File

@@ -1,3 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ARCH=64 "$DIR/build_win32.sh"

View File

@@ -1,6 +1,9 @@
SET(PLUGIN_FILES "")
IF(LMMS_BUILD_WIN32)
INSTALL(FILES $<TARGET_FILE:Qt5::QWindowsIntegrationPlugin> DESTINATION platforms)
INSTALL(FILES $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::QWindowsIntegrationPlugin> DESTINATION platforms)
INSTALL(FILES $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::QSvgIconPlugin> DESTINATION iconengines)
INSTALL(FILES $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::QSvgPlugin> DESTINATION imageformats)
INSTALL(FILES $<TARGET_FILE:Qt${QT_VERSION_MAJOR}::Svg> DESTINATION .)
ENDIF()
IF(LMMS_BUILD_WIN32 OR LMMS_INSTALL_DEPENDENCIES)
@@ -40,17 +43,10 @@ ENDIF()
if(LMMS_HAVE_STK AND (LMMS_BUILD_WIN32 OR LMMS_BUILD_APPLE))
if(STK_RAWWAVE_ROOT)
file(GLOB RAWWAVES "${STK_RAWWAVE_ROOT}/*.raw")
list(SORT RAWWAVES)
install(FILES ${RAWWAVES} DESTINATION "${DATA_DIR}/stk/rawwaves")
else()
message(WARNING "Can't find STK rawwave root!")
endif()
endif()
IF(LMMS_BUILD_APPLE)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND chmod u+x ${CMAKE_BINARY_DIR}/install_apple.sh)")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_BINARY_DIR}/install_apple.sh RESULT_VARIABLE EXIT_CODE)
IF(NOT EXIT_CODE EQUAL 0)
MESSAGE(FATAL_ERROR \"Execution of install_apple.sh failed\")
ENDIF()
")
ENDIF()

View File

@@ -3,17 +3,21 @@
ADVAPI32.dll
COMCTL32.dll
comdlg32.dll
d3d11.dll
dwmapi.dll
dxgi.dll
GDI32.dll
IMM32.dll
KERNEL32.dll
MPR.DLL
msvcrt.dll
netapi32.dll
ole32.dll
OLEAUT32.dll
OPENGL32.DLL
SHELL32.dll
USER32.dll
userenv.dll
UxTheme.dll
VERSION.dll
WINMM.DLL

View File

@@ -1,19 +1,51 @@
INSTALL(DIRECTORY icons/ DESTINATION "${DATA_DIR}/icons/hicolor")
INSTALL(FILES lmms.desktop DESTINATION "${DATA_DIR}/applications")
INSTALL(FILES lmms.xml DESTINATION "${DATA_DIR}/mime/packages")
install(DIRECTORY icons/ DESTINATION "${DATA_DIR}/icons/hicolor")
install(FILES lmms.desktop DESTINATION "${DATA_DIR}/applications")
install(FILES lmms.xml DESTINATION "${DATA_DIR}/mime/packages")
# AppImage creation target
SET(APPIMAGE_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-linux-${CMAKE_SYSTEM_PROCESSOR}.AppImage")
# Preserve old CPack behavior
if(WANT_CPACK_TARBALL)
message(STATUS "Skipping AppImage creation")
return()
endif()
CONFIGURE_FILE("package_linux.sh.in" "${CMAKE_BINARY_DIR}/package_linux.sh" @ONLY)
# Standard CPack options
set(CPACK_GENERATOR "External" PARENT_SCOPE)
set(CPACK_EXTERNAL_ENABLE_STAGING true PARENT_SCOPE)
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-linux-${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}" PARENT_SCOPE)
set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_SOURCE_DIR}/LinuxDeploy.cmake" PARENT_SCOPE)
FILE(REMOVE "${APPIMAGE_FILE}")
ADD_CUSTOM_TARGET(removeappimage
COMMAND rm -f "${APPIMAGE_FILE}"
COMMENT "Removing old AppImage")
ADD_CUSTOM_TARGET(appimage
COMMAND chmod +x "${CMAKE_BINARY_DIR}/package_linux.sh"
COMMAND "${CMAKE_BINARY_DIR}/package_linux.sh"
COMMENT "Generating AppImage"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
ADD_DEPENDENCIES(appimage removeappimage)
# Custom vars to expose to Cpack
# must be prefixed with "CPACK_" per https://stackoverflow.com/a/46526757/3196753)
set(CPACK_CURRENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
set(CPACK_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)
set(CPACK_BINARY_DIR "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
set(CPACK_SOURCE_DIR "${CMAKE_SOURCE_DIR}" PARENT_SCOPE)
set(CPACK_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}" PARENT_SCOPE)
set(CPACK_CARLA_LIBRARIES "${CARLA_LIBRARIES}" PARENT_SCOPE)
set(CPACK_WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIRS}" PARENT_SCOPE)
set(CPACK_WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIRS}" PARENT_SCOPE)
set(CPACK_PROJECT_NAME "${PROJECT_NAME}" PARENT_SCOPE)
set(CPACK_PROJECT_NAME_UCASE "${PROJECT_NAME_UCASE}" PARENT_SCOPE)
set(CPACK_PROJECT_VERSION "${VERSION}" PARENT_SCOPE)
set(CPACK_CMAKE_COMMAND "${CMAKE_COMMAND}" PARENT_SCOPE)
set(CPACK_SUIL_MODULES "${Suil_MODULES}" PARENT_SCOPE)
set(CPACK_SUIL_MODULES_PREFIX "${Suil_MODULES_PREFIX}" PARENT_SCOPE)
set(CPACK_STK_RAWWAVE_ROOT "${STK_RAWWAVE_ROOT}" PARENT_SCOPE)
# TODO: Canidate for DetectMachine.cmake
if(IS_X86_64)
set(CPACK_TARGET_ARCH x86_64 PARENT_SCOPE)
elseif(IS_X86)
set(CPACK_TARGET_ARCH i386 PARENT_SCOPE)
elseif(IS_ARM64)
set(CPACK_TARGET_ARCH aarch64 PARENT_SCOPE)
elseif(IS_ARM32)
set(CPACK_TARGET_ARCH armhf PARENT_SCOPE)
else()
set(CPACK_TARGET_ARCH unknown PARENT_SCOPE)
endif()
if(CMAKE_VERSION VERSION_LESS "3.19")
message(WARNING "AppImage creation requires at least CMake 3.19")
endif()

View File

@@ -0,0 +1,244 @@
# Create a Linux desktop installer using linuxdeploy
# * Creates a relocatable LMMS.AppDir installation in build/_CPack_Packages using linuxdeploy
# * If CPACK_TOOL=appimagetool or is not set, bundles AppDir into redistributable ".AppImage" file
# * If CPACK_TOOL=makeself is provided, bundles into a redistributable ".run" file
#
# Copyright (c) 2025, Tres Finocchiaro, <tres.finocchiaro@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Variables must be prefixed with "CPACK_" to be visible here
set(lmms "${CPACK_PROJECT_NAME}")
set(LMMS "${CPACK_PROJECT_NAME_UCASE}")
set(ARCH "${CPACK_TARGET_ARCH}")
set(APP "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/${LMMS}.AppDir")
# Target AppImage file
set(APPIMAGE_FILE "${CPACK_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}.AppImage")
set(APPIMAGE_BEFORE_RENAME "${CPACK_BINARY_DIR}/${LMMS}-${ARCH}.AppImage")
set(DESKTOP_FILE "${APP}/usr/share/applications/${lmms}.desktop")
# Determine which packaging tool to use
if(NOT CPACK_TOOL)
# Pick up environmental variable
if(DEFINED ENV{CPACK_TOOL})
set(CPACK_TOOL "$ENV{CPACK_TOOL}")
else()
set(CPACK_TOOL "appimagetool")
endif()
endif()
# Toggle command echoing & verbosity
# 0 = no output, 1 = error/warning, 2 = normal, 3 = debug
if(DEFINED ENV{CPACK_DEBUG})
set(CPACK_DEBUG "$ENV{CPACK_DEBUG}")
endif()
if(NOT CPACK_DEBUG)
set(VERBOSITY 1)
set(APPIMAGETOOL_VERBOSITY "")
set(COMMAND_ECHO NONE)
set(OUTPUT_QUIET OUTPUT_QUIET)
else()
set(VERBOSITY 2)
set(APPIMAGETOOL_VERBOSITY "--verbose")
set(COMMAND_ECHO STDOUT)
unset(OUTPUT_QUIET)
endif()
include(DownloadBinary)
include(CreateSymlink)
include(CopyDependency)
# Cleanup CPack "External" json, txt files, old AppImage files
file(GLOB cleanup "${CPACK_BINARY_DIR}/${lmms}-*.json"
"${CPACK_BINARY_DIR}/${lmms}-*.AppImage"
"${CPACK_BINARY_DIR}/install_manifest.txt")
list(SORT cleanup)
file(REMOVE ${cleanup})
# Download and extract linuxdeploy
download_binary(LINUXDEPLOY_BIN
"https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage"
linuxdeploy-${ARCH}.AppImage
FALSE)
# Guess the path to appimagetool
set(APPIMAGETOOL_BIN "${CPACK_CURRENT_BINARY_DIR}/.linuxdeploy-${ARCH}.AppImage/squashfs-root/plugins/linuxdeploy-plugin-appimage/appimagetool-prefix/AppRun")
# Download linuxdeploy-plugin-qt
download_binary(LINUXDEPLOY_PLUGIN_BIN
"https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage"
linuxdeploy-plugin-qt-${ARCH}.AppImage
FALSE)
message(STATUS "Creating AppDir ${APP}...")
file(REMOVE_RECURSE "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/include")
file(MAKE_DIRECTORY "${APP}/usr")
# Setup AppDir structure (/usr/bin, /usr/lib, /usr/share... etc)
file(GLOB files "${CPACK_TEMPORARY_INSTALL_DIRECTORY}/*")
list(SORT files)
foreach(_file ${files})
get_filename_component(_filename "${_file}" NAME)
if(NOT _filename MATCHES ".AppDir")
file(RENAME "${_file}" "${APP}/usr/${_filename}")
endif()
endforeach()
# Gather deps
list(APPEND DEPLOY_DEPS
--deploy-deps-only "${APP}/usr/lib/${lmms}/"
--deploy-deps-only "${APP}/usr/lib/${lmms}/ladspa/"
)
# If usr/bin/lmms is hard-linked to libjack, copy it to a new location
# See https://github.com/LMMS/lmms/issues/7689
copy_dependency("${APP}/usr/bin/lmms" "libjack.so" "${APP}/usr/lib/jack" JACK_LIB_RELOC)
if(JACK_LIB_RELOC)
list(APPEND DEPLOY_DEPS --deploy-deps-only "${JACK_LIB_RELOC}")
endif()
if(CPACK_HAVE_VST_32)
list(APPEND DEPLOY_DEPS --deploy-deps-only "${APP}/usr/lib/${lmms}/32/")
endif()
# Copy Suil modules
if(CPACK_SUIL_MODULES)
set(SUIL_MODULES_TARGET "${APP}/usr/lib/suil-0/")
file(MAKE_DIRECTORY "${SUIL_MODULES_TARGET}")
file(COPY ${CPACK_SUIL_MODULES} DESTINATION "${SUIL_MODULES_TARGET}")
list(APPEND DEPLOY_DEPS --deploy-deps-only "${APP}/usr/lib/suil-0/")
endif()
# Copy stk/rawwaves
if(CPACK_STK_RAWWAVE_ROOT)
set(STK_RAWWAVE_TARGET "${APP}/usr/share/stk/rawwaves/")
file(MAKE_DIRECTORY "${STK_RAWWAVE_TARGET}")
file(GLOB RAWWAVES "${CPACK_STK_RAWWAVE_ROOT}/*.raw")
file(COPY ${RAWWAVES} DESTINATION "${STK_RAWWAVE_TARGET}")
endif()
# Ensure project's "qmake" executable is first on the PATH
get_filename_component(QTBIN "${CPACK_QMAKE_EXECUTABLE}" DIRECTORY)
set(ENV{PATH} "${QTBIN}:$ENV{PATH}")
# Promote finding our own libraries first
set(ENV{LD_LIBRARY_PATH} "${APP}/usr/lib/${lmms}/:${APP}/usr/lib/${lmms}/optional:$ENV{LD_LIBRARY_PATH}")
# Workaround for finding libs from online installer
# https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/193
set(ENV{LD_LIBRARY_PATH} "${QTBIN}/../lib:$ENV{LD_LIBRARY_PATH}")
# Skip slow searching of copyright files https://github.com/linuxdeploy/linuxdeploy/issues/278
set(ENV{DISABLE_COPYRIGHT_FILES_DEPLOYMENT} 1)
# Patch desktop file
file(APPEND "${DESKTOP_FILE}" "X-AppImage-Version=${CPACK_PROJECT_VERSION}\n")
# Custom scripts to run immediately before lmms is executed
file(COPY "${CPACK_SOURCE_DIR}/cmake/linux/apprun-hooks" DESTINATION "${APP}")
file(REMOVE "${APP}/apprun-hooks/README.md")
# Prefer a hard-copy of .DirIcon over appimagetool's symlinking
# 256x256 default for Cinnamon Desktop https://forums.linuxmint.com/viewtopic.php?p=2585952
file(COPY "${APP}/usr/share/icons/hicolor/256x256/apps/${lmms}.png" DESTINATION "${APP}")
file(RENAME "${APP}/${lmms}.png" "${APP}/.DirIcon")
file(COPY "${APP}/usr/share/icons/hicolor/256x256/apps/${lmms}.png" DESTINATION "${APP}")
# Inform linuxdeploy-plugin-qt about wayland plugin
set(ENV{EXTRA_PLATFORM_PLUGINS} "libqwayland-generic.so")
set(ENV{EXTRA_QT_MODULES} "waylandcompositor")
# Call linuxdeploy
message(STATUS "Calling ${LINUXDEPLOY_BIN} --appdir \"${APP}\" ... [... libraries].")
execute_process(COMMAND "${LINUXDEPLOY_BIN}"
--appdir "${APP}"
--desktop-file "${DESKTOP_FILE}"
--plugin qt
${DEPLOY_DEPS}
--exclude-library "*libgallium*"
--verbosity ${VERBOSITY}
WORKING_DIRECTORY "${CPACK_CURRENT_BINARY_DIR}"
${OUTPUT_QUIET}
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
# Remove svg ambitiously placed by linuxdeploy
file(REMOVE "${APP}/${lmms}.svg")
# Remove libraries that are normally system-provided
file(GLOB EXCLUDE_LIBS
"${APP}/usr/lib/libwine*"
"${APP}/usr/lib/libcarla_native*"
"${APP}/usr/lib/${lmms}/optional/libcarla*"
"${APP}/usr/lib/libjack*")
list(SORT EXCLUDE_LIBS)
foreach(_lib IN LISTS EXCLUDE_LIBS)
if(EXISTS "${_lib}")
file(REMOVE "${_lib}")
endif()
endforeach()
# cleanup empty directories
file(REMOVE_RECURSE "${APP}/usr/lib/${lmms}/optional/")
if(CPACK_TOOL STREQUAL "appimagetool")
# Create ".AppImage" file using appimagetool (default)
# appimage plugin needs ARCH set when running in extracted form from squashfs-root / CI
set(ENV{ARCH} "${ARCH}")
message(STATUS "Finishing the AppImage...")
execute_process(COMMAND "${APPIMAGETOOL_BIN}" "${APP}" "${APPIMAGE_FILE}"
${APPIMAGETOOL_VERBOSITY}
${OUTPUT_QUIET}
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
message(STATUS "AppImage created: ${APPIMAGE_FILE}")
elseif(CPACK_TOOL STREQUAL "makeself")
# Create self-extracting ".run" script using makeself
find_program(MAKESELF_BIN makeself REQUIRED)
message(STATUS "Finishing the .run file using ${MAKESELF_BIN}...")
string(REPLACE ".AppImage" ".run" RUN_FILE "${APPIMAGE_FILE}")
configure_file(
"${CPACK_SOURCE_DIR}/cmake/linux/makeself_setup.sh.in" "${APP}/setup.sh" @ONLY
FILE_PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_WRITE GROUP_READ
WORLD_READ)
if(OUTPUT_QUIET)
set(MAKESELF_QUIET "--quiet")
set(ERROR_QUIET ERROR_QUIET)
endif()
# makeself.sh [args] archive_dir file_name label startup_script [script_args]
file(REMOVE "${RUN_FILE}")
execute_process(COMMAND "${MAKESELF_BIN}"
--keep-umask
--nox11
${MAKESELF_QUIET}
"${APP}"
"${RUN_FILE}"
"${LMMS} Installer"
"./setup.sh"
${OUTPUT_QUIET}
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
# ensure the installer can be executed as a script file
execute_process(COMMAND "${RUN_FILE}" --help
${OUTPUT_QUIET}
${ERROR_QUIET}
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
message(STATUS "Installer created: ${RUN_FILE}")
else()
message(FATAL_ERROR "Packaging tool CPACK_TOOL=\"${CPACK_TOOL}\" is not yet supported")
endif()

View File

@@ -0,0 +1,11 @@
# AppRun Hooks
Scripts placed in this directory will automatically be bundled into linuxdeploy AppImages
(e.g. `LMMS.AppDir/apprun-hooks`) and executed immediately before lmms.
Quoting:
> "Sometimes it's important to perform actions before running the actual app. Some plugins might have to set e.g.,
> environment variables to work properly."
See also: https://github.com/linuxdeploy/linuxdeploy/wiki/Plugin-system#apprun-hooks

View File

@@ -0,0 +1,43 @@
#!/bin/sh
# Workaround nuances with carla being an optional-yet-hard-linked plugin
CARLA_LIB_NAME="libcarla_native-plugin.so"
KNOWN_LOCATIONS="lib lib64"
unset CARLA_LIB_FILE
# Check for carla at "known" locations
if command -v carla > /dev/null 2>&1; then
CARLA_PATH="$(command -v carla)"
CARLA_PREFIX="${CARLA_PATH%/bin*}"
# Look for libcarla_native-plugin.so in adjacent lib directory
for lib in $KNOWN_LOCATIONS; do
if [ -e "$CARLA_PREFIX/$lib/carla/$CARLA_LIB_NAME" ]; then
# Add directory to LD_LIBRARY_PATH so libcarlabase.so can find it
CARLA_LIB_FILE="$CARLA_PREFIX/$lib/carla/$CARLA_LIB_NAME"
export LD_LIBRARY_PATH="$CARLA_PREFIX/$lib/carla/:$LD_LIBRARY_PATH"
echo "[${0##*/}] Carla appears to be installed on this system at $CARLA_PREFIX/$lib/carla so we'll use it." >&2
break
fi
done
else
echo "[${0##*/}] Carla does not appear to be installed, we'll remove it from the plugin listing." >&2
export "LMMS_EXCLUDE_PLUGINS=libcarla,${LMMS_EXCLUDE_PLUGINS}"
fi
# Additional workarounds for library conflicts
# libgobject has been versioned "2.0" for over 20 years, but the ABI is constantly changing
KNOWN_CONFLICTS="libgobject-2.0.so.0"
if [ -n "$CARLA_LIB_FILE" ]; then
for conflict in $KNOWN_CONFLICTS; do
# Only prepend LD_PRELOAD if we bundle the same version
if [ -e "$APPDIR/usr/lib/$conflict" ]; then
conflict_sys="$(ldd "$CARLA_LIB_FILE" | grep "$conflict" | awk '{print $3}')"
if [ -e "$conflict_sys" ]; then
# Add library to LD_PRELOAD so lmms can find it over its bundled version
echo "[${0##*/}] Preferring the system's \"$conflict\" over the version bundled." >&2
export LD_PRELOAD="$conflict_sys:$LD_PRELOAD"
fi
fi
done
fi

View File

@@ -0,0 +1,9 @@
#!/bin/sh
# Workaround crash when jack is missing by providing a dummy version
if LC_ALL=C ldd "$APPDIR/usr/bin/lmms" |grep "libjack.so" |grep "not found" > /dev/null 2>&1; then
echo "[${0##*/}] Jack does not appear to be installed. That's OK, we'll use a dummy version instead." >&2
export LD_LIBRARY_PATH="$APPDIR/usr/lib/jack:$LD_LIBRARY_PATH"
else
echo "[${0##*/}] Jack appears to be installed on this system, so we'll use it." >&2
fi

View File

@@ -0,0 +1,8 @@
#!/bin/sh
# Workaround Unity desktop menubar integration
# - Unity's menubar relocation breaks Qt's MDI window handling in Linux
# - Unity was default in Ubuntu 11.04 - 18.04
if [ "$XDG_CURRENT_DESKTOP" = "Unity" ]; then
export QT_X11_NO_NATIVE_MENUBAR=1
fi

View File

@@ -0,0 +1,4 @@
#!/bin/sh
# Paths for plugin systems to pick-up
export SUIL_MODULE_DIR="$APPDIR/usr/lib/suil-0/" # See also ${SUIL_MODULES_TARGET}

View File

@@ -0,0 +1,7 @@
#!/bin/sh
# Workaround crash in VirtualBox when hardware rendering is enabled
if lsmod |grep vboxguest > /dev/null 2>&1; then
echo "[${0##*/}] VirtualBox detected. Forcing libgl software rendering." >&2
export LIBGL_ALWAYS_SOFTWARE=1;
fi

View File

@@ -0,0 +1,10 @@
#!/bin/sh
# Configure QPlatform Abstraction (qpa) to prefer X-Protocol C-Bindings (xcb) over Wayland
if [ -n "$QT_QPA_PLATFORM" ]; then
echo "[${0##*/}] QT_QPA_PLATFORM=\"$QT_QPA_PLATFORM\" was provided, using." >&2
else
export QT_QPA_PLATFORM="xcb"
echo "[${0##*/}] Defaulting to QT_QPA_PLATFORM=\"$QT_QPA_PLATFORM\" for compatibility purposes." >&2
echo "[${0##*/}] To force wayland, set QT_QPA_PLATFORM=\"wayland\" or call using \"-platform wayland\"." >&2
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -1,24 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PATH="$PATH:/sbin"
if command -v carla > /dev/null 2>&1; then
CARLAPATH="$(command -v carla)"
CARLAPREFIX="${CARLAPATH%/bin*}"
echo "Carla appears to be installed on this system at $CARLAPREFIX/lib[64]/carla so we'll use it." >&2
export LD_LIBRARY_PATH=$CARLAPREFIX/lib/carla:$CARLAPREFIX/lib64/carla:$LD_LIBRARY_PATH
else
echo "Carla does not appear to be installed. That's OK, please ignore any related library errors." >&2
fi
export LD_LIBRARY_PATH=$DIR/usr/lib/:$DIR/usr/lib/lmms:$LD_LIBRARY_PATH
# Prevent segfault on VirualBox
if lsmod |grep vboxguest > /dev/null 2>&1; then
echo "VirtualBox detected. Forcing libgl software rendering." >&2
export LIBGL_ALWAYS_SOFTWARE=1;
fi
if ldconfig -p | grep libjack.so.0 > /dev/null 2>&1; then
echo "Jack appears to be installed on this system, so we'll use it." >&2
else
echo "Jack does not appear to be installed. That's OK, we'll use a dummy version instead." >&2
export LD_LIBRARY_PATH=$DIR/usr/lib/lmms/optional:$LD_LIBRARY_PATH
fi
QT_X11_NO_NATIVE_MENUBAR=1 "$DIR"/usr/bin/lmms.real "$@"

View File

@@ -0,0 +1,35 @@
#!/bin/bash
# Halt on first error
set -e
DESTDIR="/opt/@CPACK_PROJECT_NAME@"
BASHCOMPLETIONS="/usr/share/bash-completion/completions"
if [ "$(id -u)" != "0" ]; then
# Prepend "$HOME" so we can install to a writable location
DESTDIR="${HOME}${DESTDIR}"
BASHCOMPLETIONS="${HOME}/.local/share/bash-completion/completions"
echo "Installing as a regular user to ${DESTDIR}/..."
else
echo "Installing as elevated user to ${DESTDIR}/..."
fi
# Deploy @CPACK_PROJECT_NAME_UCASE@
mkdir -p "${DESTDIR}"
unalias cp &> /dev/null || true
cp -rf ./* "${DESTDIR}"
rm -f "${DESTDIR}/setup.sh"
mv "${DESTDIR}/AppRun" "${DESTDIR}/@CPACK_PROJECT_NAME@"
# Install bash completions
mkdir -p "${BASHCOMPLETIONS}"
ln -sf "${DESTDIR}/usr/share/@CPACK_PROJECT_NAME@/bash-completion/completions/@CPACK_PROJECT_NAME@" "${BASHCOMPLETIONS}/@CPACK_PROJECT_NAME@"
# Test @CPACK_PROJECT_NAME_UCASE@
echo "Installation complete... Testing \"@CPACK_PROJECT_NAME@\"..."
"${DESTDIR}/@CPACK_PROJECT_NAME@" --allowroot --version &> /dev/null
# TODO: Register file associations, desktop icon, etc
echo "@CPACK_PROJECT_NAME_UCASE@ was installed successfully to ${DESTDIR}. To run:"
echo " ${DESTDIR}/@CPACK_PROJECT_NAME@"

View File

@@ -1,213 +0,0 @@
#!/usr/bin/env bash
# Creates Linux ".AppImage" for @PROJECT_NAME_UCASE@
#
# Depends: linuxdeployqt
#
# Notes: Will attempt to fetch linuxdeployqt automatically (x86_64 only)
# See Also: https://github.com/probonopd/linuxdeployqt/blob/master/BUILDING.md
VERBOSITY=2 # 3=debug
LOGFILE="@CMAKE_BINARY_DIR@/appimage.log"
APPDIR="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.AppDir/"
DESKTOPFILE="${APPDIR}usr/share/applications/lmms.desktop"
STRIP=""
# Don't strip for Debug|RelWithDebInfo builds
# shellcheck disable=SC2193
if [[ "@CMAKE_BUILD_TYPE@" == *"Deb"* ]]; then
STRIP="-no-strip"
fi
# Console colors
RED="\\x1B[1;31m"
GREEN="\\x1B[1;32m"
YELLOW="\\x1B[1;33m"
PLAIN="\\x1B[0m"
function error {
echo -e " ${PLAIN}[${RED}error${PLAIN}] ${1}"
return 1
}
function success {
echo -e " ${PLAIN}[${GREEN}success${PLAIN}] ${1}"
}
function skipped {
echo -e " ${PLAIN}[${YELLOW}skipped${PLAIN}] ${1}"
}
# Exit with error message if any command fails
trap "error 'Failed to generate AppImage'; exit 1" ERR
# Run a command silently, but print output if it fails
function run_and_log {
echo -e "\n\n>>>>> $1" >> "$LOGFILE"
output="$("$@" 2>&1)"
status=$?
echo "$output" >> "$LOGFILE"
[[ $status != 0 ]] && echo "$output"
return $status
}
# Blindly assume system arch is appimage arch
ARCH=$(uname -m)
export ARCH
# Check for problematic install locations
INSTALL=$(echo "@CMAKE_INSTALL_PREFIX@" | sed 's/\/*$//g')
if [ "$INSTALL" == "/usr/local" ] || [ "$INSTALL" == "/usr" ] ; then
error "Incompatible CMAKE_INSTALL_PREFIX for creating AppImage: @CMAKE_INSTALL_PREFIX@"
fi
# Ensure linuxdeployqt uses the same qmake version as cmake
PATH="$(dirname "@QT_QMAKE_EXECUTABLE@"):$PATH"
export PATH
# Use linuxdeployqt from env or in PATH
[[ $LINUXDEPLOYQT ]] || LINUXDEPLOYQT="$(which linuxdeployqt 2>/dev/null)" || true
[[ $APPIMAGETOOL ]] || APPIMAGETOOL="$(which appimagetool 2>/dev/null)" || true
# Fetch portable linuxdeployqt if not in PATH
if [[ -z $LINUXDEPLOYQT || -z $APPIMAGETOOL ]]; then
filename="linuxdeployqt-continuous-$ARCH.AppImage"
url="https://github.com/probonopd/linuxdeployqt/releases/download/continuous/$filename"
echo " [.......] Downloading: ${url}"
wget -N -q "$url" && err=0 || err=$?
case "$err" in
0) success "Downloaded $PWD/$filename" ;;
# 8 == server issued 4xx error
8) error "Download failed (perhaps no package available for $ARCH)" ;;
*) error "Download failed" ;;
esac
# Extract AppImage and replace LINUXDEPLOYQT variable with extracted binary
# to support systems without fuse
# Also, we need to set LD_LIBRARY_PATH, but linuxdepoyqt's AppRun unsets it
# See https://github.com/probonopd/linuxdeployqt/pull/370/
chmod +x "$filename"
./"$filename" --appimage-extract >/dev/null
success "Extracted $filename"
# Use the extracted linuxdeployqt and appimagetool
PATH="$(pwd -P)/squashfs-root/usr/bin:$PATH"
[[ $LINUXDEPLOYQT ]] || LINUXDEPLOYQT="$(which linuxdeployqt)"
[[ $APPIMAGETOOL ]] || APPIMAGETOOL="$(which appimagetool)"
fi
# Make skeleton AppDir
echo -e "\nCreating ${APPDIR}..."
rm -rf "${APPDIR}"
mkdir -p "${APPDIR}usr"
success "Created ${APPDIR}"
# Clone install to AppDir
echo -e "\nCopying @CMAKE_INSTALL_PREFIX@ to ${APPDIR}..."
cp -R "@CMAKE_INSTALL_PREFIX@/." "${APPDIR}usr"
rm -rf "${APPDIR}usr/include"
success "${APPDIR}"
# Copy rawwaves directory for stk/mallets
mkdir -p "${APPDIR}usr/share/stk/"
cp -R /usr/share/stk/rawwaves/ "${APPDIR}usr/share/stk/"
# Create a wrapper script which calls the lmms executable
mv "${APPDIR}usr/bin/lmms" "${APPDIR}usr/bin/lmms.real"
cp "@CMAKE_CURRENT_SOURCE_DIR@/launch_lmms.sh" "${APPDIR}usr/bin/lmms"
chmod +x "${APPDIR}usr/bin/lmms"
# Per https://github.com/probonopd/linuxdeployqt/issues/129
unset LD_LIBRARY_PATH
# Ensure linuxdeployqt can find shared objects
export LD_LIBRARY_PATH="${APPDIR}"usr/lib/lmms/:"${APPDIR}"usr/lib/lmms/optional:"$LD_LIBRARY_PATH"
# Move executables so linuxdeployqt can find them
ZYNLIB="${APPDIR}usr/lib/lmms/RemoteZynAddSubFx"
VSTLIB32="${APPDIR}usr/lib/lmms/32/RemoteVstPlugin32.exe.so"
VSTLIB64="${APPDIR}usr/lib/lmms/RemoteVstPlugin64.exe.so"
ZYNBIN="${APPDIR}usr/bin/RemoteZynAddSubFx"
VSTBIN32="${APPDIR}usr/bin/RemoteVstPlugin32.exe.so"
VSTBIN64="${APPDIR}usr/bin/RemoteVstPlugin64.exe.so"
mv "$ZYNLIB" "$ZYNBIN"
mv "$VSTLIB32" "$VSTBIN32" || true
mv "$VSTLIB64" "$VSTBIN64" || true
# Handle wine linking
if [ -d "@WINE_32_LIBRARY_DIR@" ] && \
ldd "$VSTBIN32" | grep "libwine\.so" | grep "not found"; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"@WINE_32_LIBRARY_DIRS@"
fi
if [ -d "@WINE_64_LIBRARY_DIR@" ] && \
ldd "$VSTBIN64" | grep "libwine\.so" | grep "not found"; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"@WINE_64_LIBRARY_DIRS@"
fi
# Patch the desktop file
sed -i 's/.*Exec=.*/Exec=lmms.real/' "$DESKTOPFILE"
echo "X-AppImage-Version=@VERSION@" >> "$DESKTOPFILE"
# Fix linking for soft-linked plugins
for file in "${APPDIR}usr/lib/lmms/"*.so; do
thisfile="${APPDIR}usr/lib/lmms/${file##*/}"
executables="${executables} -executable=$thisfile"
done
executables="${executables} -executable=${ZYNBIN}"
executables="${executables} -executable=${VSTBIN32}"
executables="${executables} -executable=${VSTBIN64}"
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/imp_1199.so"
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/imbeq_1197.so"
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1193.so"
executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1194.so"
echo -e "\nWriting verbose output to \"${LOGFILE}\""
echo -n > "$LOGFILE"
# Bundle both qt and non-qt dependencies into appimage format
echo -e "\nBundling and relinking system dependencies..."
# shellcheck disable=SC2086
run_and_log "$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP
success "Bundled and relinked dependencies"
# Link to original location so lmms can find them
ln -sr "$ZYNBIN" "$ZYNLIB"
ln -sr "$VSTBIN32" "$VSTLIB32" || true
ln -sr "$VSTBIN64" "$VSTLIB64" || true
# Remove wine library conflict
rm -f "${APPDIR}/usr/lib/libwine.so.1"
# Use system-provided carla
rm -f "${APPDIR}usr/lib/"libcarla*.so
rm -f "${APPDIR}usr/lib/lmms/optional/"libcarla*.so
# Remove bundled jack in LD_LIBRARY_PATH if exists
if [ -e "${APPDIR}/usr/lib/libjack.so.0" ]; then
rm "${APPDIR}/usr/lib/libjack.so.0"
fi
# Bundle jack out of LD_LIBRARY_PATH
JACK_LIB=$(ldd "${APPDIR}/usr/bin/lmms.real" | sed -n 's/\tlibjack\.so\.0 => \(.\+\) (0x[0-9a-f]\+)/\1/p')
if [ -e "$JACK_LIB" ]; then
mkdir -p "${APPDIR}usr/lib/lmms/optional/"
cp "$JACK_LIB" "${APPDIR}usr/lib/lmms/optional/"
fi
# Point the AppRun to the shim launcher
rm -f "${APPDIR}/AppRun"
ln -sr "${APPDIR}/usr/bin/lmms" "${APPDIR}/AppRun"
# Add icon
ln -srf "${APPDIR}/lmms.png" "${APPDIR}/.DirIcon"
# Create AppImage
echo -e "\nFinishing the AppImage..."
run_and_log "$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@"
success "Created @APPIMAGE_FILE@"
echo -e "\nFinished"

View File

@@ -1,93 +1,78 @@
# A wrapper around pkg-config-provided and cmake-provided bash completion that
# will have dynamic behavior at INSTALL() time to allow both root-level
# INSTALL() as well as user-level INSTALL().
#
# See also https://github.com/scop/bash-completion
#
# Copyright (c) 2018, Tres Finocchiaro, <tres.finocchiaro@gmail.com>
# Copyright (c) 2024, Tres Finocchiaro, <tres.finocchiaro@gmail.com>
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# Description:
# Fail-safe bash-completion installation support
# - Installs to ${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions
# - Attempts to calculate and install to system-wide location
# - See also https://github.com/scop/bash-completion
#
# Usage:
# INCLUDE(BashCompletion)
# BASHCOMP_INSTALL(foo)
# ... where "foo" is a shell script adjacent to the CMakeLists.txt
#
# How it determines BASHCOMP_PKG_PATH, in order:
# 1. Uses BASHCOMP_PKG_PATH if already set (e.g. -DBASHCOMP_PKG_PATH=...)
# a. If not, uses pkg-config's PKG_CHECK_MODULES to determine path
# b. Fallback to cmake's FIND_PACKAGE(bash-completion) path
# c. Fallback to hard-coded /usr/share/bash-completion/completions
# 2. Final fallback to ${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions if
# detected path is unwritable.
# - Windows does not support bash completion
# - macOS support should eventually be added for Homebrew (TODO)
IF(WIN32)
MESSAGE(STATUS "Bash completion is not supported on this platform.")
ELSEIF(APPLE)
MESSAGE(STATUS "Bash completion is not yet implemented for this platform.")
ELSE()
INCLUDE(FindUnixCommands)
# Honor manual override if provided
IF(NOT BASHCOMP_PKG_PATH)
# First, use pkg-config, which is the most reliable
FIND_PACKAGE(PkgConfig QUIET)
IF(PKGCONFIG_FOUND)
PKG_CHECK_MODULES(BASH_COMPLETION bash-completion)
PKG_GET_VARIABLE(BASHCOMP_PKG_PATH bash-completion completionsdir)
ELSE()
# Second, use cmake (preferred but less common)
FIND_PACKAGE(bash-completion QUIET)
IF(BASH_COMPLETION_FOUND)
SET(BASHCOMP_PKG_PATH "${BASH_COMPLETION_COMPLETIONSDIR}")
ENDIF()
ENDIF()
# Honor manual override if provided
if(NOT BASHCOMP_PKG_PATH)
# First, use pkg-config, which is the most reliable
find_package(PkgConfig QUIET)
if(PKGCONFIG_FOUND)
PKG_CHECK_MODULES(BASH_COMPLETION bash-completion)
PKG_GET_VARIABLE(BASHCOMP_PKG_PATH bash-completion completionsdir)
else()
# Second, use cmake (preferred but less common)
find_package(bash-completion QUIET)
if(BASH_COMPLETION_FOUND)
set(BASHCOMP_PKG_PATH "${BASH_COMPLETION_COMPLETIONSDIR}")
endif()
endif()
# Third, use a hard-coded fallback value
IF("${BASHCOMP_PKG_PATH}" STREQUAL "")
SET(BASHCOMP_PKG_PATH "/usr/share/bash-completion/completions")
ENDIF()
ENDIF()
# Third, use a hard-coded fallback value
if("${BASHCOMP_PKG_PATH}" STREQUAL "")
set(BASHCOMP_PKG_PATH "/usr/share/bash-completion/completions")
endif()
endif()
# Always provide a fallback for non-root INSTALL()
SET(BASHCOMP_USER_PATH "${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions")
# Always provide a fallback for non-root INSTALL()
# * "lmms" subfolder ensures we don't pollute /usr/local/share/ on default "make install"
set(BASHCOMP_USER_PATH "share/${PROJECT_NAME}/bash-completion/completions")
# Cmake doesn't allow easy use of conditional logic at INSTALL() time
# this is a problem because ${BASHCOMP_PKG_PATH} may not be writable and we
# need sane fallback behavior for bundled INSTALL() (e.g. .AppImage, etc).
#
# The reason this can't be detected by cmake is that it's fairly common to
# run "cmake" as a one user (i.e. non-root) and "make install" as another user
# (i.e. root).
#
# - Creates a script called "install_${SCRIPT_NAME}_completion.sh" into the
# working binary directory and invokes this script at install.
# - Script handles INSTALL()-time conditional logic for sane ballback behavior
# when ${BASHCOMP_PKG_PATH} is unwritable (i.e. non-root); Something cmake
# can't handle on its own at INSTALL() time)
MACRO(BASHCOMP_INSTALL SCRIPT_NAME)
# A shell script for wrapping conditionl logic
SET(BASHCOMP_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install_${SCRIPT_NAME}_completion.sh")
macro(BASHCOMP_INSTALL SCRIPT_NAME)
# Note: When running from CPack, message(...) will be suppressed unless WARNING
if(WIN32)
message(STATUS "Bash completion is not supported on this platform.")
else()
# Install a copy of bash completion to the default install prefix
# See also: https://github.com/LMMS/lmms/pull/7252/files#r1815749125
install(FILES "${SCRIPT_NAME}" DESTINATION "${BASHCOMP_USER_PATH}")
# Next, blindly attempt a system-wide install, ignoring failure
# See also: https://stackoverflow.com/q/58448332
# * CPack doesn't use CMAKE_INSTALL_PREFIX, so the original will be missing when packaging
# and this step will be skipped
# * For non-root installs (e.g. ../target), this will silently fail
set(BASHCOMP_ORIG "${CMAKE_INSTALL_PREFIX}/${BASHCOMP_USER_PATH}/${CMAKE_PROJECT_NAME}")
set(BASHCOMP_LINK "${BASHCOMP_PKG_PATH}/${CMAKE_PROJECT_NAME}")
if(BASHCOMP_PKG_PATH)
# TODO: CMake 3.21 Use "file(COPY_FILE ...)"
install(CODE "
if(EXISTS \"${BASHCOMP_ORIG}\")
file(REMOVE \"${BASHCOMP_LINK}\")
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
\"${BASHCOMP_ORIG}\"
\"${BASHCOMP_LINK}\"
ERROR_QUIET
RESULT_VARIABLE result)
if(result EQUAL 0)
message(STATUS \"Bash completion-support has been installed to ${BASHCOMP_LINK}\")
endif()
endif()
")
endif()
endif()
endmacro()
FILE(WRITE ${BASHCOMP_SCRIPT} "\
#!${BASH}\n\
set -e\n\
if [ -w \"${BASHCOMP_PKG_PATH}\" ]; then\n\
BASHCOMP_PKG_PATH=\"${BASHCOMP_PKG_PATH}\"\n\
else \n\
BASHCOMP_PKG_PATH=\"\$DESTDIR${BASHCOMP_USER_PATH}\"\n\
fi\n\
echo -e \"\\nInstalling bash completion...\\n\"\n\
mkdir -p \"\$BASHCOMP_PKG_PATH\"\n\
cp \"${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_NAME}\" \"\$BASHCOMP_PKG_PATH\"\n\
chmod a+r \"\$BASHCOMP_PKG_PATH/${SCRIPT_NAME}\"\n\
echo -e \"Bash completion for ${SCRIPT_NAME} has been installed to \$BASHCOMP_PKG_PATH/${SCRIPT_NAME}\"\n\
")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND chmod u+x \"install_${SCRIPT_NAME}_completion.sh\" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"./install_${SCRIPT_NAME}_completion.sh\" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )")
MESSAGE(STATUS "Bash completion script for ${SCRIPT_NAME} will be installed to ${BASHCOMP_PKG_PATH} or fallback to ${BASHCOMP_USER_PATH} if unwritable.")
ENDMACRO()
ENDIF()

View File

@@ -1,12 +1,12 @@
# BuildPlugin.cmake - Copyright (c) 2008 Tobias Doerffel
#
# description: build LMMS-plugin
# usage: BUILD_PLUGIN(<PLUGIN_NAME> <PLUGIN_SOURCES> MOCFILES <HEADERS_FOR_MOC> EMBEDDED_RESOURCES <LIST_OF_FILES_TO_EMBED> UICFILES <UI_FILES_TO_COMPILE> LINK <SHARED|MODULE>)
# usage: BUILD_PLUGIN(<PLUGIN_NAME> <PLUGIN_SOURCES> MOCFILES <HEADERS_FOR_MOC> EMBEDDED_RESOURCES <LIST_OF_FILES_TO_EMBED> LINK <SHARED|MODULE>)
INCLUDE(GenQrc)
MACRO(BUILD_PLUGIN PLUGIN_NAME)
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "LINK;EXPORT_BASE_NAME" "MOCFILES;EMBEDDED_RESOURCES;UICFILES" ${ARGN})
CMAKE_PARSE_ARGUMENTS(PLUGIN "" "LINK;EXPORT_BASE_NAME" "MOCFILES;EMBEDDED_RESOURCES" ${ARGN})
SET(PLUGIN_SOURCES ${PLUGIN_UNPARSED_ARGUMENTS})
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/include")
@@ -30,11 +30,10 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
ADD_GEN_QRC(RCC_OUT "${PLUGIN_NAME}.qrc" PREFIX artwork/${PLUGIN_NAME} ${PLUGIN_EMBEDDED_RESOURCES})
ENDIF(ER_LEN)
QT5_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
QT5_WRAP_UI(plugin_UIC_out ${PLUGIN_UICFILES})
cmake_language(CALL QT${QT_VERSION_MAJOR}_WRAP_CPP plugin_MOC_out ${PLUGIN_MOCFILES})
FOREACH(f ${PLUGIN_SOURCES})
ADD_FILE_DEPENDENCIES(${f} ${RCC_OUT} ${plugin_UIC_out})
ADD_FILE_DEPENDENCIES(${f} ${RCC_OUT})
ENDFOREACH(f)
IF(LMMS_BUILD_APPLE)
@@ -45,10 +44,6 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
LINK_DIRECTORIES("${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}")
LINK_LIBRARIES(${QT_LIBRARIES})
ENDIF(LMMS_BUILD_WIN32)
IF(LMMS_BUILD_MSYS AND CMAKE_BUILD_TYPE STREQUAL "Debug")
# Override Qt debug libraries with release versions
SET(QT_LIBRARIES "${QT_OVERRIDE_LIBRARIES}")
ENDIF()
IF (NOT PLUGIN_LINK)
SET(PLUGIN_LINK "MODULE")
@@ -56,7 +51,7 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
ADD_LIBRARY(${PLUGIN_NAME} ${PLUGIN_LINK} ${PLUGIN_SOURCES} ${plugin_MOC_out} ${RCC_OUT})
target_link_libraries("${PLUGIN_NAME}" lmms Qt5::Widgets Qt5::Xml)
target_link_libraries("${PLUGIN_NAME}" lmms Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml)
INSTALL(TARGETS ${PLUGIN_NAME}
LIBRARY DESTINATION "${PLUGIN_DIR}"
@@ -65,7 +60,7 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
IF(LMMS_BUILD_APPLE)
IF ("${PLUGIN_LINK}" STREQUAL "SHARED")
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
TARGET_LINK_OPTIONS(${PLUGIN_NAME} PRIVATE -undefined dynamic_lookup)
ENDIF()
ENDIF(LMMS_BUILD_APPLE)
IF(LMMS_BUILD_WIN32)

View File

@@ -7,7 +7,7 @@
# INCLUDE(CheckSubmodules)
#
# Options:
# SET(PLUGIN_LIST "ZynAddSubFx;...") # skips submodules for plugins not explicitely listed
# SET(PLUGIN_LIST "ZynAddSubFx;...") # skips submodules for plugins not explicitly listed
#
# Or via command line:
# cmake -PLUGIN_LIST=foo;bar
@@ -43,7 +43,7 @@ SET(LANG_BACKUP "$ENV{LANG}")
SET(ENV{LC_ALL} "C")
SET(ENV{LANG} "en_US")
# Submodule list pairs, unparsed (WARNING: Assumes alpha-numeric paths)
# Submodule list pairs, unparsed (WARNING: Assumes alphanumeric paths)
STRING(REGEX MATCHALL "path = [-0-9A-Za-z/]+" SUBMODULE_LIST_RAW ${SUBMODULE_DATA})
STRING(REGEX MATCHALL "url = [.:%-0-9A-Za-z/]+" SUBMODULE_URL_RAW ${SUBMODULE_DATA})

View File

@@ -9,7 +9,19 @@ FUNCTION(CheckWineGcc BITNESS WINEGCC_EXECUTABLE RESULT)
return 0;
}
")
EXECUTE_PROCESS(COMMAND ${WINEGCC_EXECUTABLE} "-m${BITNESS}"
# Handle non-Intel platforms
IF(LMMS_HOST_X86_64 OR LMMS_HOST_X86)
SET(MPLATFORM "-m${BITNESS}")
ELSEIF(BITNESS EQUAL 64)
SET(MPLATFORM "")
ELSE()
# Skip 32-bit for non-Intel
SET(${RESULT} False PARENT_SCOPE)
RETURN()
ENDIF()
EXECUTE_PROCESS(COMMAND ${WINEGCC_EXECUTABLE} "${MPLATFORM}"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test.cxx"
"-o" "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/winegcc_test"
OUTPUT_QUIET ERROR_QUIET

View File

@@ -0,0 +1,76 @@
# Copy source_lib's dependency matching 'name_match' into specified location
# Sets variable named in relocated_lib to the destination
macro(copy_dependency source_lib name_match destination relocated_lib)
if(NOT COMMAND_ECHO OR "${COMMAND_ECHO}" STREQUAL "NONE")
set(_command_echo NONE)
else()
set(_command_echo "${COMMAND_ECHO}")
endif()
execute_process(COMMAND file -b --mime-type "${source_lib}" OUTPUT_VARIABLE file_type)
set(_is_linux_lib false)
set(_is_mac_lib false)
if("${file_type}" MATCHES "application/x-pie-executable")
# Linux ELF binary
set(_is_linux_lib true)
list(APPEND _lib_command ldd)
elseif("${file_type}" MATCHES "application/x-mach-binary")
# macOS Mach-O binary
set(_is_mac_lib true)
list(APPEND _lib_command otool -L)
else()
message(FATAL_ERROR "Copying dependencies for ${file_type} are not yet supported")
endif()
execute_process(COMMAND ${_lib_command}
"${source_lib}"
OUTPUT_VARIABLE raw_output
OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND_ECHO ${_command_echo}
COMMAND_ERROR_IS_FATAL ANY)
# escape periods to avoid double-escaping
string(REPLACE "." "\\." name_match "${name_match}")
# cli output --> list
string(REPLACE "\n" ";" raw_list "${raw_output}")
foreach(line ${raw_list})
if(line MATCHES "${name_match}")
if(_is_linux_lib)
# Assumes format "libname.so.0 => /lib/location/libname.so.0 (0x00007f48d0b0e000)"
string(REGEX MATCH "=> ([^\\(]+)" dummy_var "${line}")
# Trim leading/trailing whitespace and add to our list
string(STRIP "${CMAKE_MATCH_1}" lib)
elseif(_is_mac_lib)
# Assumes format "@loader_path/../Frameworks/libname-0.0.dylib (compatibility version 0.0.0, current version 0.24.26)"
string(REGEX MATCH "^[ \t]+(.*) \\(" dummy_var "${line}")
string(STRIP "${CMAKE_MATCH_1}" lib)
get_filename_component(loader_path ${source_lib} DIRECTORY)
string(REPLACE "@loader_path" "${loader_path}" resolved_lib "${lib}")
string(REPLACE "@rpath" "${loader_path}" resolved_lib "${lib}")
# Special handling for '@executable_path'
if(line MATCHES "@executable_path")
# Find the position of '/Contents/'
string(FIND "${APP_PATH}" "/Contents/" APP_CONTENTS_POS)
# Extract the base path up to '/Contents/'
string(SUBSTRING "${loader_path}" 0 "${APP_CONTENTS_POS}" app_base_path)
string(REPLACE "@executable_path" "${app_base_path}/Contents/MacOS" resolved_lib "${lib}")
endif()
endif()
# Resolve any possible symlinks
file(REAL_PATH "${lib}" libreal)
get_filename_component(symname "${lib}" NAME)
get_filename_component(realname "${libreal}" NAME)
file(MAKE_DIRECTORY "${destination}")
# Copy, but with original symlink name
file(COPY "${libreal}" DESTINATION "${destination}")
file(RENAME "${destination}/${realname}" "${destination}/${symname}")
set("${relocated_lib}" "${destination}/${symname}")
break()
endif()
endforeach()
endmacro()

View File

@@ -0,0 +1,34 @@
# Offer relative symlink support via "cmake -E create_symlink"
# For verbose, set COMMAND_ECHO to STDOUT in calling script
macro(create_symlink filepath sympath)
if(CMAKE_COMMAND)
set(_cmake_command "${CMAKE_COMMAND}")
elseif(CPACK_CMAKE_COMMAND)
set(_cmake_command "${CPACK_CMAKE_COMMAND}")
else()
message(FATAL_ERROR "Sorry, can't resolve variable CMAKE_COMMAND")
endif()
if(NOT IS_ABSOLUTE "${sympath}")
message(FATAL_ERROR "Sorry, this command only works with absolute paths")
endif()
if(NOT DEFINED COMMAND_ECHO)
set(_command_echo NONE)
else()
set(_command_echo "${COMMAND_ECHO}")
endif()
# Calculate the relative path
file(RELATIVE_PATH reldir "${sympath}/../" "${filepath}")
get_filename_component(symname "${sympath}" NAME)
# Calculate the working directory
get_filename_component(sympath_parent "${sympath}" DIRECTORY)
# Create the symbolic link
execute_process(COMMAND "${_cmake_command}" -E create_symlink "${reldir}" "${symname}"
WORKING_DIRECTORY "${sympath_parent}"
COMMAND_ECHO ${_command_echo}
COMMAND_ERROR_IS_FATAL ANY)
endmacro()

View File

@@ -12,11 +12,6 @@ ELSE()
SET(LMMS_BUILD_LINUX 1)
ENDIF(WIN32)
# LMMS_BUILD_MSYS also set in build_winXX.sh
IF(LMMS_BUILD_WIN32 AND CMAKE_COMPILER_IS_GNUCXX AND DEFINED ENV{MSYSCON})
SET(LMMS_BUILD_MSYS TRUE)
ENDIF()
MESSAGE("PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
SET(LMMS_HOST_X86 FALSE)
SET(LMMS_HOST_X86_64 FALSE)
@@ -82,13 +77,15 @@ IF(WIN32)
unset(MSVC_VER)
else()
# Cross-compiled
# TODO: Handle Windows ARM64 targets
IF(WIN64)
SET(IS_X86_64 TRUE)
SET(LMMS_BUILD_WIN64 TRUE)
ELSE(WIN64)
SET(IS_X86 TRUE)
ENDIF(WIN64)
if($ENV{MSYSTEM_CARCH} MATCHES "aarch64")
set(IS_ARM64 TRUE)
set(LMMS_BUILD_WIN64 TRUE)
elseif(WIN64)
set(IS_X86_64 TRUE)
set(LMMS_BUILD_WIN64 TRUE)
else()
set(IS_X86 TRUE)
endif()
endif()
ELSE()
# Detect target architecture based on compiler target triple e.g. "x86_64-pc-linux"
@@ -168,15 +165,26 @@ IF(LMMS_BUILD_APPLE)
# Detect Homebrew versus Macports environment
EXECUTE_PROCESS(COMMAND brew --prefix RESULT_VARIABLE DETECT_HOMEBREW OUTPUT_VARIABLE HOMEBREW_PREFIX ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS(COMMAND which port RESULT_VARIABLE DETECT_MACPORTS OUTPUT_VARIABLE MACPORTS_PREFIX ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(${DETECT_HOMEBREW} EQUAL 0)
SET(HOMEBREW 1)
SET(APPLE_PREFIX "${HOMEBREW_PREFIX}")
ELSEIF(${DETECT_MACPORTS} EQUAL 0)
SET(MACPORTS 1)
GET_FILENAME_COMPONENT(MACPORTS_PREFIX ${MACPORTS_PREFIX} DIRECTORY)
GET_FILENAME_COMPONENT(MACPORTS_PREFIX ${MACPORTS_PREFIX} DIRECTORY)
SET(APPLE_PREFIX "${MACPORTS_PREFIX}")
LINK_DIRECTORIES(${LINK_DIRECTORIES} ${APPLE_PREFIX}/lib)
IF(DETECT_HOMEBREW EQUAL 0)
SET(HOMEBREW 1)
SET(APPLE_PREFIX "${HOMEBREW_PREFIX}")
# Configure Qt
SET(Qt5_DIR "${HOMEBREW_PREFIX}/opt/qt@5/lib/cmake/Qt5")
SET(Qt5Test_DIR "${HOMEBREW_PREFIX}/opt/qt@5/lib/cmake/Qt5Test")
SET(Qt6_DIR "${HOMEBREW_PREFIX}/opt/qt@6/lib/cmake/Qt6")
SET(Qt6Test_DIR "${HOMEBREW_PREFIX}/opt/qt@6/lib/cmake/Qt6Test")
ELSEIF(DETECT_MACPORTS EQUAL 0)
SET(MACPORTS 1)
# move up two directories
GET_FILENAME_COMPONENT(MACPORTS_PREFIX "${MACPORTS_PREFIX}" DIRECTORY)
GET_FILENAME_COMPONENT(MACPORTS_PREFIX "${MACPORTS_PREFIX}" DIRECTORY)
SET(APPLE_PREFIX "${MACPORTS_PREFIX}")
# Configure Qt
SET(Qt5_DIR "${MACPORTS_PREFIX}/lib/cmake/Qt5")
SET(Qt5Test_DIR "${MACPORTS_PREFIX}/lib/cmake/Qt5Test")
SET(Qt6_DIR "${MACPORTS_PREFIX}/lib/cmake/Qt6")
SET(Qt6Test_DIR "${MACPORTS_PREFIX}/lib/cmake/Qt6Test")
LINK_DIRECTORIES(${LINK_DIRECTORIES} ${APPLE_PREFIX}/lib)
ENDIF()
# Detect OS Version

View File

@@ -0,0 +1,143 @@
# Downloads an executable from the provided URL for use in a build system
# and optionally prepends it to the PATH
#
# Assumes:
# - CMAKE_CURRENT_BINARY_DIR/[${_name}]
# - CPACK_CURRENT_BINARY_DIR/[${_name}]
# - Fallback to $ENV{TMPDIR}/[RANDOM]/[${_name}]
# - For verbose, set COMMAND_ECHO to STDOUT in calling script
#
macro(download_binary RESULT_VARIABLE _url _name _prepend_to_path)
if(NOT COMMAND_ECHO OR "${COMMAND_ECHO}" STREQUAL "NONE")
set(_command_echo NONE)
set(_output_quiet OUTPUT_QUIET)
set(_error_quiet ERROR_QUIET)
else()
set(_command_echo "${COMMAND_ECHO}")
set(_output_quiet "")
set(_error_quiet "")
endif()
# Check if fuse is needed
if("${RESULT_VARIABLE}" MATCHES "\\.AppImage$" OR "${_name}" MATCHES "\\.AppImage$")
message(STATUS "AppImage detected, we'll extract the AppImage before using")
set(_${RESULT_VARIABLE}_IS_APPIMAGE TRUE)
endif()
# Determine a suitable working directory
if(CMAKE_CURRENT_BINARY_DIR)
# Assume we're called from configure step
set(_working_dir "${CMAKE_CURRENT_BINARY_DIR}")
elseif(CPACK_CURRENT_BINARY_DIR)
# Assume cpack (non-standard variable name, but used throughout)
set(_working_dir "${CPACK_CURRENT_BINARY_DIR}")
else()
# Fallback to somewhere temporary, writable
if($ENV{_tmpdir})
# POSIX
set(_tmpdir "$ENV{_tmpdir}")
elseif($ENV{TEMP})
# Windows
set(_tmpdir "$ENV{TEMP}")
else()
# Linux, shame on you!
find_program(MKTEMP mktemp)
if(MKTEMP)
execute_process(COMMAND mktemp
OUTPUT_VARIABLE _working_dir
OUTPUT_STRIP_TRAILING_WHITESPACE
${_output_quiet}
COMMAND_ECHO ${_command_echo})
# mktemp formats it how we want it
else()
# Ummm... Linux you can do better!
set(_tmpdir "/tmp")
endif()
endif()
if(NOT DEFINED _working_dir)
string(RANDOM subdir)
set(_working_dir "${_tmpdir}/tmp.${subdir}")
endif()
if(NOT EXISTS "${_working_dir}")
file(MAKE_DIRECTORY "${_working_dir}")
endif()
endif()
if(_prepend_to_path)
# Ensure the PATH is configured
string(FIND "$ENV{PATH}" "${_working_dir}" _pathloc)
if(NOT $_pathloc EQUAL 0)
set(ENV{PATH} "${_working_dir}:$ENV{PATH}")
endif()
endif()
# First ensure the binary doesn't already exist
find_program(_${RESULT_VARIABLE} "${_name}" HINTS "${_working_dir}")
set(_binary_path "${_working_dir}/${_name}")
if(NOT _${RESULT_VARIABLE})
message(STATUS "Downloading ${_name} from ${_url}...")
file(DOWNLOAD
"${_url}"
"${_binary_path}"
STATUS DOWNLOAD_STATUS)
# Check if download was successful.
list(GET DOWNLOAD_STATUS 0 STATUS_CODE)
list(GET DOWNLOAD_STATUS 1 ERROR_MESSAGE)
if(NOT ${STATUS_CODE} EQUAL 0)
file(REMOVE "${_binary_path}")
message(FATAL_ERROR "Error downloading ${_url} ${ERROR_MESSAGE}")
endif()
# Ensure the file is executable
file(CHMOD "${_binary_path}" PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_WRITE GROUP_READ)
# Ensure it's found
find_program(_${RESULT_VARIABLE} "${_name}" HINTS "${_working_dir}" REQUIRED)
endif()
# We need to create a subdirectory for this binary and symlink it's AppRun to where it's expected
if(_${RESULT_VARIABLE}_IS_APPIMAGE AND NOT IS_SYMLINK "${_${RESULT_VARIABLE}}")
if(NOT COMMAND create_symlink)
include(CreateSymlink)
endif()
message(STATUS "Extracting ${_${RESULT_VARIABLE}} to ${_working_dir}/.${_name}/")
# extract appimage
execute_process(COMMAND "${_${RESULT_VARIABLE}}" --appimage-extract
WORKING_DIRECTORY "${_working_dir}"
COMMAND_ECHO ${_command_echo}
${_output_quiet}
${_error_quiet}
COMMAND_ERROR_IS_FATAL ANY)
# move extracted files to dedicated location (e.g. ".linuxdeploy-x86_64.AppImage/squashfs-root/")
file(MAKE_DIRECTORY "${_working_dir}/.${_name}/")
file(RENAME "${_working_dir}/squashfs-root/" "${_working_dir}/.${_name}/squashfs-root/")
# remove the unusable binary
file(REMOVE "${_${RESULT_VARIABLE}}")
# symlink the expected binary name to the AppRun file
message(STATUS "Creating a symbolic link ${_${RESULT_VARIABLE}} which points to ${_working_dir}/.${_name}/squashfs-root/AppRun")
create_symlink("${_working_dir}/.${_name}/squashfs-root/AppRun" "${_${RESULT_VARIABLE}}")
endif()
# Test the binary
# - TODO: Add support for bad binaries that set "$?" to an error code for no good reason
# - TODO: Add support for Windows binaries expecting "/?" instead of "--help"
message(STATUS "Testing that ${_name} works on this system...")
set(_test_param "--help")
execute_process(COMMAND "${_${RESULT_VARIABLE}}" ${_test_param}
COMMAND_ECHO ${_command_echo}
${_output_quiet}
${_error_quiet}
COMMAND_ERROR_IS_FATAL ANY)
message(STATUS "The binary \"${_${RESULT_VARIABLE}}\" is now available")
set(${RESULT_VARIABLE} "${_${RESULT_VARIABLE}}")
endmacro()

View File

@@ -0,0 +1,76 @@
# Shim the SYSTEM property for older CMake versions - we rely on this property
# to determine which set of error flags to use.
if(CMAKE_VERSION VERSION_LESS "3.25")
define_property(TARGET
PROPERTY SYSTEM
INHERITED
BRIEF_DOCS "Shim of built-in SYSTEM property for CMake versions less than 3.25"
FULL_DOCS "Non-functional, but allows the property to be inherited properly."
"See the CMake documentation at https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html."
)
endif()
# Allow the user to control whether to treat warnings as errors
option(USE_WERROR "Treat compiler warnings as errors" OFF)
# Compute the appropriate flags for the current compiler and options
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(COMPILE_ERROR_FLAGS
"-Wall" # Enable most warnings by default
)
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
"-w" # Disable all warnings
)
if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND COMPILE_ERROR_FLAGS
# The following warning generates false positives that are difficult
# to work around, in particular when inlining calls to standard
# algorithms performed on single-element arrays. See, for example,
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111273.
"-Wno-array-bounds" # Permit out-of-bounds array subscripts
)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11")
list(APPEND COMPILE_ERROR_FLAGS
# This has the same problems described above for "array-bounds".
"-Wno-stringop-overread" # Permit string functions overreading the source
)
endif()
endif()
if(USE_WERROR)
list(APPEND COMPILE_ERROR_FLAGS
"-Werror" # Treat warnings as errors
)
endif()
elseif(MSVC)
set(COMPILE_ERROR_FLAGS
"/W2" # Enable some warnings by default
"/external:W0" # Don't emit warnings for third-party code
"/external:anglebrackets" # Consider headers included with angle brackets to be third-party
"/external:templates-" # Still emit warnings from first-party instantiations of third-party templates
# Silence "class X needs to have DLL-interface to be used by clients of
# class Y" warnings. These aren't trivial to address, and don't pose a
# problem for us since we build all modules with the same compiler and
# options, and dynamically link the CRT.
"/wd4251"
)
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
"/W0" # Disable all warnings
)
if(USE_WERROR)
list(APPEND COMPILE_ERROR_FLAGS
"/WX" # Treat warnings as errors
)
endif()
# Silence deprecation warnings for the std::atomic_...<std::shared_ptr> family of functions.
# TODO: Remove once C++20's std::atomic<std::shared_ptr> is fully supported.
add_compile_definitions("_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING")
endif()
# Add the flags to the whole directory tree. We use the third-party flags for
# targets whose SYSTEM property is true, and the normal flags otherwise.
add_compile_options("$<IF:$<BOOL:$<TARGET_PROPERTY:SYSTEM>>,${THIRD_PARTY_COMPILE_ERROR_FLAGS},${COMPILE_ERROR_FLAGS}>")

View File

@@ -22,7 +22,7 @@ find_path(FluidSynth_INCLUDE_DIR
)
find_library(FluidSynth_LIBRARY
NAMES "fluidsynth"
NAMES "fluidsynth" "fluidsynth-3" "fluidsynth-2" "fluidsynth-1"
HINTS ${FLUIDSYNTH_PKG_LIBRARY_DIRS}
)

View File

@@ -0,0 +1,19 @@
# Copyright (c) 2025 Dalton Messmer <messmer.dalton/at/gmail.com>
#
# Redistribution and use is allowed according to the terms of the New BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(ImportedTargetHelpers)
find_package_config_mode_with_fallback(Lilv Lilv::lilv
LIBRARY_NAMES "lilv" "lilv-0"
INCLUDE_NAMES "lilv/lilv.h"
PKG_CONFIG "lilv-0"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Lilv
REQUIRED_VARS Lilv_LIBRARY Lilv_INCLUDE_DIRS
VERSION_VAR Lilv_VERSION
)

View File

@@ -18,13 +18,15 @@ ENDIF (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARIES)
IF (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
INCLUDE(FindPkgConfig)
pkg_check_modules(PA libpulse)
set(_PASIncDir ${PA_INCLUDE_DIRS})
set(_PASLinkDir ${PA_LIBRARY_DIRS})
set(_PASLinkFlags ${PA_LDFLAGS})
set(_PASCflags ${PA_CFLAGS})
SET(PULSEAUDIO_DEFINITIONS ${_PASCflags})
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PA libpulse)
set(_PASIncDir ${PA_INCLUDE_DIRS})
set(_PASLinkDir ${PA_LIBRARY_DIRS})
set(_PASLinkFlags ${PA_LDFLAGS})
set(_PASCflags ${PA_CFLAGS})
set(PULSEAUDIO_DEFINITIONS ${_PASCflags})
endif()
ENDIF (NOT WIN32)
FIND_PATH(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h

View File

@@ -33,6 +33,18 @@
find_package(SDL2 CONFIG QUIET)
if(TARGET SDL2::SDL2)
# SDL2::SDL2 under MinGW is an interface target for reasons, so we can't get
# the library location from it. Print minimal information and return early.
get_target_property(sdl2_target_type SDL2::SDL2 TYPE)
if(sdl2_target_type STREQUAL "INTERFACE_LIBRARY")
unset(sdl2_target_type)
if(NOT SDL2_FIND_QUIETLY)
message(STATUS "Found SDL2 (found version \"${SDL2_VERSION}\")")
endif()
return()
endif()
unset(sdl2_target_type)
# Extract details for find_package_handle_standard_args
get_target_property(SDL2_LIBRARY SDL2::SDL2 LOCATION)
get_target_property(SDL2_INCLUDE_DIR SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES)

View File

@@ -14,7 +14,7 @@ if(STK_INCLUDE_DIRS)
list(GET STK_INCLUDE_DIRS 0 STK_INCLUDE_DIR)
find_path(STK_RAWWAVE_ROOT
NAMES silence.raw sinewave.raw
HINTS "${STK_INCLUDE_DIR}/.."
HINTS "${STK_INCLUDE_DIR}/.." "${STK_INCLUDE_DIR}/../.."
PATH_SUFFIXES share/stk/rawwaves share/libstk/rawwaves
)
endif()
@@ -22,6 +22,6 @@ endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(STK
REQUIRED_VARS STK_LIBRARY STK_INCLUDE_DIR
REQUIRED_VARS STK_LIBRARY STK_INCLUDE_DIR STK_RAWWAVE_ROOT
# STK doesn't appear to expose its version, so we can't pass it here
)

View File

@@ -24,7 +24,7 @@ check_library_exists(sndio sio_open "${SNDIO_LIBRARY_DIR}" HAVE_SIO_OPEN)
find_path(SNDIO_INCLUDE_DIR sndio.h)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SNDIO DEFAULT_MSG SNDIO_LIBRARY SNDIO_INCLUDE_DIR HAVE_SIO_OPEN)
find_package_handle_standard_args(Sndio DEFAULT_MSG SNDIO_LIBRARY SNDIO_INCLUDE_DIR HAVE_SIO_OPEN)
if(SNDIO_FOUND)
set(SNDIO_INCLUDE_DIRS "${SNDIO_INCLUDE_DIR}")

View File

@@ -11,6 +11,6 @@ find_path(SOUNDIO_INCLUDE_DIR NAMES soundio/soundio.h)
find_library(SOUNDIO_LIBRARY NAMES soundio)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SOUNDIO DEFAULT_MSG SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR)
find_package_handle_standard_args(SoundIo DEFAULT_MSG SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR)
mark_as_advanced(SOUNDIO_INCLUDE_DIR SOUNDIO_LIBRARY)

View File

@@ -0,0 +1,40 @@
# Copyright (c) 2024 Tres Finocchiaro
#
# Redistribution and use is allowed according to the terms of the New BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# This module defines
# Suil_MODULES: List of full paths to Suil modules (e.g. "/usr/lib/suil-0/libsuil_x11.so;...")
# Suil_MODULES_PREFIX: Only the directory name of the Suil_MODULES path (e.g. "suil-0")
pkg_check_modules(Suil QUIET suil-0)
if(Suil_FOUND)
if(APPLE)
set(_lib_ext "dylib")
elseif(WIN32)
set(_lib_ext "dll")
else()
set(_lib_ext "so")
endif()
# Isolate -- if needed -- the first suil library path (e.g. "/usr/lib/libsuil-0.so")
list(GET Suil_LINK_LIBRARIES 0 _lib)
if(EXISTS "${_lib}")
# Isolate -- if needed -- the first suil library name (e.g. "suil-0")
list(GET Suil_LIBRARIES 0 _modules_prefix)
get_filename_component(_lib_dir "${_lib}" DIRECTORY)
# Construct modules path (e.g. "/usr/lib/suil-0")
set(_modules_dir "${_lib_dir}/${_modules_prefix}")
if(IS_DIRECTORY "${_modules_dir}")
set(Suil_MODULES_PREFIX "${_modules_prefix}")
file(GLOB Suil_MODULES "${_modules_dir}/*.${_lib_ext}")
list(SORT Suil_MODULES)
endif()
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SuilModules
REQUIRED_VARS Suil_MODULES Suil_MODULES_PREFIX
)

View File

@@ -2,8 +2,17 @@
# Once done this will define
#
# WINE_FOUND - System has wine
# WINE_INCLUDE_DIRS - The wine include directories
# WINE_DEFINITIONS - Compiler switches required for using wine
#
# WINE_INCLUDE_DIR - Wine include directory
# WINE_BUILD - Path to winebuild
# WINE_CXX - Path to wineg++
# WINE_GCC - Path to winegcc
# WINE_32_LIBRARY_DIRS - Path(s) to 32-bit wine libs
# WINE_32_FLAGS - 32-bit linker flags
# WINE_64_LIBRARY_DIRS - Path(s) to 64-bit wine libs
# WINE_64_FLAGS - 64-bit linker flags
# WINE_VERSION - Wine version
# WINE_ASLR_ENABLED - If binaries will use dynamicbase/ASLR; influenced by wine version and WINE_WANT_ASLR
#
MACRO(_findwine_find_flags output expression result)
@@ -23,17 +32,82 @@ MACRO(_regex_replace_foreach EXPRESSION REPLACEMENT RESULT INPUT)
ENDFOREACH()
ENDMACRO()
LIST(APPEND CMAKE_PREFIX_PATH /opt/wine-stable /opt/wine-devel /opt/wine-staging /usr/lib/wine/)
# Prefer newest wine first
list(APPEND WINE_LOCATIONS
/opt/wine-staging
/opt/wine-devel
/opt/wine-stable
# Gentoo Systems
/etc/eselect/wine
/usr/lib/wine)
FIND_PROGRAM(WINE_CXX
NAMES wineg++ winegcc winegcc64 winegcc32 winegcc-stable
PATHS /usr/lib/wine
# Prepare bin search
foreach(_loc ${WINE_LOCATIONS})
if(_loc STREQUAL /usr/lib/wine)
# /usr/lib/wine doesn't have a "bin"
list(APPEND WINE_CXX_LOCATIONS "${_loc}")
else()
# expect "bin"
list(APPEND WINE_CXX_LOCATIONS "${_loc}/bin")
endif()
endforeach()
# Fallback
list(APPEND WINE_CXX_LOCATIONS "/usr/bin")
# Prefer most-common to least common
FIND_PROGRAM(WINE_CXX NAMES
wineg++
wineg++-stable
PATHS
${WINE_CXX_LOCATIONS}
NO_DEFAULT_PATH
)
FIND_PROGRAM(WINE_BUILD NAMES winebuild)
FIND_PROGRAM(WINE_GCC NAMES
winegcc
winegcc-stable
PATHS
${WINE_CXX_LOCATIONS}
NO_DEFAULT_PATH
)
FIND_PROGRAM(WINE NAMES wine PATHS ${WINE_CXX_LOCATIONS} NO_DEFAULT_PATH)
FIND_PROGRAM(WINE_BUILD NAMES winebuild PATHS ${WINE_CXX_LOCATIONS} NO_DEFAULT_PATH)
# Detect wine version
if(WINE)
# Wine version can be formatted:
# wine-1.4
# wine-6.0.3 (Ubuntu 6.0.3~repack-1)
# wine-9.8 (Staging)
# wine-9.22
execute_process(COMMAND "${WINE}" --version OUTPUT_VARIABLE WINE_VERSION_OUTPUT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "^wine-([^\ \t]+).*$" "\\1" WINE_VERSION "${WINE_VERSION_OUTPUT}")
if(WINE_VERSION VERSION_LESS 8.17)
# Wine versions prior to 8.17 did not use ASLR by default. Assume off.
set(WINE_ASLR_ENABLED false)
elseif(WINE_VERSION VERSION_GREATER_EQUAL 10.14 AND NOT WINE_WANT_ASLR)
# Wine 10.14 introduced the ability to disable ASLR, preventing crashes with older VSTs (See issue #7987)
# Explicitly set '/DYNAMICBASE:NO' per #7987 (effectively setting '/HIGHENTROPYVA:NO' as well for 64-bit)
set(WINE_32_FLAGS "-Wb,--disable-dynamicbase")
set(WINE_64_FLAGS "-Wb,--disable-dynamicbase")
set(WINE_ASLR_ENABLED false)
else()
# Wine versions 8.17 - 10.13 use ASLR by default, but provide no option to disable. Assume on.
set(WINE_ASLR_ENABLED true)
endif()
endif()
# Detect wine paths and handle linking problems
IF(WINE_CXX)
execute_process(COMMAND ${WINE_CXX} -m32 -v /dev/zero OUTPUT_VARIABLE WINEBUILD_OUTPUT_32)
execute_process(COMMAND ${WINE_CXX} -m64 -v /dev/zero OUTPUT_VARIABLE WINEBUILD_OUTPUT_64)
# call wineg++ to obtain implied includes and libs
if(LMMS_HOST_X86_64 OR LMMS_HOST_X86)
execute_process(COMMAND ${WINE_CXX} -m32 -v /dev/zero OUTPUT_VARIABLE WINEBUILD_OUTPUT_32 ERROR_QUIET)
execute_process(COMMAND ${WINE_CXX} -m64 -v /dev/zero OUTPUT_VARIABLE WINEBUILD_OUTPUT_64 ERROR_QUIET)
else()
execute_process(COMMAND ${WINE_CXX} -v /dev/zero OUTPUT_VARIABLE WINEBUILD_OUTPUT_64 ERROR_QUIET)
endif()
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "^-isystem/usr/include$" BUGGED_WINEGCC)
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "^-isystem" WINEGCC_INCLUDE_DIR)
_findwine_find_flags("${WINEBUILD_OUTPUT_32}" "libwinecrt0\\.a.*" WINECRT_32)
@@ -42,6 +116,9 @@ IF(WINE_CXX)
_regex_replace_foreach("/wine/windows$" "" WINE_INCLUDE_HINT "${WINE_INCLUDE_HINT}")
STRING(REGEX REPLACE "wine/libwinecrt0\\.a.*" "" WINE_32_LIBRARY_DIR "${WINECRT_32}")
STRING(REGEX REPLACE "wine/libwinecrt0\\.a.*" "" WINE_64_LIBRARY_DIR "${WINECRT_64}")
# Handle winehq
STRING(REGEX REPLACE "/libwinecrt0\\.a.*" "/" WINE_32_LIBRARY_DIR "${WINE_32_LIBRARY_DIR}")
STRING(REGEX REPLACE "/libwinecrt0\\.a.*" "/" WINE_64_LIBRARY_DIR "${WINE_64_LIBRARY_DIR}")
IF(BUGGED_WINEGCC)
MESSAGE(WARNING "Your winegcc is unusable due to https://bugs.winehq.org/show_bug.cgi?id=46293,\n
@@ -98,25 +175,41 @@ find_package_handle_standard_args(Wine DEFAULT_MSG WINE_CXX WINE_INCLUDE_DIRS)
mark_as_advanced(WINE_INCLUDE_DIR WINE_LIBRARY WINE_CXX WINE_BUILD)
IF(WINE_32_LIBRARY_DIR)
IF(WINE_32_LIBRARY_DIR MATCHES "wine*/lib")
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}../")
IF(WINE_32_LIBRARY_DIR MATCHES "^/opt/wine-.*")
# winehq uses a singular lib directory
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} ${WINE_32_FLAGS}")
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}")
ELSEIF(WINE_32_LIBRARY_DIR MATCHES "wine*/lib")
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}../ ${WINE_32_FLAGS}")
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}/..")
ELSE()
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}wine/")
SET(WINE_32_FLAGS "-L${WINE_32_LIBRARY_DIR} -L${WINE_32_LIBRARY_DIR}wine/ ${WINE_32_FLAGS}")
SET(WINE_32_LIBRARY_DIRS "${WINE_32_LIBRARY_DIR}:${WINE_32_LIBRARY_DIR}wine/")
ENDIF()
ENDIF()
IF(WINE_64_LIBRARY_DIR)
IF(WINE_64_LIBRARY_DIR MATCHES "wine*/lib")
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}../")
IF(WINE_32_LIBRARY_DIR MATCHES "^/opt/wine-.*")
# winehq uses a singular lib directory
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} ${WINE_64_FLAGS}")
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}")
ELSEIF(WINE_64_LIBRARY_DIR MATCHES "wine*/lib")
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}../ ${WINE_64_FLAGS}")
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}/..")
ELSE()
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}wine/")
SET(WINE_64_FLAGS "-L${WINE_64_LIBRARY_DIR} -L${WINE_64_LIBRARY_DIR}wine/ ${WINE_64_FLAGS}")
SET(WINE_64_LIBRARY_DIRS "${WINE_64_LIBRARY_DIR}:${WINE_64_LIBRARY_DIR}wine/")
ENDIF()
ENDIF()
# Create winegcc wrapper
message(STATUS " WINE_INCLUDE_DIR: ${WINE_INCLUDE_DIR}")
message(STATUS " WINE_CXX: ${WINE_CXX}")
message(STATUS " WINE_GCC: ${WINE_GCC}")
message(STATUS " WINE_32_FLAGS: ${WINE_32_FLAGS}")
message(STATUS " WINE_64_FLAGS: ${WINE_64_FLAGS}")
message(STATUS " WINE_VERSION: ${WINE_VERSION}")
message(STATUS " WINE_ASLR_ENABLED: ${WINE_ASLR_ENABLED}")
# Create winegcc (technically, wineg++) wrapper
configure_file(${CMAKE_CURRENT_LIST_DIR}/winegcc_wrapper.in winegcc_wrapper @ONLY)
SET(WINEGCC "${CMAKE_CURRENT_BINARY_DIR}/winegcc_wrapper")

View File

@@ -58,7 +58,7 @@ function(add_gen_qrc RCC_OUT QRC_NAME)
# generators. See issue #6177.
add_custom_command(
OUTPUT "${CPP_FILE}"
COMMAND Qt5::rcc
COMMAND Qt${QT_VERSION_MAJOR}::rcc
--name "${RESOURCE_NAME}"
--output "${CPP_FILE}"
"${QRC_FILE}"

View File

@@ -44,7 +44,7 @@ function(determine_version_from_source _version_out _target _source)
_dvfs_run_result _dvfs_compile_result "${CMAKE_CURRENT_BINARY_DIR}"
SOURCES "${_source_file}"
LINK_LIBRARIES "${_target}"
CXX_STANDARD 17
CXX_STANDARD 20
RUN_OUTPUT_VARIABLE _run_output
COMPILE_OUTPUT_VARIABLE _compile_output
)

View File

@@ -34,10 +34,13 @@ SET(LMMS_PLUGIN_LIST
CrossoverEQ
Delay
Dispersion
Disintegrator
DualFilter
DynamicsProcessor
Eq
Flanger
FrequencyShifter
GranularPitchShifter
HydrogenImport
LadspaBrowser
LadspaEffect
@@ -60,6 +63,7 @@ SET(LMMS_PLUGIN_LIST
Sf2Player
Sfxr
Sid
SlewDistortion
SlicerT
SpectrumAnalyzer
StereoEnhancer
@@ -100,12 +104,3 @@ IF(LIST_PLUGINS)
UNSET(LIST_PLUGINS CACHE)
LIST_ALL_PLUGINS()
ENDIF()
IF(MSVC)
SET(MSVC_INCOMPATIBLE_PLUGINS
LadspaEffect
)
message(WARNING "Compiling with MSVC. The following plugins are not available: ${MSVC_INCOMPATIBLE_PLUGINS}")
LIST(REMOVE_ITEM PLUGIN_LIST ${MSVC_INCOMPATIBLE_PLUGINS})
ENDIF()

View File

@@ -0,0 +1,141 @@
# StaticDependencies.cmake - adds features similar to interface properties that
# are only transitive over static dependencies.
#
# Copyright (c) 2024 Dominic Clark
#
# Redistribution and use is allowed according to the terms of the New BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
define_property(TARGET
PROPERTY STATIC_COMPILE_DEFINITIONS
BRIEF_DOCS "Compile definitions to be used by targets linking statically to this one"
FULL_DOCS "Behaves similarly to INTERFACE_COMPILE_DEFINITIONS, but only over static dependencies."
"Effectively becomes private once an executable module is reached."
)
define_property(TARGET
PROPERTY STATIC_LINK_LIBRARIES
BRIEF_DOCS "Link libraries to be included in targets linking statically to this one"
FULL_DOCS "Behaves similarly to INTERFACE_LINK_LIBRARIES, but only over static dependencies."
"Effectively becomes private once an executable module is reached."
)
# Link a target statically to a set of libraries. Forward the given arguments to
# `target_link_libraries`, but also perform two additional functions. Firstly,
# ensure that the given libraries will be linked into any module that also
# links the given target (allowing, for example, object libraries and private
# static libraries to be used transitively). Secondly, add any static compile
# definitions from the given libraries to the set of compile definitions used
# to build the given target.
#
# This function must be used in order for static requirements as defined in this
# module to be inherited transitively. Using `target_link_libraries` instead
# will break the chain for static link libraries and static compile definitions.
#
# Usage:
# target_static_libraries(
# <target> # The target to which to add the libraries
# [<PRIVATE|PUBLIC|INTERFACE>] # Optionally, the scope to use for the following libraries
# <item>... # The libraries to which to link
# [<PRIVATE|PUBLIC|INTERFACE> <item>...]...
# )
function(target_static_libraries target)
# Target types that have a link step
set(linked_target_types "MODULE_LIBRARY" "SHARED_LIBRARY" "EXECUTABLE")
# Possible scopes for dependencies
set(scopes "PRIVATE" "PUBLIC" "INTERFACE")
get_target_property(target_type "${target}" TYPE)
set(scope "")
# Iterate over the dependencies (and possibly scopes) that we were given
foreach(dependency IN LISTS ARGN)
# If we have a scope, store it so we can apply it to upcoming libraries
if(dependency IN_LIST scopes)
set(scope "${dependency}")
continue()
endif()
# Link the target to the current dependency. (Note: `${scope}` is
# unquoted so that the argument disappears if no scope was given.)
target_link_libraries("${target}" ${scope} "${dependency}")
# Store the dependency so it can be linked in with this target later
set_property(
TARGET "${target}"
APPEND
PROPERTY STATIC_LINK_LIBRARIES
"${dependency}"
)
# If the dependency is a target, it may have some of our custom
# properties defined on it, so we have a bit more work to do
if(TARGET "${dependency}")
# Ensure it makes sense to link statically to this dependency
get_target_property(dependency_type "${dependency}" TYPE)
if(dependency_type IN_LIST linked_target_types)
message(SEND_ERROR "Cannot link statically to shared module ${dependency}")
endif()
# Transitively include static definitions and libraries
set(defs "$<TARGET_GENEX_EVAL:${dependency},$<TARGET_PROPERTY:${dependency},STATIC_COMPILE_DEFINITIONS>>")
set(libs "$<TARGET_GENEX_EVAL:${dependency},$<TARGET_PROPERTY:${dependency},STATIC_LINK_LIBRARIES>>")
set_property(
TARGET "${target}"
APPEND
PROPERTY STATIC_COMPILE_DEFINITIONS
"${defs}"
)
set_property(
TARGET "${target}"
APPEND
PROPERTY STATIC_LINK_LIBRARIES
"${libs}"
)
# Add the dependency's transitive static compile definitions.
# (Note: definitions are private so dynamically linked dependents
# won't pick them up; a static dependent will have them set when
# this function is called for it.)
target_compile_definitions("${target}" PRIVATE "${defs}")
# If the target has a link step, add the transitive static
# dependencies. (Note: we use `LINK_ONLY` so the caller can still
# control usage requirements through the normal use of scopes. Only
# transitive dependencies are needed here: the direct dependency was
# added earlier on. We have to append to `LINK_LIBRARIES` directly,
# rather than use `target_link_libraries(PRIVATE)`, in order to
# remain compatible with the scopeless signature of that command.)
if(target_type IN_LIST linked_target_types)
set_property(
TARGET "${target}"
APPEND
PROPERTY LINK_LIBRARIES
"$<LINK_ONLY:${libs}>"
)
endif()
endif()
endforeach()
endfunction()
# Add compile definitions to a target only for use with dependents linking
# statically to it.
#
# Behaves like `target_compile_definitions(INTERFACE)`, except the definitions
# will not be inherited beyond any executable module into which the target is
# actually linked. The definitions are added to the `STATIC_COMPILE_DEFINITIONS`
# property on the target.
#
# Usage:
# target_static_definitions(
# <target> # The target to which to add the definitions
# <definition>... # The definitions to add to the target
# )
function(target_static_definitions target)
set_property(
TARGET "${target}"
APPEND
PROPERTY STATIC_COMPILE_DEFINITIONS
"${ARGN}"
)
endfunction()

View File

@@ -8,6 +8,18 @@ IF(GIT_FOUND AND NOT FORCE_VERSION)
# number from the environment and add it to the build metadata
if("$ENV{GITHUB_REF}" MATCHES "refs/pull/([0-9]+)/merge")
list(APPEND BUILD_METADATA "pr${CMAKE_MATCH_1}")
# Parse hash from merge description
# e.g. "Merge abc1234 into def4567"
execute_process(
COMMAND "${GIT_EXECUTABLE}" log -n 1 --format=%s
OUTPUT_VARIABLE COMMIT_HASH
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
TIMEOUT 10
OUTPUT_STRIP_TRAILING_WHITESPACE)
# If successful, use the first 7 characters to mimic github's hash style
if(COMMIT_HASH)
string(SUBSTRING "${COMMIT_HASH}" 6 7 COMMIT_HASH)
endif()
endif()
# Look for git tag information (e.g. Tagged: "v1.0.0", Untagged: "v1.0.0-123-a1b2c3d")
@@ -44,7 +56,12 @@ IF(GIT_FOUND AND NOT FORCE_VERSION)
ELSEIF(TAG_LIST_LENGTH EQUAL 3)
# Get the number of commits and latest commit hash
LIST(GET TAG_LIST 1 EXTRA_COMMITS)
LIST(GET TAG_LIST 2 COMMIT_HASH)
# Prefer PR hash from above if present
if(NOT COMMIT_HASH)
list(GET TAG_LIST 2 COMMIT_HASH)
# Mimic github's hash style
string(SUBSTRING "${COMMIT_HASH}" 1 7 COMMIT_HASH)
endif()
list(APPEND PRERELEASE_DATA "${EXTRA_COMMITS}")
list(APPEND BUILD_METADATA "${COMMIT_HASH}")
# Bump the patch version, since a pre-release (as specified by the extra
@@ -57,7 +74,12 @@ IF(GIT_FOUND AND NOT FORCE_VERSION)
# Get the pre-release stage, number of commits, and latest commit hash
LIST(GET TAG_LIST 1 VERSION_STAGE)
LIST(GET TAG_LIST 2 EXTRA_COMMITS)
LIST(GET TAG_LIST 3 COMMIT_HASH)
# Prefer PR hash from above if present
if(NOT COMMIT_HASH)
list(GET TAG_LIST 3 COMMIT_HASH)
# Mimic github's hash style
string(SUBSTRING "${COMMIT_HASH}" 1 7 COMMIT_HASH)
endif()
list(APPEND PRERELEASE_DATA "${VERSION_STAGE}")
list(APPEND PRERELEASE_DATA "${EXTRA_COMMITS}")
list(APPEND BUILD_METADATA "${COMMIT_HASH}")

View File

@@ -1,19 +0,0 @@
#!/bin/bash
set -e
ppa_dir=./ppa/
pushd $ppa_dir
for f in *.deb; do
echo "Extracting $f..."
ar xv "$f"
rm debian-binary
rm control.tar.*
tar xf data.tar.* --exclude=*mingw*/bin/fluid
rm data.tar.*
done
popd
echo "Your extracted files should be located in $ppa_dir"

View File

@@ -1,53 +0,0 @@
#!/bin/bash
# Trusty=14.04, Precise=12.04
PPA_DISTRO=trusty
# Architecture=i386, amd64
PPA_ARCH=amd64
# These shouldn't change
PPA_HOST=http://ppa.launchpad.net
PPA_USER=tobydox
PPA_PROJECT=mingw-x-trusty
PPA_ROOT=$PPA_HOST/$PPA_USER/$PPA_PROJECT/ubuntu
PPA_URL=$PPA_ROOT/dists/$PPA_DISTRO/main/binary-$PPA_ARCH/Packages.gz
ppa_dir=./ppa/
temp_file=/tmp/ppa_listing_$$
temp_temp_file=/tmp/ppa_listing_temp_$$
skip_files="binutils openssl flac libgig libogg libvorbis x-bootstrap zlib"
skip_files="$skip_files x-runtime gcc qt_4 qt5 x-stk pkgconfig"
skip_files="$skip_files glib2 libpng"
echo "Connecting to $PPA_URL to get list of packages..."
wget -qO- $PPA_URL | gzip -d -c | grep "Filename:" > $temp_file
for j in $skip_files ; do
grep -v "$j" $temp_file > $temp_temp_file
mv $temp_temp_file $temp_file
done
line_count=$(wc -l $temp_file |awk '{print $1}')
echo "Found $line_count packages for download..."
echo "Downloading packages. They will be saved to $ppa_dir"
mkdir $ppa_dir
while read -r j
do
echo "Downloading $j..."
echo "$PPA_ROOT/$j"
wget -qO "$ppa_dir$(basename "$j")" "$(echo "$PPA_ROOT/$j" | sed 's/\/Filename: /\//gi')"
done < $temp_file
echo "Cleaning up temporary files..."
rm -rf $temp_file
echo "Packages have been saved to $ppa_dir. Please run extract_debs.sh"

View File

@@ -1,226 +0,0 @@
#!/bin/bash
set -eu
# Git repo information
fork="lmms" # i.e. "lmms" or "tobydox"
branch="master" # i.e. "master" or "stable-1.2"
# Console colors
red="\\x1B[1;31m"
green="\\x1B[1;32m"
yellow="\\x1B[1;33m"
plain="\\x1B[0m"
function info() { echo -e "\n${green}$1${plain}"; }
function warn() { echo -e "\n${yellow}$1${plain}"; }
function err() { echo -e "\n${red}$1${plain}"; exit 1;}
info "Checking for mingw environment"
if ! env | grep MINGW; then
err " - Failed. Please relaunch using MinGW shell"
fi
info "Preparing the git directory..."
mkdir "$HOME/.git" || true
touch "$HOME/.git/config" > /dev/null 2>&1
git config --global http.sslverify false
info "Cloning the repository..."
if [ -d ./lmms ]; then
warn " - Skipping, ./lmms already exists"
else
git clone -b $branch https://github.com/$fork/lmms.git
fi
info "Fetching ppa using cmake/msys/fetch_ppas.sh..."
if [ -d "$HOME/ppa" ]; then
warn " - Skipping, $HOME/ppa already exists"
else
lmms/cmake/msys/fetch_ppa.sh
fi
info "Extracting debs to $HOME/ppa/opt/, etc..."
if [ -d "$HOME/ppa/opt" ]; then
warn " - Skipping, $HOME/ppa/opt already exists"
else
lmms/cmake/msys/extract_debs.sh
fi
info "Preparing library merge, making all qt headers writable..."
chmod u+w /mingw64/include/qt4 -R
chmod u+w /mingw32/include/qt4 -R
info "Merging mingw headers and libraries from ppa over existing system libraries..."
if ! find /mingw64 | grep sndfile.h; then
command cp -r "$HOME/ppa/opt/mingw"* /
else
warn " - Skipping, sndfile.h has already been merged"
fi
fltkver="1.3.3"
oggver="1.3.2"
vorbisver="1.3.5"
flacver="1.3.2"
gigver="4.0.0"
stkver="4.5.1"
mingw_root="/$(echo "$MSYSTEM"|tr '[:upper:]' '[:lower:]')"
info "Downloading and building fltk $fltkver"
if ! command -v fluid; then
wget http://fltk.org/pub/fltk/$fltkver/fltk-$fltkver-source.tar.gz -O "$HOME/fltk-source.tar.gz"
tar zxf "$HOME/fltk-source.tar.gz" -C "$HOME/"
pushd "$HOME/fltk-$fltkver"
info " - Compiling fltk $fltkver..."
./configure --prefix="$mingw_root" --enable-shared
make
info " - Installing fltk..."
make install
# ln -s $mingw_root/usr/local/bin/fluid.exe $mingw_root/bin/fluid.exe
popd
else
warn " - Skipping, fluid binary already exists"
fi
info "Downloading and building libogg $oggver"
if [ ! -e "$mingw_root/lib/libogg.dll.a" ]; then
wget http://downloads.xiph.org/releases/ogg/libogg-$oggver.tar.xz -O "$HOME/libogg-source.tar.xz"
tar xf "$HOME/libogg-source.tar.xz" -C "$HOME/"
pushd "$HOME/libogg-$oggver"
info " - Compiling libogg $oggver..."
./configure --prefix="$mingw_root"
make
info " - Installing libogg..."
make install
# for some reason libgig needs this
./configure --prefix="/opt$mingw_root"
make
info " - Installing libogg..."
make install
popd
else
warn " - Skipping, libogg binary already exists"
fi
info "Downloading and building libvorbis $vorbisver"
if [ ! -e "$mingw_root/lib/libvorbis.dll.a" ]; then
wget http://downloads.xiph.org/releases/vorbis/libvorbis-$vorbisver.tar.xz -O "$HOME/libvorbis-source.tar.xz"
tar xf "$HOME/libvorbis-source.tar.xz" -C "$HOME/"
pushd "$HOME/libvorbis-$vorbisver"
info " - Compiling libvorbis $vorbisver..."
./configure --prefix="$mingw_root"
make
info " - Installing libvorbis..."
make install
# for some reason libgig needs this
./configure --prefix="/opt$mingw_root"
make
info " - Installing libvorbis..."
make install
popd
else
warn " - Skipping, libvorbis binary already exists"
fi
info "Downloading and building flac $flacver"
if [ ! -e "$mingw_root/lib/libFLAC.dll.a" ]; then
wget http://downloads.xiph.org/releases/flac/flac-$flacver.tar.xz -O "$HOME/flac-source.tar.xz"
tar xf "$HOME/flac-source.tar.xz" -C "$HOME/"
pushd "$HOME/flac-$flacver"
info " - Compiling flac $flacver..."
./configure --prefix="$mingw_root"
make
info " - Installing flac..."
make install
# for some reason libgig needs this
./configure --prefix="/opt$mingw_root"
make
info " - Installing flac..."
make install
popd
else
warn " - Skipping, libvorbis flac already exists"
fi
info "Downloading and building libgig $gigver"
if [ ! -e "$mingw_root/lib/libgig/libgig.dll.a" ]; then
wget http://download.linuxsampler.org/packages/libgig-$gigver.tar.bz2 -O "$HOME/gig-source.tar.xz"
tar xf "$HOME/gig-source.tar.xz" -C "$HOME/"
pushd "$HOME/libgig-$gigver"
info " - Compiling libgig $gigver..."
./configure --prefix="$mingw_root"
make
info " - Installing libgig..."
make install
mv "$mingw_root/lib/bin/libakai-0.dll" "$mingw_root/bin"
mv "$mingw_root/lib/bin/libgig-7.dll" "$mingw_root/bin"
popd
else
warn " - Skipping, libgig binary already exists"
fi
info "Downloading and building stk $stkver"
if [ ! -e "$mingw_root/lib/libstk.dll" ]; then
wget http://ccrma.stanford.edu/software/stk/release/stk-$stkver.tar.gz -O "$HOME/stk-source.tar.xz"
tar xf "$HOME/stk-source.tar.xz" -C "$HOME/"
pushd "$HOME/stk-$stkver"
info " - Compiling stk $stkver..."
./configure --prefix="$mingw_root"
make
info " - Installing stk..."
make install
mv "$mingw_root/lib/libstk.so" "$mingw_root/lib/libstk.dll"
mv "$mingw_root/lib/libstk-$stkver.so" "$mingw_root/lib/libstk-$stkver.dll"
popd
else
warn " - Skipping, stk binary already exists"
fi
# make a symlink to make cmake happy
if [ "$mingw_root" = "/mingw64" ]; then
if [ ! -e /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config ]; then
ln -s /usr/bin/pkg-config /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config
fi
elif [ "$mingw_root" = "/mingw32" ]; then
if [ ! -e /opt/mingw32/bin/i686-w64-mingw32-pkg-config ]; then
ln -s /usr/bin/pkg-config /opt/mingw32/bin/i686-w64-mingw32-pkg-config
fi
fi
info "Cleaning up..."
rm -rf "$HOME/fltk-$fltkver"
rm -rf "$HOME/libogg-$oggver"
rm -rf "$HOME/libvorbis-$vorbisver"
rm -rf "$HOME/flac-$flacver"
rm -rf "$HOME/libgig-$gigver"
rm -rf "$HOME/stk-$stkver"
info "Done."

View File

@@ -3,10 +3,9 @@ if(LMMS_MSVC_YEAR)
SET(WIN_PLATFORM "msvc${LMMS_MSVC_YEAR}")
endif()
SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/nsis_branding.bmp")
IF(MSVC)
STRING(REPLACE "/" "\\\\" CPACK_PACKAGE_ICON ${CPACK_PACKAGE_ICON})
ENDIF(MSVC)
# the final slash needs to be flipped for CPACK_PACKAGE_ICON to work:
# https://cmake.org/pipermail/cmake/2008-June/022085.html
SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\nsis_branding.bmp")
SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/icon.ico")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe" PARENT_SCOPE)
SET(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME_UCASE} ${VERSION}" PARENT_SCOPE)
@@ -36,7 +35,11 @@ SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "
" PARENT_SCOPE)
IF(WIN64)
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-${WIN_PLATFORM}-win64")
if(IS_ARM64)
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-${WIN_PLATFORM}-arm64")
else()
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}-${WIN_PLATFORM}-win64")
endif()
SET(CPACK_INSTALL_FIX "$PROGRAMFILES64\\\\${CPACK_PACKAGE_INSTALL_DIRECTORY}\\\\")
SET(CPACK_NSIS_DEFINES "
${CPACK_NSIS_DEFINES}
@@ -44,31 +47,21 @@ IF(WIN64)
")
ENDIF()
# Fix windows paths for msys
IF(LMMS_BUILD_MSYS)
STRING(REPLACE "/" "\\\\" CPACK_PACKAGE_ICON "${CPACK_PACKAGE_ICON}")
STRING(REPLACE "/" "\\\\" CPACK_NSIS_MUI_ICON "${CPACK_NSIS_MUI_ICON}")
STRING(REPLACE "/" "\\\\" CPACK_NSIS_DEFINES "${CPACK_NSIS_DEFINES}")
STRING(REPLACE "/" "\\\\" CMAKE_BINARY_DIR_FIX "${CMAKE_BINARY_DIR}")
# FIXME: there's no easy way to fix $INST_DIR, so we'll redefine it manually
IF(WIN64)
SET(NSIS_ARCH "win64")
ELSE()
SET(NSIS_ARCH "win32")
ENDIF()
SET(CPACK_NSIS_DEFINES "
${CPACK_NSIS_DEFINES}
!define /redef INST_DIR ${CMAKE_BINARY_DIR_FIX}\\\\_CPack_Packages\\\\${NSIS_ARCH}\\\\NSIS\\\\${CPACK_PACKAGE_FILE_NAME}
")
ENDIF()
# Setup missing parent scopes
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}" PARENT_SCOPE)
SET(CPACK_NSIS_DEFINES "${CPACK_NSIS_DEFINES}" PARENT_SCOPE)
SET(CPACK_PACKAGE_ICON "${CPACK_PACKAGE_ICON}" PARENT_SCOPE)
SET(CPACK_NSIS_MUI_ICON "${CPACK_NSIS_MUI_ICON}" PARENT_SCOPE)
# Disable cpack's strip for historic reasons
set(CPACK_STRIP_FILES_ORIG "${CPACK_STRIP_FILES}" PARENT_SCOPE)
set(CPACK_STRIP_FILES FALSE PARENT_SCOPE)
if(CPACK_DEBUG)
# CMake 3.19+
set(CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS "-V4")
endif()
# Windows resource compilers
CONFIGURE_FILE("lmms.rc.in" "${CMAKE_BINARY_DIR}/lmms.rc")
CONFIGURE_FILE("zynaddsubfx.rc.in" "${CMAKE_BINARY_DIR}/plugins/ZynAddSubFx/zynaddsubfx.rc")

View File

@@ -1,4 +0,0 @@
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/MSYS.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win32.cmake)
SET(MINGW_PREFIX /mingw32)

View File

@@ -1,5 +0,0 @@
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/MSYS.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win64.cmake)
SET(MINGW_PREFIX /mingw64)
SET(MINGW_PREFIX32 /mingw32)

View File

@@ -0,0 +1,6 @@
set(WIN64 FALSE)
set(CMAKE_SYSTEM_PROCESSOR i686)
include(${CMAKE_CURRENT_LIST_DIR}/common/MinGW-W64.cmake)

View File

@@ -0,0 +1,9 @@
set(WIN64 TRUE)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_SYSTEM_PROCESSOR32 i686)
set(CMAKE_TOOLCHAIN_FILE_32 "${CMAKE_CURRENT_LIST_DIR}/MinGW-W64-32.cmake")
include(${CMAKE_CURRENT_LIST_DIR}/common/MinGW-W64.cmake)

View File

@@ -1,2 +0,0 @@
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win32.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Ubuntu-MinGW-W64.cmake)

View File

@@ -1,4 +0,0 @@
SET(CMAKE_TOOLCHAIN_FILE_32 "${CMAKE_CURRENT_LIST_DIR}/Ubuntu-MinGW-W64-32.cmake")
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Win64.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Ubuntu-MinGW-W64.cmake)

View File

@@ -1,3 +0,0 @@
SET(MINGW_PREFIX /opt/mingw32)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Ubuntu-MinGW-X-Trusty.cmake)

View File

@@ -1,9 +0,0 @@
SET(MINGW_PREFIX /opt/mingw64)
SET(MINGW_PREFIX32 /opt/mingw32)
SET(WIN64 TRUE)
SET(CMAKE_TOOLCHAIN_FILE_32 "${CMAKE_CURRENT_LIST_DIR}/Ubuntu-MinGW-X-Trusty-32.cmake")
SET(CMAKE_PREFIX_PATH_32 "${MINGW_PREFIX32}")
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/common/Ubuntu-MinGW-X-Trusty.cmake)

View File

@@ -1,22 +0,0 @@
# The target environment
SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX})
SET(CMAKE_INSTALL_PREFIX ${MINGW_PREFIX})
# Windows msys mingw ships with a mostly-suitable preconfigured environment
SET(STRIP ${MINGW_PREFIX}/bin/strip)
SET(CMAKE_RC_COMPILER ${MINGW_PREFIX}/bin/windres)
SET(CMAKE_C_COMPILER ${MINGW_PREFIX}/bin/gcc)
SET(CMAKE_CXX_COMPILER ${MINGW_PREFIX}/bin/g++)
# For 32-bit vst support
IF(WIN64)
# Specify the 32-bit cross compiler
SET(CMAKE_C_COMPILER32 ${MINGW_PREFIX32}/bin/gcc)
SET(CMAKE_CXX_COMPILER32 ${MINGW_PREFIX32}/bin/g++)
ENDIF()
# Msys compiler does not support @CMakeFiles/Include syntax
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
SET(LMMS_BUILD_MSYS 1)

View File

@@ -0,0 +1,24 @@
# Toolchain for MinGW compiler
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_VERSION 1)
set(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set(ENV{PKG_CONFIG} /usr/bin/${TOOLCHAIN_PREFIX}-pkg-config)
if(WIN64)
set(TOOLCHAIN_PREFIX32 ${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32)
set(CMAKE_C_COMPILER32 ${TOOLCHAIN_PREFIX32}-gcc)
set(CMAKE_CXX_COMPILER32 ${TOOLCHAIN_PREFIX32}-g++)
endif()
# Search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# Search for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

View File

@@ -1,17 +0,0 @@
# Toolchain for Ubuntu MinGw compiler shipped with the mingw-w64 and
# g++-mingw-w64 packages
SET(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
SET(ENV{PKG_CONFIG} /usr/bin/${TOOLCHAIN_PREFIX}-pkg-config)
IF(WIN64)
SET(TOOLCHAIN_PREFIX32 ${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32)
SET(CMAKE_C_COMPILER32 ${TOOLCHAIN_PREFIX32}-gcc)
SET(CMAKE_CXX_COMPILER32 ${TOOLCHAIN_PREFIX32}-g++)
ENDIF()
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/WinCrossCompile.cmake)

View File

@@ -1,58 +0,0 @@
IF(WIN64)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/Win64.cmake)
ELSE()
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/Win32.cmake)
ENDIF()
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/WinCrossCompile.cmake)
# The target environment
SET(CMAKE_FIND_ROOT_PATH ${MINGW_PREFIX})
SET(CMAKE_INSTALL_PREFIX ${MINGW_PREFIX})
# Linux mingw requires explicitly defined tools to prevent clash with native system tools
SET(MINGW_TOOL_PREFIX ${MINGW_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-)
# Specify the cross compiler
SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc)
SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++)
SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}windres)
# Mingw tools
SET(STRIP ${MINGW_TOOL_PREFIX}strip)
SET(ENV{PKG_CONFIG} ${MINGW_TOOL_PREFIX}pkg-config)
# For 32-bit vst support
IF(WIN64)
# Specify the 32-bit cross compiler
SET(MINGW_TOOL_PREFIX32 ${MINGW_PREFIX32}/bin/${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32-)
SET(CMAKE_C_COMPILER32 ${MINGW_TOOL_PREFIX32}gcc)
SET(CMAKE_CXX_COMPILER32 ${MINGW_TOOL_PREFIX32}g++)
ENDIF()
INCLUDE_DIRECTORIES(${MINGW_PREFIX}/include)
LINK_DIRECTORIES(${MINGW_PREFIX}/lib ${MINGW_PREFIX}/bin)
# Qt tools
SET(QT_BINARY_DIR ${MINGW_PREFIX}/bin)
SET(QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake)
# Echo modified cmake vars to screen for debugging purposes
IF(NOT DEFINED ENV{MINGW_DEBUG_INFO})
MESSAGE("")
MESSAGE("Custom cmake vars: (blank = system default)")
MESSAGE("-----------------------------------------")
MESSAGE("* CMAKE_C_COMPILER : ${CMAKE_C_COMPILER}")
MESSAGE("* CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}")
MESSAGE("* CMAKE_RC_COMPILER : ${CMAKE_RC_COMPILER}")
MESSAGE("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}")
MESSAGE("* MINGW_TOOL_PREFIX32 : ${MINGW_TOOL_PREFIX32}")
MESSAGE("* CMAKE_C_COMPILER32 : ${CMAKE_C_COMPILER32}")
MESSAGE("* CMAKE_CXX_COMPILER32 : ${CMAKE_CXX_COMPILER32}")
MESSAGE("* STRIP : ${STRIP}")
MESSAGE("* QT_BINARY_DIR : ${QT_BINARY_DIR}")
MESSAGE("* QT_QMAKE_EXECUTABLE : ${QT_QMAKE_EXECUTABLE}")
MESSAGE("")
# So that the debug info only appears once
SET(ENV{MINGW_DEBUG_INFO} SHOWN)
ENDIF()

View File

@@ -1,6 +0,0 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSTEM_PROCESSOR i686)
SET(WIN64 FALSE)

View File

@@ -1,7 +0,0 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
SET(CMAKE_SYSTEM_PROCESSOR32 i686)
SET(WIN64 TRUE)

View File

@@ -1,9 +0,0 @@
# Required by cmake if `uname -s` is inadaquate
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_VERSION 1)
# Search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# For libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,5 +1,5 @@
SET(QT_LUPDATE_EXECUTABLE "${Qt5_LUPDATE_EXECUTABLE}")
SET(QT_LRELEASE_EXECUTABLE "${Qt5_LRELEASE_EXECUTABLE}")
SET(QT_LUPDATE_EXECUTABLE "${Qt${QT_VERSION_MAJOR}_LUPDATE_EXECUTABLE}")
SET(QT_LRELEASE_EXECUTABLE "${Qt${QT_VERSION_MAJOR}_LRELEASE_EXECUTABLE}")
IF(QT_LUPDATE_EXECUTABLE STREQUAL "")
EXECUTE_PROCESS(COMMAND "lupdate" "-help" RESULT_VARIABLE LUPDATE_FALLBACK OUTPUT_QUIET)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More