marlin r1266 - trunk/marlin



Author: iain
Date: Sun Jan 13 00:19:22 2008
New Revision: 1266
URL: http://svn.gnome.org/viewvc/marlin?rev=1266&view=rev

Log:
Make record worky


Modified:
   trunk/marlin/marlin-jack-record.c
   trunk/marlin/marlin-jack.c

Modified: trunk/marlin/marlin-jack-record.c
==============================================================================
--- trunk/marlin/marlin-jack-record.c	(original)
+++ trunk/marlin/marlin-jack-record.c	Sun Jan 13 00:19:22 2008
@@ -332,12 +332,14 @@
 
 		if (pd->frames_in_data + frames > MARLIN_BLOCK_SIZE) {
 			guint32 needed, remain;
+			float *fd;
 
 			needed = MARLIN_BLOCK_SIZE - pd->frames_in_data;
 			remain = frames - needed;
-			
+
+			fd = pd->data + pd->frames_in_data;
 			jack_ringbuffer_read (pd->rb, 
-					      (char *) pd->data + pd->frames_in_data,
+					      (char *) fd,
 					      needed * sizeof (float));
 			store_block (jack, pd, pd->data, MARLIN_BLOCK_SIZE);
 
@@ -350,9 +352,10 @@
 			}
 			pd->frames_in_data = remain;
 		} else {
-			jack_ringbuffer_read (pd->rb,
-					      (char *) pd->data + pd->frames_in_data,
-					      bytes_avail);
+			float *fd;
+
+			fd = pd->data + pd->frames_in_data;
+			jack_ringbuffer_read (pd->rb, (char *) fd, bytes_avail);
 			pd->frames_in_data += frames;
 		}
 	}

Modified: trunk/marlin/marlin-jack.c
==============================================================================
--- trunk/marlin/marlin-jack.c	(original)
+++ trunk/marlin/marlin-jack.c	Sun Jan 13 00:19:22 2008
@@ -279,13 +279,15 @@
 	
 	for (i = 0; i < n_frames; i++) {
 		double squared = pow (data[i], 2);
+		double o = p;
 
 		p = MAX (p, squared);
 		total += squared;
 	}
 
 	*peak = sqrt (p);
-	*rms = sqrt (total / n_frames);
+	*rms = sqrt (total / (double) n_frames);
+
 }
 
 void
@@ -301,12 +303,14 @@
 		return;
 	}
 
+#if 0
 	calculate_peak_and_rms (data[0], n_frames, &(peak[0]), &(rms[0]));
-	g_print ("peak: %f - rms %f\n", peak[0], rms[0]);
 	if (priv->channels > 1) {
 		calculate_peak_and_rms (data[1], n_frames, &peak[1], &rms[1]);
 	}
 
+
 	g_signal_emit (jack, signals[LEVEL_CHANGED], 0, 
 		       priv->channels, peak, rms);
+#endif
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]