summaryrefslogtreecommitdiff
path: root/includes/cdreader.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/cdreader.h')
-rw-r--r--includes/cdreader.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/includes/cdreader.h b/includes/cdreader.h
index 6e952bb..4be3344 100644
--- a/includes/cdreader.h
+++ b/includes/cdreader.h
@@ -11,7 +11,7 @@ class cdreader : public Handle {
public:
cdreader(const String &) throw (GeneralException);
cdreader(const cdreader &);
- virtual ~cdreader() {}
+ virtual ~cdreader();
virtual bool CanWrite() const;
virtual bool CanRead() const;
virtual bool CanSeek() const;
@@ -22,12 +22,24 @@ class cdreader : public Handle {
virtual off_t seek(off_t, int = SEEK_SET) throw (GeneralException);
virtual String GetName() const;
virtual ssize_t GetSize() const;
- virtual void getsector(void *, int = -1) throw (GeneralException);
- virtual void sectorseek(int);
+ void fetchsector(void *, int = -1);
+ void getsector(void *, int = -1, int = 1) throw (GeneralException);
+ void sectorseek(int);
private:
+ struct cachedsector {
+ Byte sector[2352];
+ cachedsector * next, * prev;
+ int n;
+ };
String n;
int sector;
+ cachedsector * head, * tail, * sectors[400000];
+ int nsectors;
+
+ void removetail();
+ void actualize(cachedsector * s);
+ void introduce(Byte * datas, int n);
};
#endif