From 0f50e9239bbda77ce38f297870f8cf4158025acc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 1 Oct 2016 05:46:29 -0400 Subject: Show audio and load information in status line --- src/gui/Port.cpp | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'src/gui/Port.cpp') diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 1a9750a6..c643b379 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -1,6 +1,6 @@ /* This file is part of Ingen. - Copyright 2007-2015 David Robillard + Copyright 2007-2016 David Robillard Ingen is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free @@ -33,6 +33,7 @@ #include "WidgetFactory.hpp" #include "WindowFactory.hpp" #include "ingen_config.h" +#include "rgba.hpp" using namespace Ingen::Client; using namespace std; @@ -339,38 +340,6 @@ Port::on_event(GdkEvent* ev) return false; } -/* Peak colour stuff */ - -static inline uint32_t -rgba_to_uint(uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - return ((((uint32_t)(r)) << 24) | - (((uint32_t)(g)) << 16) | - (((uint32_t)(b)) << 8) | - (((uint32_t)(a)))); -} - -static inline uint8_t -mono_interpolate(uint8_t v1, uint8_t v2, float f) -{ - return ((int)rint((v2) * (f) + (v1) * (1 - (f)))); -} - -#define RGBA_R(x) (((uint32_t)(x)) >> 24) -#define RGBA_G(x) ((((uint32_t)(x)) >> 16) & 0xFF) -#define RGBA_B(x) ((((uint32_t)(x)) >> 8) & 0xFF) -#define RGBA_A(x) (((uint32_t)(x)) & 0xFF) - -static inline uint32_t -rgba_interpolate(uint32_t c1, uint32_t c2, float f) -{ - return rgba_to_uint( - mono_interpolate(RGBA_R(c1), RGBA_R(c2), f), - mono_interpolate(RGBA_G(c1), RGBA_G(c2), f), - mono_interpolate(RGBA_B(c1), RGBA_B(c2), f), - mono_interpolate(RGBA_A(c1), RGBA_A(c2), f)); -} - inline static uint32_t peak_color(float peak) { @@ -386,8 +355,6 @@ peak_color(float peak) } } -/* End peak colour stuff */ - void Port::activity(const Atom& value) { -- cgit v1.2.1