diff --git a/.gitignore b/.gitignore index ffce069..5e9b132 100644 --- 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 index 0872e45..e5c0f75 100644 --- 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 new file mode 100644 index 0000000..0afb778 --- /dev/null +++ b/src/spek-audio.c @@ -0,0 +1,22 @@ +/* spek-audio.c + * + * Copyright (C) 2010 Alexander Kojevnikov + * + * 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 . + */ + +#include "spek-audio.h" + +void spek_audio_open (const char *file_name) { +} diff --git a/src/spek-audio.h b/src/spek-audio.h new file mode 100644 index 0000000..ece7535 --- /dev/null +++ b/src/spek-audio.h @@ -0,0 +1,24 @@ +/* spek-audio.h + * + * Copyright (C) 2010 Alexander Kojevnikov + * + * 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 . + */ + +#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 new file mode 100644 index 0000000..3d28e1b --- /dev/null +++ b/src/spek-pipeline.vala @@ -0,0 +1,32 @@ +/* spek-pipeline.vala + * + * Copyright (C) 2010 Alexander Kojevnikov + * + * 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 . + */ + +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 index 8503a50..945b70f 100644 --- 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 index 29cd822..b9869ef 100644 --- 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 new file mode 100644 index 0000000..4798466 --- /dev/null +++ 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); +}