marlin r1320 - in trunk: . marlin plugins src src/dialogs src/libegg



Author: iain
Date: Mon Oct 20 00:15:50 2008
New Revision: 1320
URL: http://svn.gnome.org/viewvc/marlin?rev=1320&view=rev

Log:
Fix crash when doing large gain changes.
Fix gain/fade corruption



Modified:
   trunk/configure.in
   trunk/marlin/ChangeLog
   trunk/marlin/marlin-block.c
   trunk/marlin/marlin-channel.c
   trunk/marlin/marlin-file-chooser.c
   trunk/marlin/marlin-jack.c
   trunk/marlin/marlin-jack.h
   trunk/marlin/marlin-x-utils.c
   trunk/plugins/marlin-green-noise.c
   trunk/src/dialogs/marlin-information-dialog.c
   trunk/src/dialogs/marlin-new-dialog.c
   trunk/src/dialogs/marlin-new-dialog.h
   trunk/src/libegg/egg-toolbar-editor.c
   trunk/src/marlin-record.c
   trunk/src/marlin-window-menu.c
   trunk/src/marlin-window.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Mon Oct 20 00:15:50 2008
@@ -157,7 +157,7 @@
 	[  --enable-debug		enable debugging],,
 	enable_debug=no)
 if test "x$enable_debug" = "xyes"; then
-	CFLAGS="$CFLAGS -g -Wall -Werror -Wno-format"
+	CFLAGS="-g -O0 -Wall -Werror -Wno-format"
 fi
 
 AC_CONFIG_FILES([

Modified: trunk/marlin/marlin-block.c
==============================================================================
--- trunk/marlin/marlin-block.c	(original)
+++ trunk/marlin/marlin-block.c	Mon Oct 20 00:15:50 2008
@@ -648,24 +648,30 @@
 
 	READ_LOCK (block->lock);
 
+	if (start > block->end) {
+		g_print ("%llu > %llu\n", start, block->end);
+		g_assert_not_reached ();
+	}
+
 	offset_in_block = start - block->start;
 	left_in_block = block->num_frames - offset_in_block;
 
 	frame_data = marlin_block_get_frame_data (block);
-	
+
  copy_data:
 	frames_to_copy = MIN (frames_needed, left_in_block);
+
 	memcpy (buffer, frame_data + offset_in_block,
 		frames_to_copy * sizeof (float));
-	
+
 	copied += frames_to_copy;
-	
+
 	if (left_in_block < frames_needed) {
 		MarlinBlock *tmp_block;
 
 		frames_needed -= frames_to_copy;
 		buffer += frames_to_copy;
-		
+
 		tmp_block = block->next;
 		if (tmp_block == NULL) {
 			if (end_block) {
@@ -674,24 +680,28 @@
 
 			READ_UNLOCK (block->lock);
 			return copied;
-		} 
-		
+		}
+
 		READ_LOCK (tmp_block->lock);
 		READ_UNLOCK (block->lock);
 
 		block = tmp_block;
-		
+
 		offset_in_block = 0;
-		
+
 		frame_data = marlin_block_get_frame_data (block);
 		left_in_block = block->num_frames;
 
 		/* copy a bit more */
 		goto copy_data;
 	}
-	
+
 	if (end_block) {
-		*end_block = block;
+		if (start + copied >= block->end) {
+			*end_block = block->next;
+		} else {
+			*end_block = block;
+		}
 	}
 
 	READ_UNLOCK (block->lock);

Modified: trunk/marlin/marlin-channel.c
==============================================================================
--- trunk/marlin/marlin-channel.c	(original)
+++ trunk/marlin/marlin-channel.c	Mon Oct 20 00:15:50 2008
@@ -488,18 +488,18 @@
 	if (first_block->previous != NULL) {
 		first_block->previous->next = last_block->next;
 	}
-	
+
 	if (last_block->next != NULL) {
 		last_block->next->previous = first_block->previous;
 	}
-	
+
 	last_block->next = NULL;
 
 	/* Need to unlock the blocks */
 	channel->frames = marlin_block_recalculate_ranges (channel->first);
 	if (blocks) {
 		*blocks = first_block;
-		
+
 		/* Reset the blocks count */
 		marlin_block_recalculate_ranges (first_block);
 	} else {
@@ -545,7 +545,7 @@
 
 	if (channel->first == c->blocks) {
 		channel->first = c->l_block->next;
-		
+
 		c->l_block->next = NULL;
 		channel->first->previous = NULL;
 	} else {
@@ -635,17 +635,17 @@
 		/* Split on insert frame */
 		lockless_split_block (channel, insert_frame);
 
-		f_block = lockless_get_for_frame (channel->first, 
+		f_block = lockless_get_for_frame (channel->first,
 						  insert_frame - 1);
 		g_assert (f_block != NULL);
-		
+
 		s_block = f_block->next;
 		g_assert (s_block != NULL);
-		
+
 		/* Link in the blocks */
 		f_block->next = block_list;
 		block_list->previous = f_block;
-		
+
 		s_block->previous = l_block;
 		l_block->next = s_block;
 	}
@@ -675,7 +675,7 @@
 
 	WRITE_UNLOCK (channel->lock);
 }
- 
+
 /* Deletes between start_frame and finish_frame inclusive */
 static void
 lockless_delete_range (MarlinChannel     *channel,
@@ -685,7 +685,7 @@
 {
 	MarlinBlock *blocks;
 
-	lockless_unlink_range (channel, start_frame, finish_frame, 
+	lockless_unlink_range (channel, start_frame, finish_frame,
 			       &blocks, ctxt);
 	marlin_block_free_list (blocks);
 }
@@ -717,14 +717,14 @@
 	MarlinBlock *next_block;
 	MarlinBlock *first_block;
 	MarlinBlock *last_block;
-	
+
 	WRITE_LOCK (c->channel->lock);
 
 	if (c->channel->first == NULL) {
 		c->channel->first = marlin_block_copy_list (c->blocks, NULL);
 		c->channel->last = marlin_block_last (c->channel->first);
 	} else {
-		prev_block = lockless_get_for_frame (c->channel->first, 
+		prev_block = lockless_get_for_frame (c->channel->first,
 						     c->insert_frame - 1);
 		first_block = marlin_block_copy_list (c->blocks, NULL);
 		last_block = marlin_block_last (first_block);
@@ -747,7 +747,7 @@
 
 	c->channel->frames = marlin_block_recalculate_ranges (c->channel->first);
 
-	WRITE_UNLOCK (c->channel->lock);	
+	WRITE_UNLOCK (c->channel->lock);
 }
 
 static void
@@ -815,14 +815,14 @@
 		}
 
 		if (insert_frame != 0) {
-			prev = lockless_get_for_frame (channel->first, 
+			prev = lockless_get_for_frame (channel->first,
 						       insert_frame - 1);
 			g_assert (prev != NULL);
-			
+
 			next = prev->next;
-			
+
 			WRITE_LOCK (prev->lock);
-			
+
 			prev->next = block;
 			block->previous = prev;
 			WRITE_UNLOCK (prev->lock);
@@ -871,7 +871,7 @@
 
 	WRITE_LOCK (channel->lock);
 
-	ret = lockless_insert_data (channel, data, num_frames, 
+	ret = lockless_insert_data (channel, data, num_frames,
 				    insert_frame, ctxt, error);
 
 	WRITE_UNLOCK (channel->lock);
@@ -899,7 +899,7 @@
 	start = range->start;
 	block = lockless_get_for_frame (src->first, start);
 	buf = g_new (float, MARLIN_BLOCK_SIZE);
-	
+
 	while (frames_needed > 0) {
 		MarlinBlock *next_block;
 		guint got_frames, frames_avail;
@@ -908,20 +908,20 @@
 		got_frames = marlin_block_get_buffer (block, buf, start,
 						      frames_avail,
 						      &next_block);
-		
+
 		ret = lockless_insert_data (dest, buf, got_frames,
 					    start, ctxt, error);
 		if (ret == FALSE) {
 			break;
 		}
-		
+
 		block = next_block;
 		frames_needed -= got_frames;
 		start += got_frames;
 	}
-	
+
 	g_free (buf);
-	
+
 	return ret;
 }
 
@@ -933,7 +933,7 @@
  * end_frame:
  * error:
  *
- * Copy the data between @start_frame and @end_frame (inclusive) from 
+ * Copy the data between @start_frame and @end_frame (inclusive) from
  * @src_channel into @dest_channel.
  *
  * Returns: TRUE on success, FALSE on failure with details in @error.
@@ -947,7 +947,7 @@
 {
 	MarlinRange range;
 	gboolean ret = FALSE;
-	
+
 	g_return_val_if_fail (src_channel != dest_channel, FALSE);
 
 	if (end_frame >= src_channel->frames) {
@@ -1006,27 +1006,27 @@
 {
 	float *data;
 	guint64 length;
-	
+
 	g_return_val_if_fail (insert_frame <= channel->frames, FALSE);
-	
+
 	if (num_frames == 0) {
 		return TRUE;
 	}
-	
+
 	/* Make a space for the zer0 */
 	data = g_new0 (float, MARLIN_BLOCK_SIZE);
-	
+
 	/* Make blocks out of the silence */
 	length = num_frames;
-	
+
 	while (length > (guint64) 0) {
 		guint len_to_copy;
 		gboolean ret;
-		
+
 		len_to_copy = MIN (MARLIN_BLOCK_SIZE, length);
 
-		ret = lockless_insert_data (channel, data, 
-					    len_to_copy, insert_frame, 
+		ret = lockless_insert_data (channel, data,
+					    len_to_copy, insert_frame,
 					    ctxt, error);
 		if (ret == FALSE) {
 			g_free (data);
@@ -1068,7 +1068,7 @@
 	g_return_val_if_fail (channel != NULL, FALSE);
 
 	WRITE_LOCK (channel->lock);
-	ret = lockless_insert_silence (channel, operation, insert_frame, 
+	ret = lockless_insert_silence (channel, operation, insert_frame,
 				       num_frames, ctxt, error);
 	WRITE_UNLOCK (channel->lock);
 
@@ -1103,7 +1103,7 @@
 	WRITE_LOCK (channel->lock);
 
 	lockless_delete_range (channel, start_frame, finish_frame, ctxt);
-	ret = lockless_insert_silence (channel, operation, start_frame, 
+	ret = lockless_insert_silence (channel, operation, start_frame,
 				       (finish_frame - start_frame) + 1,
 				       ctxt, error);
 
@@ -1186,8 +1186,8 @@
 						    src_start, frames_avail,
 						    &s_next);
 		if (dest_block != NULL) {
-			d_length = marlin_block_get_buffer (dest_block, 
-							    dest_buf, 
+			d_length = marlin_block_get_buffer (dest_block,
+							    dest_buf,
 							    dest_start,
 							    frames_avail,
 							    &d_next);
@@ -1197,12 +1197,12 @@
 
 		/* Apply the fades to the buffers */
 		for (i = 0; i < s_length; i++, frame_pos++) {
-			src_buf[i] = src_buf[i] * linear_fade 
+			src_buf[i] = src_buf[i] * linear_fade
 				(frame_pos, number_frames,
 				 src_in_level, src_out_level);
 
 			if (i < d_length) {
-				dest_buf[i] = dest_buf[i] * linear_fade 
+				dest_buf[i] = dest_buf[i] * linear_fade
 					(frame_pos, number_frames,
 					 dest_in_level, dest_out_level);
 			}
@@ -1234,7 +1234,7 @@
 
 	return ret;
 }
-	
+
 /**
  * marlin_channel_insert:
  * dest: The #MarlinChannel into which the data is inserted
@@ -1303,7 +1303,7 @@
 
 	/* This is the section of audio that we're going to crossfade over
 	   the top of the source */
-	lockless_unlink_range (dest, insert_frame, fade_length, 
+	lockless_unlink_range (dest, insert_frame, fade_length,
 			       &xf_section, ctxt);
 
 	/* Copy the source into the dest at @insert_frame */
@@ -1319,12 +1319,12 @@
 	src_range.finish = fade_length;
 	dest_range.start = insert_frame;
 	dest_range.finish = fade_length;
-	
+
 #if 0
 	/* Crossfade at start */
 	ret = lockless_crossfade_blocks (dest, xf_section,
 					 &dest_range, &src_range);
-#endif				 
+#endif
 
 	WRITE_UNLOCK (dest->lock);
 	READ_UNLOCK (src->lock);
@@ -1345,24 +1345,24 @@
 marlin_channel_crop_range (MarlinChannel *channel,
 			   guint64 start_frame,
 			   guint64 finish_frame,
-			   MarlinUndoContext *ctxt) 
+			   MarlinUndoContext *ctxt)
 {
 	g_return_if_fail (start_frame <= channel->frames);
 	g_return_if_fail (finish_frame <= channel->frames);
 	g_return_if_fail (finish_frame >= start_frame);
 
 	WRITE_LOCK (channel->lock);
-	
+
 	if (finish_frame + 1 < channel->frames) {
-		lockless_delete_range (channel, finish_frame + 1, 
+		lockless_delete_range (channel, finish_frame + 1,
 				       channel->frames - 1, ctxt);
 	}
-	
+
 	if (start_frame >= (guint64) 1) {
-		lockless_delete_range (channel, (guint64) 0, 
+		lockless_delete_range (channel, (guint64) 0,
 				       start_frame - 1, ctxt);
 	}
-	
+
 	WRITE_UNLOCK (channel->lock);
 }
 
@@ -1472,7 +1472,7 @@
 		s_frame += s_length;
 		s_block = next_s_block;
 		d_block = next_d_block;
-		
+
 		memset (s_buf, 0, MARLIN_BLOCK_SIZE * sizeof (float));
 		memset (d_buf, 0, MARLIN_BLOCK_SIZE * sizeof (float));
 	}
@@ -1490,19 +1490,20 @@
 }
 
 static gboolean
-lockless_channel_multiply (MarlinChannel *channel,
-			   guint64 start,
-			   guint64 finish,
-			   MarlinFadeFunc ratio_func,
-			   gpointer closure,
+lockless_channel_multiply (MarlinChannel     *channel,
+			   guint64            start,
+			   guint64            finish,
+			   MarlinFadeFunc     ratio_func,
+			   gpointer           closure,
 			   MarlinUndoContext *ctxt,
-			   GError **error)
+			   GError           **error)
 {
 	MarlinBlock *block, *b;
 	guint64 frames_needed;
 	float *buf;
 	gboolean ret = TRUE;
-	
+	guint64 block_start, insert_point;
+
 	frames_needed = (finish - start) + 1;
 
 	buf = g_new (float, MARLIN_BLOCK_SIZE);
@@ -1510,31 +1511,40 @@
 	lockless_unlink_range (channel, start, finish, &block, ctxt);
 	b = block;
 
-	while (frames_needed > 0) {
+	block_start = block->start;
+	insert_point = start;
+	while (frames_needed > 0 && block) {
 		MarlinBlock *next_block;
 		guint got_frames, frames_avail;
 		int i;
 
 		frames_avail = MIN (frames_needed, MARLIN_BLOCK_SIZE);
-		got_frames = marlin_block_get_buffer (block, buf, start,
-						      frames_avail, 
+		got_frames = marlin_block_get_buffer (block, buf, block_start,
+						      frames_avail,
 						      &next_block);
-		
+
 		for (i = 0; i < got_frames; i++) {
 			buf[i] = buf[i] * ratio_func (i, closure);
 		}
 
-		ret = lockless_insert_data (channel, buf, got_frames, 
-					    start, ctxt, error);
+		ret = lockless_insert_data (channel, buf, got_frames,
+					    insert_point, ctxt, error);
 		if (ret == FALSE) {
+			g_print ("Error inserting frames\n");
 			break;
 		}
 
-		block = next_block;
 		frames_needed -= got_frames;
-		start += got_frames;
+		insert_point += got_frames;
 
-		memset (buf, 0, MARLIN_BLOCK_SIZE * sizeof (float));
+		if (block != next_block) {
+			block = next_block;
+			if (block != NULL) {
+				block_start = (block_start + got_frames);
+			}
+		} else {
+			block_start += got_frames;
+		}
 	}
 
 	g_free (buf);
@@ -1630,7 +1640,7 @@
 
 	WRITE_LOCK (channel->lock);
 
-	ret = lockless_channel_multiply (channel, start, finish, 
+	ret = lockless_channel_multiply (channel, start, finish,
 					 volume_func, vc, ctxt, error);
 
 	WRITE_UNLOCK (channel->lock);

Modified: trunk/marlin/marlin-file-chooser.c
==============================================================================
--- trunk/marlin/marlin-file-chooser.c	(original)
+++ trunk/marlin/marlin-file-chooser.c	Mon Oct 20 00:15:50 2008
@@ -510,7 +510,7 @@
 static void
 build_info_contents (struct _ChooserOpenData *od)
 {
-	GtkWidget *table, *label, *vbox, *spacer, *hbox;
+	GtkWidget *table, *label, *vbox, *hbox;
 
 	vbox = gtk_vbox_new (FALSE, 6);
 	gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
@@ -588,7 +588,6 @@
 	struct _ChooserOpenData *od;
 	GtkWidget *widget;
 	GtkFileFilter *filter;
-	char *filename;
 
 	od = g_new0 (struct _ChooserOpenData, 1);
 

Modified: trunk/marlin/marlin-jack.c
==============================================================================
--- trunk/marlin/marlin-jack.c	(original)
+++ trunk/marlin/marlin-jack.c	Mon Oct 20 00:15:50 2008
@@ -109,7 +109,7 @@
 
 		priv->sample = g_value_dup_object (value);
 
-#warning Need to hook to the notify signal
+		/* FIXME: Need to hook to the notify signal */
 		g_object_get (priv->sample,
 			      "channels", &priv->channels,
 			      NULL);

Modified: trunk/marlin/marlin-jack.h
==============================================================================
--- trunk/marlin/marlin-jack.h	(original)
+++ trunk/marlin/marlin-jack.h	Mon Oct 20 00:15:50 2008
@@ -69,6 +69,7 @@
 			       double     *peak);
 };
 
+GQuark marlin_jack_error_quark (void);
 GType marlin_jack_get_type (void);
 
 gboolean marlin_jack_start (MarlinJack *jack,

Modified: trunk/marlin/marlin-x-utils.c
==============================================================================
--- trunk/marlin/marlin-x-utils.c	(original)
+++ trunk/marlin/marlin-x-utils.c	Mon Oct 20 00:15:50 2008
@@ -22,15 +22,7 @@
 
 #include <glib/gi18n.h>
 
-#include <gtk/gtklabel.h>
-#include <gtk/gtkmessagedialog.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtkalignment.h>
-#include <gtk/gtkcombobox.h>
+#include <gtk/gtk.h>
 
 #include <marlin/marlin-utils.h>
 #include <marlin/marlin-x-utils.h>
@@ -45,7 +37,7 @@
 	full = g_strdup_printf ("<span weight=\"bold\">%s</span>", text);
 	label = gtk_label_new_with_mnemonic (full);
 	g_free (full);
-	
+
 	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 	gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
 

Modified: trunk/plugins/marlin-green-noise.c
==============================================================================
--- trunk/plugins/marlin-green-noise.c	(original)
+++ trunk/plugins/marlin-green-noise.c	Mon Oct 20 00:15:50 2008
@@ -54,7 +54,7 @@
 {
 	guint64 frames_needed, insert_point, offset;
 	float *out_buf, total;
-	float cache[sources];
+	/* float cache[sources]; */
 
 	struct _source *offsets[sources];
 	MarlinBlock *block;

Modified: trunk/src/dialogs/marlin-information-dialog.c
==============================================================================
--- trunk/src/dialogs/marlin-information-dialog.c	(original)
+++ trunk/src/dialogs/marlin-information-dialog.c	Mon Oct 20 00:15:50 2008
@@ -283,12 +283,12 @@
 static GtkWidget *
 make_general_page (struct _InformationDialog *idd)
 {
-	GtkWidget *table, *label, *sep, *icon;
+	GtkWidget *table, *label, *sep;
 	char *filename, *name, *str;
 	const char *mimetype;
 	GFile *file;
 	GFileInfo *info;
-	int height, channels;
+	int channels;
 	guint64 frames, size;
 	GError *error = NULL;
 

Modified: trunk/src/dialogs/marlin-new-dialog.c
==============================================================================
--- trunk/src/dialogs/marlin-new-dialog.c	(original)
+++ trunk/src/dialogs/marlin-new-dialog.c	Mon Oct 20 00:15:50 2008
@@ -82,7 +82,7 @@
 	g_free (def_str);
 }
 
-GtkWidget *
+gboolean
 marlin_new_sample_dialog_run (MarlinBaseWindow *base,
 			      const char       *title,
 			      const char       *affirmative_text,
@@ -124,20 +124,20 @@
 	/* Sample rate */
 	inner_hb = gtk_hbox_new (FALSE, 6);
 	gtk_box_pack_start (GTK_BOX (vbox), inner_hb, TRUE, TRUE, 0);
-	
+
 	label = marlin_make_title_label (_("Sample rate:"));
 	gtk_box_pack_start (GTK_BOX (inner_hb), label, FALSE, FALSE, 0);
-	
+
 	nd->rate = gtk_combo_new ();
 	fill_combo_box_with_defaults (nd);
 	gtk_box_pack_start (GTK_BOX (inner_hb), nd->rate, TRUE, TRUE, 0);
-	
+
 	label = gtk_label_new (_("hz"));
 	gtk_box_pack_start (GTK_BOX (inner_hb), label, FALSE, FALSE, 0);
-	
+
 	marlin_add_paired_relations (nd->rate, ATK_RELATION_LABELLED_BY,
 				     label, ATK_RELATION_LABEL_FOR);
-	
+
 	/* Channels */
 	inner_vb = gtk_vbox_new (FALSE, 0);
 	gtk_box_pack_start (GTK_BOX (vbox), inner_vb, FALSE, FALSE, 0);
@@ -157,7 +157,7 @@
 	nd->mono = gtk_radio_button_new_with_mnemonic (NULL, _("_Mono"));
 	gtk_box_pack_start (GTK_BOX (inner_vb), nd->mono, FALSE, FALSE, 0);
 
-	nd->stereo = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (nd->mono), 
+	nd->stereo = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (nd->mono),
 								     _("_Stereo"));
 	gtk_box_pack_start (GTK_BOX (inner_vb), nd->stereo, FALSE, FALSE, 0);
 
@@ -165,7 +165,7 @@
 				     label, ATK_RELATION_LABEL_FOR);
 	marlin_add_paired_relations (nd->stereo, ATK_RELATION_LABELLED_BY,
 				     label, ATK_RELATION_LABEL_FOR);
-	
+
 	chans = marlin_gconf_get_int ("/apps/marlin/system-state/new-sample-channels");
 	if (chans == 1) {
 		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (nd->mono), TRUE);
@@ -193,16 +193,16 @@
 		} else {
 			*rate = atoi (rate_str);
 		}
-		
+
 		mono = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (nd->mono));
 		*channels = mono ? 1 : 2;
 
 		marlin_gconf_set_int ("/apps/marlin/system-state/new-sample-rate", *rate);
 		marlin_gconf_set_int ("/apps/marlin/system-state/new-sample-channels", *channels);
-		
+
 		retval = TRUE;
 		break;
-		
+
 	case GTK_RESPONSE_HELP:
 		marlin_display_help ("marlin-new-sample-dialog");
 		goto run;
@@ -216,9 +216,9 @@
 		g_free (p->data);
 	}
 	g_list_free (nd->list);
-	
+
 	gtk_widget_destroy (nd->dialog);
 	g_free (nd);
-	
+
 	return retval;
 }

Modified: trunk/src/dialogs/marlin-new-dialog.h
==============================================================================
--- trunk/src/dialogs/marlin-new-dialog.h	(original)
+++ trunk/src/dialogs/marlin-new-dialog.h	Mon Oct 20 00:15:50 2008
@@ -24,7 +24,7 @@
 
 #include <marlin/marlin-base-window.h>
 
-gboolean marlin_new_sample_dialog_new (MarlinBaseWindow *base,
+gboolean marlin_new_sample_dialog_run (MarlinBaseWindow *base,
 				       const char       *title,
 				       const char       *affirmative_text,
 				       int              *rate,

Modified: trunk/src/libegg/egg-toolbar-editor.c
==============================================================================
--- trunk/src/libegg/egg-toolbar-editor.c	(original)
+++ trunk/src/libegg/egg-toolbar-editor.c	Mon Oct 20 00:15:50 2008
@@ -49,7 +49,6 @@
 
 static void egg_toolbar_editor_class_init	(EggToolbarEditorClass *klass);
 static void egg_toolbar_editor_init		(EggToolbarEditor *t);
-static void egg_toolbar_editor_finalize         (GObject *object);
 static void update_actions_list			(EggToolbarEditor *editor);
 static void update_editor_sheet                 (EggToolbarEditor *editor);
 

Modified: trunk/src/marlin-record.c
==============================================================================
--- trunk/src/marlin-record.c	(original)
+++ trunk/src/marlin-record.c	Mon Oct 20 00:15:50 2008
@@ -652,7 +652,7 @@
 		      "channels", channels,
 		      NULL);
 
-	rd->recorder = marlin_jack_record_new ("marlin-record", NULL, NULL);
+	rd->recorder = (MarlinJack *) marlin_jack_record_new ("marlin-record", NULL, NULL);
 	if (rd->recorder) {
 		g_object_set (G_OBJECT (rd->recorder),
 			      "sample", rd->sample,

Modified: trunk/src/marlin-window-menu.c
==============================================================================
--- trunk/src/marlin-window-menu.c	(original)
+++ trunk/src/marlin-window-menu.c	Mon Oct 20 00:15:50 2008
@@ -67,6 +67,7 @@
 #include "marlin-record.h"
 #include "marlin-clipboard-info.h"
 #include "marlin-recent-action.h"
+#include "dialogs/marlin-new-dialog.h"
 #include "main.h"
 
 enum {

Modified: trunk/src/marlin-window.c
==============================================================================
--- trunk/src/marlin-window.c	(original)
+++ trunk/src/marlin-window.c	Mon Oct 20 00:15:50 2008
@@ -4448,12 +4448,12 @@
 	case GTK_RESPONSE_OK:
 		/* Store the db value for next time */
 		marlin_gconf_set_float ("/apps/marlin/system-state/adjust-volume-db", avd->adj->value);
-		
+
 		marlin_sample_selection_get (avd->window->priv->selection,
 					     &(range.coverage), &(range.start), &(range.finish));
 		if (range.coverage == MARLIN_COVERAGE_NONE) {
 			guint64 frames;
-			
+
 			/* Adjust whole sample */
 			g_object_get (G_OBJECT (priv->sample),
 				      "total_frames", &frames,
@@ -4493,6 +4493,7 @@
 	g_free (avd);
 }
 
+/* FIXME: Should be in dialogs/ */
 void
 marlin_window_adjust_volume (MarlinWindow *window)
 {
@@ -4501,7 +4502,7 @@
 	struct _AdjustVolData *avd;
 	char *title, *name;
 	float db;
-	
+
 	avd = g_new (struct _AdjustVolData, 1);
 	avd->window = window;
 
@@ -4517,7 +4518,7 @@
 
 	title = g_strdup_printf (_("Adjust Volume: %s"), name);
 	g_free (name);
-	
+
 	gtk_window_set_title (GTK_WINDOW (editor), title);
 	g_free (title);
 
@@ -4537,9 +4538,9 @@
 	avd->adj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, -43.1, 15.1, 0.1, 10.0, 0.1));
 	db = marlin_gconf_get_float ("/apps/marlin/system-state/adjust-volume-db");
 	gtk_adjustment_set_value (avd->adj, db);
-	
+
 	scale = gtk_hscale_new (avd->adj);
-	
+
 	g_signal_connect (G_OBJECT (scale), "format_value",
 			  G_CALLBACK (marlin_set_volume_digits), NULL);
 	gtk_range_set_inverted (GTK_RANGE (scale), TRUE);
@@ -4549,7 +4550,7 @@
 	label = gtk_label_new (_("-\xe2\x88\x9e dB -> +15.0 dB"));
 	gtk_widget_show (label);
 	gtk_box_pack_start (GTK_BOX (inner_vbox), label, FALSE, FALSE, 0);
-	
+
 	gtk_dialog_add_button (GTK_DIALOG (editor),
 			       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
 	gtk_dialog_add_button (GTK_DIALOG (editor),
@@ -4597,7 +4598,7 @@
 	MarlinUndoContext *ctxt;
 	gboolean ret;
 	GError *error = NULL;
-	
+
 	switch (response_id) {
 	case GTK_RESPONSE_HELP:
 		marlin_display_help ("marlin-process-insert-silence-dialog");
@@ -4635,7 +4636,7 @@
 			g_assert (marker != NULL);
 			position = marker->position;
 			break;
-			
+
 		default:
 			g_assert_not_reached ();
 			break;
@@ -4701,6 +4702,7 @@
 	gtk_widget_set_sensitive (sd->marker_hbox, (active == SILENCE_MARKER));
 }
 
+/* FIXME: Should be in dialogs/ */
 void
 marlin_window_insert_silence (MarlinWindow *window)
 {
@@ -4709,7 +4711,7 @@
 	struct _SilenceData *sd;
 	char *title, *name;
 	guint rate, display;
-	
+
 	sd = g_new (struct _SilenceData, 1);
 	sd->window = window;
 
@@ -4728,10 +4730,10 @@
 	g_object_get (G_OBJECT (sd->marker_model),
 		      "markers", &sd->marker_list,
 		      NULL);
-	
+
 	title = g_strdup_printf (_("Insert Silence: %s"), name);
 	g_free (name);
-	
+
 	gtk_window_set_title (GTK_WINDOW (editor), title);
 	g_free (title);
 
@@ -4752,13 +4754,13 @@
 	PACK (table, label, 0, 0, GTK_FILL);
 
 	sd->length = marlin_position_spinner_new ();
-	
+
 	display = marlin_gconf_get_int ("/apps/marlin/system-state/insert-silence-display");
 	g_object_set (G_OBJECT (sd->length),
 		      "display_as", (MarlinDisplay) display,
 		      "rate", rate,
 		      NULL);
-	
+
 	gtk_widget_show (sd->length);
 	gtk_label_set_mnemonic_widget (GTK_LABEL (label), sd->length);
 	PACK (table, sd->length, 1, 0, GTK_FILL | GTK_EXPAND);
@@ -4792,7 +4794,7 @@
 			  GTK_FILL | GTK_EXPAND,
 			  GTK_FILL | GTK_EXPAND,
 			  0, 0);
-	
+
 	label = gtk_label_new_with_mnemonic (_("_Marker:"));
 	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 	gtk_widget_show (label);
@@ -4800,10 +4802,10 @@
 
 	sd->markers = gtk_combo_box_new_text ();
 	make_marker_combo_menu (GTK_COMBO_BOX (sd->markers), sd->marker_list);
-	
+
 	gtk_widget_show (sd->markers);
 	gtk_label_set_mnemonic_widget (GTK_LABEL (label), sd->markers);
-	
+
 	gtk_box_pack_start (GTK_BOX (sd->marker_hbox), sd->markers, TRUE, TRUE, 0);
 
 	if (sd->marker_list == NULL) {
@@ -4812,7 +4814,7 @@
 
 	/* Do this here, so that the marker_hbox will exist */
 	make_insert_silence_menu (GTK_COMBO_BOX (sd->position), sd);
-	
+
 	gtk_dialog_add_button (GTK_DIALOG (editor),
 			       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
 	gtk_dialog_add_button (GTK_DIALOG (editor),
@@ -4823,7 +4825,7 @@
 
 	g_signal_connect (G_OBJECT (editor), "response",
 			  G_CALLBACK (insert_silence_response), sd);
-	
+
 	gtk_widget_show (editor);
 }
 
@@ -4835,7 +4837,7 @@
 	guint fpp;
 
 	g_return_if_fail (IS_MARLIN_WINDOW (window));
-	
+
 	priv = window->priv;
 
 	if (priv->move_cursor_dialog != NULL) {
@@ -4851,7 +4853,7 @@
 	/* FIXME: Use MarlinBaseWindow interface for this sort of thing */
 	priv->move_cursor_dialog = marlin_move_cursor_dialog_new (MARLIN_BASE_WINDOW (window));
 	g_signal_connect (priv->move_cursor_dialog, "destroy",
-			  G_CALLBACK (gtk_widget_destroyed), 
+			  G_CALLBACK (gtk_widget_destroyed),
 			  &priv->move_cursor_dialog);
 
 	gtk_widget_show (priv->move_cursor_dialog);
@@ -4995,7 +4997,7 @@
 		      NULL);
 
 	width = GTK_WIDGET (priv->view)->allocation.width / 2;
-	
+
 	marlin_sample_view_scroll_to (priv->view, position - (width * fpp));
 }
 
@@ -5003,7 +5005,7 @@
 marlin_window_vzoom_in (MarlinWindow *window)
 {
 	g_return_if_fail (IS_MARLIN_WINDOW (window));
-	
+
 	marlin_sample_view_vzoom_in (MARLIN_SAMPLE_VIEW (window->priv->view));
 }
 
@@ -5027,7 +5029,7 @@
 		gtk_window_present (GTK_WINDOW (priv->xfade_dialog));
 		return;
 	}
-	
+
 	g_object_get (G_OBJECT (priv->view),
 		      "cursor_position", &start_pos,
 		      NULL);
@@ -5036,7 +5038,7 @@
 	g_signal_connect (priv->xfade_dialog, "destroy",
 			  G_CALLBACK (gtk_widget_destroyed),
 			  &priv->xfade_dialog);
-	
+
 	gtk_widget_show (priv->xfade_dialog);
 }
 
@@ -5045,7 +5047,7 @@
 {
 }
 
-void 
+void
 marlin_window_change_channels (MarlinWindow *window)
 {
 	MarlinWindowPrivate *priv = window->priv;
@@ -5249,7 +5251,7 @@
 
 	priv->undo_history_dialog = marlin_undo_history_dialog_new (MARLIN_BASE_WINDOW (window));
 	g_signal_connect (priv->undo_history_dialog, "destroy",
-			  G_CALLBACK (gtk_widget_destroyed), 
+			  G_CALLBACK (gtk_widget_destroyed),
 			  &priv->undo_history_dialog);
 
 	gtk_widget_show (priv->undo_history_dialog);
@@ -5260,7 +5262,7 @@
 				 MarlinScale scale)
 {
 	marlin_gconf_set_int ("/apps/marlin/scale-display", scale);
-			      
+
 	g_object_set (G_OBJECT (window->priv->vruler),
 		      "scale", scale,
 		      NULL);
@@ -5326,7 +5328,7 @@
 		return;
 	}
 
-	ctxt = marlin_undo_manager_context_begin (window->priv->undo, 
+	ctxt = marlin_undo_manager_context_begin (window->priv->undo,
 						  _("Remove Marker"));
 	marlin_marker_model_remove_marker (window->priv->marker_model,
 					   window->priv->current_marker,
@@ -5368,7 +5370,7 @@
 marlin_window_marker_view_edit_marker (MarlinWindow *window)
 {
 	MarlinWindowPrivate *priv = window->priv;
-	
+
 	if (priv->edit_marker_dialog != NULL) {
 		gtk_window_present (GTK_WINDOW (priv->edit_marker_dialog));
 		return;



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