Moves the confirmation to remove mixer channels outside of `MixerView::deleteChannel` and into `MixerChannelView::removeChannel`. This is so that the confirmation only applies when the user uses the context menu to remove a channel, which is important since no confirmation should apply when, for example, the mixer view is cleared with calls to `MixerView::clear`.
* Fix mixer channel updates on solo/mute
Fix the update of the mixer channels whenever a channel is soloed or muted.
The solution is rather "brutal" as it updates all mixer channel views when one of the models changes.
Introduce private helper method `MixerView::updateAllMixerChannels`. It calls the `update` method on each `MixerChannelView` so that they can get repainted.
Call `updateAllMixerChannels` at the end of the existing method `toggledSolo`.
Introduce a new method `MixerView::toggledMute` which is called whenever the mute model of a channel changes. It also updates all mixer channels.
Fixes#7054.
* Improve mixer channel update for mute events
Improve the mixer channel update for mute events by not delegating to `MixerView` like for the solo case. Instead the `MixerChannelView` now has its own `toggledMute` slot which simply updates the widget on changes to the mute model.
Also fix `MixerChannelView::setChannelIndex` by disconnecting from the signals of the previous mixer channel and connecting to the signals for the new one.
Remove `toggledMute` from `MixerView`.
The solo implementation is kept as is because it also triggers changes to the core model. So the chain seems to be:
* Solo button clicked in mixer channel view
* Button changes solo model
* Solo model signals to mixer view which was connected via the mixer channel view
* Mixer view performs changes in the other core models
* All mixer channels are updated.
Are better chain would first update the core models and then update the GUI from the changes:
* Solo button clicked in mixer channel view
* Button changes solo model
* Solo model signals to core mixer, i.e. not a view!
* Mixer view performs changes in the other core models
* Changed models emit signal to GUI elements
* Revert "Improve mixer channel update for mute events"
This reverts commit ede65963ea.
* Add comment
After the revert done with commit the code is more consistent again but not in a good way. Hence a comment is added which indicates that an inprovement is needed.
* Abstract mixer retrieval
Abstract the retrieval of the mixer behind the new method `getMixer`. This is done in preparation for some dependency injection so that the `MixerView` does not have to ask the `Engine` for the mixer but gets it injected, a.k.a. the "Hollywood principle": "Don't call us, we'll call you."
It's called `getMixer` and not just mixer because it allows for locale variables to be called `mixer` without confusing it with the method.
* Let MixerView connect directly to models
Let the `MixerView` connect directly to the solo and mute models it is connected with.
Remove the connections that are made in `MixerChannelView` which acted as a proxy which only complicated things.
Add `connectToSoloAndMute` which connects the `MixerView` to the solo and mute models of a given channel. Call it whenever a new channel is created.
Add `disconnectFromSoloAndMute` which disconnects the `MixerView` from the solo and mute models of a given channel. Call it when a channel is deleted.
* Code cleanup
Cleanup code related to the creation of the master channel view.
* Inject the Mixer into the MixerView
Inject the `Mixer` into the `MixerView` via the constructor. This makes it more explicit that the `Mixer` is the model of the view. It also implements the "Dependency Inversion Principle" in that the `MIxerView` does not have to ask the `Engine` for the `Mixer` anymore.
The current changes should be safe in that the `Mixer` instance is static and does not change.
* Fix connections on song load
Disconnect and reconnect in `MixerView::refreshDisplay` which is called when a song is loaded.
Use Qt layouts for the mixer channels. These changes will enable several other improvements, like for example making the mixer and faders resizable, adding peak indicators, etc.
This is a squash commit which consists of the following individual commits:
* Remove extra transparency in send/receive arrows
The extra transparency was conflicting with the positioning of
the arrows in the layout
* Begin reimplementing MixerChannelView
MixerChannelView is now a combination of the
MixerLine with the previous MixerChannelView
* Adjust SendButtonIndicator to use MixerChannelView
* Remove MixerLine
- Move MixerChannelView into src/gui
* Remove MixerView::MixerChannelView
* Remove header of MixerLine
* Change MixerView.h to use MixerChannelView
Change MixerView.h to use MixerChannelView rather than MixerLine
Also do some cleanup, such as removing an unused forward declaration
of QButtonGroup
* Create EffectRackView
+ Set height of sizeHint() using MIXER_CHANNEL_HEIGHT (287)
* Remove include of MixerLine
- Include MixerChannelView
* Phase 1: Adjust MixerView to use new MixerChannelView
* Move children wigets into header file
* Phase 2: Adjust MixerView to use new MixerChannelView
* Phase 3: Adjust MixerView to use new MixerChannelView
* Phase 4: Adjust MixerView to use new MixerChannelView
* Phase 5: Adjust MixerView to use new MixerChannelView
* Phase 5: Adjust MixerView to use new MixerChannelView
* Remove places where MixerChannelView is being deleted
Before, MixerChannelView was not inherited by QWidget,
meaning it could not have a parent and had to be deleted
when necessary. Since the MixerView owns the
new MixerChannelView, this is no longer necessary.
* Replace MixerLine with MixerChannelView
- Include MixerChannelView in MixerView
* Replace setCurrentMixerLine calls with setCurrentMixerChannel around codebase
* Add event handlers in MixerChannelView
* Implement MixerChannelView::eventFilter
* Update theme styles to use MixerChannelView
* Add QColor properties from style
- Set the Qt::WA_StyledBackground attribute on
* Add effect rack to rack layout when adding channel
* Set size for MixerChannelView
- Change nullptr to this for certain widgets
- Some custom widgets may expect there to be a parent
- Add spacing in channel layout
- Increase size of mixer channel
* Retain size when widgets are hidden
* Implement paintEvent
- Rename states in SendReceiveState
* Implement send/receive arrow toggling
- Make maxTextHeight constexpr in elideName
- Remove background changing on mouse press
(is now handled in paintEvent)
* Implement renaming mixer channels
* Implement color functions
* Implement channel moving/removing functions
* Do some cleanup
Not sure if that connection with the mute model was needed, but removing
it did not seem to introduce any issues.
* Include cassert
* Replace references to MixerLine with MixerChannelView
* Reduce height
+ Make m_renameLineEdit transparent
+ Retain size when LCD is hidden
+ Remove stretch after renameLineEdit in layout
* Remove trailing whitespace
* Make m_renameLineEdit read only
+ Transpose m_renameLineEditView rectangle (with 5px offset)
* Set spacing in channel layout back to 0
* Remove sizeHint override and constant size
* Use sizeHint for mixerChannelSize
+ Leave auto fill background to false in MixerChannelView
+ Only set width for EffectRackView
* Set margins to 4 on all sides in MixerChannelView
* Move solo and mute closer to each other
Move the solo and mute buttons closer to each other in the mixer channels.
Technically this is accomplished by putting them into their own layout with minimal margins and spacing.
* Fixes for CodeFactor
* Code review changes
Mostly whitespace and formatting changes: remove tabs, remove spaces in parameter lists, remove underscores from parameter names.
Some lines have been shortened by introducing intermediate variables, e.g. in `MixerChannelView`.
`MixerView` has many changes but only related to whitespace. Spaces have been introduced for if and for statements. Whitespace at round braces has been removed everywhere in the implementation file even if a line was not touched by the intial changes.
Remove duplicate forward declaration of `MixerChannelView`.
* Adjust parameter order in MixerChannelView's constructor
Make the parent `QWidget` the first parameter as it is a Qt convention. The default parameter had to be removed due to this.
* Move styling of rename line edit into style sheets
Move the style of the `QGraphicsView` for the rename line edit from the code into the style sheets of the default and classic theme.
* More code review changes
Fix spaces between types and references/pointers, e.g. use `const QBrush& c` instead of `const QBrush & c`.
Remove underscores from parameter names.
Remove spaces near parentheses.
Replace tabs with spaces.
Introduce intermediate variable to resolve "hanging" + operator.
Replace the connection for the periodic fader updates with one that uses function pointers instead of `SIGNAL` and `SLOT`.
---------
Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
* Add confirm removal on mixer channels
Add confirm removal popup when the user calls the action "remove channel" on a mixer channel that is in use (receives audio from other channel or track). Set a config variable to keep track if the user don't want to be asked again. Adding a scroll on settings-general tab because there weren't enough space on the area.
* Core Mixer function channel in use
New core Mixer function to check if a given channel is in use (receives audio)
---------
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Co-authored-by: saker <sakertooth@Gmail.com>
This PR places all LMMS symbols into namespaces to eliminate any potential future name collisions between LMMS and third-party modules.
Also, this PR changes back `LmmsCore` to `Engine`, reverting c519921306 .
Co-authored-by: allejok96 <allejok96@gmail.com>