Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions sources/Application/Views/MixerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
#include "Application/Utils/char.h"
#include "Application/Utils/mathutils.h"
#include "UIController.h"
#include <Application/AppWindow.h>
#include <string>

#define CHANNELS_X_OFFSET_ 3 // stride between each channel

MixerView::MixerView(GUIWindow &w, ViewData *viewData)
: FieldView(w, viewData), needsPlayTimeUpdate_(false),
needsNotesUpdate_(false) {
: FieldView(w, viewData) {

// Initialize the channel volume fields
initChannelVolumeFields();
Expand Down Expand Up @@ -242,6 +242,17 @@ void MixerView::initChannelVolumeFields() {
}
}

// Add master volume field to the right of channel volumes
GUIPoint masterPos = position;
// Position to the right of channel volumes
masterPos._x += (SONG_CHANNEL_COUNT * CHANNELS_X_OFFSET_);

Variable *v = project->FindVariable(FourCC::VarMasterVolume);
if (v) {
masterVolumeField_.emplace_back(masterPos, *v, "%2.2d", 0, 100, 1, 5);
fieldList_.insert(fieldList_.end(), &(*masterVolumeField_.begin()));
}

// Set focus to the first field if we have any fields
if (!fieldList_.empty()) {
SetFocus(*fieldList_.begin());
Expand Down Expand Up @@ -311,6 +322,15 @@ void MixerView::DrawView() {
drawNotes();
drawMasterVuMeter(player, props);

// Draw master volume label
GUIPoint labelPos = GetAnchor();
// Align with master volume control
labelPos._x += (SONG_CHANNEL_COUNT * CHANNELS_X_OFFSET_);
labelPos._y = SCREEN_HEIGHT - 3; // Position below the volume control
SetColor(CD_HILITE2);
DrawString(labelPos._x, labelPos._y, "MB", props);
SetColor(CD_NORMAL);

if (player->IsRunning()) {
OnPlayerUpdate(PET_UPDATE);
};
Expand Down
1 change: 1 addition & 0 deletions sources/Application/Views/MixerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class MixerView : public FieldView {

// Channel volume UI fields
etl::vector<UIIntVarField, SONG_CHANNEL_COUNT> channelVolumeFields_;
etl::vector<UIIntVarField, 1> masterVolumeField_; // Master volume field

// Flags to track which UI elements need updating
// These prevent core1 from directly updating the UI
Expand Down