ScummVM API documentation
atari-audiocd.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BACKENDS_AUDIOCD_ATARI_H
23 #define BACKENDS_AUDIOCD_ATARI_H
24 
25 #include "backends/audiocd/default/default-audiocd.h"
26 
27 #include <mint/cdromio.h>
28 #include <mint/metados.h>
29 
30 #include "common/array.h"
31 
37 public:
39  ~AtariAudioCDManager() override;
40 
41  bool open() override;
42  void close() override;
43  bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate,
44  Audio::Mixer::SoundType soundType) override;
45  void stop() override;
46  bool isPlaying() const override;
47  void update() override;
48  bool existExtractedCDAudioFiles(uint track) override;
49 
50 protected:
51  bool openCD(int drive) override;
52 
53 private:
54  enum { kMaxDrives = 32 };
55 
56  struct Drive {
57  char letter; // Drive letter ('A'..'Z'), 0 if absent
58  metaopen_t metaopen; // Filled in while the drive is open
59  };
60 
61  bool loadTOC();
62  int ioctl(int command, void *arg) const;
63  bool startPlayback(int track, int startFrame, int duration);
64 
65  Drive _drives[kMaxDrives];
66  int _numDrives;
67  int _drive; // Index into _drives, -1 if no drive is open
68 
69  // GEMDOS-to-BOS drive mapping table from metainit.info->log2phys
70  // (NULL if MetaDOS didn't supply one)
71  const char *_log2phys;
72 
73  Common::Array<cdrom_tocentry> _tocEntries; // Includes the leadout as the final entry
74 
75  int _cdTrack;
76  int _cdNumLoops;
77  int _cdStartFrame;
78  int _cdDuration;
79  uint32 _cdEndTime;
80  uint32 _cdStopTime;
81 };
82 
83 #endif
void update() override
bool isPlaying() const override
Definition: default-audiocd.h:35
bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate, Audio::Mixer::SoundType soundType) override
void close() override
Definition: atari-audiocd.h:36
SoundType
Definition: mixer.h:73
void stop() override
bool open() override
bool existExtractedCDAudioFiles(uint track) override
bool openCD(int drive) override