diff options
-rw-r--r-- | client/platform.h | 4 | ||||
-rw-r--r-- | client/windows/platform.cpp | 8 | ||||
-rw-r--r-- | client/windows/playback.cpp | 14 | ||||
-rw-r--r-- | client/windows/playback.h | 4 | ||||
-rw-r--r-- | client/windows/record.cpp | 12 | ||||
-rw-r--r-- | client/windows/record.h | 4 | ||||
-rw-r--r-- | client/x11/platform.cpp | 8 | ||||
-rw-r--r-- | client/x11/playback.cpp | 16 | ||||
-rw-r--r-- | client/x11/playback.h | 6 | ||||
-rw-r--r-- | client/x11/record.cpp | 10 | ||||
-rw-r--r-- | client/x11/record.h | 4 |
11 files changed, 45 insertions, 45 deletions
diff --git a/client/platform.h b/client/platform.h index 0a88f06b..7b543e9c 100644 --- a/client/platform.h +++ b/client/platform.h @@ -66,11 +66,11 @@ public: class RecordClient; static WaveRecordAbstract* create_recorder(RecordClient& client, - uint32_t sampels_per_sec, + uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size); - static WavePlaybackAbstract* create_player(uint32_t sampels_per_sec, + static WavePlaybackAbstract* create_player(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size); diff --git a/client/windows/platform.cpp b/client/windows/platform.cpp index d3417e39..fc51a12d 100644 --- a/client/windows/platform.cpp +++ b/client/windows/platform.cpp @@ -640,18 +640,18 @@ void Platform::set_process_loop(ProcessLoop& main_process_loop) } WaveRecordAbstract* Platform::create_recorder(RecordClient& client, - uint32_t sampels_per_sec, + uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels) { - return new WaveRecorder(client, sampels_per_sec, bits_per_sample, channels); + return new WaveRecorder(client, samples_per_sec, bits_per_sample, channels); } -WavePlaybackAbstract* Platform::create_player(uint32_t sampels_per_sec, +WavePlaybackAbstract* Platform::create_player(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels) { - return new WavePlayer(sampels_per_sec, bits_per_sample, channels); + return new WavePlayer(samples_per_sec, bits_per_sample, channels); } static void toggle_modifier(int key) diff --git a/client/windows/playback.cpp b/client/windows/playback.cpp index 41b92bc1..87ed26a0 100644 --- a/client/windows/playback.cpp +++ b/client/windows/playback.cpp @@ -29,9 +29,9 @@ #define LOW_MARK_MS 40 -WavePlayer::WavePlayer(uint32_t sampels_per_sec, uint32_t bits_per_sample, uint32_t channels) +WavePlayer::WavePlayer(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels) : _wave_out (NULL) - , _sampels_per_ms (sampels_per_sec / 1000) + , _samples_per_ms (samples_per_sec / 1000) , _ring (NULL) , _head (0) , _in_use (0) @@ -42,9 +42,9 @@ WavePlayer::WavePlayer(uint32_t sampels_per_sec, uint32_t bits_per_sample, uint3 info.wFormatTag = WAVE_FORMAT_PCM; info.nChannels = channels; - info.nSamplesPerSec = sampels_per_sec; + info.nSamplesPerSec = samples_per_sec; sample_bytes = info.nBlockAlign = channels * bits_per_sample / 8; - info.nAvgBytesPerSec = sampels_per_sec * info.nBlockAlign; + info.nAvgBytesPerSec = samples_per_sec * info.nBlockAlign; info.wBitsPerSample = bits_per_sample; if (waveOutOpen(&_wave_out, WAVE_MAPPER, &info, 0, 0, CALLBACK_NULL) @@ -53,8 +53,8 @@ WavePlayer::WavePlayer(uint32_t sampels_per_sec, uint32_t bits_per_sample, uint3 } int frame_size = WavePlaybackAbstract::FRAME_SIZE; - _ring_size = (sampels_per_sec * RING_SIZE_MS / 1000) / frame_size; - _start_mark = (sampels_per_sec * START_MARK_MS / 1000) / frame_size; + _ring_size = (samples_per_sec * RING_SIZE_MS / 1000) / frame_size; + _start_mark = (samples_per_sec * START_MARK_MS / 1000) / frame_size; _frame_bytes = frame_size * channels * bits_per_sample / 8; _ring_item_size = sizeof(WAVEHDR) + _frame_bytes + sample_bytes; @@ -174,5 +174,5 @@ bool WavePlayer::abort() uint32_t WavePlayer::get_delay_ms() { - return _in_use * WavePlaybackAbstract::FRAME_SIZE / _sampels_per_ms; + return _in_use * WavePlaybackAbstract::FRAME_SIZE / _samples_per_ms; } diff --git a/client/windows/playback.h b/client/windows/playback.h index 6f70a7b4..6493eff4 100644 --- a/client/windows/playback.h +++ b/client/windows/playback.h @@ -22,7 +22,7 @@ class WavePlayer: public WavePlaybackAbstract { public: - WavePlayer(uint32_t sampels_per_sec, uint32_t bits_per_sample, uint32_t channels); + WavePlayer(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels); virtual ~WavePlayer(); virtual bool write(uint8_t* frame); @@ -40,7 +40,7 @@ private: private: HWAVEOUT _wave_out; - uint32_t _sampels_per_ms; + uint32_t _samples_per_ms; uint32_t _frame_bytes; uint32_t _start_mark; uint32_t _ring_item_size; diff --git a/client/windows/record.cpp b/client/windows/record.cpp index 0736b113..a2e5f393 100644 --- a/client/windows/record.cpp +++ b/client/windows/record.cpp @@ -32,7 +32,7 @@ static void CALLBACK in_proc(HWAVEIN handle, UINT msg, DWORD user_data, DWORD pa recorder->trigger(); } -WaveRecorder::WaveRecorder(Platform::RecordClient& client, uint32_t sampels_per_sec, +WaveRecorder::WaveRecorder(Platform::RecordClient& client, uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels) : _client (client) , _ring (NULL) @@ -45,9 +45,9 @@ WaveRecorder::WaveRecorder(Platform::RecordClient& client, uint32_t sampels_per_ info.wFormatTag = WAVE_FORMAT_PCM; info.nChannels = channels; - info.nSamplesPerSec = sampels_per_sec; + info.nSamplesPerSec = samples_per_sec; info.nBlockAlign = frame_align = channels * bits_per_sample / 8; - info.nAvgBytesPerSec = sampels_per_sec * info.nBlockAlign; + info.nAvgBytesPerSec = samples_per_sec * info.nBlockAlign; info.wBitsPerSample = bits_per_sample; @@ -63,7 +63,7 @@ WaveRecorder::WaveRecorder(Platform::RecordClient& client, uint32_t sampels_per_ _frame = new uint8_t[frame_bytes]; _frame_pos = _frame; _frame_end = _frame + frame_bytes; - init_ring(sampels_per_sec, frame_bytes, frame_align); + init_ring(samples_per_sec, frame_bytes, frame_align); _client.add_event_source(*this); } catch (...) { delete[] _ring; @@ -83,11 +83,11 @@ WaveRecorder::~WaveRecorder() delete[] _frame; } -void WaveRecorder::init_ring(uint32_t sampels_per_sec, uint32_t frame_bytes, uint32_t frame_align) +void WaveRecorder::init_ring(uint32_t samples_per_sec, uint32_t frame_bytes, uint32_t frame_align) { const int frame_size = WavePlaybackAbstract::FRAME_SIZE; - _ring_size = (sampels_per_sec * RING_SIZE_MS / 1000) / frame_size; + _ring_size = (samples_per_sec * RING_SIZE_MS / 1000) / frame_size; _ring_item_size = sizeof(WAVEHDR) + frame_bytes + frame_align; int ring_bytes = _ring_size * _ring_item_size; diff --git a/client/windows/record.h b/client/windows/record.h index 4071af4f..73264197 100644 --- a/client/windows/record.h +++ b/client/windows/record.h @@ -23,7 +23,7 @@ class WaveRecorder: public WaveRecordAbstract, public EventSources::Trigger { public: - WaveRecorder(Platform::RecordClient& client, uint32_t sampels_per_sec, + WaveRecorder(Platform::RecordClient& client, uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels); virtual ~WaveRecorder(); @@ -34,7 +34,7 @@ public: virtual void on_event(); private: - void init_ring(uint32_t sampels_per_sec, uint32_t frame_bytes, uint32_t frame_align); + void init_ring(uint32_t samples_per_sec, uint32_t frame_bytes, uint32_t frame_align); WAVEHDR* wave_hader(uint32_t position); void move_head(); diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp index bb8704c4..6a374835 100644 --- a/client/x11/platform.cpp +++ b/client/x11/platform.cpp @@ -3431,20 +3431,20 @@ void Platform::reset_cursor_pos() } WaveRecordAbstract* Platform::create_recorder(RecordClient& client, - uint32_t sampels_per_sec, + uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size) { - return new WaveRecorder(client, sampels_per_sec, bits_per_sample, channels, frame_size); + return new WaveRecorder(client, samples_per_sec, bits_per_sample, channels, frame_size); } -WavePlaybackAbstract* Platform::create_player(uint32_t sampels_per_sec, +WavePlaybackAbstract* Platform::create_player(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size) { - return new WavePlayer(sampels_per_sec, bits_per_sample, channels, frame_size); + return new WavePlayer(samples_per_sec, bits_per_sample, channels, frame_size); } void XPlatform::on_focus_in() diff --git a/client/x11/playback.cpp b/client/x11/playback.cpp index 035d6de8..83946aac 100644 --- a/client/x11/playback.cpp +++ b/client/x11/playback.cpp @@ -24,12 +24,12 @@ #define REING_SIZE_MS 300 -WavePlayer::WavePlayer(uint32_t sampels_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size) +WavePlayer::WavePlayer(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size) : _pcm (NULL) , _hw_params (NULL) , _sw_params (NULL) { - if (!init(sampels_per_sec, bits_per_sample, channels, frame_size)) { + if (!init(samples_per_sec, bits_per_sample, channels, frame_size)) { cleanup(); THROW("failed"); } @@ -55,7 +55,7 @@ WavePlayer::~WavePlayer() cleanup(); } -bool WavePlayer::init(uint32_t sampels_per_sec, +bool WavePlayer::init(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size) @@ -74,7 +74,7 @@ bool WavePlayer::init(uint32_t sampels_per_sec, default: return false; } - _sampels_per_ms = sampels_per_sec / 1000; + _samples_per_ms = samples_per_sec / 1000; _frame_size = frame_size; if ((err = snd_pcm_open(&_pcm, pcm_device, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK)) < 0) { @@ -108,7 +108,7 @@ bool WavePlayer::init(uint32_t sampels_per_sec, return false; } - if ((err = snd_pcm_hw_params_set_rate(_pcm, _hw_params, sampels_per_sec, 0)) < 0) { + if ((err = snd_pcm_hw_params_set_rate(_pcm, _hw_params, samples_per_sec, 0)) < 0) { LOG_ERROR("cannot set sample rate %s", snd_strerror(err)); return false; } @@ -124,7 +124,7 @@ bool WavePlayer::init(uint32_t sampels_per_sec, } snd_pcm_uframes_t buffer_size; - buffer_size = (sampels_per_sec * REING_SIZE_MS / 1000) / frame_size * frame_size; + buffer_size = (samples_per_sec * REING_SIZE_MS / 1000) / frame_size * frame_size; if ((err = snd_pcm_hw_params_set_buffer_size_near(_pcm, _hw_params, &buffer_size)) < 0) { LOG_ERROR("cannot set buffer size %s", snd_strerror(err)); @@ -132,7 +132,7 @@ bool WavePlayer::init(uint32_t sampels_per_sec, } int direction = 1; - snd_pcm_uframes_t period_size = (sampels_per_sec * 20 / 1000) / frame_size * frame_size; + snd_pcm_uframes_t period_size = (samples_per_sec * 20 / 1000) / frame_size * frame_size; if ((err = snd_pcm_hw_params_set_period_size_near(_pcm, _hw_params, &period_size, &direction)) < 0) { LOG_ERROR("cannot set period size %s", snd_strerror(err)); @@ -217,5 +217,5 @@ uint32_t WavePlayer::get_delay_ms() if (snd_pcm_delay(_pcm, &delay) < 0) { return 0; } - return delay / _sampels_per_ms; + return delay / _samples_per_ms; } diff --git a/client/x11/playback.h b/client/x11/playback.h index 383f02d3..c0b8c52e 100644 --- a/client/x11/playback.h +++ b/client/x11/playback.h @@ -25,7 +25,7 @@ class WavePlayer: public WavePlaybackAbstract { public: - WavePlayer(uint32_t sampels_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size); + WavePlayer(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size); virtual ~WavePlayer(); virtual bool write(uint8_t* frame); @@ -34,14 +34,14 @@ public: virtual uint32_t get_delay_ms(); private: - bool init(uint32_t sampels_per_sec, uint32_t bits_per_sample, uint32_t channel, uint32_t frame_size); + bool init(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channel, uint32_t frame_size); void cleanup(); private: snd_pcm_t* _pcm; snd_pcm_hw_params_t* _hw_params; snd_pcm_sw_params_t* _sw_params; - uint32_t _sampels_per_ms; + uint32_t _samples_per_ms; uint32_t _frame_size; }; diff --git a/client/x11/record.cpp b/client/x11/record.cpp index 32c0af7f..6bc9f604 100644 --- a/client/x11/record.cpp +++ b/client/x11/record.cpp @@ -46,7 +46,7 @@ void WaveRecorder::EventTrigger::on_event() } WaveRecorder::WaveRecorder(Platform::RecordClient& client, - uint32_t sampels_per_sec, + uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size) @@ -60,7 +60,7 @@ WaveRecorder::WaveRecorder(Platform::RecordClient& client, , _frame_end (_frame + _sample_bytes * frame_size) , _event_trigger (NULL) { - if (!init(sampels_per_sec, bits_per_sample, channels, frame_size)) { + if (!init(samples_per_sec, bits_per_sample, channels, frame_size)) { cleanup(); THROW("failed"); } @@ -92,7 +92,7 @@ void WaveRecorder::cleanup() } } -bool WaveRecorder::init(uint32_t sampels_per_sec, +bool WaveRecorder::init(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size) @@ -144,7 +144,7 @@ bool WaveRecorder::init(uint32_t sampels_per_sec, return false; } - if ((err = snd_pcm_hw_params_set_rate(_pcm, _hw_params, sampels_per_sec, 0)) < 0) { + if ((err = snd_pcm_hw_params_set_rate(_pcm, _hw_params, samples_per_sec, 0)) < 0) { LOG_ERROR("cannot set sample rate %s", snd_strerror(err)); return false; } @@ -160,7 +160,7 @@ bool WaveRecorder::init(uint32_t sampels_per_sec, } int direction = 0; - snd_pcm_uframes_t buffer_size = (sampels_per_sec * 160 / 1000) / frame_size * frame_size; + snd_pcm_uframes_t buffer_size = (samples_per_sec * 160 / 1000) / frame_size * frame_size; if ((err = snd_pcm_hw_params_set_buffer_size_near(_pcm, _hw_params, &buffer_size)) < 0) { LOG_ERROR("cannot set buffer size %s", snd_strerror(err)); diff --git a/client/x11/record.h b/client/x11/record.h index 9470791f..fc46948b 100644 --- a/client/x11/record.h +++ b/client/x11/record.h @@ -27,7 +27,7 @@ class WaveRecorder: public WaveRecordAbstract { public: WaveRecorder(Platform::RecordClient& client, - uint32_t sampels_per_sec, + uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size); @@ -38,7 +38,7 @@ public: virtual bool abort(); private: - bool init(uint32_t sampels_per_sec, + bool init(uint32_t samples_per_sec, uint32_t bits_per_sample, uint32_t channels, uint32_t frame_size); |