7#include "virtualfileqt-openal.h"
9VirtualFileQt::VirtualFileQt(
const QString &path)
14bool VirtualFileQt::open()
19int64_t VirtualFileQt::getFileLen()
const
21 return static_cast<int64_t
>(m_file.
size());
24int64_t VirtualFileQt::seek(int64_t offset,
int whence)
28 return m_file.
seek(
static_cast<quint64
>(offset)) ? m_file.
pos() : -1;
30 return m_file.
seek(m_file.
pos() +
static_cast<quint64
>(offset)) ? m_file.
pos() : -1;
32 return m_file.
seek(m_file.
size() +
static_cast<quint64
>(offset)) ? m_file.
pos() : -1;
38int64_t VirtualFileQt::read(
void *ptr, int64_t count)
40 return static_cast<int64_t
>(m_file.
read(
static_cast<char *
>(ptr),
static_cast<qint64
>(count)));
43int64_t VirtualFileQt::write(
const void *, int64_t)
49int64_t VirtualFileQt::tell()
51 return static_cast<int64_t
>(m_file.
pos());
54sf_count_t sf_get_filelen(
void *user_data)
56 return static_cast<sf_count_t
>(VirtualFileQt::get(user_data)->getFileLen());
59sf_count_t sf_seek(sf_count_t offset,
int whence,
void *user_data)
61 return static_cast<sf_count_t
>(VirtualFileQt::get(user_data)->seek(
static_cast<int64_t
>(offset), whence));
64sf_count_t sf_read(
void *ptr, sf_count_t count,
void *user_data)
66 return static_cast<sf_count_t
>(VirtualFileQt::get(user_data)->read(ptr,
static_cast<int64_t
>(count)));
69sf_count_t sf_write(
const void *ptr, sf_count_t count,
void *user_data)
71 return static_cast<sf_count_t
>(VirtualFileQt::get(user_data)->write(ptr,
static_cast<int64_t
>(count)));
74sf_count_t sf_tell(
void *user_data)
76 return static_cast<sf_count_t
>(VirtualFileQt::get(user_data)->tell());
79SF_VIRTUAL_IO sfVirtualIO = {
87SF_VIRTUAL_IO &VirtualFileQt::getSndfileVirtualIO()
92VirtualFileQt *VirtualFileQt::get(
void *user_data)
94 return static_cast<VirtualFileQt *
>(user_data);
QString path(const QString &relativePath)
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
virtual qint64 size() const const override
virtual qint64 pos() const const override
virtual bool seek(qint64 pos) override
QByteArray read(qint64 maxSize)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:04 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.