mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-29 02:51:24 +00:00
add a little visual to channel names
This commit is contained in:
parent
73dd66b439
commit
d1e166a34e
5 changed files with 24 additions and 2 deletions
|
@ -4911,6 +4911,9 @@ void DivEngine::play() {
|
|||
} else {
|
||||
stepPlay=0;
|
||||
}
|
||||
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||
keyHit[i]=false;
|
||||
}
|
||||
isBusy.unlock();
|
||||
}
|
||||
|
||||
|
@ -4921,6 +4924,9 @@ void DivEngine::playToRow(int row) {
|
|||
sPreview.pos=0;
|
||||
freelance=false;
|
||||
playSub(false,row);
|
||||
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||
keyHit[i]=false;
|
||||
}
|
||||
isBusy.unlock();
|
||||
}
|
||||
|
||||
|
@ -4929,6 +4935,9 @@ void DivEngine::stepOne(int row) {
|
|||
if (!isPlaying()) {
|
||||
freelance=false;
|
||||
playSub(false,row);
|
||||
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||
keyHit[i]=false;
|
||||
}
|
||||
}
|
||||
stepPlay=2;
|
||||
ticks=1;
|
||||
|
@ -6322,6 +6331,7 @@ bool DivEngine::init() {
|
|||
|
||||
for (int i=0; i<DIV_MAX_CHANS; i++) {
|
||||
isMuted[i]=0;
|
||||
keyHit[i]=false;
|
||||
}
|
||||
|
||||
oscBuf[0]=new float[32768];
|
||||
|
|
|
@ -223,6 +223,7 @@ class DivEngine {
|
|||
DivSystem sysOfChan[DIV_MAX_CHANS];
|
||||
int dispatchOfChan[DIV_MAX_CHANS];
|
||||
int dispatchChanOfChan[DIV_MAX_CHANS];
|
||||
bool keyHit[DIV_MAX_CHANS];
|
||||
float* oscBuf[2];
|
||||
float oscSize;
|
||||
|
||||
|
|
|
@ -731,6 +731,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
|||
chan[i].portaNote=chan[i].note;
|
||||
} else if (!chan[i].noteOnInhibit) {
|
||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,chan[i].note,chan[i].volume>>8));
|
||||
keyHit[i]=true;
|
||||
}
|
||||
}
|
||||
chan[i].doNote=false;
|
||||
|
@ -871,6 +872,7 @@ bool DivEngine::nextTick(bool noAccum) {
|
|||
if (note.on) {
|
||||
dispatchCmd(DivCommand(DIV_CMD_INSTRUMENT,note.channel,note.ins,1));
|
||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,note.channel,note.note));
|
||||
keyHit[note.channel]=true;
|
||||
chan[note.channel].noteOnInhibit=true;
|
||||
} else {
|
||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,note.channel));
|
||||
|
@ -901,6 +903,7 @@ bool DivEngine::nextTick(bool noAccum) {
|
|||
if (--chan[i].retrigTick<0) {
|
||||
chan[i].retrigTick=chan[i].retrigSpeed-1;
|
||||
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,DIV_NOTE_NULL));
|
||||
keyHit[i]=true;
|
||||
}
|
||||
}
|
||||
if (chan[i].volSpeed!=0) {
|
||||
|
|
|
@ -3061,9 +3061,15 @@ void FurnaceGUI::drawPattern() {
|
|||
ImVec4 chanHead=muted?uiColors[GUI_COLOR_CHANNEL_MUTED]:uiColors[GUI_COLOR_CHANNEL_FM+e->getChannelType(i)];
|
||||
ImVec4 chanHeadActive=chanHead;
|
||||
ImVec4 chanHeadHover=chanHead;
|
||||
chanHead.x*=0.25; chanHead.y*=0.25; chanHead.z*=0.25;
|
||||
if (e->keyHit[i]) {
|
||||
keyHit[i]=0.2;
|
||||
e->keyHit[i]=false;
|
||||
}
|
||||
chanHead.x*=0.25+keyHit[i]; chanHead.y*=0.25+keyHit[i]; chanHead.z*=0.25+keyHit[i];
|
||||
chanHeadActive.x*=0.8; chanHeadActive.y*=0.8; chanHeadActive.z*=0.8;
|
||||
chanHeadHover.x*=0.4; chanHeadHover.y*=0.4; chanHeadHover.z*=0.4;
|
||||
chanHeadHover.x*=0.4+keyHit[i]; chanHeadHover.y*=0.4+keyHit[i]; chanHeadHover.z*=0.4+keyHit[i];
|
||||
keyHit[i]-=0.02;
|
||||
if (keyHit[i]<0) keyHit[i]=0;
|
||||
ImGui::PushStyleColor(ImGuiCol_Header,chanHead);
|
||||
ImGui::PushStyleColor(ImGuiCol_HeaderActive,chanHeadActive);
|
||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered,chanHeadHover);
|
||||
|
|
|
@ -342,6 +342,8 @@ class FurnaceGUI {
|
|||
std::deque<UndoStep> undoHist;
|
||||
std::deque<UndoStep> redoHist;
|
||||
|
||||
float keyHit[DIV_MAX_CHANS];
|
||||
|
||||
void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size);
|
||||
void drawFMEnv(unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, const ImVec2& size);
|
||||
|
||||
|
|
Loading…
Reference in a new issue