Skip to content

Commit

Permalink
add default value getter (#457)
Browse files Browse the repository at this point in the history
* add default value getter

* add const to getDefault, put before setDefault
  • Loading branch information
chrisherb committed Jun 18, 2024
1 parent bc3cc0b commit 7a338bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dgl/EventHandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class KnobEventHandler
// returns 0-1 ranged value, already with log scale as needed
float getNormalizedValue() const noexcept;

float getDefault() const noexcept;

// NOTE: value is assumed to be scaled if using log
void setDefault(float def) noexcept;

Expand Down
5 changes: 5 additions & 0 deletions dgl/src/EventHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,11 @@ float KnobEventHandler::getNormalizedValue() const noexcept
return pData->getNormalizedValue();
}

float KnobEventHandler::getDefault() const noexcept
{
return pData->valueDef;
}

void KnobEventHandler::setDefault(const float def) noexcept
{
pData->valueDef = def;
Expand Down

0 comments on commit 7a338bd

Please sign in to comment.