#pragma once

#include <psemek/audio/duration.hpp>
#include <psemek/audio/constants.hpp>

#include <cmath>

namespace psemek::audio::literals
{

	duration operator ""_s (unsigned long long value)
	{
		return duration::from_frames(value * frequency);
	}

	duration operator ""_ms (unsigned long long value)
	{
		return duration::from_frames((value * frequency) / 1000);
	}

	duration operator ""_s (long double value)
	{
		return duration::from_frames(std::round(value * frequency));
	}

	duration operator ""_ms (long double value)
	{
		return duration::from_frames(std::round(value * frequency / 1000.0));
	}

}
