Ejemplo n.º 1
0
void K3b::AudioDataSource::fixupOffsets()
{
    // no length available yet
    if( originalLength() == 0 )
        return;

    if( startOffset() >= originalLength() ) {
        setStartOffset( 0 );
    }
    if( endOffset() > originalLength() ) {
        setEndOffset( 0 ); // whole source
    }
    if( endOffset() > 0 && endOffset() <= startOffset() ) {
        setEndOffset( startOffset() );
    }
}
Ejemplo n.º 2
0
K3b::AudioDataSource* K3b::AudioDataSource::split( const K3b::Msf& pos )
{
    if( pos < length() ) {
        K3b::AudioDataSource* s = copy();
        s->setStartOffset( startOffset() + pos );
        s->setEndOffset( endOffset() );
        setEndOffset( startOffset() + pos );
        s->moveAfter( this );
        emitChange();
        return s;
    }
    else
        return 0;
}
void MobipocketHtmlBookReader::TOCReader::addReference(size_t position, const std::string &text) {
	myEntries[position] = text;
	if (rangeContainsPosition(position)) {
		setEndOffset(position);
	}
}