-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Tidy up MixerChannelView
#7527
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
Merged
sakertooth
merged 13 commits into
LMMS:master
from
sakertooth:tidy-up-mixer-channel-view
Nov 3, 2024
Merged
Tidy up MixerChannelView
#7527
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f2e7b75
Fix copyright
sakertooth db0fb90
Fix header guards
sakertooth c1a9595
Inline property getters/setters
sakertooth a526e7c
Inline more functions
sakertooth 09b169f
Move constexpr definitions into class
sakertooth 1dec14f
Remove extraneous code from paintEvent
sakertooth a1a0bce
Fix unused variable warnings
sakertooth c927d62
Move reset function back into cpp file
sakertooth 3a6f1f3
Remove PeakIndicator.h include and add forward declaration
sakertooth 6b556fa
Move inner border size and outer border size into paintEvent function
sakertooth 7fe0851
Merge remote-tracking branch 'upstream/master' into tidy-up-mixer-cha…
sakertooth 50482c6
Set name inside textbox when moving to a new channel
sakertooth ff2b178
Elide name
sakertooth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| /* | ||
| * MixerChannelView.h - the mixer channel view | ||
| * MixerChannelView.h | ||
| * | ||
| * Copyright (c) 2022 saker <[email protected]> | ||
| * Copyright (c) 2024 saker | ||
| * | ||
| * This file is part of LMMS - https://lmms.io | ||
| * | ||
|
|
@@ -22,8 +22,8 @@ | |
| * | ||
| */ | ||
|
|
||
| #ifndef MIXER_CHANNEL_VIEW_H | ||
| #define MIXER_CHANNEL_VIEW_H | ||
| #ifndef LMMS_GUI_MIXER_CHANNEL_VIEW_H | ||
| #define LMMS_GUI_MIXER_CHANNEL_VIEW_H | ||
|
|
||
| #include <QGraphicsView> | ||
| #include <QLabel> | ||
|
|
@@ -38,16 +38,14 @@ | |
| #include "LcdWidget.h" | ||
| #include "PixmapButton.h" | ||
| #include "SendButtonIndicator.h" | ||
| #include "PeakIndicator.h" | ||
|
|
||
| namespace lmms { | ||
| class MixerChannel; | ||
| } | ||
|
|
||
| namespace lmms::gui { | ||
| class PeakIndicator; | ||
|
|
||
| constexpr int MIXER_CHANNEL_INNER_BORDER_SIZE = 3; | ||
| constexpr int MIXER_CHANNEL_OUTER_BORDER_SIZE = 1; | ||
|
|
||
| class MixerChannelView : public QWidget | ||
| { | ||
|
|
@@ -58,32 +56,34 @@ class MixerChannelView : public QWidget | |
| Q_PROPERTY(QColor strokeInnerActive READ strokeInnerActive WRITE setStrokeInnerActive) | ||
| Q_PROPERTY(QColor strokeInnerInactive READ strokeInnerInactive WRITE setStrokeInnerInactive) | ||
| public: | ||
| static constexpr auto InnerBorderSize = 3; | ||
| static constexpr auto OuterBorderSize = 1; | ||
|
|
||
| MixerChannelView(QWidget* parent, MixerView* mixerView, int channelIndex); | ||
| void paintEvent(QPaintEvent* event) override; | ||
| void contextMenuEvent(QContextMenuEvent*) override; | ||
| void mousePressEvent(QMouseEvent*) override; | ||
| void mouseDoubleClickEvent(QMouseEvent*) override; | ||
| bool eventFilter(QObject* dist, QEvent* event) override; | ||
|
|
||
| int channelIndex() const; | ||
| void reset() { m_peakIndicator->resetPeakToMinusInf(); } | ||
sakertooth marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| int channelIndex() const { return m_channelIndex; } | ||
| void setChannelIndex(int index); | ||
|
|
||
| QBrush backgroundActive() const; | ||
| void setBackgroundActive(const QBrush& c); | ||
|
|
||
| QColor strokeOuterActive() const; | ||
| void setStrokeOuterActive(const QColor& c); | ||
| QBrush backgroundActive() const { return m_backgroundActive; } | ||
| void setBackgroundActive(const QBrush& c) { m_backgroundActive = c; } | ||
|
|
||
| QColor strokeOuterInactive() const; | ||
| void setStrokeOuterInactive(const QColor& c); | ||
| QColor strokeOuterActive() const { return m_strokeOuterActive; } | ||
| void setStrokeOuterActive(const QColor& c) { m_strokeOuterActive = c; } | ||
|
|
||
| QColor strokeInnerActive() const; | ||
| void setStrokeInnerActive(const QColor& c); | ||
| QColor strokeOuterInactive() const { return m_strokeOuterInactive; } | ||
| void setStrokeOuterInactive(const QColor& c) { m_strokeOuterInactive = c; } | ||
|
|
||
| QColor strokeInnerInactive() const; | ||
| void setStrokeInnerInactive(const QColor& c); | ||
| QColor strokeInnerActive() const { return m_strokeInnerActive; } | ||
| void setStrokeInnerActive(const QColor& c) { m_strokeInnerActive = c; } | ||
|
|
||
| void reset(); | ||
| QColor strokeInnerInactive() const { return m_strokeInnerInactive; } | ||
| void setStrokeInnerInactive(const QColor& c) { m_strokeInnerInactive = c; } | ||
|
|
||
| public slots: | ||
| void renameChannel(); | ||
|
|
@@ -135,4 +135,4 @@ private slots: | |
| }; | ||
| } // namespace lmms::gui | ||
|
|
||
| #endif // MIXER_CHANNEL_VIEW_H | ||
| #endif // LMMS_GUI_MIXER_CHANNEL_VIEW_H | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.