ITAAudiofileCommon.cpp 1.08 KB
Newer Older
Fabian Schlieper's avatar
Fabian Schlieper committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#include "ITAAudiofileCommon.h"

#include <cstdio>

std::string toString( ITAQuantization eQuantization )
{
	switch( eQuantization )
	{
	case ITAQuantization::ITA_INT16: return "Integer with 16-Bit";
	case ITAQuantization::ITA_INT20: return "Integer with 20-Bit";
	case ITAQuantization::ITA_INT24: return "Integer with 24-Bit";
	case ITAQuantization::ITA_INT32: return "Integer with 32-Bit";
	case ITAQuantization::ITA_FLOAT: return "Floating point with 32-Bit";
	case ITAQuantization::ITA_DOUBLE: return "Floating point with 64-Bit";
	default: return "Unkown";
	}
}

std::string toString( ITADomain eDomain )
{
	return ( eDomain == ITADomain::ITA_TIME_DOMAIN ? "time domain" : "frequency domain" );
}

void print( const ITAAudiofileProperties& props )
{
	printf( "%s | %0.1f Hz | %i channels | %s | length: %i Samples",
		toString( props.eDomain ).c_str(),
		props.dSampleRate,
		props.iChannels,
		toString( props.eQuantization ).c_str(),
		props.iLength );

	if( !props.sComment.empty() )
		printf( " | Comment: \"%s\"", props.sComment.c_str() );
	
	printf( "\n" );
}