Skip to content
Open
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
359 changes: 358 additions & 1 deletion src/config.cpp

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ namespace OMC

// old
OMC_MODEL _model;
bool isSyncingStereoLink = false;

bool GetLinkChannels(MP_ID mp, uint index, uint& leftChannel, uint& rightChannel);
void SyncLinkedParameter(MP_ID mp, uint index);

public:

Expand Down Expand Up @@ -102,6 +106,11 @@ namespace OMC
void Refresh(MP_ID mp, uint index = 0);
void Reset(MP_ID mp, uint index = 0);

bool GetPeerVChannel(uint index, uint& peerIndex);
bool IsRightChannelOfLinkedPair(uint index);
bool IsStereoLinkedMainRouted(uint index);
void ApplyStereoPanWidth(uint index);

MP_ID ParameterCalcId(SurfaceBindingParameter* binding_parameter);
uint ParameterCalcIndex(SurfaceBindingParameter* binding_parameter);
MP_ID ParameterDependsOn(SurfaceBindingParameter* binding_parameter);
Expand Down Expand Up @@ -180,4 +189,3 @@ namespace OMC
vector<X32ConfigFileEntry> entries;
};
}

7 changes: 7 additions & 0 deletions src/ctrl-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "page-setup.h"
#include "page-setup-card.h"
#include "page-setup-surface.h"
#include "page-setup-mixer-config.h"
#include "page-debug.h"
#include "page-about.h"
#include "page-scenes.h"
Expand Down Expand Up @@ -361,6 +362,7 @@ void CtrlClient::InitPagesAndGUI()
pages[X32_PAGE::SETUP] = new PageSetup(pagebasepar);
pages[X32_PAGE::SETUP_CARD] = new PageSetupCard(pagebasepar);
pages[X32_PAGE::SETUP_SURFACE] = new PageSetupSurface(pagebasepar);
pages[X32_PAGE::SETUP_MIXER_CONFIG] = new PageSetupMixerConfig(pagebasepar);
pages[X32_PAGE::ABOUT] = new PageAbout(pagebasepar);
pages[X32_PAGE::DEBUG] = new PageDebug(pagebasepar);
pages[X32_PAGE::PROTOTYPEGUI] = new PagePrototypeGui(pagebasepar);
Expand Down Expand Up @@ -501,6 +503,11 @@ void CtrlClient::syncGuiOrLcd() {
// sync mixer state to Surface
void CtrlClient::syncSurface(bool fullSync)
{
if (config->HasParametersChanged({CHANNEL_LINKED, BUS_LINKED, MATRIX_LINKED}))
{
surface->UpdateStereoBanks();
}

// ######################################
//
// Check, if banking has changed
Expand Down
11 changes: 10 additions & 1 deletion src/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ enum class X32_PAGE :int
// sub-pages of setup
SETUP_CARD,
SETUP_SURFACE,
SETUP_MIXER_CONFIG,
ABOUT,
DEBUG,
PROTOTYPEGUI,
Expand Down Expand Up @@ -478,6 +479,14 @@ enum class MP_ID {
DMX_ARTNET_VALUE,
//DMX_ARTNET_OFFSET,

// Stereo-link configuration. Keep these at the end so existing scene
// files retain the numeric IDs of all established parameters.
CHANNEL_LINKED,
BUS_LINKED,
MATRIX_LINKED,
CHANNEL_STEREO_PAN,
CHANNEL_STEREO_WIDTH,

__ELEMENT_COUNTER_DO_NOT_MOVE
};

Expand Down Expand Up @@ -1202,4 +1211,4 @@ enum class OMCBankTarget
BusSection,

WING_COMPACT,
};
};
7 changes: 6 additions & 1 deletion src/mixerparameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ namespace OMC
{
using enum MP_UOM;

if (parameter_id == MP_ID::CHANNEL_STEREO_WIDTH && value_float == 0.0f)
{
return "Mono";
}

if (unitOfMeasurement == PERCENT) {
value_float *= 100.0f;
}
Expand Down Expand Up @@ -506,4 +511,4 @@ namespace OMC
// check that values are the same
CHECK(metervalue == metervalue_received);
}
}
}
6 changes: 3 additions & 3 deletions src/page-about.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ namespace OMC
class PageAbout: public Page {
public:
PageAbout(PageBaseParameter* pagebasepar) : Page(pagebasepar) {
prevPage = X32_PAGE::SETUP_SURFACE;
prevPage = X32_PAGE::SETUP_MIXER_CONFIG;
nextPage = X32_PAGE::DEBUG;
tabLayer0 = objects.maintab;
tabIndex0 = 3;
tabLayer1 = objects.setuptab;
tabIndex1 = 3;
tabIndex1 = 4;
hideEncoders = true;
}
};

}
}
4 changes: 2 additions & 2 deletions src/page-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PageDebug: public Page
tabLayer0 = objects.maintab;
tabIndex0 = 3;
tabLayer1 = objects.setuptab;
tabIndex1 = 4;
tabIndex1 = 5;

osc_client = new OscClient(pagebasepar);
}
Expand Down Expand Up @@ -142,4 +142,4 @@ class PageDebug: public Page
}
};

}
}
45 changes: 38 additions & 7 deletions src/page-main.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ class PageMain : public Page

uint bankingSends = 0;
uint bankingSendsBefore = 0;
bool stereoControlsBound = false;

void BindMainEncoders()
{
bool stereo = config->IsStereoLinkedMainRouted(config->GetUint(SELECTED_CHANNEL));

config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_1, MixerparameterAction::CHANGE_SELECTED_CHANNEL, CHANNEL_VOLUME);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_BUTTON_1, MixerparameterAction::TOGGLE_SELECTED_CHANNEL, CHANNEL_SEND_LR);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_2, MixerparameterAction::CHANGE_SELECTED_CHANNEL, stereo ? CHANNEL_STEREO_PAN : CHANNEL_PANORAMA);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_BUTTON_2, MixerparameterAction::RESET_SELECTED_CHANNEL, stereo ? CHANNEL_STEREO_PAN : CHANNEL_PANORAMA);

if (stereo)
{
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_3, MixerparameterAction::CHANGE_SELECTED_CHANNEL, CHANNEL_STEREO_WIDTH);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_BUTTON_3, MixerparameterAction::RESET_SELECTED_CHANNEL, CHANNEL_STEREO_WIDTH);
}
else
{
config->SurfaceUnbind(SurfaceElementId::DISPLAY_ENCODER_3);
config->SurfaceUnbind(SurfaceElementId::DISPLAY_ENCODER_BUTTON_3);
}

config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_4, MixerparameterAction::CHANGE_SELECTED_CHANNEL, CHANNEL_VOLUME_SUB);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_BUTTON_4, MixerparameterAction::TOGGLE_SELECTED_CHANNEL, CHANNEL_SEND_SUB);
stereoControlsBound = stereo;
}

public:

Expand All @@ -29,13 +55,18 @@ class PageMain : public Page

void OnShow() override
{
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_1, MixerparameterAction::CHANGE_SELECTED_CHANNEL, CHANNEL_VOLUME);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_BUTTON_1, MixerparameterAction::TOGGLE_SELECTED_CHANNEL, CHANNEL_SEND_LR);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_2, MixerparameterAction::CHANGE_SELECTED_CHANNEL, CHANNEL_PANORAMA);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_BUTTON_2, MixerparameterAction::RESET_SELECTED_CHANNEL, CHANNEL_PANORAMA);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_4, MixerparameterAction::CHANGE_SELECTED_CHANNEL, CHANNEL_VOLUME_SUB);
config->SurfaceBind(SurfaceElementId::DISPLAY_ENCODER_BUTTON_4, MixerparameterAction::TOGGLE_SELECTED_CHANNEL, CHANNEL_SEND_SUB);
BindMainEncoders();
}

void OnChange(bool force_update) override
{
bool stereo = config->IsStereoLinkedMainRouted(config->GetUint(SELECTED_CHANNEL));
if (force_update || stereo != stereoControlsBound ||
config->HasParametersChanged({CHANNEL_LINKED, BUS_LINKED, CHANNEL_SEND_LR}))
{
BindMainEncoders();
}
}
};

}
}
4 changes: 2 additions & 2 deletions src/page-prototypegui.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PagePrototypeGui: public Page
tabLayer0 = objects.maintab;
tabIndex0 = 3;
tabLayer1 = objects.setuptab;
tabIndex1 = 5;
tabIndex1 = 6;
}

void OnInit() override
Expand All @@ -45,4 +45,4 @@ class PagePrototypeGui: public Page
}
};

}
}
33 changes: 22 additions & 11 deletions src/page-routing-channels.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ class PageRoutingChannels: public Page
int gui_selected_item = 0;
int gui_selected_item_before = 0;
bool page_routing_dsp1_table_drawn = false;

String GetDestinationName(uint index)
{
String name = index < 32 ? String("Channel ") + String(index + 1) :
String("Aux ") + String(index - 31);
uint peerIndex = 0;
if (config->GetPeerVChannel(index, peerIndex))
{
name += index < peerIndex ? " [ST L]" : " [ST R]";
}
return name;
}

static void draw_event_header_cb(lv_event_t * e) {
lv_draw_task_t * draw_task = lv_event_get_draw_task(e);
Expand Down Expand Up @@ -181,16 +193,7 @@ class PageRoutingChannels: public Page
lv_table_set_column_width(objects.table_routing_dsp_input, 4, 200);
for (uint8_t i = 0; i < 40; i++)
{
String inputChannelName;
if (((i + 1) >= DSP_BUF_IDX_DSPCHANNEL) && ((i + 1) < (DSP_BUF_IDX_DSPCHANNEL + 32)))
{
inputChannelName = String("Channel ") + (i + 1);

}
else if (((i + 1) >= DSP_BUF_IDX_AUX) && ((i + 1) < (DSP_BUF_IDX_AUX + 8)))
{
inputChannelName = String("Aux ") + (i + 1 - 32);
}
String inputChannelName = GetDestinationName(i);

lv_table_set_cell_value(objects.table_routing_dsp_input, i, 0, (config->GetParameter(ROUTING_FPGA)->GetFormatedValue(72 + i) + " -> " + config->GetParameter(ROUTING_DSP_INPUT)->GetFormatedValue(i)).c_str());
lv_table_set_cell_value(objects.table_routing_dsp_input, i, 2, config->GetParameter(ROUTING_DSP_INPUT_TAPPOINT)->GetFormatedValue(i).c_str());
Expand Down Expand Up @@ -220,6 +223,14 @@ class PageRoutingChannels: public Page
void OnChange(bool force) override
{
UpdateRowSelection();

if (config->HasParameterChanged(CHANNEL_LINKED) || force)
{
for (uint index = 0; index < 40; index++)
{
lv_table_set_cell_value(objects.table_routing_dsp_input, index, 4, GetDestinationName(index).c_str());
}
}

if(config->HasParametersChanged({ROUTING_DSP_INPUT, ROUTING_DSP_INPUT_TAPPOINT}) || force)
{
Expand Down Expand Up @@ -276,4 +287,4 @@ class PageRoutingChannels: public Page
}
};

}
}
Loading