Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
8b8937c75This file is pinned to the selected release. Download the original to open it in your design tool.
/*****************************************************************************
VcvGateIn.cpp
Copyright (c) 2020 Raphael DINGE
*Tab=3***********************************************************************/
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
#include "erb/vcvrack/VcvGateIn.h"
#include "erb/vcvrack/VcvModule.h"
namespace erb
{
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*
==============================================================================
Name : ctor
==============================================================================
*/
VcvGateIn::VcvGateIn (VcvModule & module, const VcvPin & /* pin */)
: VcvInputBase (module)
{
}
/*
==============================================================================
Name : triggered
==============================================================================
*/
bool VcvGateIn::triggered () const
{
return _current && !_previous;
}
/*
==============================================================================
Name : operator bool
==============================================================================
*/
VcvGateIn::operator bool () const
{
return _current;
}
/*\\\ INTERNAL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*
==============================================================================
Name : impl_notify_audio_buffer_start
==============================================================================
*/
void VcvGateIn::impl_notify_audio_buffer_start ()
{
VcvInputBase::impl_notify_audio_buffer_start ();
_previous = _current;
_current = norm_val () > 0.5f;
}
/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
} // namespace erb
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/