Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
/*****************************************************************************
Pot.cpp
Copyright (c) 2020 Raphael DINGE
*Tab=3***********************************************************************/
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
#include "erb/Pot.h"
#include "erb/def.h"
namespace erb
{
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*
==============================================================================
Name : ctor
==============================================================================
*/
Pot::Pot (Mode mode)
: _mode (mode)
{
}
/*
==============================================================================
Name : set_mode
==============================================================================
*/
void Pot::set_mode (Mode mode)
{
_mode = mode;
}
/*
==============================================================================
Name : operator float
==============================================================================
*/
Pot::operator float () const
{
switch (_mode)
{
case Mode::Normalized:
#if erb_GNUC_SWITCH_COVERAGE_FIX
default:
#endif
return *_norm_val_ptr;
case Mode::Bipolar:
return *_norm_val_ptr * 2.f - 1.f;
}
}
/*\\\ INTERNAL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*
==============================================================================
Name : impl_bind_data
==============================================================================
*/
void Pot::impl_bind_data (float & norm_val)
{
_norm_val_ptr = &norm_val;
}
/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
} // namespace erb
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
8b8937c75This file is pinned to the selected release. Download the original to open it in your design tool.