Skip to content

Commit d4cc209

Browse files
author
Your Name
committed
Minor process fixes
1 parent df3a84f commit d4cc209

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

examples/Helpers/Poles.hpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <halp/log.hpp>
88
#include <halp/mappers.hpp>
99
#include <halp/meta.hpp>
10+
#include <boost/container/vector.hpp>
1011

1112
namespace examples::helpers
1213
{
@@ -45,11 +46,13 @@ struct Poles
4546
}
4647
}
4748
} sigma;
49+
50+
halp::knob_f32<"Range", halp::range{0., 1., 1.0}> mult;
4851
} inputs;
4952

5053
struct
5154
{
52-
halp::val_port<"Out", std::vector<float>> a;
55+
halp::val_port<"Out", boost::container::vector<float>> a;
5356
} outputs;
5457

5558
static double pdf(double x, double inv_sigma) noexcept
@@ -62,15 +65,15 @@ struct Poles
6265
{
6366
if(inputs.length.value < 0 || inputs.length.value > 1000)
6467
return;
68+
69+
const float mult = inputs.mult.value;
70+
auto& res = outputs.a.value;
71+
res.resize(inputs.length + 1, boost::container::default_init);
6572

66-
std::vector<float>& res = outputs.a.value;
67-
res.resize(inputs.length + 1);
68-
69-
std::string s;
7073
for(int k = 0; k <= inputs.length; k++)
7174
{
7275
const double i = 2. * k / inputs.length - 1.;
73-
res[k] = pdf(i / 10. - inputs.pos, inv_sigma);
76+
res[k] = mult * pdf(i / 10. - inputs.pos, inv_sigma);
7477
}
7578
}
7679
double inv_sigma{1.};

examples/Raw/ProcessLauncher.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ struct ProcessLauncher
6262
// Stop case
6363
if(cur)
6464
{
65-
cur->terminate();
65+
QMetaObject::invokeMethod(qApp, [cur] {
66+
cur->terminate();
67+
});
6668
}
6769
return [](ProcessLauncher& self) { self.process.reset(); };
6870
}

0 commit comments

Comments
 (0)