center tuning and more

This commit is contained in:
Ryzerth
2020-12-08 16:27:52 +01:00
parent 7ba6081cb3
commit 16d8a31c12
9 changed files with 49 additions and 7 deletions

View File

@ -164,7 +164,7 @@ void SinkManager::setStreamSink(std::string name, std::string providerName) {
spdlog::warn("setStreamSink is NOT implemented!!!");
}
void SinkManager::showVolumeSlider(std::string name, std::string prefix, float width, float btnHeight, int btwBorder) {
void SinkManager::showVolumeSlider(std::string name, std::string prefix, float width, float btnHeight, int btwBorder, bool sameLine) {
// TODO: Replace map with some hashmap for it to be faster
float height = ImGui::GetTextLineHeightWithSpacing() + 2;
float sliderHeight = height;
@ -185,6 +185,7 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w
ImGui::SetCursorPosY(ypos + ((height - sliderHeight) / 2.0f) + btwBorder);
ImGui::SliderFloat((prefix + name).c_str(), &dummy, 0.0f, 1.0f, "");
style::endDisabled();
if (sameLine) { ImGui::SetCursorPosY(ypos); }
return;
}
@ -221,6 +222,7 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w
saveStreamConfig(name);
core::configManager.release(true);
}
if (sameLine) { ImGui::SetCursorPosY(ypos); }
//ImGui::SetCursorPosY(ypos);
}

View File

@ -99,7 +99,7 @@ public:
void setStreamSink(std::string name, std::string providerName);
void showVolumeSlider(std::string name, std::string prefix, float width, float btnHeight = -1.0f, int btwBorder = 0);
void showVolumeSlider(std::string name, std::string prefix, float width, float btnHeight = -1.0f, int btwBorder = 0, bool sameLine = false);
dsp::stream<dsp::stereo_t>* bindStream(std::string name);
void unbindStream(std::string name, dsp::stream<dsp::stereo_t>* stream);