[Goodies-commits] r6173 - xfburn/trunk/xfburn

David Mohr squisher at xfce.org
Sun Nov 23 08:45:17 CET 2008


Author: squisher
Date: 2008-11-23 07:45:16 +0000 (Sun, 23 Nov 2008)
New Revision: 6173

Modified:
   xfburn/trunk/xfburn/xfburn-audio-composition.c
   xfburn/trunk/xfburn/xfburn-transcoder-basic.c
   xfburn/trunk/xfburn/xfburn-transcoder-gst.c
   xfburn/trunk/xfburn/xfburn-transcoder.c
   xfburn/trunk/xfburn/xfburn-transcoder.h
Log:
Adding transcoder info button to the gstreamer composition, descriptions about the transcoders

Modified: xfburn/trunk/xfburn/xfburn-audio-composition.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-audio-composition.c	2008-11-23 06:53:17 UTC (rev 6172)
+++ xfburn/trunk/xfburn/xfburn-audio-composition.c	2008-11-23 07:45:16 UTC (rev 6173)
@@ -127,6 +127,7 @@
 //static gint song_tree_sortfunc (GtkTreeModel * model, GtkTreeIter * a, GtkTreeIter * b, gpointer user_data);
 
 static void action_clear (GtkAction *, XfburnAudioComposition *);
+static void action_info (GtkAction *, XfburnAudioComposition *);
 static void action_remove_selection (GtkAction *, XfburnAudioComposition *);
 #if 0 /* CDTEXT */
 static void action_rename_selection_artist (GtkAction *, XfburnAudioComposition *);
@@ -194,9 +195,11 @@
 } XfburnAudioCompositionPrivate;
 
 /* globals */
+#define MAX_NAME_LENGTH 80
 static GtkHPanedClass *parent_class = NULL;
 static guint instances = 0;
 static gchar *did_warn = "Did warn about this already";
+static gchar trans_name[MAX_NAME_LENGTH] = {""};
 
 static const GtkActionEntry action_entries[] = {
   {"add-file", GTK_STOCK_ADD, N_("Add"), NULL, N_("Add the selected file(s) to the composition"),
@@ -205,6 +208,8 @@
    G_CALLBACK (action_remove_selection),},
   {"clear", GTK_STOCK_CLEAR, N_("Clear"), NULL, N_("Clear the content of the composition"),
    G_CALLBACK (action_clear),},
+  {"transcoder-info", GTK_STOCK_INFO, trans_name, NULL, N_("What files can get burned to an audio CD?"),
+   G_CALLBACK (action_info),},
   //{"import-session", "xfburn-import-session", N_("Import"), NULL, N_("Import existing session"),},
 #if 0 /* CDTEXT */
   {"rename-artist", GTK_STOCK_EDIT, N_("Rename Artist"), NULL, N_("Rename the artist of the selected file"),
@@ -219,6 +224,7 @@
   "remove-file",
   "clear",
   "import-session",
+  "transcoder-info",
 };
 
 static GdkPixbuf *icon_directory = NULL, *icon_file = NULL;
@@ -315,7 +321,11 @@
                               };
 
   priv->full_paths_to_add = NULL;
+  priv->trans = xfburn_transcoder_get_global ();
 
+  if (trans_name[0] == '\0')
+    strncpy (trans_name, xfburn_transcoder_get_name (priv->trans), MAX_NAME_LENGTH);
+
   instances++;
   
   /* initialize static members */
@@ -353,6 +363,8 @@
   exo_toolbars_model_add_separator (model_toolbar, toolbar_position, -1);
   exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "remove-file", EXO_TOOLBARS_ITEM_TYPE);
   exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "clear", EXO_TOOLBARS_ITEM_TYPE);
+  exo_toolbars_model_add_separator (model_toolbar, toolbar_position, -1);
+  exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "transcoder-info", EXO_TOOLBARS_ITEM_TYPE);
   //exo_toolbars_model_add_separator (model_toolbar, toolbar_position, -1);
   //exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "import-session", EXO_TOOLBARS_ITEM_TYPE);
 
@@ -467,8 +479,6 @@
   action = gtk_action_group_get_action (priv->action_group, "remove-file");
   gtk_action_set_sensitive (GTK_ACTION (action), FALSE);
 
-  priv->trans = xfburn_transcoder_get_global ();
-
   priv->warned_about = g_hash_table_new (g_direct_hash, g_direct_equal);
 }
 
@@ -1000,6 +1010,14 @@
 }
 
 static void
+action_info (GtkAction * action, XfburnAudioComposition * dc)
+{
+  XfburnAudioCompositionPrivate *priv = XFBURN_AUDIO_COMPOSITION_GET_PRIVATE (dc);
+  
+  xfce_info (xfburn_transcoder_get_description (priv->trans));
+}
+
+static void
 cb_content_drag_data_get (GtkWidget * widget, GdkDragContext * dc,
                           GtkSelectionData * data, guint info, guint time, XfburnAudioComposition * content)
 {

Modified: xfburn/trunk/xfburn/xfburn-transcoder-basic.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-transcoder-basic.c	2008-11-23 06:53:17 UTC (rev 6172)
+++ xfburn/trunk/xfburn/xfburn-transcoder-basic.c	2008-11-23 07:45:16 UTC (rev 6173)
@@ -52,6 +52,7 @@
 
 /* internals */
 static const gchar * get_name (XfburnTranscoder *trans);
+static const gchar * get_description (XfburnTranscoder *trans);
 static gboolean is_initialized (XfburnTranscoder *trans, GError **error);
 
 static XfburnAudioTrack * get_audio_track (XfburnTranscoder *trans, const gchar *fn, GError **error);
@@ -151,6 +152,7 @@
 transcoder_interface_init (XfburnTranscoderInterface *iface, gpointer iface_data)
 {
   iface->get_name = get_name;
+  iface->get_description = get_description;
   iface->is_initialized = is_initialized;
   iface->get_audio_track = get_audio_track;
   iface->create_burn_track = create_burn_track;
@@ -162,9 +164,22 @@
 static const gchar * 
 get_name (XfburnTranscoder *trans)
 {
-  return "basic";
+  return _("basic");
 }
 
+static const gchar * 
+get_description (XfburnTranscoder *trans)
+{
+  return _("The basic transcoder is built in,\n"
+           "and does not require any library.\n"
+           "But it can only handle uncompressed\n"
+           ".wav files.\n"
+           "If you would like to create audio\n"
+           "compositions from different types of\n"
+           "audio files, please compile with\n"
+           "gstreamer support.");
+}
+
 static gboolean
 is_initialized (XfburnTranscoder *trans, GError **error)
 {

Modified: xfburn/trunk/xfburn/xfburn-transcoder-gst.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-transcoder-gst.c	2008-11-23 06:53:17 UTC (rev 6172)
+++ xfburn/trunk/xfburn/xfburn-transcoder-gst.c	2008-11-23 07:45:16 UTC (rev 6173)
@@ -72,6 +72,7 @@
 static void delete_pipeline (XfburnTranscoderGst *trans);
 static void recreate_pipeline (XfburnTranscoderGst *trans);
 static const gchar * get_name (XfburnTranscoder *trans);
+static const gchar * get_description (XfburnTranscoder *trans);
 static XfburnAudioTrack * get_audio_track (XfburnTranscoder *trans, const gchar *fn, GError **error);
 
 static struct burn_track * create_burn_track (XfburnTranscoder *trans, XfburnAudioTrack *atrack, GError **error);
@@ -243,6 +244,7 @@
 transcoder_interface_init (XfburnTranscoderInterface *iface, gpointer iface_data)
 {
   iface->get_name = get_name;
+  iface->get_description = get_description;
   iface->is_initialized = is_initialized;
   iface->get_audio_track = get_audio_track;
   iface->create_burn_track = create_burn_track;
@@ -692,9 +694,25 @@
 static const gchar * 
 get_name (XfburnTranscoder *trans)
 {
-  return "gstreamer";
+  /* Note to translators: you can probably keep this as gstreamer,
+   * unless you have a good reason to call it by another name that
+   * the user would understand better */
+  return _("gstreamer");
 }
 
+static const gchar * 
+get_description (XfburnTranscoder *trans)
+{
+  return _("The gstreamer transcoder uses the gstreamer\n"
+           "library for creating audio compositions.\n"
+           "\n"
+           "Essentially all audio files should be supported\n"
+           "given that the correct plugins are installed.\n"
+           "If an audio file is not recognized, make sure\n"
+           "that you have the 'good','bad', and 'ugly'\n"
+           "gstreamer plugin packages installed.");
+}
+
 #if DEBUG_GST > 0 && DEBUG > 0
 
 /* this function can inspect the data just before it is passed on

Modified: xfburn/trunk/xfburn/xfburn-transcoder.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-transcoder.c	2008-11-23 06:53:17 UTC (rev 6172)
+++ xfburn/trunk/xfburn/xfburn-transcoder.c	2008-11-23 07:45:16 UTC (rev 6173)
@@ -101,9 +101,19 @@
   if (iface->get_name)
     return iface->get_name (trans);
   else
-    return "no";
+    return "none";
 }
 
+const gchar *
+xfburn_transcoder_get_description (XfburnTranscoder *trans)
+{
+  XfburnTranscoderInterface *iface = XFBURN_TRANSCODER_GET_INTERFACE (trans);
+  if (iface->get_description)
+    return iface->get_description (trans);
+  else
+    return "none";
+}
+
 gboolean 
 xfburn_transcoder_is_initialized (XfburnTranscoder *trans, GError **error)
 {

Modified: xfburn/trunk/xfburn/xfburn-transcoder.h
===================================================================
--- xfburn/trunk/xfburn/xfburn-transcoder.h	2008-11-23 06:53:17 UTC (rev 6172)
+++ xfburn/trunk/xfburn/xfburn-transcoder.h	2008-11-23 07:45:16 UTC (rev 6173)
@@ -63,6 +63,7 @@
 
   /* required functions */
   const gchar * (*get_name) (XfburnTranscoder *trans);
+  const gchar * (*get_description) (XfburnTranscoder *trans);
   gboolean (*is_initialized) (XfburnTranscoder *trans, GError **error);
   XfburnAudioTrack * (*get_audio_track) (XfburnTranscoder *trans, const gchar *fn, GError **error);
   struct burn_track * (*create_burn_track) (XfburnTranscoder *trans, XfburnAudioTrack *atrack, GError **error);
@@ -80,6 +81,7 @@
 XfburnTranscoder *xfburn_transcoder_get_global ();
 
 const gchar *xfburn_transcoder_get_name (XfburnTranscoder *trans);
+const gchar *xfburn_transcoder_get_description (XfburnTranscoder *trans);
 gboolean xfburn_transcoder_is_initialized (XfburnTranscoder *trans, GError **error);
 XfburnAudioTrack * xfburn_transcoder_get_audio_track (XfburnTranscoder *trans, const gchar *fn, GError **error);
 struct burn_track *xfburn_transcoder_create_burn_track (XfburnTranscoder *trans, XfburnAudioTrack *atrack, GError **error);




More information about the Goodies-commits mailing list