summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/spkrdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/spkrdev.h')
-rw-r--r--src/devices/sound/spkrdev.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/devices/sound/spkrdev.h b/src/devices/sound/spkrdev.h
index 49e953b5d40..175cc1f5996 100644
--- a/src/devices/sound/spkrdev.h
+++ b/src/devices/sound/spkrdev.h
@@ -1,12 +1,12 @@
// license:BSD-3-Clause
-// copyright-holders:Nicola Salmoria
+// copyright-holders:Nathan Woods, Anders Hallström
/**********************************************************************
- speaker.h
Sound driver to emulate a simple speaker,
driven by one or more output bits
**********************************************************************/
+
#ifndef MAME_SOUND_SPKRDEV_H
#define MAME_SOUND_SPKRDEV_H
@@ -21,18 +21,18 @@ public:
~speaker_sound_device() {}
// configuration
- void set_levels(int num_levels, const int16_t *levels) { m_num_levels = num_levels; m_levels = levels; }
+ void set_levels(int num_levels, const double *levels) { m_num_levels = num_levels; m_levels = levels; }
void level_w(int new_level); // can use as writeline
protected:
// device-level overrides
- virtual void device_start() override;
- virtual void device_reset() override;
+ virtual void device_start() override ATTR_COLD;
+ virtual void device_reset() override ATTR_COLD;
virtual void device_post_load() override;
// sound stream update overrides
- virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
+ virtual void sound_stream_update(sound_stream &stream) override;
private:
// Length of anti-aliasing filter kernel, measured in number of intermediate samples
@@ -44,12 +44,12 @@ private:
// internal state
// Updates the composed volume array according to time
- void update_interm_samples(const attotime &time, int volume);
+ void update_interm_samples(const attotime &time, double volume);
// Updates the composed volume array and returns final filtered volume of next stream sample
- double update_interm_samples_get_filtered_volume(int volume);
+ double update_interm_samples_get_filtered_volume(double volume);
- void finalize_interm_sample(int volume);
+ void finalize_interm_sample(double volume);
void init_next_interm_sample();
inline double make_fraction(const attotime &a, const attotime &b, double timediv);
double get_filtered_volume();
@@ -80,7 +80,7 @@ private:
double m_prevx, m_prevy;
int m_num_levels; /* optional: number of levels (if not two) */
- const int16_t *m_levels; /* optional: pointer to level lookup table */
+ const double *m_levels; /* optional: pointer to level lookup table */
};
DECLARE_DEVICE_TYPE(SPEAKER_SOUND, speaker_sound_device)