KDEGames

virtualfileqt-openal.h
1 /***************************************************************************
2  * Copyright 2019 Alexander Potashev <[email protected]> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Library General Public License *
6  * version 2 as published by the Free Software Foundation *
7  * *
8  * This program is distributed in the hope that it will be useful, *
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11  * GNU Library General Public License for more details. *
12  * *
13  * You should have received a copy of the GNU Library General Public *
14  * License along with this program; if not, write to the *
15  * Free Software Foundation, Inc., *
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
17  ***************************************************************************/
18 
19 #ifndef LIBKDEGAMES_VIRTUALFILEQT_OPENAL_H
20 #define LIBKDEGAMES_VIRTUALFILEQT_OPENAL_H
21 
22 #include <sndfile.hh>
23 
24 #include <QFile>
25 
26 class VirtualFileQt
27 {
28 public:
29  explicit VirtualFileQt(const QString &path);
30  ~VirtualFileQt() = default;
31 
32  bool open();
33 
34  int64_t getFileLen() const;
35  int64_t seek(int64_t offset, int whence);
36  int64_t read(void *ptr, int64_t count);
37  int64_t write(const void *ptr, int64_t count);
38  int64_t tell();
39 
40  static SF_VIRTUAL_IO& getSndfileVirtualIO();
41  static VirtualFileQt *get(void *user_data);
42 
43 private:
44  QFile m_file;
45 };
46 
47 #endif //LIBKDEGAMES_VIRTUALFILEQT_OPENAL_H
KIOCORE_EXPORT FileJob * open(const QUrl &url, QIODevice::OpenMode mode)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 22:37:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.