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:
Michael Gregorius
2024-01-13 22:03:03 +01:00
committed by GitHub
parent d945ac1cbe
commit 85399c12c2
2 changed files with 24 additions and 12 deletions

View File

@@ -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;