# HG changeset patch # User mf0102 <0102@gmx.at> # Date 1210279792 -7200 # Node ID 97b29dec6c6b698f2ce31c09213fc4999c556ea2 # Parent cbb1f66d8971cf826c390d952a9c56ca12e27475 moved away some stuff from main.c diff -r cbb1f66d8971 -r 97b29dec6c6b src/audacious/main.c --- 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) { diff -r cbb1f66d8971 -r 97b29dec6c6b src/audacious/main.h --- 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; diff -r cbb1f66d8971 -r 97b29dec6c6b src/audacious/playlist.c --- 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; +} diff -r cbb1f66d8971 -r 97b29dec6c6b src/audacious/playlist.h --- 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); diff -r cbb1f66d8971 -r 97b29dec6c6b src/audacious/ui_preferences.c --- 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,