@@ -253,44 +253,38 @@ InputMixButton* ModelInputsPage::createLineButton(InputMixGroup *group,
|
|||||||
menu->addLine(STR_EDIT, [=]() {
|
menu->addLine(STR_EDIT, [=]() {
|
||||||
uint8_t idx = button->getIndex();
|
uint8_t idx = button->getIndex();
|
||||||
editInput(input, idx);
|
editInput(input, idx);
|
||||||
_copyMode = 0;
|
|
||||||
});
|
});
|
||||||
if (!reachExposLimit()) {
|
if (!reachExposLimit()) {
|
||||||
menu->addLine(STR_INSERT_BEFORE, [=]() {
|
if (this->_copyMode != 0) {
|
||||||
uint8_t idx = button->getIndex();
|
|
||||||
insertInput(input, idx);
|
|
||||||
_copyMode = 0;
|
|
||||||
});
|
|
||||||
menu->addLine(STR_INSERT_AFTER, [=]() {
|
|
||||||
uint8_t idx = button->getIndex();
|
|
||||||
insertInput(input, idx + 1);
|
|
||||||
_copyMode = 0;
|
|
||||||
});
|
|
||||||
menu->addLine(STR_COPY, [=]() {
|
|
||||||
_copyMode = COPY_MODE;
|
|
||||||
_copySrc = button;
|
|
||||||
});
|
|
||||||
if (_copyMode != 0) {
|
|
||||||
menu->addLine(STR_PASTE_BEFORE, [=]() {
|
menu->addLine(STR_PASTE_BEFORE, [=]() {
|
||||||
uint8_t idx = button->getIndex();
|
uint8_t idx = button->getIndex();
|
||||||
pasteInputBefore(idx);
|
pasteInputBefore(idx);
|
||||||
_copyMode = 0;
|
|
||||||
});
|
});
|
||||||
menu->addLine(STR_PASTE_AFTER, [=]() {
|
menu->addLine(STR_PASTE_AFTER, [=]() {
|
||||||
uint8_t idx = button->getIndex();
|
uint8_t idx = button->getIndex();
|
||||||
pasteInputAfter(idx);
|
pasteInputAfter(idx);
|
||||||
_copyMode = 0;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
menu->addLine(STR_INSERT_BEFORE, [=]() {
|
||||||
|
uint8_t idx = button->getIndex();
|
||||||
|
insertInput(input, idx);
|
||||||
|
});
|
||||||
|
menu->addLine(STR_INSERT_AFTER, [=]() {
|
||||||
|
uint8_t idx = button->getIndex();
|
||||||
|
insertInput(input, idx + 1);
|
||||||
|
});
|
||||||
|
menu->addLine(STR_COPY, [=]() {
|
||||||
|
this->_copyMode = COPY_MODE;
|
||||||
|
this->_copySrc = button;
|
||||||
|
});
|
||||||
|
menu->addLine(STR_MOVE, [=]() {
|
||||||
|
this->_copyMode = MOVE_MODE;
|
||||||
|
this->_copySrc = button;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
menu->addLine(STR_MOVE, [=]() {
|
|
||||||
_copyMode = MOVE_MODE;
|
|
||||||
_copySrc = button;
|
|
||||||
});
|
|
||||||
menu->addLine(STR_DELETE, [=]() {
|
menu->addLine(STR_DELETE, [=]() {
|
||||||
uint8_t idx = button->getIndex();
|
uint8_t idx = button->getIndex();
|
||||||
deleteInput(idx);
|
deleteInput(idx);
|
||||||
_copyMode = 0;
|
|
||||||
});
|
});
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
@@ -356,6 +350,8 @@ void ModelInputsPage::addLineButton(mixsrc_t src, uint8_t index)
|
|||||||
|
|
||||||
void ModelInputsPage::editInput(uint8_t input, uint8_t index)
|
void ModelInputsPage::editInput(uint8_t input, uint8_t index)
|
||||||
{
|
{
|
||||||
|
_copyMode = 0;
|
||||||
|
|
||||||
auto group = getGroupBySrc(MIXSRC_FIRST_INPUT + input);
|
auto group = getGroupBySrc(MIXSRC_FIRST_INPUT + input);
|
||||||
if (!group) return;
|
if (!group) return;
|
||||||
|
|
||||||
@@ -380,6 +376,8 @@ void ModelInputsPage::insertInput(uint8_t input, uint8_t index)
|
|||||||
|
|
||||||
void ModelInputsPage::deleteInput(uint8_t index)
|
void ModelInputsPage::deleteInput(uint8_t index)
|
||||||
{
|
{
|
||||||
|
_copyMode = 0;
|
||||||
|
|
||||||
auto group = getGroupByIndex(index);
|
auto group = getGroupByIndex(index);
|
||||||
if (!group) return;
|
if (!group) return;
|
||||||
|
|
||||||
@@ -408,8 +406,11 @@ void ModelInputsPage::pasteInput(uint8_t dst_idx, uint8_t input)
|
|||||||
addLineButton(dst_idx);
|
addLineButton(dst_idx);
|
||||||
|
|
||||||
if (_copyMode == MOVE_MODE) {
|
if (_copyMode == MOVE_MODE) {
|
||||||
|
src_idx = _copySrc->getIndex();
|
||||||
deleteInput(src_idx);
|
deleteInput(src_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_copyMode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _inputChnFromIndex(uint8_t index)
|
static int _inputChnFromIndex(uint8_t index)
|
||||||
|
|||||||
@@ -342,44 +342,38 @@ InputMixButton* ModelMixesPage::createLineButton(InputMixGroup *group, uint8_t i
|
|||||||
menu->addLine(STR_EDIT, [=]() {
|
menu->addLine(STR_EDIT, [=]() {
|
||||||
uint8_t idx = button->getIndex();
|
uint8_t idx = button->getIndex();
|
||||||
editMix(ch, idx);
|
editMix(ch, idx);
|
||||||
_copyMode = 0;
|
|
||||||
});
|
});
|
||||||
if (!reachMixesLimit()) {
|
if (!reachMixesLimit()) {
|
||||||
menu->addLine(STR_INSERT_BEFORE, [=]() {
|
if (this->_copyMode != 0) {
|
||||||
uint8_t idx = button->getIndex();
|
|
||||||
insertMix(ch, idx);
|
|
||||||
_copyMode = 0;
|
|
||||||
});
|
|
||||||
menu->addLine(STR_INSERT_AFTER, [=]() {
|
|
||||||
uint8_t idx = button->getIndex();
|
|
||||||
insertMix(ch, idx + 1);
|
|
||||||
_copyMode = 0;
|
|
||||||
});
|
|
||||||
menu->addLine(STR_COPY, [=]() {
|
|
||||||
_copyMode = COPY_MODE;
|
|
||||||
_copySrc = button;
|
|
||||||
});
|
|
||||||
if (_copyMode != 0) {
|
|
||||||
menu->addLine(STR_PASTE_BEFORE, [=]() {
|
menu->addLine(STR_PASTE_BEFORE, [=]() {
|
||||||
uint8_t idx = button->getIndex();
|
uint8_t idx = button->getIndex();
|
||||||
pasteMixBefore(idx);
|
pasteMixBefore(idx);
|
||||||
_copyMode = 0;
|
|
||||||
});
|
});
|
||||||
menu->addLine(STR_PASTE_AFTER, [=]() {
|
menu->addLine(STR_PASTE_AFTER, [=]() {
|
||||||
uint8_t idx = button->getIndex();
|
uint8_t idx = button->getIndex();
|
||||||
pasteMixAfter(idx);
|
pasteMixAfter(idx);
|
||||||
_copyMode = 0;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
menu->addLine(STR_INSERT_BEFORE, [=]() {
|
||||||
|
uint8_t idx = button->getIndex();
|
||||||
|
insertMix(ch, idx);
|
||||||
|
});
|
||||||
|
menu->addLine(STR_INSERT_AFTER, [=]() {
|
||||||
|
uint8_t idx = button->getIndex();
|
||||||
|
insertMix(ch, idx + 1);
|
||||||
|
});
|
||||||
|
menu->addLine(STR_COPY, [=]() {
|
||||||
|
this->_copyMode = COPY_MODE;
|
||||||
|
this->_copySrc = button;
|
||||||
|
});
|
||||||
|
menu->addLine(STR_MOVE, [=]() {
|
||||||
|
this->_copyMode = MOVE_MODE;
|
||||||
|
this->_copySrc = button;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
menu->addLine(STR_MOVE, [=]() {
|
|
||||||
_copyMode = MOVE_MODE;
|
|
||||||
_copySrc = button;
|
|
||||||
});
|
|
||||||
menu->addLine(STR_DELETE, [=]() {
|
menu->addLine(STR_DELETE, [=]() {
|
||||||
uint8_t idx = button->getIndex();
|
uint8_t idx = button->getIndex();
|
||||||
deleteMix(idx);
|
deleteMix(idx);
|
||||||
_copyMode = 0;
|
|
||||||
});
|
});
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
@@ -429,6 +423,8 @@ void ModelMixesPage::newMix()
|
|||||||
|
|
||||||
void ModelMixesPage::editMix(uint8_t channel, uint8_t index)
|
void ModelMixesPage::editMix(uint8_t channel, uint8_t index)
|
||||||
{
|
{
|
||||||
|
_copyMode = 0;
|
||||||
|
|
||||||
auto line = getLineByIndex(index);
|
auto line = getLineByIndex(index);
|
||||||
if (!line) return;
|
if (!line) return;
|
||||||
|
|
||||||
@@ -446,6 +442,8 @@ void ModelMixesPage::editMix(uint8_t channel, uint8_t index)
|
|||||||
|
|
||||||
void ModelMixesPage::insertMix(uint8_t channel, uint8_t index)
|
void ModelMixesPage::insertMix(uint8_t channel, uint8_t index)
|
||||||
{
|
{
|
||||||
|
_copyMode = 0;
|
||||||
|
|
||||||
::insertMix(index, channel);
|
::insertMix(index, channel);
|
||||||
addLineButton(MIXSRC_CH1 + channel, index);
|
addLineButton(MIXSRC_CH1 + channel, index);
|
||||||
editMix(channel, index);
|
editMix(channel, index);
|
||||||
@@ -453,6 +451,8 @@ void ModelMixesPage::insertMix(uint8_t channel, uint8_t index)
|
|||||||
|
|
||||||
void ModelMixesPage::deleteMix(uint8_t index)
|
void ModelMixesPage::deleteMix(uint8_t index)
|
||||||
{
|
{
|
||||||
|
_copyMode = 0;
|
||||||
|
|
||||||
auto group = getGroupByIndex(index);
|
auto group = getGroupByIndex(index);
|
||||||
if (!group) return;
|
if (!group) return;
|
||||||
|
|
||||||
@@ -481,8 +481,11 @@ void ModelMixesPage::pasteMix(uint8_t dst_idx, uint8_t channel)
|
|||||||
addLineButton(dst_idx);
|
addLineButton(dst_idx);
|
||||||
|
|
||||||
if (_copyMode == MOVE_MODE) {
|
if (_copyMode == MOVE_MODE) {
|
||||||
deleteInput(src_idx);
|
src_idx = _copySrc->getIndex();
|
||||||
|
deleteMix(src_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_copyMode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _mixChnFromIndex(uint8_t index)
|
static int _mixChnFromIndex(uint8_t index)
|
||||||
|
|||||||
Reference in New Issue
Block a user