spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 1ea744502a318883c4d1616add3ae44a2195ab03
parent 99375b456d5e1553787c6e62e22cbfab24580fac
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Wed, 30 Jun 2010 09:47:26 +1000

Add skeleton spek-audio.{c,h,vapi}

Diffstat:
M.gitignore | 1+
Msrc/Makefile.am | 6+++++-
Asrc/spek-audio.c | 22++++++++++++++++++++++
Asrc/spek-audio.h | 24++++++++++++++++++++++++
Asrc/spek-pipeline.vala | 32++++++++++++++++++++++++++++++++
Msrc/spek-source.vala | 4++--
Mvapi/Makefile.am | 3++-
Avapi/spek-audio.vapi | 4++++
8 files changed, 92 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -28,6 +28,7 @@ po/POTFILES po/stamp-it samples/ src/*.c +!src/spek-audio.c src/*.o src/*.stamp src/spek diff --git a/src/Makefile.am b/src/Makefile.am @@ -2,6 +2,8 @@ bin_PROGRAMS = spek spek_SOURCES = \ spek.vala \ + spek-audio.c \ + spek-pipeline.vala \ spek-ruler.vala \ spek-source.vala \ spek-spectrogram.vala \ @@ -16,7 +18,9 @@ INCLUDES = \ -DPKGLIBDIR=\""$(pkglibdir)"\" VALAFLAGS = \ - --vapidir=$(srcdir)/../vapi --pkg config \ + --vapidir=$(srcdir)/../vapi \ + --pkg config \ + --pkg spek-audio \ @SPEK_PACKAGES@ spek_LDADD = \ diff --git a/src/spek-audio.c b/src/spek-audio.c @@ -0,0 +1,22 @@ +/* spek-audio.c + * + * Copyright (C) 2010 Alexander Kojevnikov <alexander@kojevnikov.com> + * + * Spek 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. + * + * Spek 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 Spek. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "spek-audio.h" + +void spek_audio_open (const char *file_name) { +} diff --git a/src/spek-audio.h b/src/spek-audio.h @@ -0,0 +1,24 @@ +/* spek-audio.h + * + * Copyright (C) 2010 Alexander Kojevnikov <alexander@kojevnikov.com> + * + * Spek 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. + * + * Spek 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 Spek. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __SPEK_AUDIO_H__ +#define __SPEK_AUDIO_H__ + +void spek_audio_open (const char *file_name); + +#endif diff --git a/src/spek-pipeline.vala b/src/spek-pipeline.vala @@ -0,0 +1,32 @@ +/* spek-pipeline.vala + * + * Copyright (C) 2010 Alexander Kojevnikov <alexander@kojevnikov.com> + * + * Spek 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. + * + * Spek 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 Spek. If not, see <http://www.gnu.org/licenses/>. + */ + +namespace Spek { + public class Pipeline { + public string file_name { get; private set; } + public string audio_codec { get; private set; } + + public Pipeline (string file_name) { + this.file_name = file_name; + } + + public void open () { + Audio.open (file_name); + } + } +} diff --git a/src/spek-source.vala b/src/spek-source.vala @@ -39,7 +39,7 @@ namespace Spek { public delegate void DataCallback (int sample, float[] values); public delegate void InfoCallback (); - private Pipeline pipeline = null; + private Gst.Pipeline pipeline = null; private Element spectrum = null; private Pad pad = null; private int sample; @@ -72,7 +72,7 @@ namespace Spek { // TODO: Check for gst errors, in particular test the situation when // `spectrum` (good), `decodebin` (base) or `fakesink` (core) plugins are not available. - pipeline = new Pipeline ("pipeline"); + pipeline = new Gst.Pipeline ("pipeline"); var filesrc = ElementFactory.make ("filesrc", null); var decodebin = ElementFactory.make ("decodebin", null); pipeline.add_many (filesrc, decodebin); diff --git a/vapi/Makefile.am b/vapi/Makefile.am @@ -1,5 +1,6 @@ noinst_DATA = \ - config.vapi + config.vapi \ + spek-audio.vapi EXTRA_DIST = \ $(noinst_DATA) diff --git a/vapi/spek-audio.vapi b/vapi/spek-audio.vapi @@ -0,0 +1,4 @@ +[CCode (cprefix = "SpekAudio", lower_case_cprefix = "spek_audio_", cheader_filename = "spek-audio.h")] +namespace Spek.Audio { + public static void open (string file_name); +}