projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use regex to match [mM][iI][dD] file extension for MIDI files, thus making it case...
[ardour.git]
/
libs
/
ardour
/
coreaudiosource.cc
diff --git
a/libs/ardour/coreaudiosource.cc
b/libs/ardour/coreaudiosource.cc
index 5212a3006dcaca62b58fa25c1488f01bf9d57d2b..947c66e756d070ac7a134683216829b45ab10f66 100644
(file)
--- a/
libs/ardour/coreaudiosource.cc
+++ b/
libs/ardour/coreaudiosource.cc
@@
-19,7
+19,6
@@
*/
#include <algorithm>
*/
#include <algorithm>
-#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include "pbd/error.h"
#include <inttypes.h>
#include "pbd/error.h"
@@
-93,16
+92,16
@@
CoreAudioSource::~CoreAudioSource ()
}
int
}
int
-CoreAudioSource::safe_read (Sample* dst,
nframes_t start, nframes
_t cnt, AudioBufferList& abl) const
+CoreAudioSource::safe_read (Sample* dst,
framepos_t start, framecnt
_t cnt, AudioBufferList& abl) const
{
{
-
nframes
_t nread = 0;
+
framecnt
_t nread = 0;
while (nread < cnt) {
try {
af.Seek (start+nread);
} catch (CAXException& cax) {
while (nread < cnt) {
try {
af.Seek (start+nread);
} catch (CAXException& cax) {
- error << string_compose("CoreAudioSource: %1 to %2 (%3)", cax.mOperation, start+nread, _name.substr (1)) << endmsg;
+ error << string_compose("CoreAudioSource: %1 to %2 (%3)", cax.mOperation, start+nread, _name.
val().
substr (1)) << endmsg;
return -1;
}
return -1;
}
@@
-138,10
+137,10
@@
CoreAudioSource::safe_read (Sample* dst, nframes_t start, nframes_t cnt, AudioBu
}
}
-
nframes
_t
-CoreAudioSource::read_unlocked (Sample *dst, framepos_t start,
nframes
_t cnt) const
+
framecnt
_t
+CoreAudioSource::read_unlocked (Sample *dst, framepos_t start,
framecnt
_t cnt) const
{
{
-
nframes
_t file_cnt;
+
framecnt
_t file_cnt;
AudioBufferList abl;
abl.mNumberBuffers = 1;
AudioBufferList abl;
abl.mNumberBuffers = 1;
@@
-167,7
+166,7
@@
CoreAudioSource::read_unlocked (Sample *dst, framepos_t start, nframes_t cnt) co
}
if (file_cnt != cnt) {
}
if (file_cnt != cnt) {
-
nframes
_t delta = cnt - file_cnt;
+
frameoffset
_t delta = cnt - file_cnt;
memset (dst+file_cnt, 0, sizeof (Sample) * delta);
}
memset (dst+file_cnt, 0, sizeof (Sample) * delta);
}
@@
-175,7
+174,6
@@
CoreAudioSource::read_unlocked (Sample *dst, framepos_t start, nframes_t cnt) co
if (n_channels == 1) {
if (safe_read (dst, start, file_cnt, abl) == 0) {
if (n_channels == 1) {
if (safe_read (dst, start, file_cnt, abl) == 0) {
- _read_data_count = cnt * sizeof (Sample);
return cnt;
}
return 0;
return cnt;
}
return 0;
@@
-188,13
+186,11
@@
CoreAudioSource::read_unlocked (Sample *dst, framepos_t start, nframes_t cnt) co
return 0;
}
return 0;
}
- _read_data_count = cnt * sizeof(float);
-
Sample *ptr = interleave_buf + _channel;
/* stride through the interleaved data */
Sample *ptr = interleave_buf + _channel;
/* stride through the interleaved data */
- for (
uint32
_t n = 0; n < file_cnt; ++n) {
+ for (
framecnt
_t n = 0; n < file_cnt; ++n) {
dst[n] = *ptr;
ptr += n_channels;
}
dst[n] = *ptr;
ptr += n_channels;
}
@@
-218,17
+214,17
@@
CoreAudioSource::sample_rate() const
}
int
}
int
-CoreAudioSource::update_header (framepos_t
when
, struct tm&, time_t)
+CoreAudioSource::update_header (framepos_t, struct tm&, time_t)
{
return 0;
}
int
{
return 0;
}
int
-CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&
error_msg
)
+CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&)
{
FSRef ref;
ExtAudioFileRef af = 0;
{
FSRef ref;
ExtAudioFileRef af = 0;
-
size_t
size;
+
UInt32
size;
CFStringRef name;
int ret = -1;
CFStringRef name;
int ret = -1;