KDEGames

virtualfileqt-openal.h
1 /*
2  SPDX-FileCopyrightText: 2019 Alexander Potashev <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-only
5 */
6 
7 #ifndef LIBKDEGAMES_VIRTUALFILEQT_OPENAL_H
8 #define LIBKDEGAMES_VIRTUALFILEQT_OPENAL_H
9 
10 // Qt
11 #include <QFile>
12 // sndfile
13 #include <sndfile.hh>
14 
15 
16 class VirtualFileQt
17 {
18 public:
19  explicit VirtualFileQt(const QString &path);
20  ~VirtualFileQt() = default;
21 
22  bool open();
23 
24  int64_t getFileLen() const;
25  int64_t seek(int64_t offset, int whence);
26  int64_t read(void *ptr, int64_t count);
27  int64_t write(const void *ptr, int64_t count);
28  int64_t tell();
29 
30  static SF_VIRTUAL_IO& getSndfileVirtualIO();
31  static VirtualFileQt *get(void *user_data);
32 
33 private:
34  QFile m_file;
35 };
36 
37 #endif //LIBKDEGAMES_VIRTUALFILEQT_OPENAL_H
QVariant read(const QByteArray &data, int versionOverride=0)
KIOCORE_EXPORT FileJob * open(const QUrl &url, QIODevice::OpenMode mode)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Dec 7 2021 22:34:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.