From: Bert Vermeulen Date: Sat, 26 Jul 2014 09:00:51 +0000 (+0200) Subject: output/wav: Initial module skeleton. X-Git-Tag: libsigrok-0.4.0~1185 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=afaa75b98c8beca03d67d28dacbffee819c2f70b;p=libsigrok.git output/wav: Initial module skeleton. --- diff --git a/Makefile.am b/Makefile.am index e81ead05..8ffc99a9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,6 +59,7 @@ libsigrok_la_SOURCES += \ src/output/binary.c \ src/output/csv.c \ src/output/chronovu_la8.c \ + src/output/wav.c \ src/output/gnuplot.c \ src/output/hex.c \ src/output/ols.c \ diff --git a/src/output/output.c b/src/output/output.c index 6406fcac..c5533454 100644 --- a/src/output/output.c +++ b/src/output/output.c @@ -60,6 +60,7 @@ extern SR_PRIV struct sr_output_module output_gnuplot; extern SR_PRIV struct sr_output_module output_chronovu_la8; extern SR_PRIV struct sr_output_module output_csv; extern SR_PRIV struct sr_output_module output_analog; +extern SR_PRIV struct sr_output_module output_wav; /* @endcond */ static const struct sr_output_module *output_module_list[] = { @@ -73,6 +74,7 @@ static const struct sr_output_module *output_module_list[] = { &output_vcd, &output_chronovu_la8, &output_analog, + &output_wav, NULL, }; diff --git a/src/output/wav.c b/src/output/wav.c new file mode 100644 index 00000000..1fed39a0 --- /dev/null +++ b/src/output/wav.c @@ -0,0 +1,58 @@ +/* + * This file is part of the libsigrok project. + * + * Copyright (C) 2014 Bert Vermeulen + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "libsigrok.h" +#include "libsigrok-internal.h" + +#define LOG_PREFIX "output/wav" + +static int init(struct sr_output *o, GHashTable *options) +{ + (void)o; + (void)options; + + return SR_OK; +} + +static int receive(const struct sr_output *o, const struct sr_datafeed_packet *packet, + GString **out) +{ + (void)o; + (void)packet; + (void)out; + + return SR_OK; +} + +static int cleanup(struct sr_output *o) +{ + (void)o; + + return SR_OK; +} + +SR_PRIV struct sr_output_module output_wav = { + .id = "wav", + .name = "WAV", + .desc = "WAVE PCM sound module", + .init = init, + .receive = receive, + .cleanup = cleanup, +}; +