Beispiel #1
0
/**
 * @ingroup VuoTransform
 * Produces a brief human-readable summary of @c value.
 */
char * VuoTransform_summaryFromValue(const VuoTransform value)
{
	if (VuoTransform_isIdentity(value))
		return strdup("identity transform (no change)");

	if (value.type == VuoTransformTypeTargeted)
		return VuoText_format("position (%g, %g, %g)<br>target (%g, %g, %g)<br>up (%g, %g, %g)",
							  value.translation.x, value.translation.y, value.translation.z, value.rotationSource.target.x, value.rotationSource.target.y, value.rotationSource.target.z, value.rotationSource.upDirection.x, value.rotationSource.upDirection.y, value.rotationSource.upDirection.z);

	char *rotation;
	if (value.type == VuoTransformTypeQuaternion)
		rotation = VuoText_format("(%g, %g, %g, %g) quaternion",
								  value.rotationSource.quaternion.x, value.rotationSource.quaternion.y, value.rotationSource.quaternion.z, value.rotationSource.quaternion.w);
	else
	{
		VuoPoint3d r = VuoPoint3d_multiply(value.rotationSource.euler, 180./M_PI);
		rotation = VuoText_format("(%g°, %g°, %g°) euler",
								  r.x, r.y, r.z);
	}

	char *valueAsString = VuoText_format("translation (%g, %g, %g)<br>rotation %s<br>scale (%g, %g, %g)",
										 value.translation.x, value.translation.y, value.translation.z, rotation, value.scale.x, value.scale.y, value.scale.z);
	free(rotation);
	return valueAsString;
}
Beispiel #2
0
/**
 * Returns a compact string representation of @c value (comma-separated coordinates).
 */
char * VuoMidiInputDevice_getSummary(const VuoMidiInputDevice md)
{
	if (md.id == -1 && strlen(md.name) == 0)
		return VuoText_format("The first MIDI input device");
	else if (md.id == -1)
		return VuoText_format("The first MIDI input device whose name contains \"%s\"", md.name);
	else if (strlen(md.name) == 0)
		return VuoText_format("MIDI input device #%lld", md.id);
	else
		return VuoText_format("MIDI input device #%lld (\"%s\")", md.id, md.name);
}
Beispiel #3
0
/**
 * Returns a compact string representation of @c value.
 */
char * VuoAudioOutputDevice_getSummary(const VuoAudioOutputDevice value)
{
	if (value.id == -1 && strlen(value.name) == 0)
		return strdup("The default audio output device");
	else if (value.id == -1)
		return VuoText_format("The first audio output device whose name contains \"%s\"", value.name);
	else if (strlen(value.name) == 0)
		return VuoText_format("Audio output device #%lld", value.id);
	else
		// An actual detected audio output device (rather than abstract criteria).
		return VuoText_format("Audio output device #%lld (\"%s\")<br>%lld output channels", value.id, value.name, value.channelCount);
}
/**
 * @ingroup VuoSyphonServerDescription
 * Returns a compact string representation of @c value.
 */
char * VuoSyphonServerDescription_getSummary(const VuoSyphonServerDescription value)
{
	const char *serverUUID = strlen(value.serverUUID) > 0 ? value.serverUUID : "(unknown)";
	const char *serverName = strlen(value.serverName) > 0 ? value.serverName : "(unknown)";
	const char *applicationName = strlen(value.applicationName) > 0 ? value.applicationName : "(unknown)";

	return VuoText_format("Syphon server \"%s\" in application \"%s\"<br>UUID: %s",
						  serverName, applicationName, serverUUID);
}
Beispiel #5
0
/**
 * @ingroup VuoPoint3d
 * Returns a compact string representation of @c value (comma-separated coordinates).
 */
char * VuoPoint3d_getSummary(const VuoPoint3d value)
{
	return VuoText_format("%g, %g, %g", value.x, value.y, value.z);
}
Beispiel #6
0
/**
 * @ingroup VuoPoint4d
 * Returns a compact string representation of @c value (comma-separated coordinates).
 */
char * VuoPoint4d_summaryFromValue(const VuoPoint4d value)
{
	return VuoText_format("%g, %g, %g, %g", value.x, value.y, value.z, value.w);
}
Beispiel #7
0
/**
 * @ingroup VuoLeapPointable
 * Returns a compact string representation of @c value.
 */
char * VuoLeapHand_getSummary(const VuoLeapHand value)
{
	return VuoText_format("%lld", value.id);
}
Beispiel #8
0
/**
 * @ingroup VuoReal
 * Returns a string representation of @c value (either decimal or scientific notation, whichever is shorter).
 */
char * VuoReal_getSummary(const VuoReal value)
{
	return VuoText_format("%g", value);
}
/**
 * Returns a compact string representation of @c value.
 */
char * VuoAudioSamples_getSummary(const VuoAudioSamples value)
{
	return VuoText_format("%lld samples @ %g kHz", value.sampleCount, value.samplesPerSecond/1000);
}