Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Scalable envelope graph #7194

Merged

Commits on Apr 5, 2024

  1. Scalable envelope graph

    Remove the setting of a fixed size from the envelope graph and only set a minimum size.
    
    Adjust the painting code of the envelope so that it does not assume fixed widths and heights anymore.
    
    The new code is more or less divided into two parts. The first part calculates `QPointF` instances for the different points. In the second part these points are then used to draw the lines and markers. This makes the actual rendering code much more straight forward, readable and maintainable.
    
    The interpolation between the line color of an inactive and an active envelope has also been restructured so that it is much more obvious that we are doing an interpolation in the first place. The colors at both ends of the interpolation are explicit now and can therefore be adjusted much easier. The actual color interpolation is done in the new helper function `interpolateInRgb` which might be moved elsewhere later if needed.
    
    The line is rendered as a polyline instead of single line segments.
    
    The drawing of the markers has been abstracted into a lambda (with some outside captures though) so that it can be easily adjusted if necessary. The markers are rendered as circles instead of rectangles because that looks much nicer especially when the widget is rendered at a larger size.
    
    The width of the lines and marker outlines is determined using the size of the widget so that it scales with the size.
    
    A `lerp` function has been added to `lmms_math.h`.
    michaelgregorius committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    701af7c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1c8ca85 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2024

  1. Add new scaling modes

    Add the two new scaling modes "Dynamic" and "Relative" so that there are three modes now:
    * "Dynamic": This modes corresponds to the rendering strategy of the previous implementation. Initially 80/182 of the available width is used as the maximum width per segment. This can be interpreted like a "zoomed" version of the absolute mode. If the needed space becomes larger than the full width though then it falls back to relative rendering.
    * "Absolute": Each of the five segments is assigned 1/5 of the available width. The envelopes will always fit but might appear small depending of the current settings. This is a good mode to compare envelopes though.
    * "Relative": If there is at least one non-zero segment then the whole width is always used to present the envelope.
    
    The default scaling mode is "Dynamic".
    
    Add a context menu to the graph what can be used to set the current scaling mode.
    michaelgregorius committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    de1c4a9 View commit details
    Browse the repository at this point in the history
  2. Introduce ColorHelper

    Move the function `interpolateInRgb` into the new class `ColorHelper` as it will later also be needed when the LFO graph is made scalable.
    michaelgregorius committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    05082b1 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2024

  1. Code review changes

    michaelgregorius committed Apr 9, 2024
    Configuration menu
    Copy the full SHA
    af4672b View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2024

  1. Configuration menu
    Copy the full SHA
    26d260e View commit details
    Browse the repository at this point in the history