marlin r1332 - in trunk: . src
- From: iain svn gnome org
- To: svn-commits-list gnome org
- Subject: marlin r1332 - in trunk: . src
- Date: Sun, 2 Nov 2008 01:02:27 +0000 (UTC)
Author: iain
Date: Sun Nov 2 01:02:26 2008
New Revision: 1332
URL: http://svn.gnome.org/viewvc/marlin?rev=1332&view=rev
Log:
Squashed commit of the following:
commit 2b633968f22d7be919330656f47a141ea737257c
Author: iain <iain gnome org>
Date: Sun Nov 2 00:58:57 2008 +0000
Check for jackd
commit d96f9ca802c8508440ed5a611f0c42eca1e33278
Author: iain <iain gnome org>
Date: Sun Nov 2 00:39:04 2008 +0000
Turn off the Process menu whenever the sample is playing.
Stop sample playing whenever the window is closed
commit 647984e8cad2cb3d6885609fff53521ac1a345ed
Author: iain <iain gnome org>
Date: Sat Nov 1 02:01:40 2008 +0000
Only need one progress window in the struct...save 4bytes every
window!!!!
commit 4603444f3c9aad0ac8b47c8edb22e823231670eb
Author: iain <iain gnome org>
Date: Sat Nov 1 01:55:36 2008 +0000
Take name of new sample from the beginning marker, rather than the end
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/src/ChangeLog
trunk/src/marlin-window.c
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Sun Nov 2 01:02:26 2008
@@ -68,6 +68,9 @@
fi
AM_CONDITIONAL(LIBSTDCXX_HACK, test "x$HAS_STDCXX_HACK" = "xyes")
+# Check for jackd
+AC_CHECK_PROG(HAVE_JACKD, jackd, yes, no)
+
# Substitute this... Update it every time GST changes.
HAVE_GSTREAMER=no
@@ -209,3 +212,7 @@
else
echo "Use media profiles: no"
fi
+if test "x$HAVE_JACKD" = "xno"; then
+ echo ""
+ echo "Missing jackd - Marlin will not be able to play or record until it is installed. See http://jackaudio.org"
+fi
Modified: trunk/src/marlin-window.c
==============================================================================
--- trunk/src/marlin-window.c (original)
+++ trunk/src/marlin-window.c Sun Nov 2 01:02:26 2008
@@ -135,9 +135,7 @@
guint selection_id;
MarlinSampleView *view;
- /* FIXME: Do we really need two of these per window? */
MarlinProgressDialog *progress_window;
- MarlinProgressDialog *save_progress_window;
MarlinOverviewBar *overview_bar;
MarlinUndoManager *undo;
@@ -278,6 +276,7 @@
priv = window->priv;
if (priv->sample != NULL) {
+ marlin_window_stop_sample (window);
g_signal_handler_disconnect (G_OBJECT (priv->sample),
priv->notify_id);
g_object_unref (G_OBJECT (priv->sample));
@@ -525,27 +524,22 @@
if (priv->marker_model != NULL) {
g_signal_handler_disconnect (G_OBJECT (priv->marker_model),
priv->marker_added_id);
- g_signal_handler_disconnect (G_OBJECT (priv->marker_model),
+ g_signal_handler_disconnect (G_OBJECT (priv->marker_model),
priv->marker_removed_id);
g_object_unref (G_OBJECT (priv->marker_model));
}
- priv->sample = g_value_get_object (value);
- g_object_ref (G_OBJECT (priv->sample));
-
+ priv->sample = g_value_dup_object (value);
+
priv->notify_id = g_signal_connect (G_OBJECT (priv->sample), "notify",
G_CALLBACK (marlin_window_sample_notify),
window);
-
+
g_object_get (G_OBJECT (priv->sample),
"total_frames", &total_frames,
"selection", &priv->selection,
"markers", &priv->marker_model,
NULL);
-#if 0
- g_object_ref (G_OBJECT (priv->selection));
- g_object_ref (G_OBJECT (priv->marker_model));
-#endif
priv->marker_added_id = g_signal_connect (G_OBJECT (priv->marker_model),
"marker-added",
@@ -1094,7 +1088,7 @@
NULL);
}
-static void
+static void
change_position_display (GtkCheckMenuItem *item,
MarlinWindow *window)
{
@@ -1107,8 +1101,8 @@
priv->position_display = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "position-display"));
client = gconf_client_get_default ();
- gconf_client_set_int (client,
- "/apps/marlin/system-state/position-display",
+ gconf_client_set_int (client,
+ "/apps/marlin/system-state/position-display",
priv->position_display, NULL);
g_object_unref (G_OBJECT (client));
@@ -1148,19 +1142,19 @@
/* Share the one menu for all the status bars */
if (menu == NULL) {
menu = gtk_menu_new ();
-
+
for (pd = MARLIN_DISPLAY_FRAMES; pd < MARLIN_DISPLAY_NULL; pd++) {
GtkWidget *item;
-
+
item = gtk_radio_menu_item_new_with_mnemonic (group, _(names[pd]));
if (pd == window->priv->position_display) {
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
}
- g_object_set_data (G_OBJECT (item), "position-display",
+ g_object_set_data (G_OBJECT (item), "position-display",
GINT_TO_POINTER (pd));
-
+
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
-
+
gtk_widget_show (item);
gtk_menu_shell_append ((GtkMenuShell *) menu, item);
g_signal_connect (G_OBJECT (item), "toggled",
@@ -1179,7 +1173,7 @@
MarlinWindowPrivate *priv = window->priv;
MarlinUndoContext *ctxt;
guint64 position;
-
+
switch (event->keyval) {
case GDK_space:
switch (priv->state) {
@@ -1202,7 +1196,7 @@
default:
break;
}
-
+
break;
case GDK_m:
@@ -1219,7 +1213,7 @@
marlin_undo_manager_context_end (priv->undo, ctxt);
break;
-
+
default:
/* g_print ("Other key pressed\n"); */
return FALSE;
@@ -1256,7 +1250,7 @@
if (filename[0] == 0) {
continue;
}
-
+
marlin_open_window (filename + 7, NULL, NULL, NULL);
g_free (filename);
}
@@ -1979,12 +1973,14 @@
static void
set_path_sensitive (GtkActionGroup *ag,
- const char *name,
- gboolean sensitive)
+ const char *name,
+ gboolean sensitive)
{
GtkAction *action;
action = gtk_action_group_get_action (ag, name);
+ g_return_if_fail (action != NULL);
+
g_object_set (G_OBJECT (action), "sensitive", sensitive, NULL);
}
@@ -2458,9 +2454,11 @@
MarlinWindowPrivate *priv;
g_return_if_fail (IS_MARLIN_WINDOW (window));
-
priv = window->priv;
+ /* Turn off processing */
+ set_path_sensitive (priv->ui_action, "Process", FALSE);
+
if (priv->state == MARLIN_STATE_PLAYING) {
priv->state = MARLIN_STATE_PAUSED;
}
@@ -2525,6 +2523,7 @@
priv = window->priv;
+ set_path_sensitive (priv->ui_action, "Process", TRUE);
if (priv->state == MARLIN_STATE_STOPPED) {
return;
}
@@ -2953,13 +2952,13 @@
_("Saving file"), text);
g_free (text);
- window->priv->save_progress_window = marlin_progress_dialog_new (operation,
- GTK_WINDOW (window),
- tmp, NULL);
+ window->priv->progress_window = marlin_progress_dialog_new (operation,
+ GTK_WINDOW (window),
+ tmp, NULL);
g_free (tmp);
/* Show the window immediatly */
- gtk_widget_show (GTK_WIDGET (window->priv->save_progress_window));
+ gtk_widget_show (GTK_WIDGET (window->priv->progress_window));
}
static void
@@ -2970,8 +2969,8 @@
MarlinWindowPrivate *priv = window->priv;
MarlinPipeline *pipeline;
- gtk_widget_destroy (GTK_WIDGET (priv->save_progress_window));
- window->priv->save_progress_window = NULL;
+ gtk_widget_destroy (GTK_WIDGET (priv->progress_window));
+ window->priv->progress_window = NULL;
pipeline = sod->pipeline;
g_print ("Save-Op finished\n");
@@ -3008,8 +3007,8 @@
MarlinWindowPrivate *priv = window->priv;
MarlinPipeline *pipeline = sod->pipeline;
- gtk_widget_destroy (GTK_WIDGET (priv->save_progress_window));
- priv->save_progress_window = NULL;
+ gtk_widget_destroy (GTK_WIDGET (priv->progress_window));
+ priv->progress_window = NULL;
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
g_object_unref (pipeline);
@@ -3396,7 +3395,7 @@
gtk_dialog_run (GTK_DIALOG (isdir));
gtk_widget_destroy (isdir);
-
+
return FALSE;
}
@@ -3466,11 +3465,11 @@
if (is_valid_filename (GTK_WINDOW (filesel), name) == FALSE) {
return;
}
-
+
d = g_path_get_dirname (name);
/* Add a trailing / so that the file selector will cd into it */
dirname = g_strdup_printf ("%s/", d);
-
+
client = gconf_client_get_default ();
gconf_client_set_string (client,
"/apps/marlin/system-state/save-file-directory",
@@ -3493,7 +3492,7 @@
GstElement *id;
GError *err = NULL;
GMAudioProfile *profile = gm_audio_profile_choose_get_active (sd->profiles);
-
+
prof = gm_audio_profile_get_pipeline (profile);
pipeline = g_strdup_printf ("(name=profile-encoder identity name=encoder_start ! %s ! identity name=encoder_end )", prof);
encoder = gst_parse_launch (pipeline, &err);
@@ -3502,31 +3501,31 @@
g_free (pipeline);
g_error_free (err);
encoder = NULL;
- } else {
+ } else {
GstPad *ghost;
- /* Hook up ghost pads to the start
+ /* Hook up ghost pads to the start
and end */
- id = gst_bin_get_by_name
- (GST_BIN (encoder),
+ id = gst_bin_get_by_name
+ (GST_BIN (encoder),
"encoder_start");
g_assert (id != NULL);
-
+
sink = gst_element_get_pad (id, "sink");
ghost = gst_ghost_pad_new ("sink-ghost",
sink);
gst_element_add_pad (encoder, ghost);
-
- id = gst_bin_get_by_name
- (GST_BIN (encoder),
+
+ id = gst_bin_get_by_name
+ (GST_BIN (encoder),
"encoder_end");
g_assert (id != NULL);
-
+
src = gst_element_get_pad (id, "src");
ghost = gst_ghost_pad_new ("src-ghost",
src);
gst_element_add_pad (encoder, ghost);
-
+
/* g_print ("Using %s as pipeline\n", pipeline); */
g_free (pipeline);
}
@@ -3540,11 +3539,11 @@
save_sample_as (window, name, encoder);
break;
-
+
case GTK_RESPONSE_CANCEL:
default:
break;
-
+
}
gtk_widget_destroy (GTK_WIDGET (filesel));
@@ -3633,7 +3632,7 @@
char *directory, *name, *filename, *sname;
sd = g_new (struct _FileSaveData, 1);
-
+
g_object_get (G_OBJECT (window->priv->sample),
"filename", &filename,
"name", &name,
@@ -3641,7 +3640,7 @@
sd->window = window;
sd->filesel = (GtkWidget *) marlin_file_save_dialog_new (GTK_WINDOW (window));
-
+
sname = filename ? g_path_get_basename (filename) : g_strdup (name);
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (sd->filesel),
sname);
@@ -3795,7 +3794,7 @@
g_object_set (G_OBJECT (window->priv->view),
"frames_per_pixel", fpp,
NULL);
-
+
marlin_window_set_view_sensitive (window, TRUE);
marlin_window_set_plugins_sensitive (window, TRUE);
}
@@ -3880,10 +3879,10 @@
MarlinWindowPrivate *priv;
MarlinUndoContext *ctxt;
MarlinRange range;
-
+
priv = window->priv;
-
- marlin_sample_selection_get (priv->selection, &(range.coverage),
+
+ marlin_sample_selection_get (priv->selection, &(range.coverage),
&(range.start), &(range.finish));
/* Check we're only deleting on BOTH */
if (range.coverage != MARLIN_COVERAGE_BOTH) {
@@ -3901,7 +3900,7 @@
return;
}
-
+
ctxt = marlin_undo_manager_context_begin (priv->undo, _("Delete Selection"));
marlin_sample_delete_range (priv->sample, NULL, &range, ctxt, NULL);
marlin_undo_manager_context_end (priv->undo, ctxt);
@@ -3976,17 +3975,17 @@
G_CALLBACK (mute_op_error), md);
g_signal_connect (G_OBJECT (md->operation), "paused",
G_CALLBACK (mute_op_paused), md);
-
+
marlin_sample_selection_get (priv->selection, &(range.coverage),
&(range.start), &(range.finish));
if (range.coverage == MARLIN_COVERAGE_NONE) {
guint64 frames;
-
+
/* Clear the whole sample */
g_object_get (G_OBJECT (priv->sample),
"total_frames", &frames,
NULL);
-
+
ctxt = marlin_undo_manager_context_begin (priv->undo,
_("Mute Sample"));
range.start = 0;
@@ -4071,7 +4070,7 @@
stereo sample make a mono sample as the result? */
if (range.coverage != MARLIN_COVERAGE_BOTH) {
GtkWidget *dialog;
-
+
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT |
GTK_DIALOG_MODAL,
@@ -4107,7 +4106,7 @@
guint64 position;
gboolean ret;
GError *error = NULL;
-
+
priv = window->priv;
g_object_get (G_OBJECT (priv->view),
@@ -4126,8 +4125,8 @@
marlin_undo_manager_context_end (priv->undo, ctxt);
}
-/* FIXME: Pretty much everything after this needs to be in a seperate
- file in dialogs/
+/* FIXME: Pretty much everything after this needs to be in a seperate
+ file in dialogs/
if it opens a dialog, it should go there...keep the clutter out of
marlin-window.c */
struct _mixer_data {
@@ -4148,7 +4147,7 @@
MarlinWindowPrivate *priv;
MarlinRange range;
gboolean clip = FALSE;
-
+
priv = md->window->priv;
switch (response_id) {
case GTK_RESPONSE_CANCEL:
@@ -4178,7 +4177,7 @@
be invalid */
if (range.coverage == MARLIN_COVERAGE_NONE ||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (md->expand)) == FALSE) {
- marlin_sample_mix (dest, clipboard,
+ marlin_sample_mix (dest, clipboard,
md->src_level->value,
md->dest_level->value,
&range, clip,
@@ -4204,7 +4203,7 @@
md->dest_level->value,
NULL, ctxt, NULL);
}
-
+
marlin_undo_manager_context_end (priv->undo, ctxt);
break;
@@ -4235,7 +4234,7 @@
GtkWidget *mixer, *vbox, *table;
GtkWidget *label, *s_scale, *d_scale;
char *name, *title, *expand_str;
-
+
md = g_new (struct _mixer_data, 1);
md->src = MARLIN_SAMPLE (marlin_program_get_clipboard (program));
md->dest = window->priv->sample;
@@ -4246,12 +4245,12 @@
NULL);
title = g_strdup_printf (_("Mix Clipboard: %s"), name);
g_free (name);
-
+
mixer = gtk_dialog_new ();
gtk_window_set_transient_for (GTK_WINDOW (mixer), GTK_WINDOW (window));
gtk_window_set_title (GTK_WINDOW (mixer), title);
g_free (title);
-
+
gtk_dialog_set_has_separator (GTK_DIALOG (mixer), FALSE);
gtk_window_set_default_size (GTK_WINDOW (mixer), 325, 270);
/* gtk_window_set_resizable (GTK_WINDOW (mixer), FALSE); */
@@ -4276,7 +4275,7 @@
gtk_range_set_inverted (GTK_RANGE (s_scale), TRUE);
gtk_widget_show (s_scale);
PACK_FULL (table, s_scale, 0, 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND);
-
+
label = gtk_label_new_with_mnemonic (_("_Clipboard Level:"));
gtk_label_set_mnemonic_widget (GTK_LABEL (label), s_scale);
gtk_widget_show (label);
@@ -4284,14 +4283,14 @@
marlin_add_paired_relations (s_scale, ATK_RELATION_LABELLED_BY,
label, ATK_RELATION_LABEL_FOR);
-
+
d_scale = gtk_vscale_new (md->dest_level);
g_signal_connect (G_OBJECT (d_scale), "format-value",
G_CALLBACK (marlin_set_volume_digits), NULL);
gtk_range_set_inverted (GTK_RANGE (d_scale), TRUE);
gtk_widget_show (d_scale);
PACK_FULL (table, d_scale, 1, 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND);
-
+
label = gtk_label_new_with_mnemonic (_("_Sample Level:"));
gtk_label_set_mnemonic_widget (GTK_LABEL (label), d_scale);
gtk_widget_show (label);
@@ -4305,21 +4304,21 @@
&(dest_range.start),
&(dest_range.finish));
- /* We only want to show the time stretch option
+ /* We only want to show the time stretch option
if we have a selection to stretch into */
if (dest_range.coverage != MARLIN_COVERAGE_NONE) {
dest_frames = (dest_range.finish - dest_range.start) + 1;
-
+
g_object_get (md->src,
"total_frames", &src_frames,
NULL);
-
+
if (src_frames < dest_frames) {
expand_str = N_("Expand clipboard to fill selection");
} else {
expand_str = N_("Shrink clipboard to fit selection");
}
-
+
md->expand = gtk_check_button_new_with_label (_(expand_str));
gtk_box_pack_start (GTK_BOX (vbox), md->expand, FALSE, FALSE, 0);
gtk_widget_show (md->expand);
@@ -4406,7 +4405,7 @@
gdk_window_show (window->priv->select_region_dialog->window);
return;
}
-
+
g_object_get (G_OBJECT (window->priv->view),
"frames_per_pixel", &fpp,
"cursor_position", &position,
@@ -4417,7 +4416,7 @@
g_signal_connect (window->priv->select_region_dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window->priv->select_region_dialog);
-
+
gtk_widget_show (window->priv->select_region_dialog);
}
@@ -4850,7 +4849,6 @@
"frames_per_pixel", &fpp,
NULL);
- /* 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),
@@ -5076,7 +5074,6 @@
gtk_widget_show (priv->adjust_channels_dialog);
}
-/* FIXME: Takes the name from the next marker,should take name from previous */
void
marlin_window_split_sample (MarlinWindow *window)
{
@@ -5087,6 +5084,7 @@
guint64 num_frames;
GError *error = NULL;
MarlinRange range;
+ char *name = NULL;
g_object_get (G_OBJECT (original),
"markers", &model,
@@ -5115,12 +5113,17 @@
return;
}
+ if (name == NULL) {
+ name = "Marker 0";
+ }
+
g_object_set (G_OBJECT (sample),
- "name", marker->name,
+ "name", name,
"dirty", TRUE,
NULL);
marlin_open_window_with_sample (sample);
+ name = marker->name;
range.start = marker->position;
}
@@ -5133,6 +5136,7 @@
}
g_object_set (G_OBJECT (sample),
+ "name", name,
"dirty", TRUE,
NULL);
marlin_open_window_with_sample (sample);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]