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 --- gtk2_ardour/SAE-de-nokeypad.bindings.in | 3 ++- libs/ardour/coreaudiosource.cc | 24 ++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/SAE-de-nokeypad.bindings.in b/gtk2_ardour/SAE-de-nokeypad.bindings.in index f0799b2be0..27c824e5dd 100644 --- a/gtk2_ardour/SAE-de-nokeypad.bindings.in +++ b/gtk2_ardour/SAE-de-nokeypad.bindings.in @@ -9,6 +9,8 @@ (gtk_accel_path "/Transport/ToggleRollForgetCapture" "<%PRIMARY%>period") (gtk_accel_path "/Transport/record-roll" "<%PRIMARY%>space") +(gtk_accel_path "/Common/ToggleOptionsEditor" "<%PRIMARY%>,") + (gtk_accel_path "/Editor/align-regions-end" "<%PRIMARY%><%SECONDARY%>less") (gtk_accel_path "/Editor/align-regions-end-relative" "<%PRIMARY%>less") (gtk_accel_path "/Editor/align-regions-start" "<%LEVEL4%><%SECONDARY%>less") @@ -61,7 +63,6 @@ (gtk_accel_path "/Editor/insert-region" "i") (gtk_accel_path "/Editor/addExistingAudioFiles" "<%PRIMARY%>i") (gtk_accel_path "/Editor/invert-selection" "<%TERTIARY%>i") -(gtk_accel_path "/Common/ToggleOptionsEditor" "<%SECONDARY%>o") (gtk_accel_path "/Main/Open" "<%PRIMARY%>o") (gtk_accel_path "/Main/Recent" "<%PRIMARY%><%TERTIARY%>o") (gtk_accel_path "/Editor/naturalize-region" "<%LEVEL4%>o") 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