From e7ad2e1fab9c51189fdc8b4f2d81f625da9dd422 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 29 Oct 2016 22:09:13 +0200 Subject: Modernise PRBS generator and remove code for cmd line parser --- src/dabInputPrbs.h | 48 ++++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) (limited to 'src/dabInputPrbs.h') diff --git a/src/dabInputPrbs.h b/src/dabInputPrbs.h index 22c088c..9cde7e2 100644 --- a/src/dabInputPrbs.h +++ b/src/dabInputPrbs.h @@ -1,6 +1,13 @@ /* Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) + + Copyright (C) 2016 + Matthias P. Braendli, matthias.braendli@mpb.li + + http://www.opendigitalradio.org + + Pseudo-Random Bit Sequence generator for test purposes. */ /* This file is part of ODR-DabMux. @@ -19,38 +26,27 @@ along with ODR-DabMux. If not, see . */ -#ifndef DAB_INPUT_PRBS_H -#define DAB_INPUT_PRBS_H - +#pragma once #ifdef HAVE_CONFIG_H -# include "config.h" +# include "config.h" #endif -#include "dabInput.h" -#include "prbs.h" - -#include +#include -#ifdef HAVE_FORMAT_RAW -# ifdef HAVE_INPUT_PRBS - - -extern struct dabInputOperations dabInputPrbsOperations; - -int dabInputPrbsInit(void** args); -int dabInputPrbsOpen(void* args, const char* name); -int dabInputPrbsRead(void* args, void* buffer, int size); -int dabInputPrbsReadFrame(dabInputOperations* ops, void* args, - void* buffer, int size); -int dabInputPrbsBitrate(dabInputOperations* ops, void* args, int bitrate); -int dabInputPrbsClose(void* args); -int dabInputPrbsClean(void** args); -int dabInputPrbsRewind(void* args); +#include "dabInput.h" +#include "prbs.h" +class DabInputPrbs : public DabInputBase { + public: + virtual int open(const std::string name); + virtual int readFrame(void* buffer, int size); + virtual int setBitrate(int bitrate); + virtual int close(); -# endif -#endif + private: + virtual int rewind(); + PrbsGenerator m_prbs; +}; -#endif // DAB_INPUT_PRBS_H -- cgit v1.2.3