diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e17317..4c122c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,13 +2,13 @@ name: build on: push: - branches: [ master ] + branches: [ master, dev ] tags: [ 'v*' ] pull_request: branches: [ master ] jobs: - ubuntu-build: + build-ubuntu: runs-on: ubuntu-latest steps: @@ -21,10 +21,8 @@ jobs: run: meson setup -Dwerror=true build - name: compile run: cd build && meson compile - - name: test - run: cd build && meson test - build-deb: + build-ubuntu-deb-package: runs-on: ubuntu-latest steps: @@ -39,7 +37,22 @@ jobs: #- name: Install .deb # run: dpkg -i ../redsea_*.deb - macos-build: + build-debian-oldoldstable: + runs-on: ubuntu-latest + container: debian:buster + + steps: + - uses: actions/checkout@v4 + - name: Install dependencies (apt-get) + run: apt-get update && apt-get -y install python3-pip ninja-build build-essential libsndfile1-dev libliquid-dev nlohmann-json3-dev + - name: Install meson (pip3) + run: pip3 install --user meson + - name: meson setup + run: export PATH=$PATH:$HOME/.local/bin && meson setup -Dwerror=true build + - name: compile + run: export PATH=$PATH:$HOME/.local/bin && cd build && meson compile + + build-test-macos: runs-on: macos-latest steps: @@ -53,7 +66,7 @@ jobs: - name: test run: cd build && meson test - windows-msys2-mingw-build: + build-windows-msys2-mingw: runs-on: windows-latest steps: @@ -84,9 +97,6 @@ jobs: shell: msys2 {0} run: | meson setup -Dwerror=true build && cd build && meson compile - - name: test - shell: msys2 {0} - run: cd build && meson test - name: Package into distrib shell: msys2 {0} run: >- @@ -100,7 +110,7 @@ jobs: awk '{$1=$1};1' | xargs -I{} cp {} distrib/ - windows-cygwin-build: + build-windows-cygwin: runs-on: windows-latest steps: @@ -139,6 +149,3 @@ jobs: - name: Build redsea shell: C:\cygwin\bin\bash.exe -eo pipefail '{0}' run: meson setup -Dwerror=true build && cd build && meson compile - - name: test - shell: C:\cygwin\bin\bash.exe -eo pipefail '{0}' - run: cd build && meson test diff --git a/src/redsea.cc b/src/redsea.cc index 58d859f..12ca917 100644 --- a/src/redsea.cc +++ b/src/redsea.cc @@ -128,26 +128,26 @@ int processMPXInput(Options options) { auto& output_stream = options.feed_thru ? std::cerr : std::cout; - std::vector channels; + std::vector> channels; std::vector> subcarriers; for (uint32_t i = 0; i < options.num_channels; i++) { - channels.emplace_back(options, i, output_stream); + channels.emplace_back(std::make_unique(options, i, output_stream)); subcarriers.push_back(std::make_unique(options)); } while (!mpx.eof()) { mpx.fillBuffer(); for (uint32_t i = 0; i < options.num_channels; i++) { - channels[i].processBits(subcarriers[i]->processChunk(mpx.readChunk(i))); - if (channels[i].getSecondsSinceCarrierLost() > 10.f && + channels[i]->processBits(subcarriers[i]->processChunk(mpx.readChunk(i))); + if (channels[i]->getSecondsSinceCarrierLost() > 10.f && subcarriers[i]->getSecondsSinceLastReset() > 5.f) { subcarriers[i]->reset(); - channels[i].resetPI(); + channels[i]->resetPI(); } } } - for (uint32_t i = 0; i < options.num_channels; i++) channels[i].flush(); + for (uint32_t i = 0; i < options.num_channels; i++) channels[i]->flush(); return EXIT_SUCCESS; }