source: thomson/elec/CrO2/software/Tape.h@ 53c4be3

main
Last change on this file since 53c4be3 was 53c4be3, checked in by Adrien Destugues <pulkomandy@…>, 12 years ago
  • Support for ZX spectrup TAP files.

git-svn-id: svn://localhost/thomson@17 85ae3b6b-dc8f-4344-a89d-598714f2e4e5

  • Property mode set to 100644
File size: 1006 bytes
Line 
1/* CrO2 datassette emulator
2 * Copyright 2012, Adrien Destugues <pulkomandy@pulkomandy.ath.cx>
3 *
4 * Distributed under the terms of the MIT licence.
5 */
6#pragma once
7
8#include <stdint.h>
9#include <string>
10#include <vector>
11
12class Tape {
13 public:
14 class Block {
15 public:
16 Block(int length);
17 Block(const Block& other);
18 virtual ~Block();
19 const Block& operator=(const Block& other);
20
21 virtual bool isFile() const = 0;
22 // Does this block mark the start of a file ?
23 virtual bool isControl() const = 0;
24 // Is this block a control (sync, eof, ...) or data block ?
25 virtual const std::string getName() const = 0;
26
27 int length;
28 uint8_t* data;
29 private:
30 Block() = delete;
31 };
32
33 virtual ~Tape();
34
35 static Tape* load(const char* filename) throw (const char*);
36
37 int getBlockCount() const;
38 Block& getBlock(int number);
39 const Block& getBlock(int number) const;
40 protected:
41 Tape() {};
42 std::vector<Block*> blocks;
43};
Note: See TracBrowser for help on using the repository browser.