summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/BlockModel.cpp2
-rw-r--r--src/gui/GraphPortModule.cpp4
-rw-r--r--src/gui/NodeMenu.cpp7
-rw-r--r--src/gui/NodeModule.cpp4
-rw-r--r--src/gui/Port.cpp2
-rw-r--r--src/gui/PropertiesWindow.cpp4
-rw-r--r--src/server/Buffer.cpp16
-rw-r--r--src/server/Buffer.hpp4
-rw-r--r--src/server/JackDriver.cpp2
-rw-r--r--src/server/JackDriver.hpp2
-rw-r--r--src/server/internals/Controller.cpp4
11 files changed, 17 insertions, 34 deletions
diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp
index d672b439..a4318f4e 100644
--- a/src/client/BlockModel.cpp
+++ b/src/client/BlockModel.cpp
@@ -223,7 +223,7 @@ BlockModel::port_value_range(const SPtr<const PortModel>& port,
}
if (max <= min) {
- max = min + 1.0;
+ max = min + 1.0f;
}
if (port->port_property(_uris.lv2_sampleRate)) {
diff --git a/src/gui/GraphPortModule.cpp b/src/gui/GraphPortModule.cpp
index cf9858a3..a602f2f0 100644
--- a/src/gui/GraphPortModule.cpp
+++ b/src/gui/GraphPortModule.cpp
@@ -135,9 +135,9 @@ GraphPortModule::property_changed(const URI& key, const Atom& value)
const URIs& uris = app().uris();
if (value.type() == uris.forge.Float) {
if (key == uris.ingen_canvasX) {
- move_to(value.get<float>(), get_y());
+ move_to(static_cast<double>(value.get<float>()), get_y());
} else if (key == uris.ingen_canvasY) {
- move_to(get_x(), value.get<float>());
+ move_to(get_x(), static_cast<double>(value.get<float>()));
}
} else if (value.type() == uris.forge.String) {
if (key == uris.lv2_name &&
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index e2478592..3e9057fc 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -175,9 +175,12 @@ NodeMenu::on_menu_randomize()
const SPtr<const BlockModel> bm = block();
for (const auto& p : bm->ports()) {
if (p->is_input() && _app->can_control(p.get())) {
- float min = 0.0f, max = 1.0f;
+ float min = 0.0f;
+ float max = 1.0f;
bm->port_value_range(p, min, max, _app->sample_rate());
- const float val = g_random_double_range(0.0, 1.0) * (max - min) + min;
+
+ const float r = static_cast<float>(g_random_double_range(0.0, 1.0));
+ const float val = r * (max - min) + min;
_app->set_property(p->uri(),
_app->uris().ingen_value,
_app->forge().make(val));
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 1c62dd10..f333d3d2 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -467,9 +467,9 @@ NodeModule::property_changed(const URI& key, const Atom& value)
const URIs& uris = app().uris();
if (value.type() == uris.forge.Float) {
if (key == uris.ingen_canvasX) {
- move_to(value.get<float>(), get_y());
+ move_to(static_cast<double>(value.get<float>()), get_y());
} else if (key == uris.ingen_canvasY) {
- move_to(get_x(), value.get<float>());
+ move_to(get_x(), static_cast<double>(value.get<float>()));
}
} else if (value.type() == uris.forge.Bool) {
if (key == uris.ingen_polyphonic) {
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 4282343e..643cca5f 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -352,7 +352,7 @@ peak_color(float peak)
static const uint32_t peak_min = 0xFF561FC0;
static const uint32_t peak_max = 0xFF0A38C0;
- if (peak < 1.0) {
+ if (peak < 1.0f) {
return rgba_interpolate(min, max, peak);
} else {
return rgba_interpolate(peak_min, peak_max, fminf(peak, 2.0f) - 1.0f);
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index 9912f73a..5c7a58ea 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -305,10 +305,10 @@ PropertiesWindow::create_value_widget(const URI& key,
Gtk::SpinButton* widget = manage(new Gtk::SpinButton(0.0, 4));
widget->property_numeric() = true;
widget->set_snap_to_ticks(false);
- widget->set_range(-FLT_MAX, FLT_MAX);
+ widget->set_range(-DBL_MAX, DBL_MAX);
widget->set_increments(0.1, 1.0);
if (value.is_valid()) {
- widget->set_value(value.get<float>());
+ widget->set_value(static_cast<double>(value.get<float>()));
}
widget->signal_value_changed().connect(
sigc::bind(sigc::mem_fun(this, &PropertiesWindow::on_change), key));
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp
index 3a09762f..084e8e72 100644
--- a/src/server/Buffer.cpp
+++ b/src/server/Buffer.cpp
@@ -429,22 +429,6 @@ Buffer::update_value_buffer(SampleCount offset)
}
}
-#ifndef NDEBUG
-void
-Buffer::dump_cv(const RunContext& ctx) const
-{
- float value = samples()[0];
- fprintf(stderr, "{ 0000: %.02f\n", value);
- for (uint32_t i = 0; i < ctx.nframes(); ++i) {
- if (samples()[i] != value) {
- value = samples()[i];
- fprintf(stderr, " %4u: %.02f\n", i, value);
- }
- }
- fprintf(stderr, "}\n");
-}
-#endif
-
void* Buffer::aligned_alloc(size_t size)
{
#ifdef HAVE_POSIX_MEMALIGN
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp
index 57db16dd..e22e89e6 100644
--- a/src/server/Buffer.hpp
+++ b/src/server/Buffer.hpp
@@ -204,10 +204,6 @@ public:
/// Set/add to audio buffer from the Sequence of Float in `src`
void render_sequence(const RunContext& ctx, const Buffer* src, bool add);
-#ifndef NDEBUG
- void dump_cv(const RunContext& ctx) const;
-#endif
-
void set_capacity(uint32_t capacity) { _capacity = capacity; }
void set_buffer(void* buf) { assert(_external); _buf = buf; }
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 1e27207b..b4594cda 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -71,7 +71,7 @@ JackDriver::JackDriver(Engine& engine)
, _is_activated(false)
, _position()
, _transport_state()
- , _old_bpm(120.0f)
+ , _old_bpm(120.0)
, _old_frame(0)
, _old_rolling(false)
{
diff --git a/src/server/JackDriver.hpp b/src/server/JackDriver.hpp
index 99aa7a7f..ecaaec5f 100644
--- a/src/server/JackDriver.hpp
+++ b/src/server/JackDriver.hpp
@@ -159,7 +159,7 @@ protected:
bool _is_activated;
jack_position_t _position;
jack_transport_state_t _transport_state;
- float _old_bpm;
+ double _old_bpm;
jack_nframes_t _old_frame;
bool _old_rolling;
};
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp
index 0d38bc43..f2498eba 100644
--- a/src/server/internals/Controller.cpp
+++ b/src/server/internals/Controller.cpp
@@ -157,9 +157,9 @@ ControllerNode::control(RunContext& ctx, uint8_t control_num, uint8_t val, Frame
Sample scaled_value = 0.0f;
if (log_port_val > 0.0f) {
// haaaaack, stupid negatives and logarithms
- Sample log_offset = 0;
+ Sample log_offset = 0.0f;
if (min_port_val < 0) {
- log_offset = fabs(min_port_val);
+ log_offset = fabsf(min_port_val);
}
const Sample min = logf(min_port_val + 1 + log_offset);
const Sample max = logf(max_port_val + 1 + log_offset);