Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc1 #7859

Merged
merged 4 commits into from
Nov 21, 2024
Merged

Misc1 #7859

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/common/Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4680,7 +4680,7 @@ bool Parameter::set_value_from_string_onto(const std::string &s, pdata &ontoThis
}
case ct_pbdepth:
{
if (extend_range && s.find("/") != std::string::npos)
if (extend_range && s.find('/') != std::string::npos)
{
if (!supports_tuning_value_from_string(s, errMsg))
return false;
Expand Down Expand Up @@ -4813,7 +4813,7 @@ bool Parameter::set_value_from_string_onto(const std::string &s, pdata &ontoThis
if (displayInfo.customFeatures & ParamDisplayFeatures::kAllowsTuningFractionTypein)
{
// Check for a fraction
if (s.find("/") != std::string::npos)
if (s.find('/') != std::string::npos)
{
if (!supports_tuning_value_from_string(s, errMsg))
return false;
Expand Down Expand Up @@ -5016,7 +5016,7 @@ bool Parameter::set_value_from_string_onto(const std::string &s, pdata &ontoThis
// OK so do we contain a /?
const char *slp;

if ((slp = strstr(strip, "/")) != nullptr)
if ((slp = strchr(strip, '/')) != nullptr)
{
float num = std::atof(strip);
float den = std::atof(slp + 1);
Expand Down Expand Up @@ -5120,7 +5120,7 @@ float Parameter::calculate_modulation_value_from_string(const std::string &s, st
if (displayInfo.customFeatures & ParamDisplayFeatures::kAllowsTuningFractionTypein)
{
// Check for a fraction
if (s.find("/") != std::string::npos)
if (s.find('/') != std::string::npos)
{
if (!supports_tuning_value_from_string(s, errMsg))
return false;
Expand Down Expand Up @@ -5435,7 +5435,7 @@ float Parameter::calculate_modulation_value_from_string(const std::string &s, st
// OK so do we contain a /?
const char *slp;

if ((slp = strstr(strip, "/")) != nullptr)
if ((slp = strchr(strip, '/')) != nullptr)
{
float num = std::atof(strip);
float den = std::atof(slp + 1);
Expand Down
10 changes: 4 additions & 6 deletions src/surge-xt/gui/widgets/LFOAndStepDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1335,11 +1335,9 @@ void LFOAndStepDisplay::paintStepSeq(juce::Graphics &g)

auto q = boxo;

auto tf = juce::AffineTransform()
.scaled(boxo.getWidth() / valScale, boxo.getHeight() / valScale)
.translated(q.getTopLeft().x, q.getTopLeft().y);

auto tfpath = tf;
const auto tfpath = juce::AffineTransform()
.scaled(boxo.getWidth() / valScale, boxo.getHeight() / valScale)
.translated(q.getTopLeft().x, q.getTopLeft().y);

g.setColour(skin->getColor(Colors::LFO::StepSeq::Envelope));

Expand Down Expand Up @@ -2609,7 +2607,7 @@ void LFOAndStepDisplay::showStepTypein(int i)
}

auto handleTypein = [this, i](const std::string &s) {
auto divPos = s.find("/");
auto divPos = s.find('/');
float v = 0.f;

if (divPos != std::string::npos)
Expand Down
4 changes: 2 additions & 2 deletions src/surge-xt/gui/widgets/PatchSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1210,11 +1210,11 @@ bool PatchSelector::populatePatchMenuForCategory(int c, juce::PopupMenu &context

if (n_subc > 1)
{
name = fmt::format("{} {}", menuName, subc + 1).c_str();
name = fmt::format("{} {}", menuName, subc + 1);
}
else
{
name = menuName.c_str();
name = menuName;
}

if (!single_category)
Expand Down
Loading