From 389f48d169226d726b358e554476f06baa37be74 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 6 Dec 2008 11:37:06 +0000 Subject: fix up shorter versions of coreaudio file format strings git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4296 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/coreaudiosource.cc | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'libs/ardour/coreaudiosource.cc') diff --git a/libs/ardour/coreaudiosource.cc b/libs/ardour/coreaudiosource.cc index 693be65035..a6aceb7842 100644 --- a/libs/ardour/coreaudiosource.cc +++ b/libs/ardour/coreaudiosource.cc @@ -19,6 +19,8 @@ */ #include +#define __STDC_FORMAT_MACROS +#include #include #include @@ -256,6 +258,8 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string& goto out; } + _info.format_name = ""; + if (absd.mFormatID == kAudioFormatLinearPCM) { if (absd.mFormatFlags & kAudioFormatFlagIsBigEndian) { _info.format_name += "big-endian"; @@ -264,17 +268,17 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string& } char buf[32]; - snprintf (buf, sizeof (buf), "%u bit", absd.mBitsPerChannel); + snprintf (buf, sizeof (buf), " %" PRIu32 " bit", absd.mBitsPerChannel); _info.format_name += buf; _info.format_name += '\n'; if (absd.mFormatFlags & kAudioFormatFlagIsFloat) { - _info.format_name += " float"; + _info.format_name += "float"; } else { if (absd.mFormatFlags & kAudioFormatFlagIsSignedInteger) { - _info.format_name += " signed"; + _info.format_name += "signed"; } else { - _info.format_name += " unsigned"; + _info.format_name += "unsigned"; } /* integer is typical, do not show it */ } @@ -302,8 +306,16 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string& _info.format_name += "60958 AC3"; break; - case kAudioFormatMPEG: - _info.format_name += "MPEG"; + case kAudioFormatMPEGLayer1: + _info.format_name += "MPEG-1"; + break; + + case kAudioFormatMPEGLayer2: + _info.format_name += "MPEG-2"; + break; + + case kAudioFormatMPEGLayer3: + _info.format_name += "MPEG-3"; break; case kAudioFormatAppleIMA4: -- cgit v1.2.3