summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/cdda.h
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-09-13 08:41:44 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2015-09-13 08:41:44 +0200
commitf88cefad27a1737c76e09d99c9fb43e173506081 (patch)
tree2d8167d03579c46e226471747eb4407bd00ed6fa /src/devices/sound/cdda.h
parente92ac9e0fa8e99869894bea00589bbb526be30aa (diff)
Move all devices into separate part of src tree (nw)
Diffstat (limited to 'src/devices/sound/cdda.h')
-rw-r--r--src/devices/sound/cdda.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/devices/sound/cdda.h b/src/devices/sound/cdda.h
new file mode 100644
index 00000000000..7650348a099
--- /dev/null
+++ b/src/devices/sound/cdda.h
@@ -0,0 +1,58 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles,smf
+#pragma once
+
+#ifndef __CDDA_H__
+#define __CDDA_H__
+
+#include "cdrom.h"
+
+class cdda_device : public device_t,
+ public device_sound_interface
+{
+public:
+ cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ void set_cdrom(void *file);
+
+ void start_audio(UINT32 startlba, UINT32 numblocks);
+ void stop_audio();
+ void pause_audio(int pause);
+ void set_volume(int volume);
+ void set_channel_volume(int channel, int volume);
+ INT16 get_channel_volume(int channel);
+
+ UINT32 get_audio_lba();
+ int audio_active();
+ int audio_paused();
+ int audio_ended();
+
+ cdrom_file * m_disc;
+
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+
+ // sound stream update overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
+private:
+ void get_audio_data(stream_sample_t *bufL, stream_sample_t *bufR, UINT32 samples_wanted);
+
+ // internal state
+ sound_stream * m_stream;
+
+ INT8 m_audio_playing, m_audio_pause, m_audio_ended_normally;
+ UINT32 m_audio_lba, m_audio_length;
+
+ UINT8 * m_audio_cache;
+ UINT32 m_audio_samples;
+ UINT32 m_audio_bptr;
+ INT16 m_audio_volume[2];
+};
+
+extern const device_type CDDA;
+
+
+#endif /* __CDDA_H__ */