MCPcopy Create free account
hub / github.com/cinder/Cinder / seek

Method seek

src/cinder/audio/linux/FileAudioLoader.cpp:83–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 }
82
83 static sf_count_t seek( sf_count_t offset, int whence, void* userData ) {
84 ci::IStreamCinder* stream = static_cast<ci::IStreamCinder*>( userData );
85 switch( whence ) {
86 case SEEK_SET:
87 stream->seekAbsolute( offset );
88 break;
89
90 case SEEK_CUR:
91 stream->seekRelative( offset );
92 break;
93
94 case SEEK_END: {
95 size_t absOffset = stream->size() - offset;
96 stream->seekAbsolute( absOffset );
97 }
98 break;
99
100 default :
101 stream->seekAbsolute( 0 );
102 break;
103 }
104 return stream->tell();
105 }
106
107 static sf_count_t read( void* ptr, sf_count_t count, void* userData ) {
108 ci::IStreamCinder* stream = static_cast<ci::IStreamCinder*>( userData );

Callers

nothing calls this directly

Calls 4

seekAbsoluteMethod · 0.45
seekRelativeMethod · 0.45
sizeMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected