changeset 4532:97b29dec6c6b

moved away some stuff from main.c
author mf0102 <0102@gmx.at>
date Thu, 08 May 2008 22:49:52 +0200
parents cbb1f66d8971
children 6fd552b6e5db 024be3d7ef4c
files src/audacious/main.c src/audacious/main.h src/audacious/playlist.c src/audacious/playlist.h src/audacious/ui_preferences.c
diffstat 5 files changed, 44 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/main.c	Mon May 05 07:48:56 2008 -0500
+++ b/src/audacious/main.c	Thu May 08 22:49:52 2008 +0200
@@ -110,32 +110,6 @@
 
 static AudCmdLineOpt options;
 
-const gchar *aud_titlestring_presets[] = {
-    "${title}",
-    "${?artist:${artist} - }${title}",
-    "${?artist:${artist} - }${?album:${album} - }${title}",
-    "${?artist:${artist} - }${?album:${album} - }${?track-number:${track-number}. }${title}",
-    "${?artist:${artist} }${?album:[ ${album} ] }${?artist:- }${?track-number:${track-number}. }${title}",
-    "${?album:${album} - }${title}"
-};
-const guint n_titlestring_presets = G_N_ELEMENTS(aud_titlestring_presets);
-
-const gchar *chardet_detector_presets[] = {
-    N_("None"),
-    N_("Japanese"),
-    N_("Taiwanese"),
-    N_("Chinese"),
-    N_("Korean"),
-    N_("Russian"),
-    N_("Greek"),
-    N_("Hebrew"),
-    N_("Turkish"),
-    N_("Arabic"),
-#ifdef HAVE_UDET
-    N_("Universal")
-#endif
-};
-const guint n_chardet_detector_presets = G_N_ELEMENTS(chardet_detector_presets);
 
 gchar *aud_paths[BMP_PATH_COUNT] = {};
 
@@ -151,17 +125,6 @@
     g_printf("%s %s [%s]\n", _(application_name), VERSION, svn_stamp);
 }
 
-const gchar *
-get_gentitle_format(void)
-{
-    guint titlestring_preset = cfg.titlestring_preset;
-
-    if (titlestring_preset < n_titlestring_presets)
-        return aud_titlestring_presets[titlestring_preset];
-
-    return cfg.gentitle_format;
-}
-
 static void
 aud_make_user_dir(void)
 {
--- a/src/audacious/main.h	Mon May 05 07:48:56 2008 -0500
+++ b/src/audacious/main.h	Thu May 08 22:49:52 2008 +0200
@@ -76,12 +76,6 @@
 
 extern gchar *aud_paths[];
 
-extern const gchar *aud_titlestring_presets[];
-extern const guint n_titlestring_presets;
-
-extern const gchar *chardet_detector_presets[];
-extern const guint n_chardet_detector_presets;
-
 extern gboolean has_x11_connection;
 
 extern GCond *cond_scan;
--- a/src/audacious/playlist.c	Mon May 05 07:48:56 2008 -0500
+++ b/src/audacious/playlist.c	Thu May 08 22:49:52 2008 +0200
@@ -142,6 +142,17 @@
 #define EXT_HAVE_SUBTUNE    2
 #define EXT_CUSTOM  3
 
+const gchar *aud_titlestring_presets[] = {
+    "${title}",
+    "${?artist:${artist} - }${title}",
+    "${?artist:${artist} - }${?album:${album} - }${title}",
+    "${?artist:${artist} - }${?album:${album} - }${?track-number:${track-number}. }${title}",
+    "${?artist:${artist} }${?album:[ ${album} ] }${?artist:- }${?track-number:${track-number}. }${title}",
+    "${?album:${album} - }${title}"
+};
+const guint n_titlestring_presets = G_N_ELEMENTS(aud_titlestring_presets);
+
+
 static gint filter_by_extension(const gchar *filename);
 static gboolean is_http(const gchar *filename);
 static gboolean do_precheck(Playlist *playlist, const gchar *uri, ProbeResult **pr);
@@ -3324,3 +3335,14 @@
 
     return rv;
 }
+
+const gchar *
+get_gentitle_format(void)
+{
+    guint titlestring_preset = cfg.titlestring_preset;
+
+    if (titlestring_preset < n_titlestring_presets)
+        return aud_titlestring_presets[titlestring_preset];
+
+    return cfg.gentitle_format;
+}
--- a/src/audacious/playlist.h	Mon May 05 07:48:56 2008 -0500
+++ b/src/audacious/playlist.h	Thu May 08 22:49:52 2008 +0200
@@ -106,6 +106,8 @@
     PLAYLIST_ASSOC_SHUFFLE
 } PlaylistAssociation;
 
+extern const guint n_titlestring_presets;
+
 PlaylistEntry *playlist_entry_new(const gchar * filename,
                                   const gchar * title, const gint len,
 				  InputPlugin * dec);
--- a/src/audacious/ui_preferences.c	Mon May 05 07:48:56 2008 -0500
+++ b/src/audacious/ui_preferences.c	Thu May 08 22:49:52 2008 +0200
@@ -159,6 +159,26 @@
     { N_("Codec")      , "${codec}" },
     { N_("Quality")    , "${quality}" },
 };
+static const guint n_title_field_tags = G_N_ELEMENTS(title_field_tags);
+
+
+const gchar *chardet_detector_presets[] = {
+    N_("None"),
+    N_("Japanese"),
+    N_("Taiwanese"),
+    N_("Chinese"),
+    N_("Korean"),
+    N_("Russian"),
+    N_("Greek"),
+    N_("Hebrew"),
+    N_("Turkish"),
+    N_("Arabic"),
+#ifdef HAVE_UDET
+    N_("Universal")
+#endif
+};
+const guint n_chardet_detector_presets = G_N_ELEMENTS(chardet_detector_presets);
+
 
 typedef struct {
     void *next;
@@ -169,8 +189,6 @@
 
 CategoryQueueEntry *category_queue = NULL;
 
-static const guint n_title_field_tags = G_N_ELEMENTS(title_field_tags);
-
 typedef enum {
     WIDGET_NONE,
     WIDGET_CHK_BTN,