/*=============================================================================
   Copyright (c) 2014-2021 <NAME>. All rights reserved.

   Distributed under the MIT License [ https://opensource.org/licenses/MIT ]
=============================================================================*/
#if !defined(CYCFI_Q_SIN_HPP_DECEMBER_24_2015)
#define CYCFI_Q_SIN_HPP_DECEMBER_24_2015

#include <q/support/phase.hpp>
#include <q/detail/sin_table.hpp>

namespace cycfi::q
{
   ////////////////////////////////////////////////////////////////////////////
   // sin_synth: Synthesizes sine waves.
   ////////////////////////////////////////////////////////////////////////////
   struct sin_synth
   {
      constexpr float operator()(phase p) const
      {
         return detail::sin_gen(p);
      }

      constexpr float operator()(phase_iterator i) const
      {
         return (*this)(i._phase);
      }
   };

   constexpr auto sin = sin_synth{};
}

#endif
