Browse Source

Fix plugin chunks randomly not saving; Misc changes

tags/1.9.5
falkTX 10 years ago
parent
commit
f257a8e061
2 changed files with 11 additions and 3 deletions
  1. +8
    -3
      source/backend/CarlaBackend.h
  2. +3
    -0
      source/utils/CarlaString.hpp

+ 8
- 3
source/backend/CarlaBackend.h View File

@@ -1282,7 +1282,7 @@ typedef struct {

#ifdef __cplusplus
/*!
* Fix default value within range.
* Fix the default value within range.
*/
void fixDefault() noexcept
{
@@ -1294,7 +1294,7 @@ typedef struct {
*/
void fixValue(float& value) const noexcept
{
if (value <= min)
if (value < min)
value = min;
else if (value > max)
value = max;
@@ -1303,7 +1303,7 @@ typedef struct {
/*!
* Get a fixed value within range.
*/
float getFixedValue(const float& value) const noexcept
const float& getFixedValue(const float& value) const noexcept
{
if (value <= min)
return min;
@@ -1351,6 +1351,11 @@ typedef struct {
*/
float getUnnormalizedValue(const float& value) const noexcept
{
if (value <= 0.0f)
return min;
if (value >= 1.0f)
return max;

return value * (max - min) + min;
}
#endif /* __cplusplus */


+ 3
- 0
source/utils/CarlaString.hpp View File

@@ -632,7 +632,10 @@ public:

for (; i++ < 3;)
strBuf[strBufIndex++] = '=';
}

if (strBufIndex != 0)
{
strBuf[strBufIndex] = '\0';
ret += strBuf;
}


Loading…
Cancel
Save