giga-refactor, part 13
get rid of time base
This commit is contained in:
parent
334d8708e2
commit
663f32d9d4
9 changed files with 43 additions and 35 deletions
|
|
@ -1295,16 +1295,14 @@ void FurnaceGUI::prepareLayout() {
|
|||
float FurnaceGUI::calcBPM(const DivGroovePattern& speeds, float hz, int vN, int vD) {
|
||||
float hl=e->curSubSong->hilightA;
|
||||
if (hl<=0.0f) hl=4.0f;
|
||||
float timeBase=e->curSubSong->timeBase+1;
|
||||
float speedSum=0;
|
||||
for (int i=0; i<MIN(16,speeds.len); i++) {
|
||||
speedSum+=speeds.val[i];
|
||||
}
|
||||
speedSum/=MAX(1,speeds.len);
|
||||
if (timeBase<1.0f) timeBase=1.0f;
|
||||
if (speedSum<1.0f) speedSum=1.0f;
|
||||
if (vD<1) vD=1;
|
||||
return (60.0f*hz/(timeBase*hl*speedSum))*(float)vN/(float)vD;
|
||||
return (60.0f*hz/(hl*speedSum))*(float)vN/(float)vD;
|
||||
}
|
||||
|
||||
void FurnaceGUI::play(int row) {
|
||||
|
|
|
|||
|
|
@ -198,9 +198,11 @@ void FurnaceGUI::drawSpeed(bool asChild) {
|
|||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
/*
|
||||
ImGui::AlignTextToFramePadding();
|
||||
ImGui::Text(_("Divider"));
|
||||
ImGui::Text(_("Divider"));*/
|
||||
ImGui::TableNextColumn();
|
||||
/*
|
||||
ImGui::SetNextItemWidth(halfAvail);
|
||||
unsigned char realTB=e->curSubSong->timeBase+1;
|
||||
if (ImGui::InputScalar("##TimeBase",ImGuiDataType_U8,&realTB,&_ONE,&_THREE)) { MARK_MODIFIED
|
||||
|
|
@ -210,6 +212,7 @@ void FurnaceGUI::drawSpeed(bool asChild) {
|
|||
recalcTimestamps=true;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
*/
|
||||
ImGui::Text("%.2f BPM",calcBPM(e->curSubSong->speeds,e->curSubSong->hz,e->curSubSong->virtualTempoN,e->curSubSong->virtualTempoD));
|
||||
|
||||
ImGui::TableNextRow();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue