diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dbtree.c | 55 | ||||
-rw-r--r-- | apps/dbtree.h | 2 | ||||
-rw-r--r-- | apps/lang/english.lang | 18 | ||||
-rw-r--r-- | apps/tree.c | 2 |
4 files changed, 58 insertions, 19 deletions
diff --git a/apps/dbtree.c b/apps/dbtree.c index 6f78e02ca2..46acfff3d5 100644 --- a/apps/dbtree.c +++ b/apps/dbtree.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "applimits.h" | 39 | #include "applimits.h" |
40 | #include "dbtree.h" | 40 | #include "dbtree.h" |
41 | #include "icons.h" | 41 | #include "icons.h" |
42 | #include "lang.h" | ||
42 | 43 | ||
43 | #ifdef LITTLE_ENDIAN | 44 | #ifdef LITTLE_ENDIAN |
44 | #include <netinet/in.h> | 45 | #include <netinet/in.h> |
@@ -148,11 +149,29 @@ int db_load(struct tree_context* c) | |||
148 | DEBUGF("db_load(%d, %x, %d)\n", table, extra, c->firstpos); | 149 | DEBUGF("db_load(%d, %x, %d)\n", table, extra, c->firstpos); |
149 | 150 | ||
150 | if (!table) { | 151 | if (!table) { |
151 | table = allartists; | 152 | table = root; |
152 | c->currtable = table; | 153 | c->currtable = table; |
153 | } | 154 | } |
154 | 155 | ||
155 | switch (table) { | 156 | switch (table) { |
157 | case root: { | ||
158 | static const int tables[] = {allartists, allalbums, allsongs}; | ||
159 | char* nbuf = (char*)nptr; | ||
160 | char* labels[3] = { str(LANG_ID3DB_ARTISTS), | ||
161 | str(LANG_ID3DB_ALBUMS), | ||
162 | str(LANG_ID3DB_SONGS)}; | ||
163 | |||
164 | for (i=0; i < 3; i++) { | ||
165 | strcpy(nbuf, labels[i]); | ||
166 | dptr[0] = (unsigned int)nbuf; | ||
167 | dptr[1] = tables[i]; | ||
168 | nbuf += strlen(nbuf) + 1; | ||
169 | dptr += 2; | ||
170 | } | ||
171 | c->dirlength = c->filesindir = i; | ||
172 | return i; | ||
173 | } | ||
174 | |||
156 | case allsongs: | 175 | case allsongs: |
157 | offset = songstart + c->firstpos * (songlen + 12); | 176 | offset = songstart + c->firstpos * (songlen + 12); |
158 | itemcount = songcount; | 177 | itemcount = songcount; |
@@ -303,34 +322,36 @@ int db_load(struct tree_context* c) | |||
303 | 322 | ||
304 | void db_enter(struct tree_context* c) | 323 | void db_enter(struct tree_context* c) |
305 | { | 324 | { |
325 | int newextra = ((int*)c->dircache)[(c->dircursor + c->dirstart)*2 + 1]; | ||
326 | |||
327 | c->dirpos[c->dirlevel] = c->dirstart; | ||
328 | c->cursorpos[c->dirlevel] = c->dircursor; | ||
329 | c->table_history[c->dirlevel] = c->currtable; | ||
330 | c->extra_history[c->dirlevel] = c->currextra; | ||
331 | c->pos_history[c->dirlevel] = c->firstpos; | ||
332 | c->dirlevel++; | ||
333 | |||
306 | switch (c->currtable) { | 334 | switch (c->currtable) { |
307 | case allartists: | 335 | case root: |
308 | case albums4artist: | 336 | c->currtable = newextra; |
309 | c->dirpos[c->dirlevel] = c->dirstart; | 337 | c->currextra = newextra; |
310 | c->cursorpos[c->dirlevel] = c->dircursor; | ||
311 | c->table_history[c->dirlevel] = c->currtable; | ||
312 | c->extra_history[c->dirlevel] = c->currextra; | ||
313 | c->pos_history[c->dirlevel] = c->firstpos; | ||
314 | c->dirlevel++; | ||
315 | break; | 338 | break; |
316 | 339 | ||
317 | default: | ||
318 | break; | ||
319 | } | ||
320 | |||
321 | switch (c->currtable) { | ||
322 | case allartists: | 340 | case allartists: |
323 | c->currtable = albums4artist; | 341 | c->currtable = albums4artist; |
324 | c->currextra = ((int*)c->dircache)[(c->dircursor + c->dirstart)*2 + 1]; | 342 | c->currextra = newextra; |
325 | break; | 343 | break; |
326 | 344 | ||
345 | case allalbums: | ||
327 | case albums4artist: | 346 | case albums4artist: |
328 | c->currtable = songs4album; | 347 | c->currtable = songs4album; |
329 | c->currextra = ((int*)c->dircache)[(c->dircursor + c->dirstart)*2 + 1]; | 348 | c->currextra = newextra; |
330 | break; | 349 | break; |
331 | 350 | ||
332 | case songs4album: | 351 | case songs4album: |
352 | case allsongs: | ||
333 | splash(HZ,true,"No playing implemented yet"); | 353 | splash(HZ,true,"No playing implemented yet"); |
354 | c->dirlevel--; | ||
334 | #if 0 | 355 | #if 0 |
335 | /* find filenames, build playlist, play */ | 356 | /* find filenames, build playlist, play */ |
336 | playlist_create(NULL,NULL); | 357 | playlist_create(NULL,NULL); |
diff --git a/apps/dbtree.h b/apps/dbtree.h index 5fa09b0eaf..43c903ccf3 100644 --- a/apps/dbtree.h +++ b/apps/dbtree.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #include "tree.h" | 22 | #include "tree.h" |
23 | 23 | ||
24 | enum table { invalid, allsongs, allalbums, allartists, | 24 | enum table { invalid, root, allsongs, allalbums, allartists, |
25 | albums4artist, songs4album }; | 25 | albums4artist, songs4album }; |
26 | 26 | ||
27 | int db_init(void); | 27 | int db_init(void); |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 6cbe2c469b..e43e43d615 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -2877,3 +2877,21 @@ desc: show ID3 database | |||
2877 | eng: "ID3 database" | 2877 | eng: "ID3 database" |
2878 | voice: "ID3 database" | 2878 | voice: "ID3 database" |
2879 | new: | 2879 | new: |
2880 | |||
2881 | id: LANG_ID3DB_ARTISTS | ||
2882 | desc: ID3 virtual folder name | ||
2883 | eng: "Artists" | ||
2884 | voice: "Artists" | ||
2885 | new: | ||
2886 | |||
2887 | id: LANG_ID3DB_ALBUMS | ||
2888 | desc: ID3 virtual folder name | ||
2889 | eng: "Albums" | ||
2890 | voice: "Albums" | ||
2891 | new: | ||
2892 | |||
2893 | id: LANG_ID3DB_SONGS | ||
2894 | desc: ID3 virtual folder name | ||
2895 | eng: "Songs" | ||
2896 | voice: "Songs" | ||
2897 | new: | ||
diff --git a/apps/tree.c b/apps/tree.c index 438e2f5ff1..61dd12c006 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -1389,7 +1389,7 @@ void tree_init(void) | |||
1389 | /* We copy the settings value in case it is changed by the user. We can't | 1389 | /* We copy the settings value in case it is changed by the user. We can't |
1390 | use it until the next reboot. */ | 1390 | use it until the next reboot. */ |
1391 | max_files = global_settings.max_files_in_dir; | 1391 | max_files = global_settings.max_files_in_dir; |
1392 | 1392 | ||
1393 | /* initialize tree context struct */ | 1393 | /* initialize tree context struct */ |
1394 | memset(&tc, 0, sizeof(tc)); | 1394 | memset(&tc, 0, sizeof(tc)); |
1395 | tc.dirfilter = &global_settings.dirfilter; | 1395 | tc.dirfilter = &global_settings.dirfilter; |