diff options
Diffstat (limited to 'src/devices/sound/samples.h')
-rw-r--r-- | src/devices/sound/samples.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/devices/sound/samples.h b/src/devices/sound/samples.h index f1512853a6a..288d46f4d51 100644 --- a/src/devices/sound/samples.h +++ b/src/devices/sound/samples.h @@ -42,27 +42,27 @@ class samples_device : public device_t, { public: // construction/destruction - samples_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + samples_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // static configuration helpers - static void static_set_channels(device_t &device, UINT8 channels) { downcast<samples_device &>(device).m_channels = channels; } + static void static_set_channels(device_t &device, uint8_t channels) { downcast<samples_device &>(device).m_channels = channels; } static void static_set_samples_names(device_t &device, const char *const *names) { downcast<samples_device &>(device).m_names = names; } static void set_samples_start_callback(device_t &device, samples_start_cb_delegate callback) { downcast<samples_device &>(device).m_samples_start_cb = callback; } // getters - bool playing(UINT8 channel) const; - UINT32 base_frequency(UINT8 channel) const; + bool playing(uint8_t channel) const; + uint32_t base_frequency(uint8_t channel) const; // start/stop helpers - void start(UINT8 channel, UINT32 samplenum, bool loop = false); - void start_raw(UINT8 channel, const INT16 *sampledata, UINT32 samples, UINT32 frequency, bool loop = false); - void pause(UINT8 channel, bool pause = true); - void stop(UINT8 channel); + void start(uint8_t channel, uint32_t samplenum, bool loop = false); + void start_raw(uint8_t channel, const int16_t *sampledata, uint32_t samples, uint32_t frequency, bool loop = false); + void pause(uint8_t channel, bool pause = true); + void stop(uint8_t channel); void stop_all(); // dynamic control - void set_frequency(UINT8 channel, UINT32 frequency); - void set_volume(UINT8 channel, float volume); + void set_frequency(uint8_t channel, uint32_t frequency); + void set_volume(uint8_t channel, float volume); // helpers struct sample_t @@ -70,19 +70,19 @@ public: // shouldn't need a copy, but in case it happens, catch it here sample_t &operator=(const sample_t &rhs) { assert(false); return *this; } - UINT32 frequency; // frequency of the sample - std::vector<INT16> data; // 16-bit signed data + uint32_t frequency; // frequency of the sample + std::vector<int16_t> data; // 16-bit signed data }; static bool read_sample(emu_file &file, sample_t &sample); // interface - UINT8 m_channels; // number of discrete audio channels needed + uint8_t m_channels; // number of discrete audio channels needed const char *const *m_names; // array of sample names samples_start_cb_delegate m_samples_start_cb; // optional callback protected: // subclasses can do it this way - samples_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + samples_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source); // device-level overrides virtual void device_start() override; @@ -96,13 +96,13 @@ protected: struct channel_t { sound_stream * stream; - const INT16 * source; - INT32 source_length; - INT32 source_num; - UINT32 pos; - UINT32 frac; - UINT32 step; - UINT32 basefreq; + const int16_t * source; + int32_t source_length; + int32_t source_num; + uint32_t pos; + uint32_t frac; + uint32_t step; + uint32_t basefreq; bool loop; bool paused; }; @@ -117,9 +117,9 @@ protected: std::vector<sample_t> m_sample; // internal constants - static const UINT8 FRAC_BITS = 24; - static const UINT32 FRAC_ONE = 1 << FRAC_BITS; - static const UINT32 FRAC_MASK = FRAC_ONE - 1; + static const uint8_t FRAC_BITS = 24; + static const uint32_t FRAC_ONE = 1 << FRAC_BITS; + static const uint32_t FRAC_MASK = FRAC_ONE - 1; }; // iterator, since lots of people are interested in these devices |