mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-27 18:14:44 +01:00
fixed bug introduced in recorder by the last commit
This commit is contained in:
parent
5e9486ef4c
commit
eff9cd4b71
@ -36,8 +36,6 @@ SDRPP_MOD_INFO {
|
|||||||
|
|
||||||
#define INPUT_SAMPLE_RATE 6000000
|
#define INPUT_SAMPLE_RATE 6000000
|
||||||
|
|
||||||
std::ofstream file("test.ts", std::ios::binary);
|
|
||||||
|
|
||||||
class Falcon9DecoderModule : public ModuleManager::Instance {
|
class Falcon9DecoderModule : public ModuleManager::Instance {
|
||||||
public:
|
public:
|
||||||
Falcon9DecoderModule(std::string name) {
|
Falcon9DecoderModule(std::string name) {
|
||||||
@ -197,8 +195,8 @@ private:
|
|||||||
_this->logsMtx.unlock();
|
_this->logsMtx.unlock();
|
||||||
}
|
}
|
||||||
else if (pktId == 0x01123201042E1403) {
|
else if (pktId == 0x01123201042E1403) {
|
||||||
//fwrite(data + 25, 1, 940, _this->ffplay);
|
fwrite(data + 25, 1, 940, _this->ffplay);
|
||||||
file.write((char*)(data + 25), 940);
|
//file.write((char*)(data + 25), 940);
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("%016" PRIX64 ": %d bytes, %d full\n", pktId, length, count);
|
//printf("%016" PRIX64 ": %d bytes, %d full\n", pktId, length, count);
|
||||||
|
@ -50,7 +50,7 @@ public:
|
|||||||
RecorderModule(std::string name) : folderSelect("%ROOT%/recordings") {
|
RecorderModule(std::string name) : folderSelect("%ROOT%/recordings") {
|
||||||
this->name = name;
|
this->name = name;
|
||||||
|
|
||||||
recPath = "%ROOT%/recording";
|
recPath = "%ROOT%/recordings";
|
||||||
|
|
||||||
// Init audio path
|
// Init audio path
|
||||||
vol.init(&dummyStream, 1.0f);
|
vol.init(&dummyStream, 1.0f);
|
||||||
@ -161,13 +161,18 @@ private:
|
|||||||
if (!pathValid) { style::beginDisabled(); }
|
if (!pathValid) { style::beginDisabled(); }
|
||||||
if (!recording) {
|
if (!recording) {
|
||||||
if (ImGui::Button(CONCAT("Record##_recorder_rec_", name), ImVec2(menuColumnWidth, 0))) {
|
if (ImGui::Button(CONCAT("Record##_recorder_rec_", name), ImVec2(menuColumnWidth, 0))) {
|
||||||
recording = true;
|
|
||||||
samplesWritten = 0;
|
samplesWritten = 0;
|
||||||
std::string expandedPath = expandString(recPath + genFileName("/baseband_", false));
|
std::string expandedPath = expandString(recPath + genFileName("/baseband_", false));
|
||||||
sampleRate = sigpath::signalPath.getSampleRate();
|
sampleRate = sigpath::signalPath.getSampleRate();
|
||||||
basebandWriter = new WavWriter(expandedPath, 16, 2, sigpath::signalPath.getSampleRate());
|
basebandWriter = new WavWriter(expandedPath, 16, 2, sigpath::signalPath.getSampleRate());
|
||||||
basebandHandler.start();
|
if (basebandWriter->isOpen()) {
|
||||||
sigpath::signalPath.bindIQStream(&basebandStream);
|
basebandHandler.start();
|
||||||
|
sigpath::signalPath.bindIQStream(&basebandStream);
|
||||||
|
recording = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
spdlog::error("Could not create '{0}'", expandedPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_Text), "Idle --:--:--");
|
ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_Text), "Idle --:--:--");
|
||||||
}
|
}
|
||||||
@ -214,13 +219,18 @@ private:
|
|||||||
if (!pathValid || selectedStreamName == "") { style::beginDisabled(); }
|
if (!pathValid || selectedStreamName == "") { style::beginDisabled(); }
|
||||||
if (!recording) {
|
if (!recording) {
|
||||||
if (ImGui::Button(CONCAT("Record##_recorder_rec_", name), ImVec2(menuColumnWidth, 0))) {
|
if (ImGui::Button(CONCAT("Record##_recorder_rec_", name), ImVec2(menuColumnWidth, 0))) {
|
||||||
recording = true;
|
|
||||||
samplesWritten = 0;
|
samplesWritten = 0;
|
||||||
std::string expandedPath = expandString(recPath + genFileName("/audio_", true, selectedStreamName));
|
std::string expandedPath = expandString(recPath + genFileName("/audio_", true, selectedStreamName));
|
||||||
sampleRate = sigpath::sinkManager.getStreamSampleRate(selectedStreamName);
|
sampleRate = sigpath::sinkManager.getStreamSampleRate(selectedStreamName);
|
||||||
audioWriter = new WavWriter(expandedPath, 16, 2, sigpath::sinkManager.getStreamSampleRate(selectedStreamName));
|
audioWriter = new WavWriter(expandedPath, 16, 2, sigpath::sinkManager.getStreamSampleRate(selectedStreamName));
|
||||||
audioHandler.start();
|
if (audioWriter->isOpen()) {
|
||||||
audioSplit.bindStream(&audioHandlerStream);
|
recording = true;
|
||||||
|
audioHandler.start();
|
||||||
|
audioSplit.bindStream(&audioHandlerStream);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
spdlog::error("Could not create '{0}'", expandedPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_Text), "Idle --:--:--");
|
ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_Text), "Idle --:--:--");
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,10 @@ public:
|
|||||||
file.write((char*)&hdr, sizeof(WavHeader_t));
|
file.write((char*)&hdr, sizeof(WavHeader_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isOpen() {
|
||||||
|
return file.is_open();
|
||||||
|
}
|
||||||
|
|
||||||
void writeSamples(void* data, size_t size) {
|
void writeSamples(void* data, size_t size) {
|
||||||
file.write((char*)data, size);
|
file.write((char*)data, size);
|
||||||
bytesWritten += size;
|
bytesWritten += size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user