IanCaio e2bb606341 Fixes createTCO method on some classes (#5699)
* Fixes createTCO method on some classes

	Classes that inherit from "Track", also inherit the createTCO method. That method takes a MidiTime position as an argument, but except on the class SampleTrack that argument was ignored. That lead to unnecessary calls to TCO->movePosition after creating a TCO in many parts of the codebase (making the argument completely redundant) and even to a bug on the BBEditor, caused by a call to createTCO that expected the position to be set on the constructor (see issue #5673).

	That PR adds code to move the TCO to the appropriate position inside the constructor of the classes that didn't have it, fixes the code style on the SampleTrack createTCO method and removes the now unneeded calls to movePosition from source files on src/ and plugins/. On Track::loadSettings there was a call to saveJournallingState(false) followed immediately by restoreJournallingState() which was deleted because it's redundant (probably a left over from copying the code from pasteSelection?).

* Fix code style issues

	Fixes code style issues on some files (except for ones where the current statements already had a different code style. In those the used code style was kept for consistency).

* Fixes more code style issues

* Fixes code style issues on the parameter name

	Fixes code style issue on the parameter name of createTCO, where _pos was supposed to be just pos. The existing code had the old style and I ended up replicating it on the other methods.

* Code style fixes

	Fixes code style in the changed lines.

* Fixes bug with dragging to negative positions

	There was a bug (already present before this PR) where dragging
a selection before MidiTime 0 would result in some TCOs being placed on
negative positions. This PR fixes this bug by applying the following
changes:

	1) TrackContentObject::movePosition now moves the TCO to
positions equal or above 0 only.
	2) Because of the previous change, I removed the line that
calculated the max value between 0 and the new position on
TrackContentObjectView::mouseMoveEvent when dragging a single TCO (and
added a line updating the value to the real new position of the TCO so
the label displays the position correctly).
	3) Unrelated to this bug, but removed an unnecessary call to
TrackContentWidget::changePosition on the left resize of sample TCOs
because it will already be called when movePosition triggers the
positionChanged signal.
	4) Added some logic to the TrackContentWidget::pasteSelection
method to find the left most TCO being pasted and make sure that the
offset is corrected so it doesn't end up on a negative position (similar
to the logic for the MoveSelection action).
	5) Removed another line that calculated the max between 0 and
the new position on Track::removeBar since it's now safe to call
movePosition with negative values.

* Uses std::max instead of a conditional statement

	As suggested by Spekular, we use std::max instead of a
conditional statement to correct the value of offset if it positions a
TCO on a negative position.
2020-11-07 13:54:04 +01:00
2020-09-24 17:59:07 +02:00
2020-09-24 17:59:07 +02:00
2016-03-26 14:23:22 +08:00
2018-03-07 23:54:28 +09:00
2020-10-30 13:34:15 -04:00
2020-10-30 21:52:32 +01:00
2020-04-04 12:08:55 +09:00
2020-07-05 11:27:33 +09:00
2020-10-31 13:28:18 +00:00
2019-06-25 03:37:14 +02:00
2018-09-15 09:32:29 -04:00
2020-11-01 00:37:38 -04:00
2019-09-15 21:08:33 +09:00
2020-07-05 11:27:33 +09:00
2020-11-03 13:13:59 -05:00
2020-09-17 18:24:54 +02:00

LMMS Logo LMMS

Build status Latest stable release Overall downloads on Github Join the chat at Discord Localise on transifex

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
Downloads/Releases
Developer Wiki
Artist & User Wiki/Documentation
Sound Demos
LMMS Sharing Platform Share your songs!

Features

  • Song-Editor for composing songs
  • A Beat+Bassline-Editor for creating beats and basslines
  • An easy-to-use Piano-Roll for editing patterns and melodies
  • An FX mixer with unlimited FX 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
  • MIDI file importing and exporting

Building

See Compiling LMMS on our wiki for information on how to build LMMS.

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!

Information about what you can do and how can be found in the wiki.

Before coding a new big feature, please always file an issue 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.

Description
No description provided
Readme 160 MiB
Languages
C++ 87.6%
C 6.5%
CMake 3.5%
CSS 1%
HTML 0.9%
Other 0.4%