Abstraction in MixerChannelView (#7057)
Reduce code repetition in `MixerChannelView` by introducing methods that: * Retrieve the `MixerChannel` that's associated with the view * Check if the associated channel is the master channel This abstracts some functionality and also reduces direct usage of the variable `m_channelIndex`.
This commit is contained in:
committed by
GitHub
parent
d945ac1cbe
commit
85399c12c2
@@ -38,6 +38,11 @@
|
||||
#include <QPixmap>
|
||||
#include <QWidget>
|
||||
|
||||
namespace lmms
|
||||
{
|
||||
class MixerChannel;
|
||||
}
|
||||
|
||||
namespace lmms::gui
|
||||
{
|
||||
constexpr int MIXER_CHANNEL_INNER_BORDER_SIZE = 3;
|
||||
@@ -100,6 +105,8 @@ namespace lmms::gui
|
||||
|
||||
private:
|
||||
QString elideName(const QString& name);
|
||||
MixerChannel* mixerChannel() const;
|
||||
auto isMasterChannel() const -> bool { return m_channelIndex == 0; }
|
||||
|
||||
private:
|
||||
SendButtonIndicator* m_sendButton;
|
||||
|
||||
Reference in New Issue
Block a user