本文整理汇总了C++中AFfilehandle::getTrack方法的典型用法代码示例。如果您正苦于以下问题:C++ AFfilehandle::getTrack方法的具体用法?C++ AFfilehandle::getTrack怎么用?C++ AFfilehandle::getTrack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AFfilehandle
的用法示例。
在下文中一共展示了AFfilehandle::getTrack方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: afSetChannelMatrix
void afSetChannelMatrix (AFfilehandle file, int trackid, double* matrix)
{
if (!_af_filehandle_ok(file))
return;
Track *track = file->getTrack(trackid);
if (!track)
return;
if (track->channelMatrix != NULL)
free(track->channelMatrix);
track->channelMatrix = NULL;
if (matrix != NULL)
{
int i, size;
size = track->v.channelCount * track->f.channelCount;
track->channelMatrix = (double *) malloc(size * sizeof (double));
for (i = 0; i < size; i++)
track->channelMatrix[i] = matrix[i];
}
}
示例2: afSetMarkPosition
void afSetMarkPosition (AFfilehandle file, int trackid, int markid,
AFframecount position)
{
if (!_af_filehandle_ok(file))
return;
if (!file->checkCanWrite())
return;
Track *track = file->getTrack(trackid);
if (!track)
return;
Marker *marker = track->getMarker(markid);
if (!marker)
return;
if (position < 0)
{
#ifdef __WXOSX__
_af_error(AF_BAD_MARKPOS, "invalid marker position %jd",
#else
_af_error(AF_BAD_MARKPOS, "invalid marker position %"PRId64,
#endif
static_cast<intmax_t>(position));
position = 0;
}
示例3: afGetVirtualFrameSize
float afGetVirtualFrameSize (AFfilehandle file, int trackid, int stretch3to4)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
return _af_format_frame_size(&track->v, stretch3to4);
}
示例4: afGetTrackBytes
AFfileoffset afGetTrackBytes (AFfilehandle file, int trackid)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
return track->data_size;
}
示例5: afGetDataOffset
AFfileoffset afGetDataOffset (AFfilehandle file, int trackid)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
return track->fpos_first_frame;
}
示例6: afGetVirtualChannels
int afGetVirtualChannels (AFfilehandle file, int trackid)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
return track->v.channelCount;
}
示例7: afGetVirtualRate
double afGetVirtualRate (AFfilehandle file, int trackid)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
return track->v.sampleRate;
}
示例8: afGetVirtualByteOrder
int afGetVirtualByteOrder (AFfilehandle file, int trackid)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
return track->v.byteOrder;
}
示例9: afGetFrameCount
AFframecount afGetFrameCount (AFfilehandle file, int trackid)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
if (track->ms->isDirty() && track->ms->setup(file, track) == AF_FAIL)
return -1;
return track->totalvframes;
}
示例10: afGetVirtualSampleFormat
void afGetVirtualSampleFormat (AFfilehandle file, int trackid, int *sampleFormat, int *sampleWidth)
{
if (!_af_filehandle_ok(file))
return;
Track *track = file->getTrack(trackid);
if (!track)
return;
if (sampleFormat)
*sampleFormat = track->v.sampleFormat;
if (sampleWidth)
*sampleWidth = track->v.sampleWidth;
}
示例11: afSetVirtualSampleFormat
int afSetVirtualSampleFormat (AFfilehandle file, int trackid,
int sampleFormat, int sampleWidth)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
if (_af_set_sample_format(&track->v, sampleFormat, sampleWidth) == AF_FAIL)
return -1;
track->ms->setDirty();
return 0;
}
示例12: afSetVirtualChannels
int afSetVirtualChannels (AFfilehandle file, int trackid, int channelCount)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
track->v.channelCount = channelCount;
track->ms->setDirty();
if (track->channelMatrix)
free(track->channelMatrix);
track->channelMatrix = NULL;
return 0;
}
示例13: afSeekFrame
AFframecount afSeekFrame (AFfilehandle file, int trackid, AFframecount frame)
{
if (!_af_filehandle_ok(file))
return -1;
if (!file->checkCanRead())
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
if (track->ms->isDirty() && track->ms->setup(file, track) == AF_FAIL)
return -1;
if (frame < 0)
return track->nextvframe;
/* Optimize the case of seeking to the current position. */
if (frame == track->nextvframe)
return track->nextvframe;
/* Limit request to the number of frames in the file. */
if (track->totalvframes != -1)
if (frame > track->totalvframes)
frame = track->totalvframes - 1;
/*
Now that the modules are not dirty and frame
represents a valid virtual frame, we call
_AFsetupmodules again after setting track->nextvframe.
_AFsetupmodules will look at track->nextvframe and
compute track->nextfframe in clever and mysterious
ways.
*/
track->nextvframe = frame;
if (track->ms->setup(file, track) == AF_FAIL)
return -1;
return track->nextvframe;
}
示例14: afSetVirtualRate
int afSetVirtualRate (AFfilehandle file, int trackid, double rate)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
if (rate < 0)
{
_af_error(AF_BAD_RATE, "invalid sampling rate %.30g", rate);
return -1;
}
track->v.sampleRate = rate;
track->ms->setDirty();
return 0;
}
示例15: afSetVirtualByteOrder
int afSetVirtualByteOrder (AFfilehandle file, int trackid, int byteorder)
{
if (!_af_filehandle_ok(file))
return AF_FAIL;
Track *track = file->getTrack(trackid);
if (!track)
return AF_FAIL;
if (byteorder != AF_BYTEORDER_BIGENDIAN &&
byteorder != AF_BYTEORDER_LITTLEENDIAN)
{
_af_error(AF_BAD_BYTEORDER, "invalid byte order %d", byteorder);
return AF_FAIL;
}
track->v.byteOrder = byteorder;
track->ms->setDirty();
return AF_SUCCEED;
}