new demo song
by ALTMUS
This commit is contained in:
parent
bb2b2e1cc6
commit
13b56870ec
16 changed files with 802 additions and 74 deletions
|
|
@ -300,50 +300,23 @@ void FurnaceGUI::drawOsc() {
|
|||
}
|
||||
|
||||
if ((oscWidth-24)>0) {
|
||||
if (settings.oscMono) {
|
||||
if (rend->supportsDrawOsc() && settings.shaderOsc) {
|
||||
_do.gui=this;
|
||||
_do.data=&oscValuesAverage[12];
|
||||
_do.len=oscWidth-24;
|
||||
_do.pos0=inRect.Min;
|
||||
_do.pos1=inRect.Max;
|
||||
_do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE];
|
||||
_do.lineSize=dpiScale*settings.oscLineSize;
|
||||
|
||||
dl->AddCallback(_drawOsc,&_do);
|
||||
dl->AddCallback(ImDrawCallback_ResetRenderState,NULL);
|
||||
} else {
|
||||
for (int i=0; i<oscWidth-24; i++) {
|
||||
float x=(float)i/(float)(oscWidth-24);
|
||||
float y=oscValuesAverage[i+12]*0.5f;
|
||||
if (!settings.oscEscapesBoundary) {
|
||||
if (y<-0.5f) y=-0.5f;
|
||||
if (y>0.5f) y=0.5f;
|
||||
}
|
||||
waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y));
|
||||
}
|
||||
|
||||
if (settings.oscEscapesBoundary) {
|
||||
dl->PushClipRectFullScreen();
|
||||
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
|
||||
dl->PopClipRect();
|
||||
} else {
|
||||
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
|
||||
}
|
||||
}
|
||||
if (!e->isPlaying() && fullView) {
|
||||
ImVec2 point0=inRect.Min;
|
||||
ImVec2 point1=inRect.Max;
|
||||
point0.y=0;
|
||||
point1.y=canvasH;
|
||||
dl->PushClipRectFullScreen();
|
||||
dl->AddRectFilled(point0,point1,color,0,ImDrawFlags_None);
|
||||
dl->PopClipRect();
|
||||
} else {
|
||||
for (int ch=0; ch<e->getAudioDescGot().outChans; ch++) {
|
||||
if (!isClipping) {
|
||||
color=ImGui::GetColorU32(uiColors[GUI_COLOR_OSC_WAVE_CH0+ch]);
|
||||
}
|
||||
|
||||
if (settings.oscMono) {
|
||||
if (rend->supportsDrawOsc() && settings.shaderOsc) {
|
||||
_do.gui=this;
|
||||
_do.data=&oscValues[ch][12];
|
||||
_do.data=&oscValuesAverage[12];
|
||||
_do.len=oscWidth-24;
|
||||
_do.pos0=inRect.Min;
|
||||
_do.pos1=inRect.Max;
|
||||
_do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE_CH0+ch];
|
||||
_do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE];
|
||||
_do.lineSize=dpiScale*settings.oscLineSize;
|
||||
|
||||
dl->AddCallback(_drawOsc,&_do);
|
||||
|
|
@ -351,7 +324,7 @@ void FurnaceGUI::drawOsc() {
|
|||
} else {
|
||||
for (int i=0; i<oscWidth-24; i++) {
|
||||
float x=(float)i/(float)(oscWidth-24);
|
||||
float y=oscValues[ch][i+12]*oscZoom;
|
||||
float y=oscValuesAverage[i+12]*0.5f;
|
||||
if (!settings.oscEscapesBoundary) {
|
||||
if (y<-0.5f) y=-0.5f;
|
||||
if (y>0.5f) y=0.5f;
|
||||
|
|
@ -359,7 +332,6 @@ void FurnaceGUI::drawOsc() {
|
|||
waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y));
|
||||
}
|
||||
|
||||
|
||||
if (settings.oscEscapesBoundary) {
|
||||
dl->PushClipRectFullScreen();
|
||||
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
|
||||
|
|
@ -368,6 +340,44 @@ void FurnaceGUI::drawOsc() {
|
|||
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int ch=0; ch<e->getAudioDescGot().outChans; ch++) {
|
||||
if (!isClipping) {
|
||||
color=ImGui::GetColorU32(uiColors[GUI_COLOR_OSC_WAVE_CH0+ch]);
|
||||
}
|
||||
|
||||
if (rend->supportsDrawOsc() && settings.shaderOsc) {
|
||||
_do.gui=this;
|
||||
_do.data=&oscValues[ch][12];
|
||||
_do.len=oscWidth-24;
|
||||
_do.pos0=inRect.Min;
|
||||
_do.pos1=inRect.Max;
|
||||
_do.color=isClipping?uiColors[GUI_COLOR_OSC_WAVE_PEAK]:uiColors[GUI_COLOR_OSC_WAVE_CH0+ch];
|
||||
_do.lineSize=dpiScale*settings.oscLineSize;
|
||||
|
||||
dl->AddCallback(_drawOsc,&_do);
|
||||
dl->AddCallback(ImDrawCallback_ResetRenderState,NULL);
|
||||
} else {
|
||||
for (int i=0; i<oscWidth-24; i++) {
|
||||
float x=(float)i/(float)(oscWidth-24);
|
||||
float y=oscValues[ch][i+12]*oscZoom;
|
||||
if (!settings.oscEscapesBoundary) {
|
||||
if (y<-0.5f) y=-0.5f;
|
||||
if (y>0.5f) y=0.5f;
|
||||
}
|
||||
waveform[i]=ImLerp(inRect.Min,inRect.Max,ImVec2(x,0.5f-y));
|
||||
}
|
||||
|
||||
|
||||
if (settings.oscEscapesBoundary) {
|
||||
dl->PushClipRectFullScreen();
|
||||
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
|
||||
dl->PopClipRect();
|
||||
} else {
|
||||
dl->AddPolyline(waveform,oscWidth-24,color,ImDrawFlags_None,dpiScale*settings.oscLineSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue