diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-04 13:40:33 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-04 13:40:33 +0000 |
commit | fe11ab585a81f28493326838d94189e4ba84b741 (patch) | |
tree | 2791cab7d61045283f0ee60be01d2dd43d7ab357 /libs/ardour/coreaudiosource.cc | |
parent | ce5e7745cb81b7fd716056a373775523fadb7ac5 (diff) |
shorten CoreAudioFileSource's format text and drop use of "legacy" CoreAudio function for this
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4284 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/coreaudiosource.cc')
-rw-r--r-- | libs/ardour/coreaudiosource.cc | 88 |
1 files changed, 87 insertions, 1 deletions
diff --git a/libs/ardour/coreaudiosource.cc b/libs/ardour/coreaudiosource.cc index 4383f1a696..693be65035 100644 --- a/libs/ardour/coreaudiosource.cc +++ b/libs/ardour/coreaudiosource.cc @@ -256,7 +256,93 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string& goto out; } - _info.format_name = CFStringRefToStdString(name); + if (absd.mFormatID == kAudioFormatLinearPCM) { + if (absd.mFormatFlags & kAudioFormatFlagIsBigEndian) { + _info.format_name += "big-endian"; + } else { + _info.format_name += "little-endian"; + } + + char buf[32]; + snprintf (buf, sizeof (buf), "%u bit", absd.mBitsPerChannel); + _info.format_name += buf; + _info.format_name += '\n'; + + if (absd.mFormatFlags & kAudioFormatFlagIsFloat) { + _info.format_name += " float"; + } else { + if (absd.mFormatFlags & kAudioFormatFlagIsSignedInteger) { + _info.format_name += " signed"; + } else { + _info.format_name += " unsigned"; + } + /* integer is typical, do not show it */ + } + + if (_info.channels > 1) { + if (absd.mFormatFlags & kAudioFormatFlagIsNonInterleaved) { + _info.format_name += " noninterleaved"; + } + /* interleaved is the normal case, do not show it */ + } + + _info.format_name += ' '; + } + + switch (absd.mFormatID) { + case kAudioFormatLinearPCM: + _info.format_name += "PCM"; + break; + + case kAudioFormatAC3: + _info.format_name += "AC3"; + break; + + case kAudioFormat60958AC3: + _info.format_name += "60958 AC3"; + break; + + case kAudioFormatMPEG: + _info.format_name += "MPEG"; + break; + + case kAudioFormatAppleIMA4: + _info.format_name += "IMA-4"; + break; + + case kAudioFormatMPEG4AAC: + _info.format_name += "AAC"; + break; + + case kAudioFormatMPEG4CELP: + _info.format_name += "CELP"; + break; + + case kAudioFormatMPEG4HVXC: + _info.format_name += "HVXC"; + break; + + case kAudioFormatMPEG4TwinVQ: + _info.format_name += "TwinVQ"; + break; + + /* these really shouldn't show up, but we should do something + somewhere else to make sure that doesn't happen. until + that is guaranteed, print something anyway. + */ + + case kAudioFormatTimeCode: + _info.format_name += "timecode"; + break; + + case kAudioFormatMIDIStream: + _info.format_name += "MIDI"; + break; + + case kAudioFormatParameterValueStream: + _info.format_name += "parameter values"; + break; + } // XXX it would be nice to find a way to get this information if it exists |