diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 5873552252..3e05fbe4e8 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -16509,6 +16509,440 @@
*: "Remaining"
+
+ id: LANG_SHOW_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "First Letter"
+
+
+ *: "First Letter"
+
+
+ *: "First Letter"
+
+
+
+ id: LANG_SHOW_BY_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "By First Letter..."
+
+
+ *: "By First Letter..."
+
+
+ *: "By First Letter"
+
+
+
+ id: LANG_SHOW_ARTISTS_BY_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "Artists by First Letter"
+
+
+ *: "Artists by First Letter"
+
+
+ *: "Artists by First Letter"
+
+
+
+ id: LANG_SHOW_ALBUMS_BY_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "Albums by First Letter"
+
+
+ *: "Albums by First Letter"
+
+
+ *: "Albums by First Letter"
+
+
+
+ id: LANG_SHOW_TRACKS_BY_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "Tracks by First Letter"
+
+
+ *: "Tracks by First Letter"
+
+
+ *: "Tracks by First Letter"
+
+
+
+ id: LANG_ARTISTS
+ desc: Database menu
+ user: core
+
+ *: "Artists"
+
+
+ *: "Artists"
+
+
+ *: "Artists"
+
+
+
+ id: LANG_ALBUMS
+ desc: Database menu
+ user: core
+
+ *: "Albums"
+
+
+ *: "Albums"
+
+
+ *: "Albums"
+
+
+
+ id: LANG_TRACKS
+ desc: Database menu
+ user: core
+
+ *: "Tracks"
+
+
+ *: "Tracks"
+
+
+ *: "Tracks"
+
+
+
+ id: LANG_SHUFFLE_SONGS
+ desc: Database menu
+ user: core
+
+ *: "Shuffle Songs"
+
+
+ *: "Shuffle Songs"
+
+
+ *: "Shuffle Songs"
+
+
+
+ id: LANG_FILENAME
+ desc: Database and recording menus
+ user: core
+
+ *: "Filename"
+
+
+ *: "Filename"
+
+
+ *: "Filename"
+
+
+
+ id: LANG_TITLE_WITH_DURATION
+ desc: Database menu
+ user: core
+
+ *: "Title (with track duration)"
+
+
+ *: "Title (with track duration)"
+
+
+ *: "Title with track duration"
+
+
+
+ id: LANG_USER_RATING
+ desc: Database menu
+ user: core
+
+ *: "User Rating"
+
+
+ *: "User Rating"
+
+
+ *: "User Rating"
+
+
+
+ id: LANG_SEARCH
+ desc: Database menu
+ user: core
+
+ *: "Search"
+
+
+ *: "Search"
+
+
+ *: "Search"
+
+
+
+ id: LANG_SEARCH_BY
+ desc: Database menu
+ user: core
+
+ *: "Search by..."
+
+
+ *: "Search by..."
+
+
+ *: "Search by"
+
+
+
+ id: LANG_RECENTLY_ADDED
+ desc: Database menu
+ user: core
+
+ *: "Recently Added"
+
+
+ *: "Recently Added"
+
+
+ *: "Recently Added"
+
+
+
+ id: LANG_PLAYBACK_HISTORY
+ desc: Database menu
+ user: core
+
+ *: "Playback History"
+
+
+ *: "Playback History"
+
+
+ *: "Playback History"
+
+
+
+ id: LANG_CUSTOM_MENU
+ desc: Database menu
+ user: core
+
+ *: "Custom menu"
+
+
+ *: "Custom menu"
+
+
+ *: "Custom menu"
+
+
+
+ id: LANG_SAME_AS_CURRENT
+ desc: Database menu
+ user: core
+
+ *: "Same as currently played track"
+
+
+ *: "Same as currently played track"
+
+
+ *: "Same as currently played track"
+
+
+
+ id: LANG_DIRECTORY
+ desc: Database menu
+ user: core
+
+ *: "Directory"
+
+
+ *: "Directory"
+
+
+ *: "Directory"
+
+
+
+ id: LANG_ALBUMS_BY_YEAR
+ desc: Database menu
+ user: core
+
+ *: "Albums by Year"
+
+
+ *: "Albums by Year"
+
+
+ *: "Albums by Year"
+
+
+
+ id: LANG_ALBUMS_BETWEEN_YEARS
+ desc: Database menu
+ user: core
+
+ *: "Albums between Years"
+
+
+ *: "Albums between Years"
+
+
+ *: "Albums between Years"
+
+
+
+ id: LANG_ARTISTS_BETWEEN_YEARS
+ desc: Database menu
+ user: core
+
+ *: "Artists between Years"
+
+
+ *: "Artists between Years"
+
+
+ *: "Artists between Years"
+
+
+
+ id: LANG_HISTORY_MOST_PLAYED
+ desc: Database menu
+ user: core
+
+ *: "Most played (Plays|Score)"
+
+
+ *: "Most played (Plays|Score)"
+
+
+ *: "Most played by Plays then by Score"
+
+
+
+ id: LANG_HISTORY_RECENTLY_PLAYED_TRACKS
+ desc: Database menu
+ user: core
+
+ *: "Recently played tracks"
+
+
+ *: "Recently played tracks"
+
+
+ *: "Recently played tracks"
+
+
+
+ id: LANG_HISTORY_NEVER_PLAYED_TRACKS
+ desc: Database menu
+ user: core
+
+ *: "Never played tracks"
+
+
+ *: "Never played tracks"
+
+
+ *: "Never played tracks"
+
+
+
+ id: LANG_HISTORY_FAVOURITE_ARTISTS
+ desc: Database menu
+ user: core
+
+ *: "Favourite artists"
+
+
+ *: "Favourite artists"
+
+
+ *: "Favourite artists"
+
+
+
+ id: LANG_HISTORY_FAVOURITE_ALBUMS
+ desc: Database menu
+ user: core
+
+ *: "Favourite albums"
+
+
+ *: "Favourite albums"
+
+
+ *: "Favourite albums"
+
+
+
+ id: LANG_HISTORY_RECENT_FAVOURITES
+ desc: Database menu
+ user: core
+
+ *: "Recent favourites"
+
+
+ *: "Recent favourites"
+
+
+ *: "Recent favourites"
+
+
+
+ id: LANG_HISTORY_NEW_FAVOURITES
+ desc: Database menu
+ user: core
+
+ *: "New favourites"
+
+
+ *: "New favourites"
+
+
+ *: "New favourites"
+
+
+
+ id: LANG_HISTORY_FORGOTTEN_FAVOURITES
+ desc: Database menu
+ user: core
+
+ *: "Forgotten favourites"
+
+
+ *: "Forgotten favourites"
+
+
+ *: "Forgotten favourites"
+
+
+
+ id: LANG_TRACKS_BY
+ desc: Database menu
+ user: core
+
+ *: "Tracks by"
+
+
+ *: "Tracks by"
+
+
+ *: "Tracks by"
+
+
id: LANG_VIEW_ALBUMART
desc: WPS context menu
diff --git a/apps/lang/francais.lang b/apps/lang/francais.lang
index 9bfa437a75..9b00326335 100644
--- a/apps/lang/francais.lang
+++ b/apps/lang/francais.lang
@@ -373,10 +373,10 @@
*: "Now Playing"
- *: "Lecture en cours"
+ *: "En lecture"
- *: "Lecture en cours"
+ *: "En lecture"
@@ -16417,6 +16417,439 @@
+ id: LANG_SHOW_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "First Letter"
+
+
+ *: "Première Lettre"
+
+
+ *: "Première Lettre"
+
+
+
+ id: LANG_SHOW_BY_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "By First Letter..."
+
+
+ *: "Par Première Lettre..."
+
+
+ *: "Par Première Lettre"
+
+
+
+ id: LANG_SHOW_ARTISTS_BY_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "Artists by First Letter"
+
+
+ *: "Artistes par Première Lettre"
+
+
+ *: "Artistes par Première Lettre"
+
+
+
+ id: LANG_SHOW_ALBUMS_BY_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "Albums by First Letter"
+
+
+ *: "Albums par Première Lettre"
+
+
+ *: "Albums par Première Lettre"
+
+
+
+ id: LANG_SHOW_TRACKS_BY_FIRST_LETTER
+ desc: Database menu
+ user: core
+
+ *: "Tracks by First Letter"
+
+
+ *: "Pistes par Première Lettre"
+
+
+ *: "Pistes par Première Lettre"
+
+
+
+ id: LANG_ARTISTS
+ desc: Database menu
+ user: core
+
+ *: "Artists"
+
+
+ *: "Artistes"
+
+
+ *: "Artistes"
+
+
+
+ id: LANG_ALBUMS
+ desc: Database menu
+ user: core
+
+ *: "Albums"
+
+
+ *: "Albums"
+
+
+ *: "Albums"
+
+
+
+ id: LANG_TRACKS
+ desc: Database menu
+ user: core
+
+ *: "Tracks"
+
+
+ *: "Pistes"
+
+
+ *: "Pistes"
+
+
+
+ id: LANG_SHUFFLE_SONGS
+ desc: Database menu
+ user: core
+
+ *: "Shuffle Songs"
+
+
+ *: "Mix de morceaux"
+
+
+ *: "Mix de morceaux"
+
+
+
+ id: LANG_FILENAME
+ desc: Database menu
+ user: core
+
+ *: "Filename"
+
+
+ *: "Nom du fichier"
+
+
+ *: "Nom du fichier"
+
+
+
+ id: LANG_TITLE_WITH_DURATION
+ desc: Database menu
+ user: core
+
+ *: "Title (with track duration)"
+
+
+ *: "Titre (avec durée de la piste)"
+
+
+ *: "Titre avec durée de la piste"
+
+
+
+ id: LANG_USER_RATING
+ desc: Database menu
+ user: core
+
+ *: "User Rating"
+
+
+ *: "Note Utilisateur"
+
+
+ *: "Note Utilisateur"
+
+
+
+ id: LANG_SEARCH
+ desc: Database menu
+ user: core
+
+ *: "Search"
+
+
+ *: "Rechercher"
+
+
+ *: "Rechercher"
+
+
+
+ id: LANG_SEARCH_BY
+ desc: Database menu
+ user: core
+
+ *: "Search by..."
+
+
+ *: "Rechercher par..."
+
+
+ *: "Rechercher par"
+
+
+
+ id: LANG_RECENTLY_ADDED
+ desc: Database menu
+ user: core
+
+ *: "Recently Added"
+
+
+ *: "Récemment Ajoutées"
+
+
+ *: "Récemment Ajoutées"
+
+
+
+ id: LANG_PLAYBACK_HISTORY
+ desc: Database menu
+ user: core
+
+ *: "Playback History"
+
+
+ *: "Historique des lectures"
+
+
+ *: "Historique des lectures"
+
+
+
+ id: LANG_CUSTOM_MENU
+ desc: Database menu
+ user: core
+
+ *: "Custom menu"
+
+
+ *: "Menu personnalisé"
+
+
+ *: "Menu personnalisé"
+
+
+
+ id: LANG_SAME_AS_CURRENT
+ desc: Database menu
+ user: core
+
+ *: "Same as currently played track"
+
+
+ *: "Semblable à la piste en cours de lecture"
+
+
+ *: "Semblable à la piste en cours de lecture"
+
+
+
+ id: LANG_DIRECTORY
+ desc: Database menu
+ user: core
+
+ *: "Directory"
+
+
+ *: "Répertoire"
+
+
+ *: "Répertoire"
+
+
+
+ id: LANG_ALBUMS_BY_YEAR
+ desc: Database menu
+ user: core
+
+ *: "Albums by Year"
+
+
+ *: "Albums par Année"
+
+
+ *: "Albums par Année"
+
+
+
+ id: LANG_ALBUMS_BETWEEN_YEARS
+ desc: Database menu
+ user: core
+
+ *: "Albums between Years"
+
+
+ *: "Albums entre des Années"
+
+
+ *: "Albums entre des Années"
+
+
+
+ id: LANG_ARTISTS_BETWEEN_YEARS
+ desc: Database menu
+ user: core
+
+ *: "Artists between Years"
+
+
+ *: "Artistes entre des Années"
+
+
+ *: "Artistes entre des Années"
+
+
+
+ id: LANG_HISTORY_MOST_PLAYED
+ desc: Database menu
+ user: core
+
+ *: "Most played (Plays|Score)"
+
+
+ *: "Les plus jouées (Nombre|Score)"
+
+
+ *: "Les plus jouées par Nombre puis par Score"
+
+
+
+ id: LANG_HISTORY_RECENTLY_PLAYED_TRACKS
+ desc: Database menu
+ user: core
+
+ *: "Recently played tracks"
+
+
+ *: "Pistes récemment jouées"
+
+
+ *: "Pistes récemment jouées"
+
+
+
+ id: LANG_HISTORY_NEVER_PLAYED_TRACKS
+ desc: Database menu
+ user: core
+
+ *: "Never played tracks"
+
+
+ *: "Pistes jamais jouées"
+
+
+ *: "Pistes jamais jouées"
+
+
+
+ id: LANG_HISTORY_FAVOURITE_ARTISTS
+ desc: Database menu
+ user: core
+
+ *: "Favourite artists"
+
+
+ *: "Artistes favoris"
+
+
+ *: "Artistes favoris"
+
+
+
+ id: LANG_HISTORY_FAVOURITE_ALBUMS
+ desc: Database menu
+ user: core
+
+ *: "Favourite albums"
+
+
+ *: "Albums favoris"
+
+
+ *: "Albums favoris"
+
+
+
+ id: LANG_HISTORY_RECENT_FAVOURITES
+ desc: Database menu
+ user: core
+
+ *: "Recent favourites"
+
+
+ *: "Favoris récents"
+
+
+ *: "Favoris récents"
+
+
+
+ id: LANG_HISTORY_NEW_FAVOURITES
+ desc: Database menu
+ user: core
+
+ *: "New favourites"
+
+
+ *: "Nouveaux favoris"
+
+
+ *: "Nouveaux favoris"
+
+
+
+ id: LANG_HISTORY_FORGOTTEN_FAVOURITES
+ desc: Database menu
+ user: core
+
+ *: "Forgotten favourites"
+
+
+ *: "Favoris oubliés"
+
+
+ *: "Favoris oubliés"
+
+
+
+ id: LANG_TRACKS_BY
+ desc: Database menu
+ user: core
+
+ *: "Tracks by"
+
+
+ *: "Pistes par"
+
+
+ *: "Pistes par"
+
+
id: LANG_RESET_EQUALIZER
desc: in the equalizer settings menu
user: core
diff --git a/apps/tagnavi.config b/apps/tagnavi.config
index 6335610253..da64b2d44d 100644
--- a/apps/tagnavi.config
+++ b/apps/tagnavi.config
@@ -8,6 +8,9 @@
# If you only want to add menus and don't need to modify the default
# ones, you can edit "/.rockbox/tagnavi_custom.config" instead, which
# is included by this file and will not be overwritten automatically.
+#
+# Please note that modifying any menu labels/titles may result in them
+# not being translated or voiced.
# Basic format declarations
%format "fmt_title" "%s - %02d:%02d (%s)" basename Lm Ls filename ? title == "[Untagged]"
@@ -26,20 +29,20 @@
%include "/.rockbox/tagnavi_custom.config"
#
-# === Begin of "A to Z" sub menus
+# === Begin of "First Letter" sub menus
#
-# Define the A to Z Artist sub menu
-%byfirstletter "custom_artist" "Artist A to Z" "canonicalartist"
-# Define the A to Z album sub menu
-%byfirstletter "custom_album" "Album A to Z" "album"
-# Define the A to Z track sub menu
-%byfirstletter "custom_track" "Track A to Z" "title"
+# Define the First Letter Artist sub menu
+%byfirstletter "custom_artist" "Artists by First Letter" "canonicalartist"
+# Define the First Letter album sub menu
+%byfirstletter "custom_album" "Albums by First Letter" "album"
+# Define the First Letter track sub menu
+%byfirstletter "custom_track" "Tracks by First Letter" "title"
# ^ An empy line ends the menu
-# Define the A to Z sub menu
-%menu_start "a2z" "A to Z..."
+# Define the First Letter sub menu
+%menu_start "a2z" "By First Letter..."
"Artists" ==> "custom_artist"
"Albums" ==> "custom_album"
"Tracks" ==> "custom_track"
@@ -54,24 +57,24 @@
"Album Artist" -> albumartist ? albumartist ~ "" -> album -> title = "fmt_title"
"Album" -> album ? album ~ "" -> title = "fmt_title"
"Title" -> title = "fmt_title" ? title ~ ""
-"Album by year" -> album ? year = "" -> title = "fmt_title"
-"Artist between years" -> canonicalartist ? year >= "" & year <= "" -> album -> title = "fmt_title"
-"Album between years" -> album ? year >= "" & year <= "" -> title = "fmt_title"
+"Albums by Year" -> album ? year = "" -> title = "fmt_title"
+"Albums between Years" -> album ? year >= "" & year <= "" -> title = "fmt_title"
+"Artists between Years" -> canonicalartist ? year >= "" & year <= "" -> album -> title = "fmt_title"
"Filename" -> filename ? filename ~ ""
"Score" -> title = "fmt_score" ? autoscore > ""
"User Rating" -> title = "fmt_rating" ? rating > ""
"Comment" -> album ? comment ~ "" -> title = "fmt_title"
-# Define the "same as current" sub menu
-%menu_start "same" "Same as current"
+# Define the "Same as currently played track" sub menu
+%menu_start "same" "Same as currently played track"
"Directory" -> title ? filename ^ "#directory#"
"Title" -> title = "fmt_title" ? title = "#title#"
-"Artist" -> album ? artist = "#artist#" | artist = "#albumartist#" | albumartist = "#artist#" | albumartist = "#albumartist#" -> title = "fmt_title"
+"Artist" -> album ? artist = "#artist#" | artist = "#albumartist#" | albumartist = "#artist#" | albumartist = "#albumartist#" -> title = "fmt_title"
"Album" -> title = "fmt_title" ? album = "#album#"
"Composer" -> title = "fmt_title" ? composer = "#composer#"
# Define the runtime sub menu
-%menu_start "runtime" "Play history"
+%menu_start "runtime" "Playback History"
"Most played (Plays|Score)" -> title = "fmt_mostplayed" ? playcount > "0"
"Recently played tracks" -> title = "fmt_lastplayed" ? playcount > "0"
"Never played tracks" -> canonicalartist ? playcount == "0" -> album -> title = "fmt_title"
@@ -85,7 +88,7 @@
%menu_start "track" "Tracks by"
"Filename" -> basename
"Title" -> title
-"Title mm:ss" -> title = "fmt_alphanum_title"
+"Title (with track duration)" -> title = "fmt_alphanum_title"
#
# === Begin of main menu
@@ -99,15 +102,15 @@
"Genre" -> genre -> canonicalartist -> album -> title = "fmt_title"
"Year" -> year ? year > "0" -> canonicalartist -> album -> title = "fmt_title"
"Composer" -> composer -> album -> title = "fmt_title"
-"A to Z" ==> "a2z"
-"Track" ==> "track"
+"First Letter" ==> "a2z"
+"Tracks by" ==> "track"
"Shuffle Songs" ~> title = "fmt_title"
"Search" ==> "search"
"User Rating" -> rating -> title = "fmt_title"
"Recently Added" -> album ? entryage < "4" & commitid > "0" -> title = "fmt_title"
-"History" ==> "runtime"
-"Same as current" ==> "same"
-"Custom view" ==> "custom"
+"Playback History" ==> "runtime"
+"Same as currently played track" ==> "same"
+"Custom menu" ==> "custom"
# And finally set main menu as our root menu
%root_menu "main"
diff --git a/apps/tagtree.c b/apps/tagtree.c
index de014b008d..67abc4e9b8 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -24,7 +24,7 @@
* support the tag cache interface.
*/
-/*#define LOGF_ENABLE*/
+//#define LOGF_ENABLE
#include
#include
@@ -58,6 +58,7 @@
#include "panic.h"
#include "onplay.h"
#include "plugin.h"
+#include "language.h"
#define str_or_empty(x) (x ? x : "(NULL)")
@@ -176,7 +177,8 @@ static int format_count;
#define MENUENTRY_MAX_NAME 64
struct menu_entry {
- char name[MENUENTRY_MAX_NAME];
+ char _name[MENUENTRY_MAX_NAME];
+ const unsigned char *name;
int type;
struct search_instruction {
char name[MENUENTRY_MAX_NAME];
@@ -191,7 +193,8 @@ struct menu_entry {
};
struct menu_root {
- char title[MENUENTRY_MAX_NAME];
+ char _title[MENUENTRY_MAX_NAME];
+ const unsigned char *title;
char id[MAX_MENU_ID_SIZE];
int itemcount;
struct menu_entry *items[TAGMENU_MAX_ITEMS];
@@ -228,7 +231,11 @@ static int move_callback(int handle, void* current, void* new)
ptrdiff_t diff = new - current;
if (menu)
+ {
+ if ((char *) menu->title == (char *) menu->_title)
+ UPDATE(menu->title, diff);
UPDATE(menu, diff);
+ }
if (csi)
UPDATE(csi, diff);
@@ -251,8 +258,12 @@ static int move_callback(int handle, void* current, void* new)
UPDATE(mentry->si.clause[k][l], diff);
}
}
+ if ((char *) menuroot->items[j]->name == (char *) menuroot->items[j]->_name)
+ UPDATE(menuroot->items[j]->name, diff);
UPDATE(menuroot->items[j], diff);
}
+ if ((char *) menus[i]->title == (char *) menus[i]->_title)
+ UPDATE(menus[i]->title, diff);
UPDATE(menus[i], diff);
}
@@ -796,12 +807,26 @@ static bool parse_search(struct menu_entry *entry, const char *str)
strp = str;
/* Parse entry name */
- if (get_token_str(entry->name, sizeof entry->name) < 0)
+ if (get_token_str(entry->_name, sizeof entry->_name) < 0)
{
logf("No name found.");
return false;
}
+ /* Attempt to entry name to lang_id for voicing/translation
+ (excepted for single character entries like those in the 'First Letter' menus)
+ */
+ if (entry->_name[0] != '\0' && entry->_name[1] != '\0')
+ {
+ int lang_id = lang_english_to_id(entry->_name);
+ if (lang_id >= 0)
+ entry->name = ID2P(lang_id);
+ else
+ entry->name = entry->_name;
+ }
+ else
+ entry->name = entry->_name;
+
/* Parse entry type */
if (get_tag(&entry->type) <= 0)
return false;
@@ -1223,12 +1248,20 @@ static int parse_line(int n, char *buf, void *parameters)
strmemccpy(menu->id, data, MAX_MENU_ID_SIZE);
}
- if (get_token_str(menu->title, sizeof(menu->title)) < 0)
+ if (get_token_str(menu->_title, sizeof(menu->_title)) < 0)
{
logf("%%menu_start title empty");
return 0;
}
- logf("menu: %s", menu->title);
+
+ /* Attempt to match title to lang_id for voicing/translation */
+ int lang_id = lang_english_to_id(menu->_title);
+ if (lang_id >= 0)
+ menu->title = ID2P(lang_id);
+ else
+ menu->title = menu->_title;
+
+ logf("menu: %s id: %ld", P2STR(menu->title), P2ID(menu->title));
if (variable == menu_byfirstletter)
{
@@ -1355,7 +1388,7 @@ static void tagtree_unload(struct tree_context *c)
tree_unlock_cache(c);
}
-static bool initialize_tagtree(void) /* also used when user selects 'Reload' in 'custom view'*/
+static bool initialize_tagtree(void) /* also used when user selects 'Reload' in 'custom menu'*/
{
max_history_level = 0;
format_count = 0;
@@ -1635,7 +1668,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
if (offset == 0)
{
dptr->newtable = TABLE_ALLSUBENTRIES;
- dptr->name = str(LANG_TAGNAVI_ALL_TRACKS);
+ dptr->name = ID2P(LANG_TAGNAVI_ALL_TRACKS);
dptr->customaction = ONPLAY_NO_CUSTOMACTION;
dptr++;
current_entry_count++;
@@ -1644,7 +1677,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
if (offset <= 1)
{
dptr->newtable = TABLE_NAVIBROWSE;
- dptr->name = str(LANG_TAGNAVI_RANDOM);
+ dptr->name = ID2P(LANG_TAGNAVI_RANDOM);
dptr->extraseek = -1;
dptr->customaction = ONPLAY_NO_CUSTOMACTION;
dptr++;
@@ -1864,7 +1897,12 @@ static int load_root(struct tree_context *c)
for (i = 0; i < menu->itemcount; i++)
{
- dptr->name = menu->items[i]->name;
+
+ dptr->name = (char*)menu->items[i]->name;
+
+ logf( "%s loading menu %d name: %s, lang_id %ld", __func__, i,
+ P2STR((unsigned char*)dptr->name),P2ID((unsigned char*)dptr->name));
+
switch (menu->items[i]->type)
{
case menu_next:
@@ -2062,9 +2100,13 @@ int tagtree_enter(struct tree_context* c, bool is_visible)
csi = &menu->items[seek]->si;
c->currextra = 0;
- strmemccpy(current_title[c->currextra], dptr->name,
+ unsigned char *name = dptr->name;
+
+ strmemccpy(current_title[c->currextra], P2STR(name),
sizeof(current_title[0]));
+ logf("%s (ROOT) current title %s", __func__, P2STR(name));
+
/* Read input as necessary. */
for (i = 0; i < csi->tagorder_count; i++)
{
@@ -2157,9 +2199,11 @@ int tagtree_enter(struct tree_context* c, bool is_visible)
else
c->dirlevel--;
+ unsigned char *name = dptr->name;
+ name = P2STR(name);
+ logf("%s (NAVI/ALLSUB) current title %s", __func__, name);
/* Update the statusbar title */
- strmemccpy(current_title[c->currextra], dptr->name,
- sizeof(current_title[0]));
+ strmemccpy(current_title[c->currextra], name, sizeof(current_title[0]));
break;
default:
@@ -2328,7 +2372,7 @@ static bool insert_all_playlist(struct tree_context *c,
}
fill_randomly = n > slots_remaining;
-
+
if (fill_randomly)
{
srand(current_tick);
@@ -2648,6 +2692,18 @@ char* tagtree_get_entry_name(struct tree_context *c, int id,
struct tagentry *entry = tagtree_get_entry(c, id);
if (!entry)
return NULL;
+
+ unsigned char *name = entry->name;
+
+ int lang_id = P2ID(name);
+ logf("%s: '%s' id: %d\n", __func__,
+ P2STR(name), lang_id);
+ if (lang_id >= 0)
+ {
+ strmemccpy(buf,P2STR(name), bufsize);
+ return entry->name;
+ }
+
strmemccpy(buf, entry->name, bufsize);
return buf;
}
@@ -2658,10 +2714,13 @@ char *tagtree_get_title(struct tree_context* c)
switch (c->currtable)
{
case TABLE_ROOT:
- return menu->title;
+ logf("%s (ROOT) %s", __func__, P2STR(menu->title));
+ return P2STR(menu->title);
case TABLE_NAVIBROWSE:
case TABLE_ALLSUBENTRIES:
+ logf("%s (NAVI/ALLSUB) idx: %d %s", __func__,
+ c->currextra, current_title[c->currextra]);
return current_title[c->currextra];
}
diff --git a/apps/tree.c b/apps/tree.c
index 8e8499ba1b..439fdd7582 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -210,7 +210,7 @@ static enum themable_icons tree_get_fileicon(int selected_item, void * data)
static int tree_voice_cb(int selected_item, void * data)
{
struct tree_context * local_tc=(struct tree_context *)data;
- char *name;
+ unsigned char *name;
int attr=0;
int customaction = ONPLAY_NO_CUSTOMACTION;
#ifdef HAVE_TAGCACHE
@@ -222,6 +222,31 @@ static int tree_voice_cb(int selected_item, void * data)
attr = tagtree_get_attr(local_tc);
name = tagtree_get_entry_name(local_tc, selected_item, buf, sizeof(buf));
customaction = tagtree_get_custom_action(local_tc);
+
+ /* See if name is an encoded ID, if it is, then speak it normally */
+ int lang_id = P2ID(name);
+ /*debugf("%s Found name %s id %d\n", __func__, P2STR(name), lang_id);*/
+ if (lang_id >= 0)
+ {
+ talk_id(lang_id, true);
+ return 0;
+ }
+
+ /* Otherwise, it is either a custom "header" or a database entry,
+ so try to look up a talk clip for it. */
+
+ // XXX this needs further work, so disable it for now
+ // -- need to distinguish between "headers" and entries
+ // each entry type ("artist", "album", etc) should be delineated
+ // so we can split the clips into subdirs.
+#if 0
+ if (talk_file(LANG_DIR"/database/", NULL,
+ P2STR(name), file_thumbnail_ext, NULL, true) > 0)
+ {
+ return 0;
+ }
+ // XXX fall back to spelling it out?
+#endif
}
else
#endif
@@ -479,7 +504,7 @@ static int update_dir(void)
if (*title == '\0')
{
/* Display "Files" for the root dir */
- title = str(LANG_DIR_BROWSER);
+ title = ID2P(LANG_DIR_BROWSER);
}
icon = filetype_get_icon(ATTR_DIRECTORY);
}
@@ -489,7 +514,7 @@ static int update_dir(void)
/* set title and icon, if nothing is set, clear the title
* with NULL and icon as NOICON as the list is reused */
- gui_synclist_set_title(list, title, icon);
+ gui_synclist_set_title(list, P2STR((unsigned char*)title), icon);
gui_synclist_set_nb_items(list, tc.filesindir);
gui_synclist_set_icon_callback(list,