Skylicht Engine
Loading...
Searching...
No Matches
CZipAudioFileStream.h
1// Copyright (C) 2012 Pham Hong Duc
2// This file is part of the "Skylicht Technologies".
3
4#pragma once
5
6#ifdef BUILD_SKYLICHT_AUDIO
7
8#include "pch.h"
9#include "Stream/IStream.h"
10
11namespace Skylicht
12{
13 class SKYLICHT_API CZipAudioFileStreamCursor : public Skylicht::Audio::IStreamCursor
14 {
15 protected:
16 io::IReadFile* m_file;
17 int m_size;
18 int m_pos;
19
20 unsigned char* m_buffer;
21 int m_bufferSize;
22 int m_bufferAvailableBytes;
23 int m_bufferPos;
24 int m_bufferOffset;
25 public:
26 CZipAudioFileStreamCursor(io::IReadFile* file);
27 virtual ~CZipAudioFileStreamCursor();
28
29 virtual int seek(int pos, EOrigin origin);
30 virtual int tell();
31 virtual int read(unsigned char* buff, int len);
32 virtual bool endOfStream();
33 virtual int size();
34 virtual bool readyReadData(int len)
35 {
36 return true;
37 }
38 };
39
40 class SKYLICHT_API CZipAudioFileStream : public Skylicht::Audio::IStream
41 {
42 protected:
43 std::string m_fileName;
44 io::IReadFile* m_file;
45 int m_size;
46
47 public:
48 CZipAudioFileStream(const char* fileName);
49 virtual ~CZipAudioFileStream();
50
51 bool isError();
52
54 };
55
56}
57
58#endif
Interface for a stream cursor, providing seek and read operations on an audio stream.
Definition IStream.h:39
EOrigin
Origin for seek operations.
Definition IStream.h:45
Interface for an audio data stream (File, Memory, etc.).
Definition IStream.h:107
virtual int seek(int pos, EOrigin origin)
Move the cursor position.
virtual bool readyReadData(int len)
Check if a certain amount of data is ready to be read.
Definition CZipAudioFileStream.h:34
virtual int size()
Get total size of the stream.
virtual bool endOfStream()
Check if the cursor is at the end of the stream.
virtual int read(unsigned char *buff, int len)
Read data from the stream.
virtual int tell()
Get current cursor position.
virtual Skylicht::Audio::IStreamCursor * createCursor()
Create a new cursor for this stream.
Interface providing read acess to a file.
Definition IReadFile.h:18
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29