summaryrefslogtreecommitdiffhomepage
path: root/ClickStream.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2025-01-03 21:02:11 +0100
committerRoland Reichwein <mail@reichwein.it>2025-01-03 21:02:11 +0100
commit22cdfccb11679d6ae241653c9cb92c32f4fc1fde (patch)
tree16b0f8401e22c99e8d953eea14ac57a2fe50c67a /ClickStream.h
parent6bf4770e950299da92952f2965cccf86a903fc9f (diff)
Integrate ClickStream into PCM
Diffstat (limited to 'ClickStream.h')
-rw-r--r--ClickStream.h57
1 files changed, 0 insertions, 57 deletions
diff --git a/ClickStream.h b/ClickStream.h
deleted file mode 100644
index c94f8de..0000000
--- a/ClickStream.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#pragma once
-
-#include "config.h"
-
-#include <libreichwein/file.h>
-
-#include <cstring>
-#include <string>
-#include <vector>
-
-class ClickStream
-{
-public:
- ClickStream(): m_phase(1000000)
- {
- std::string data_s = Reichwein::File::getFile("media/click.s16le");
- m_data.resize(data_s.size() / 2); // src is in bytes
- memcpy(m_data.data(), data_s.data(), data_s.size());
- }
-
- // generate 1 buffer size
- void generate()
- {
- int i;
- size_t j = m_phase;
-
- for (i = 0; i < nframes; i++) {
- if (j >= m_data.size())
- {
- buffer[i] = 0;
- }
- else
- {
- buffer[i] = m_data[j];
- }
- j++;
- }
-
- m_phase = j;
- }
-
- void click()
- {
- m_phase = 0;
- }
-
- int16_t* get_buffer()
- {
- return buffer;
- }
-
-private:
- std::vector<uint16_t> m_data;
- size_t m_phase;
- int16_t buffer[nframes];
-};
-