summaryrefslogtreecommitdiffstats
path: root/gst/level/plot.c
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-03-14 22:34:33 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-03-14 22:34:33 +0000
commit5d25c00e4b613b9cdf2c04fa3a68dffa03834a68 (patch)
tree74a5b1eaf3a324b520e64e87404fd0b3018a7829 /gst/level/plot.c
parent1e83b097f7b732ae49e294a5a398bdc3e88854a8 (diff)
gst-indent
Original commit message from CVS: gst-indent
Diffstat (limited to 'gst/level/plot.c')
-rw-r--r--gst/level/plot.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/gst/level/plot.c b/gst/level/plot.c
index 27ecd01a..ad6d70d7 100644
--- a/gst/level/plot.c
+++ b/gst/level/plot.c
@@ -28,24 +28,25 @@
#include <gst/gst.h>
#include <gtk/gtk.h>
-gboolean got_channel[2] = { FALSE, FALSE}; /* to see if we got the signal for this one yet */
-gint channels = 0 ; /* guess at how many channels there are */
-gdouble last_time = 0.0; /* time of last signal */
-gdouble values[2][3]; /* array of levels from which to print */
+gboolean got_channel[2] = { FALSE, FALSE }; /* to see if we got the signal for this one yet */
+gint channels = 0; /* guess at how many channels there are */
+gdouble last_time = 0.0; /* time of last signal */
+gdouble values[2][3]; /* array of levels from which to print */
static void
-level_callback (GstElement *element, gdouble time, gint channel,
- gdouble rms, gdouble peak, gdouble decay)
+level_callback (GstElement * element, gdouble time, gint channel,
+ gdouble rms, gdouble peak, gdouble decay)
{
int i = 0, j = 0;
gboolean got_all = FALSE;
- if (channel + 1> channels) channels = channel + 1;
+ if (channel + 1 > channels)
+ channels = channel + 1;
/* reset got_channel if this is a new time point */
- if (time > last_time)
- {
- for (i = 0; i < channels; ++i) got_channel[i] = FALSE;
+ if (time > last_time) {
+ for (i = 0; i < channels; ++i)
+ got_channel[i] = FALSE;
last_time = time;
}
@@ -59,13 +60,13 @@ level_callback (GstElement *element, gdouble time, gint channel,
/* FIXME: this fails on the first, no ? */
got_all = TRUE;
for (i = 0; i < channels; ++i)
- if (!got_channel[i]) got_all = FALSE;
- if (got_all)
- {
+ if (!got_channel[i])
+ got_all = FALSE;
+ if (got_all) {
g_print ("%f ", time);
for (i = 0; i < channels; ++i)
for (j = 0; j < 3; ++j)
- g_print ("%f ", values[i][j]);
+ g_print ("%f ", values[i][j]);
g_print ("\n");
}
}
@@ -74,6 +75,7 @@ static gboolean
idler (gpointer data)
{
GstElement *pipeline = GST_ELEMENT (data);
+
if (gst_bin_iterate (GST_BIN (pipeline)))
return TRUE;
@@ -81,8 +83,8 @@ idler (gpointer data)
return FALSE;
}
-int main
-(int argc, char *argv[])
+int
+main (int argc, char *argv[])
{
GstElement *pipeline = NULL;
@@ -93,8 +95,7 @@ int main
gtk_init (&argc, &argv);
pipeline = gst_parse_launchv ((const gchar **) &argv[1], &error);
- if (error)
- {
+ if (error) {
g_print ("pipeline could not be constructed: %s\n", error->message);
g_print ("Please give a complete pipeline with a 'level' element.\n");
g_print ("Example: sinesrc ! level ! osssink\n");
@@ -103,8 +104,7 @@ int main
}
level = gst_bin_get_by_name (GST_BIN (pipeline), "level0");
- if (level == NULL)
- {
+ if (level == NULL) {
g_print ("Please give a pipeline with a 'level' element in it\n");
return 1;
}
@@ -112,7 +112,7 @@ int main
g_object_set (level, "signal", TRUE, NULL);
g_signal_connect (level, "level", G_CALLBACK (level_callback), NULL);
-
+
/* go to main loop */
gst_element_set_state (pipeline, GST_STATE_PLAYING);
g_idle_add (idler, pipeline);
@@ -121,4 +121,3 @@ int main
return 0;
}
-