2007-03-01 11:14:46 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
2007-03-29 22:51:03 +00:00
|
|
|
* $Id$
|
2007-03-01 11:14:46 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Jonathan Gordon
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-03-01 11:14:46 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
2010-05-06 21:04:40 +00:00
|
|
|
#include "string-extra.h"
|
2007-03-01 11:14:46 +00:00
|
|
|
#include "config.h"
|
2009-01-11 04:03:17 +00:00
|
|
|
#include "appevents.h"
|
2007-03-01 11:14:46 +00:00
|
|
|
#include "menu.h"
|
|
|
|
#include "root_menu.h"
|
|
|
|
#include "lang.h"
|
|
|
|
#include "settings.h"
|
2007-04-09 13:39:37 +00:00
|
|
|
#include "screens.h"
|
2007-03-01 11:14:46 +00:00
|
|
|
#include "kernel.h"
|
|
|
|
#include "debug.h"
|
|
|
|
#include "misc.h"
|
2020-08-01 02:45:10 +00:00
|
|
|
#include "open_plugin.h"
|
2007-03-01 11:14:46 +00:00
|
|
|
#include "rolo.h"
|
2007-03-01 12:35:24 +00:00
|
|
|
#include "powermgmt.h"
|
2007-04-09 13:39:37 +00:00
|
|
|
#include "power.h"
|
2007-04-25 22:08:00 +00:00
|
|
|
#include "talk.h"
|
|
|
|
#include "audio.h"
|
2011-11-15 13:22:02 +00:00
|
|
|
#include "shortcuts.h"
|
2007-03-01 11:14:46 +00:00
|
|
|
|
2009-11-26 00:37:27 +00:00
|
|
|
#ifdef HAVE_HOTSWAP
|
|
|
|
#include "storage.h"
|
2014-02-18 06:11:11 +00:00
|
|
|
#include "mv.h"
|
2009-11-26 00:37:27 +00:00
|
|
|
#endif
|
2007-03-01 11:14:46 +00:00
|
|
|
/* gui api */
|
|
|
|
#include "list.h"
|
|
|
|
#include "splash.h"
|
|
|
|
#include "action.h"
|
|
|
|
#include "yesno.h"
|
2008-12-31 05:59:26 +00:00
|
|
|
#include "viewport.h"
|
2007-03-01 11:14:46 +00:00
|
|
|
|
|
|
|
#include "tree.h"
|
2007-03-01 12:18:30 +00:00
|
|
|
#if CONFIG_TUNER
|
2007-03-01 11:14:46 +00:00
|
|
|
#include "radio.h"
|
2007-03-01 12:18:30 +00:00
|
|
|
#endif
|
2007-03-01 11:14:46 +00:00
|
|
|
#ifdef HAVE_RECORDING
|
|
|
|
#include "recording.h"
|
|
|
|
#endif
|
2009-08-03 04:43:34 +00:00
|
|
|
#include "wps.h"
|
2007-03-01 11:14:46 +00:00
|
|
|
#include "bookmark.h"
|
2008-03-26 23:35:34 +00:00
|
|
|
#include "playlist.h"
|
2010-02-20 19:06:39 +00:00
|
|
|
#include "playlist_viewer.h"
|
2011-07-20 14:11:15 +00:00
|
|
|
#include "playlist_catalog.h"
|
2007-03-01 11:14:46 +00:00
|
|
|
#include "menus/exported_menus.h"
|
2007-03-01 11:46:26 +00:00
|
|
|
#ifdef HAVE_RTC_ALARM
|
|
|
|
#include "rtc.h"
|
|
|
|
#endif
|
2007-03-07 19:56:15 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
|
|
|
#include "tagcache.h"
|
|
|
|
#endif
|
2009-10-08 22:40:38 +00:00
|
|
|
#include "language.h"
|
2010-06-09 04:25:41 +00:00
|
|
|
#include "plugin.h"
|
2013-11-20 16:39:42 +00:00
|
|
|
#include "disk.h"
|
2007-03-01 11:14:46 +00:00
|
|
|
|
|
|
|
struct root_items {
|
|
|
|
int (*function)(void* param);
|
|
|
|
void* param;
|
2007-04-12 15:28:51 +00:00
|
|
|
const struct menu_item_ex *context_menu;
|
2007-03-01 11:14:46 +00:00
|
|
|
};
|
2009-10-16 19:14:46 +00:00
|
|
|
static int next_screen = GO_TO_ROOT; /* holding info about the upcoming screen
|
|
|
|
* which is the current screen for the
|
|
|
|
* rest of the code after load_screen
|
|
|
|
* is called */
|
2007-03-01 11:14:46 +00:00
|
|
|
static int last_screen = GO_TO_ROOT; /* unfortunatly needed so we can resume
|
|
|
|
or goto current track based on previous
|
|
|
|
screen */
|
2012-12-16 03:26:03 +00:00
|
|
|
|
2014-04-15 07:34:22 +00:00
|
|
|
static int previous_music = GO_TO_WPS; /* Toggles behavior of the return-to
|
|
|
|
* playback-button depending
|
|
|
|
* on FM radio */
|
|
|
|
|
|
|
|
#if (CONFIG_TUNER)
|
|
|
|
static void rootmenu_start_playback_callback(unsigned short id, void *param)
|
|
|
|
{
|
|
|
|
(void) id; (void) param;
|
|
|
|
/* Cancel FM radio selection as previous music. For cases where we start
|
|
|
|
playback without going to the WPS, such as playlist insert or
|
|
|
|
playlist catalog. */
|
|
|
|
previous_music = GO_TO_WPS;
|
|
|
|
}
|
|
|
|
#endif
|
2009-10-16 19:14:33 +00:00
|
|
|
|
2009-01-11 04:03:17 +00:00
|
|
|
static char current_track_path[MAX_PATH];
|
2014-03-14 22:15:16 +00:00
|
|
|
static void rootmenu_track_changed_callback(unsigned short id, void* param)
|
2009-01-11 04:03:17 +00:00
|
|
|
{
|
2014-03-14 22:15:16 +00:00
|
|
|
(void)id;
|
2013-07-12 16:06:38 +00:00
|
|
|
struct mp3entry *id3 = ((struct track_event *)param)->id3;
|
2009-07-14 13:57:45 +00:00
|
|
|
strlcpy(current_track_path, id3->path, MAX_PATH);
|
2009-01-11 04:03:17 +00:00
|
|
|
}
|
2007-03-01 11:14:46 +00:00
|
|
|
static int browser(void* param)
|
|
|
|
{
|
|
|
|
int ret_val;
|
2007-03-07 04:36:02 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
2007-03-01 11:14:46 +00:00
|
|
|
struct tree_context* tc = tree_get_context();
|
2007-03-07 04:36:02 +00:00
|
|
|
#endif
|
2010-12-14 13:37:58 +00:00
|
|
|
struct browse_context browse;
|
2007-03-01 11:14:46 +00:00
|
|
|
int filter = SHOW_SUPPORTED;
|
|
|
|
char folder[MAX_PATH] = "/";
|
|
|
|
/* stuff needed to remember position in file browser */
|
|
|
|
static char last_folder[MAX_PATH] = "/";
|
|
|
|
/* and stuff for the database browser */
|
2007-03-07 04:36:02 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
2007-03-10 12:51:08 +00:00
|
|
|
static int last_db_dirlevel = 0, last_db_selection = 0;
|
2007-03-07 04:36:02 +00:00
|
|
|
#endif
|
2010-12-14 13:37:58 +00:00
|
|
|
|
2007-03-01 12:18:30 +00:00
|
|
|
switch ((intptr_t)param)
|
2007-03-01 11:14:46 +00:00
|
|
|
{
|
|
|
|
case GO_TO_FILEBROWSER:
|
|
|
|
filter = global_settings.dirfilter;
|
2012-12-16 03:26:03 +00:00
|
|
|
if (global_settings.browse_current &&
|
2008-02-09 15:20:15 +00:00
|
|
|
last_screen == GO_TO_WPS &&
|
2009-01-11 04:03:17 +00:00
|
|
|
current_track_path[0])
|
2007-03-01 11:14:46 +00:00
|
|
|
{
|
2009-01-11 04:03:17 +00:00
|
|
|
strcpy(folder, current_track_path);
|
2007-03-01 11:14:46 +00:00
|
|
|
}
|
2010-10-04 10:34:38 +00:00
|
|
|
else if (!strcmp(last_folder, "/"))
|
|
|
|
{
|
|
|
|
strcpy(folder, global_settings.start_directory);
|
|
|
|
}
|
2007-03-01 11:14:46 +00:00
|
|
|
else
|
2009-11-26 00:37:27 +00:00
|
|
|
{
|
|
|
|
#ifdef HAVE_HOTSWAP
|
|
|
|
bool in_hotswap = false;
|
|
|
|
/* handle entering an ejected drive */
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < NUM_VOLUMES; i++)
|
|
|
|
{
|
Rewrite filesystem code (WIP)
This patch redoes the filesystem code from the FAT driver up to the
clipboard code in onplay.c.
Not every aspect of this is finished therefore it is still "WIP". I
don't wish to do too much at once (haha!). What is left to do is get
dircache back in the sim and find an implementation for the dircache
indicies in the tagcache and playlist code or do something else that
has the same benefit. Leaving these out for now does not make anything
unusable. All the basics are done.
Phone app code should probably get vetted (and app path handling
just plain rewritten as environment expansions); the SDL app and
Android run well.
Main things addressed:
1) Thread safety: There is none right now in the trunk code. Most of
what currently works is luck when multiple threads are involved or
multiple descriptors to the same file are open.
2) POSIX compliance: Many of the functions behave nothing like their
counterparts on a host system. This leads to inconsistent code or very
different behavior from native to hosted. One huge offender was
rename(). Going point by point would fill a book.
3) Actual running RAM usage: Many targets will use less RAM and less
stack space (some more RAM because I upped the number of cache buffers
for large memory). There's very little memory lying fallow in rarely-used
areas (see 'Key core changes' below). Also, all targets may open the same
number of directory streams whereas before those with less than 8MB RAM
were limited to 8, not 12 implying those targets will save slightly
less.
4) Performance: The test_disk plugin shows markedly improved performance,
particularly in the area of (uncached) directory scanning, due partly to
more optimal directory reading and to a better sector cache algorithm.
Uncached times tend to be better while there is a bit of a slowdown in
dircache due to it being a bit heavier of an implementation. It's not
noticeable by a human as far as I can say.
Key core changes:
1) Files and directories share core code and data structures.
2) The filesystem code knows which descriptors refer to same file.
This ensures that changes from one stream are appropriately reflected
in every open descriptor for that file (fileobj_mgr.c).
3) File and directory cache buffers are borrowed from the main sector
cache. This means that when they are not in use by a file, they are not
wasted, but used for the cache. Most of the time, only a few of them
are needed. It also means that adding more file and directory handles
is less expensive. All one must do in ensure a large enough cache to
borrow from.
4) Relative path components are supported and the namespace is unified.
It does not support full relative paths to an implied current directory;
what is does support is use of "." and "..". Adding the former would
not be very difficult. The namespace is unified in the sense that
volumes may be specified several times along with relative parts, e.g.:
"/<0>/foo/../../<1>/bar" :<=> "/<1>/bar".
5) Stack usage is down due to sharing of data, static allocation and
less duplication of strings on the stack. This requires more
serialization than I would like but since the number of threads is
limited to a low number, the tradoff in favor of the stack seems
reasonable.
6) Separates and heirarchicalizes (sic) the SIM and APP filesystem
code. SIM path and volume handling is just like the target. Some
aspects of the APP file code get more straightforward (e.g. no path
hashing is needed).
Dircache:
Deserves its own section. Dircache is new but pays homage to the old.
The old one was not compatible and so it, since it got redone, does
all the stuff it always should have done such as:
1) It may be update and used at any time during the build process.
No longer has one to wait for it to finish building to do basic file
management (create, remove, rename, etc.).
2) It does not need to be either fully scanned or completely disabled;
it can be incomplete (i.e. overfilled, missing paths), still be
of benefit and be correct.
3) Handles mounting and dismounting of individual volumes which means
a full rebuild is not needed just because you pop a new SD card in the
slot. Now, because it reuses its freed entry data, may rebuild only
that volume.
4) Much more fundamental to the file code. When it is built, it is
the keeper of the master file list whether enabled or not ("disabled"
is just a state of the cache). Its must always to ready to be started
and bind all streams opened prior to being enabled.
5) Maintains any short filenames in OEM format which means that it does
not need to be rebuilt when changing the default codepage.
Miscellaneous Compatibility:
1) Update any other code that would otherwise not work such as the
hotswap mounting code in various card drivers.
2) File management: Clipboard needed updating because of the behavioral
changes. Still needs a little more work on some finer points.
3) Remove now-obsolete functionality such as the mutex's "no preempt"
flag (which was only for the prior FAT driver).
4) struct dirinfo uses time_t rather than raw FAT directory entry
time fields. I plan to follow up on genericizing everything there
(i.e. no FAT attributes).
5) unicode.c needed some redoing so that the file code does not try
try to load codepages during a scan, which is actually a problem with
the current code. The default codepage, if any is required, is now
kept in RAM separarately (bufalloced) from codepages specified to
iso_decode() (which must not be bufalloced because the conversion
may be done by playback threads).
Brings with it some additional reusable core code:
1) Revised file functions: Reusable code that does things such as
safe path concatenation and parsing without buffer limitations or
data duplication. Variants that copy or alter the input path may be
based off these.
To do:
1) Put dircache functionality back in the sim. Treating it internally
as a different kind of file system seems the best approach at this
time.
2) Restore use of dircache indexes in the playlist and database or
something effectively the same. Since the cache doesn't have to be
complete in order to be used, not getting a hit on the cache doesn't
unambiguously say if the path exists or not.
Change-Id: Ia30f3082a136253e3a0eae0784e3091d138915c8
Reviewed-on: http://gerrit.rockbox.org/566
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2013-08-06 02:02:45 +00:00
|
|
|
char vol_string[VOL_MAX_LEN + 1];
|
2013-11-20 16:39:42 +00:00
|
|
|
if (!volume_removable(i))
|
2009-11-26 00:37:27 +00:00
|
|
|
continue;
|
Rewrite filesystem code (WIP)
This patch redoes the filesystem code from the FAT driver up to the
clipboard code in onplay.c.
Not every aspect of this is finished therefore it is still "WIP". I
don't wish to do too much at once (haha!). What is left to do is get
dircache back in the sim and find an implementation for the dircache
indicies in the tagcache and playlist code or do something else that
has the same benefit. Leaving these out for now does not make anything
unusable. All the basics are done.
Phone app code should probably get vetted (and app path handling
just plain rewritten as environment expansions); the SDL app and
Android run well.
Main things addressed:
1) Thread safety: There is none right now in the trunk code. Most of
what currently works is luck when multiple threads are involved or
multiple descriptors to the same file are open.
2) POSIX compliance: Many of the functions behave nothing like their
counterparts on a host system. This leads to inconsistent code or very
different behavior from native to hosted. One huge offender was
rename(). Going point by point would fill a book.
3) Actual running RAM usage: Many targets will use less RAM and less
stack space (some more RAM because I upped the number of cache buffers
for large memory). There's very little memory lying fallow in rarely-used
areas (see 'Key core changes' below). Also, all targets may open the same
number of directory streams whereas before those with less than 8MB RAM
were limited to 8, not 12 implying those targets will save slightly
less.
4) Performance: The test_disk plugin shows markedly improved performance,
particularly in the area of (uncached) directory scanning, due partly to
more optimal directory reading and to a better sector cache algorithm.
Uncached times tend to be better while there is a bit of a slowdown in
dircache due to it being a bit heavier of an implementation. It's not
noticeable by a human as far as I can say.
Key core changes:
1) Files and directories share core code and data structures.
2) The filesystem code knows which descriptors refer to same file.
This ensures that changes from one stream are appropriately reflected
in every open descriptor for that file (fileobj_mgr.c).
3) File and directory cache buffers are borrowed from the main sector
cache. This means that when they are not in use by a file, they are not
wasted, but used for the cache. Most of the time, only a few of them
are needed. It also means that adding more file and directory handles
is less expensive. All one must do in ensure a large enough cache to
borrow from.
4) Relative path components are supported and the namespace is unified.
It does not support full relative paths to an implied current directory;
what is does support is use of "." and "..". Adding the former would
not be very difficult. The namespace is unified in the sense that
volumes may be specified several times along with relative parts, e.g.:
"/<0>/foo/../../<1>/bar" :<=> "/<1>/bar".
5) Stack usage is down due to sharing of data, static allocation and
less duplication of strings on the stack. This requires more
serialization than I would like but since the number of threads is
limited to a low number, the tradoff in favor of the stack seems
reasonable.
6) Separates and heirarchicalizes (sic) the SIM and APP filesystem
code. SIM path and volume handling is just like the target. Some
aspects of the APP file code get more straightforward (e.g. no path
hashing is needed).
Dircache:
Deserves its own section. Dircache is new but pays homage to the old.
The old one was not compatible and so it, since it got redone, does
all the stuff it always should have done such as:
1) It may be update and used at any time during the build process.
No longer has one to wait for it to finish building to do basic file
management (create, remove, rename, etc.).
2) It does not need to be either fully scanned or completely disabled;
it can be incomplete (i.e. overfilled, missing paths), still be
of benefit and be correct.
3) Handles mounting and dismounting of individual volumes which means
a full rebuild is not needed just because you pop a new SD card in the
slot. Now, because it reuses its freed entry data, may rebuild only
that volume.
4) Much more fundamental to the file code. When it is built, it is
the keeper of the master file list whether enabled or not ("disabled"
is just a state of the cache). Its must always to ready to be started
and bind all streams opened prior to being enabled.
5) Maintains any short filenames in OEM format which means that it does
not need to be rebuilt when changing the default codepage.
Miscellaneous Compatibility:
1) Update any other code that would otherwise not work such as the
hotswap mounting code in various card drivers.
2) File management: Clipboard needed updating because of the behavioral
changes. Still needs a little more work on some finer points.
3) Remove now-obsolete functionality such as the mutex's "no preempt"
flag (which was only for the prior FAT driver).
4) struct dirinfo uses time_t rather than raw FAT directory entry
time fields. I plan to follow up on genericizing everything there
(i.e. no FAT attributes).
5) unicode.c needed some redoing so that the file code does not try
try to load codepages during a scan, which is actually a problem with
the current code. The default codepage, if any is required, is now
kept in RAM separarately (bufalloced) from codepages specified to
iso_decode() (which must not be bufalloced because the conversion
may be done by playback threads).
Brings with it some additional reusable core code:
1) Revised file functions: Reusable code that does things such as
safe path concatenation and parsing without buffer limitations or
data duplication. Variants that copy or alter the input path may be
based off these.
To do:
1) Put dircache functionality back in the sim. Treating it internally
as a different kind of file system seems the best approach at this
time.
2) Restore use of dircache indexes in the playlist and database or
something effectively the same. Since the cache doesn't have to be
complete in order to be used, not getting a hit on the cache doesn't
unambiguously say if the path exists or not.
Change-Id: Ia30f3082a136253e3a0eae0784e3091d138915c8
Reviewed-on: http://gerrit.rockbox.org/566
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2013-08-06 02:02:45 +00:00
|
|
|
get_volume_name(i, vol_string);
|
2009-11-26 00:37:27 +00:00
|
|
|
/* test whether we would browse the external card */
|
2013-11-20 16:39:42 +00:00
|
|
|
if (!volume_present(i) &&
|
2009-11-26 00:37:27 +00:00
|
|
|
(strstr(last_folder, vol_string)
|
|
|
|
#ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN
|
|
|
|
|| (i == 0)
|
|
|
|
#endif
|
|
|
|
))
|
|
|
|
{ /* leave folder as "/" to avoid crash when trying
|
|
|
|
* to access an ejected drive */
|
|
|
|
strcpy(folder, "/");
|
|
|
|
in_hotswap = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2010-10-04 10:34:38 +00:00
|
|
|
if (!in_hotswap)
|
2009-11-26 00:37:27 +00:00
|
|
|
#endif
|
2010-10-04 10:34:38 +00:00
|
|
|
strcpy(folder, last_folder);
|
2009-11-26 00:37:27 +00:00
|
|
|
}
|
2011-06-01 14:41:49 +00:00
|
|
|
push_current_activity(ACTIVITY_FILEBROWSER);
|
2007-03-01 11:14:46 +00:00
|
|
|
break;
|
2007-03-07 04:36:02 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
2007-03-01 11:14:46 +00:00
|
|
|
case GO_TO_DBBROWSER:
|
2007-03-07 19:56:15 +00:00
|
|
|
if (!tagcache_is_usable())
|
2007-03-01 11:14:46 +00:00
|
|
|
{
|
2007-03-08 08:20:30 +00:00
|
|
|
bool reinit_attempted = false;
|
2007-03-07 19:56:15 +00:00
|
|
|
|
|
|
|
/* Now display progress until it's ready or the user exits */
|
|
|
|
while(!tagcache_is_usable())
|
|
|
|
{
|
2012-12-16 03:26:03 +00:00
|
|
|
struct tagcache_stat *stat = tagcache_get_stat();
|
|
|
|
|
2007-03-08 08:20:30 +00:00
|
|
|
/* Allow user to exit */
|
|
|
|
if (action_userabort(HZ/2))
|
|
|
|
break;
|
2007-03-07 19:56:15 +00:00
|
|
|
|
|
|
|
/* Maybe just needs to reboot due to delayed commit */
|
|
|
|
if (stat->commit_delayed)
|
|
|
|
{
|
2008-08-15 08:27:39 +00:00
|
|
|
splash(HZ*2, ID2P(LANG_PLEASE_REBOOT));
|
2007-03-07 19:56:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2007-03-08 08:20:30 +00:00
|
|
|
/* Check if ready status is known */
|
|
|
|
if (!stat->readyvalid)
|
|
|
|
{
|
2019-08-07 16:45:34 +00:00
|
|
|
splash(0, ID2P(LANG_TAGCACHE_BUSY));
|
2007-03-08 08:20:30 +00:00
|
|
|
continue;
|
|
|
|
}
|
2012-12-16 03:26:03 +00:00
|
|
|
|
2007-03-08 08:20:30 +00:00
|
|
|
/* Re-init if required */
|
2012-12-16 03:26:03 +00:00
|
|
|
if (!reinit_attempted && !stat->ready &&
|
2007-03-08 08:20:30 +00:00
|
|
|
stat->processed_entries == 0 && stat->commit_step == 0)
|
|
|
|
{
|
|
|
|
/* Prompt the user */
|
|
|
|
reinit_attempted = true;
|
2008-04-26 09:30:24 +00:00
|
|
|
static const char *lines[]={
|
|
|
|
ID2P(LANG_TAGCACHE_BUSY), ID2P(LANG_TAGCACHE_FORCE_UPDATE)};
|
|
|
|
static const struct text_message message={lines, 2};
|
2007-03-08 08:20:30 +00:00
|
|
|
if(gui_syncyesno_run(&message, NULL, NULL) == YESNO_NO)
|
|
|
|
break;
|
|
|
|
FOR_NB_SCREENS(i)
|
|
|
|
screens[i].clear_display();
|
|
|
|
|
|
|
|
/* Start initialisation */
|
|
|
|
tagcache_rebuild();
|
|
|
|
}
|
|
|
|
|
2007-03-07 19:56:15 +00:00
|
|
|
/* Display building progress */
|
2007-08-06 13:08:36 +00:00
|
|
|
static long talked_tick = 0;
|
2007-10-19 15:31:42 +00:00
|
|
|
if(global_settings.talk_menu &&
|
2007-08-06 13:08:36 +00:00
|
|
|
(talked_tick == 0
|
|
|
|
|| TIME_AFTER(current_tick, talked_tick+7*HZ)))
|
|
|
|
{
|
|
|
|
talked_tick = current_tick;
|
|
|
|
if (stat->commit_step > 0)
|
|
|
|
{
|
|
|
|
talk_id(LANG_TAGCACHE_INIT, false);
|
|
|
|
talk_number(stat->commit_step, true);
|
|
|
|
talk_id(VOICE_OF, true);
|
|
|
|
talk_number(tagcache_get_max_commit_step(), true);
|
|
|
|
} else if(stat->processed_entries)
|
|
|
|
{
|
|
|
|
talk_number(stat->processed_entries, false);
|
|
|
|
talk_id(LANG_BUILDING_DATABASE, true);
|
|
|
|
}
|
|
|
|
}
|
2007-03-07 19:56:15 +00:00
|
|
|
if (stat->commit_step > 0)
|
|
|
|
{
|
2009-10-08 22:40:38 +00:00
|
|
|
if (lang_is_rtl())
|
|
|
|
{
|
|
|
|
splashf(0, "[%d/%d] %s", stat->commit_step,
|
|
|
|
tagcache_get_max_commit_step(),
|
|
|
|
str(LANG_TAGCACHE_INIT));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
splashf(0, "%s [%d/%d]", str(LANG_TAGCACHE_INIT),
|
|
|
|
stat->commit_step,
|
|
|
|
tagcache_get_max_commit_step());
|
|
|
|
}
|
2007-03-07 19:56:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-15 08:27:39 +00:00
|
|
|
splashf(0, str(LANG_BUILDING_DATABASE),
|
|
|
|
stat->processed_entries);
|
2007-03-07 19:56:15 +00:00
|
|
|
}
|
|
|
|
}
|
2007-03-01 11:14:46 +00:00
|
|
|
}
|
2007-03-07 19:56:15 +00:00
|
|
|
if (!tagcache_is_usable())
|
|
|
|
return GO_TO_PREVIOUS;
|
2007-03-01 11:14:46 +00:00
|
|
|
filter = SHOW_ID3DB;
|
|
|
|
tc->dirlevel = last_db_dirlevel;
|
2007-03-10 12:51:08 +00:00
|
|
|
tc->selected_item = last_db_selection;
|
2011-06-01 14:41:49 +00:00
|
|
|
push_current_activity(ACTIVITY_DATABASEBROWSER);
|
2007-03-01 11:14:46 +00:00
|
|
|
break;
|
2007-03-07 04:36:02 +00:00
|
|
|
#endif
|
2007-03-01 11:14:46 +00:00
|
|
|
}
|
2010-12-14 13:37:58 +00:00
|
|
|
|
|
|
|
browse_context_init(&browse, filter, 0, NULL, NOICON, folder, NULL);
|
|
|
|
ret_val = rockbox_browse(&browse);
|
2011-06-01 14:41:49 +00:00
|
|
|
pop_current_activity();
|
2007-03-01 12:18:30 +00:00
|
|
|
switch ((intptr_t)param)
|
2007-03-01 11:14:46 +00:00
|
|
|
{
|
|
|
|
case GO_TO_FILEBROWSER:
|
2010-10-04 10:34:38 +00:00
|
|
|
if (!get_current_file(last_folder, MAX_PATH) ||
|
2010-10-25 13:55:34 +00:00
|
|
|
(!strchr(&last_folder[1], '/') &&
|
|
|
|
global_settings.start_directory[1] != '\0'))
|
2010-08-27 10:33:09 +00:00
|
|
|
{
|
|
|
|
last_folder[0] = '/';
|
|
|
|
last_folder[1] = '\0';
|
|
|
|
}
|
2007-03-01 11:14:46 +00:00
|
|
|
break;
|
2007-03-07 04:36:02 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
2007-03-01 11:14:46 +00:00
|
|
|
case GO_TO_DBBROWSER:
|
|
|
|
last_db_dirlevel = tc->dirlevel;
|
2007-03-10 12:51:08 +00:00
|
|
|
last_db_selection = tc->selected_item;
|
2007-03-01 11:14:46 +00:00
|
|
|
break;
|
2007-03-07 04:36:02 +00:00
|
|
|
#endif
|
2007-03-01 11:14:46 +00:00
|
|
|
}
|
|
|
|
return ret_val;
|
|
|
|
}
|
2011-01-29 01:01:12 +00:00
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
#ifdef HAVE_RECORDING
|
|
|
|
static int recscrn(void* param)
|
|
|
|
{
|
|
|
|
(void)param;
|
|
|
|
recording_screen(false);
|
|
|
|
return GO_TO_ROOT;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
static int wpsscrn(void* param)
|
|
|
|
{
|
|
|
|
int ret_val = GO_TO_PREVIOUS;
|
|
|
|
(void)param;
|
2011-06-01 14:41:49 +00:00
|
|
|
push_current_activity(ACTIVITY_WPS);
|
2007-03-01 11:14:46 +00:00
|
|
|
if (audio_status())
|
|
|
|
{
|
2007-10-19 15:31:42 +00:00
|
|
|
talk_shutup();
|
2007-03-01 11:14:46 +00:00
|
|
|
ret_val = gui_wps_show();
|
|
|
|
}
|
|
|
|
else if ( global_status.resume_index != -1 )
|
|
|
|
{
|
2012-12-09 20:04:17 +00:00
|
|
|
DEBUGF("Resume index %X crc32 %lX offset %lX\n",
|
2007-03-01 11:14:46 +00:00
|
|
|
global_status.resume_index,
|
2012-12-09 20:04:17 +00:00
|
|
|
(unsigned long)global_status.resume_crc32,
|
2007-03-17 10:50:58 +00:00
|
|
|
(unsigned long)global_status.resume_offset);
|
2007-03-01 11:14:46 +00:00
|
|
|
if (playlist_resume() != -1)
|
|
|
|
{
|
2012-12-09 20:04:17 +00:00
|
|
|
playlist_resume_track(global_status.resume_index,
|
|
|
|
global_status.resume_crc32,
|
2013-07-14 11:59:39 +00:00
|
|
|
global_status.resume_elapsed,
|
2007-03-01 11:14:46 +00:00
|
|
|
global_status.resume_offset);
|
|
|
|
ret_val = gui_wps_show();
|
|
|
|
}
|
|
|
|
}
|
2007-03-17 09:54:28 +00:00
|
|
|
else
|
2007-03-01 11:14:46 +00:00
|
|
|
{
|
2008-08-15 08:27:39 +00:00
|
|
|
splash(HZ*2, ID2P(LANG_NOTHING_TO_RESUME));
|
2007-03-01 11:14:46 +00:00
|
|
|
}
|
2011-06-01 14:41:49 +00:00
|
|
|
pop_current_activity();
|
2007-03-01 11:14:46 +00:00
|
|
|
return ret_val;
|
|
|
|
}
|
|
|
|
#if CONFIG_TUNER
|
|
|
|
static int radio(void* param)
|
|
|
|
{
|
|
|
|
(void)param;
|
|
|
|
radio_screen();
|
|
|
|
return GO_TO_ROOT;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-01-29 01:01:12 +00:00
|
|
|
static int miscscrn(void * param)
|
|
|
|
{
|
|
|
|
const struct menu_item_ex *menu = (const struct menu_item_ex*)param;
|
2011-01-29 11:50:38 +00:00
|
|
|
int result = do_menu(menu, NULL, NULL, false);
|
|
|
|
switch (result)
|
2011-01-29 01:01:12 +00:00
|
|
|
{
|
2020-08-01 02:45:10 +00:00
|
|
|
case GO_TO_PLUGIN:
|
2011-01-29 01:01:12 +00:00
|
|
|
case GO_TO_PLAYLIST_VIEWER:
|
2011-02-28 14:38:18 +00:00
|
|
|
case GO_TO_WPS:
|
|
|
|
return result;
|
2011-01-29 01:01:12 +00:00
|
|
|
default:
|
|
|
|
return GO_TO_ROOT;
|
|
|
|
}
|
|
|
|
}
|
2011-07-20 14:11:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
static int playlist_view_catalog(void * param)
|
|
|
|
{
|
|
|
|
/* kludge untill catalog_view_playlists() returns something useful */
|
|
|
|
int old_playstatus = audio_status();
|
|
|
|
(void)param;
|
|
|
|
push_current_activity(ACTIVITY_PLAYLISTBROWSER);
|
|
|
|
catalog_view_playlists();
|
|
|
|
pop_current_activity();
|
|
|
|
if (!old_playstatus && audio_status())
|
|
|
|
return GO_TO_WPS;
|
|
|
|
return GO_TO_PREVIOUS;
|
|
|
|
}
|
|
|
|
|
2010-02-20 19:06:39 +00:00
|
|
|
static int playlist_view(void * param)
|
|
|
|
{
|
|
|
|
(void)param;
|
2011-06-13 07:33:20 +00:00
|
|
|
int val;
|
|
|
|
|
|
|
|
push_current_activity(ACTIVITY_PLAYLISTVIEWER);
|
|
|
|
val = playlist_viewer();
|
|
|
|
pop_current_activity();
|
|
|
|
switch (val)
|
2010-02-20 19:06:39 +00:00
|
|
|
{
|
|
|
|
case PLAYLIST_VIEWER_MAINMENU:
|
|
|
|
case PLAYLIST_VIEWER_USB:
|
|
|
|
return GO_TO_ROOT;
|
|
|
|
case PLAYLIST_VIEWER_OK:
|
|
|
|
return GO_TO_PREVIOUS;
|
|
|
|
}
|
|
|
|
return GO_TO_PREVIOUS;
|
|
|
|
}
|
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
static int load_bmarks(void* param)
|
|
|
|
{
|
|
|
|
(void)param;
|
2007-10-12 04:10:08 +00:00
|
|
|
if(bookmark_mrb_load())
|
|
|
|
return GO_TO_WPS;
|
2007-03-01 11:14:46 +00:00
|
|
|
return GO_TO_PREVIOUS;
|
|
|
|
}
|
2010-12-14 13:37:58 +00:00
|
|
|
|
2007-04-12 15:28:51 +00:00
|
|
|
/* These are all static const'd from apps/menus/ *.c
|
|
|
|
so little hack so we can use them */
|
2012-12-16 03:26:03 +00:00
|
|
|
extern struct menu_item_ex
|
|
|
|
file_menu,
|
2007-04-18 19:46:34 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
2007-04-12 15:28:51 +00:00
|
|
|
tagcache_menu,
|
2007-04-18 19:46:34 +00:00
|
|
|
#endif
|
2011-01-29 01:01:12 +00:00
|
|
|
main_menu_,
|
2007-04-12 15:28:51 +00:00
|
|
|
manage_settings,
|
2011-01-29 11:50:38 +00:00
|
|
|
plugin_menu,
|
2011-01-29 01:01:12 +00:00
|
|
|
playlist_options,
|
|
|
|
info_menu,
|
2007-04-12 15:28:51 +00:00
|
|
|
system_menu;
|
2007-03-01 11:14:46 +00:00
|
|
|
static const struct root_items items[] = {
|
2007-04-12 15:28:51 +00:00
|
|
|
[GO_TO_FILEBROWSER] = { browser, (void*)GO_TO_FILEBROWSER, &file_menu},
|
2007-04-18 19:46:34 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
2007-04-12 15:28:51 +00:00
|
|
|
[GO_TO_DBBROWSER] = { browser, (void*)GO_TO_DBBROWSER, &tagcache_menu },
|
2007-04-18 19:46:34 +00:00
|
|
|
#endif
|
2008-05-22 08:02:48 +00:00
|
|
|
[GO_TO_WPS] = { wpsscrn, NULL, &playback_settings },
|
2011-01-29 01:01:12 +00:00
|
|
|
[GO_TO_MAINMENU] = { miscscrn, (struct menu_item_ex*)&main_menu_,
|
|
|
|
&manage_settings },
|
2012-12-16 03:26:03 +00:00
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
#ifdef HAVE_RECORDING
|
2007-07-03 18:31:13 +00:00
|
|
|
[GO_TO_RECSCREEN] = { recscrn, NULL, &recording_settings_menu },
|
2007-03-01 11:14:46 +00:00
|
|
|
#endif
|
2012-12-16 03:26:03 +00:00
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
#if CONFIG_TUNER
|
2007-07-03 18:31:13 +00:00
|
|
|
[GO_TO_FM] = { radio, NULL, &radio_settings_menu },
|
2007-03-01 11:14:46 +00:00
|
|
|
#endif
|
2012-12-16 03:26:03 +00:00
|
|
|
|
|
|
|
[GO_TO_RECENTBMARKS] = { load_bmarks, NULL, &bookmark_settings_menu },
|
2011-01-29 11:50:38 +00:00
|
|
|
[GO_TO_BROWSEPLUGINS] = { miscscrn, &plugin_menu, NULL },
|
2011-07-20 14:11:15 +00:00
|
|
|
[GO_TO_PLAYLISTS_SCREEN] = { playlist_view_catalog, NULL,
|
|
|
|
&playlist_options },
|
|
|
|
[GO_TO_PLAYLIST_VIEWER] = { playlist_view, NULL, &playlist_options },
|
2011-01-29 01:01:12 +00:00
|
|
|
[GO_TO_SYSTEM_SCREEN] = { miscscrn, &info_menu, &system_menu },
|
2011-11-15 13:22:02 +00:00
|
|
|
[GO_TO_SHORTCUTMENU] = { do_shortcut_menu, NULL, NULL },
|
2012-12-16 03:26:03 +00:00
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
};
|
|
|
|
static const int nb_items = sizeof(items)/sizeof(*items);
|
|
|
|
|
2020-07-19 17:42:04 +00:00
|
|
|
static int item_callback(int action,
|
|
|
|
const struct menu_item_ex *this_item,
|
|
|
|
struct gui_synclist *this_list);
|
2007-03-01 11:14:46 +00:00
|
|
|
|
2011-11-15 13:22:02 +00:00
|
|
|
MENUITEM_RETURNVALUE(shortcut_menu, ID2P(LANG_SHORTCUTS), GO_TO_SHORTCUTMENU,
|
|
|
|
NULL, Icon_Bookmark);
|
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
MENUITEM_RETURNVALUE(file_browser, ID2P(LANG_DIR_BROWSER), GO_TO_FILEBROWSER,
|
2007-03-03 13:52:14 +00:00
|
|
|
NULL, Icon_file_view_menu);
|
2007-03-07 04:36:02 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
2012-12-16 03:26:03 +00:00
|
|
|
MENUITEM_RETURNVALUE(db_browser, ID2P(LANG_TAGCACHE), GO_TO_DBBROWSER,
|
2007-03-03 13:52:14 +00:00
|
|
|
NULL, Icon_Audio);
|
2007-03-07 04:36:02 +00:00
|
|
|
#endif
|
2012-12-16 03:26:03 +00:00
|
|
|
MENUITEM_RETURNVALUE(rocks_browser, ID2P(LANG_PLUGINS), GO_TO_BROWSEPLUGINS,
|
2007-03-03 13:52:14 +00:00
|
|
|
NULL, Icon_Plugin);
|
2011-07-20 14:11:15 +00:00
|
|
|
|
2012-12-16 03:26:03 +00:00
|
|
|
MENUITEM_RETURNVALUE(playlist_browser, ID2P(LANG_CATALOG), GO_TO_PLAYLIST_VIEWER,
|
2011-07-20 14:11:15 +00:00
|
|
|
NULL, Icon_Playlist);
|
|
|
|
|
2019-09-20 08:07:29 +00:00
|
|
|
static char *get_wps_item_name(int selected_item, void * data,
|
|
|
|
char *buffer, size_t buffer_len)
|
2007-03-01 11:14:46 +00:00
|
|
|
{
|
2019-09-20 08:07:29 +00:00
|
|
|
(void)selected_item; (void)data; (void)buffer; (void)buffer_len;
|
2007-03-01 11:14:46 +00:00
|
|
|
if (audio_status())
|
2007-03-05 00:32:33 +00:00
|
|
|
return ID2P(LANG_NOW_PLAYING);
|
|
|
|
return ID2P(LANG_RESUME_PLAYBACK);
|
2007-03-01 11:14:46 +00:00
|
|
|
}
|
2012-12-16 03:26:03 +00:00
|
|
|
MENUITEM_RETURNVALUE_DYNTEXT(wps_item, GO_TO_WPS, NULL, get_wps_item_name,
|
2007-10-09 03:48:56 +00:00
|
|
|
NULL, NULL, Icon_Playback_menu);
|
2007-03-01 11:14:46 +00:00
|
|
|
#ifdef HAVE_RECORDING
|
2012-12-16 03:26:03 +00:00
|
|
|
MENUITEM_RETURNVALUE(rec, ID2P(LANG_RECORDING), GO_TO_RECSCREEN,
|
2007-03-03 13:52:14 +00:00
|
|
|
NULL, Icon_Recording);
|
2007-03-01 11:14:46 +00:00
|
|
|
#endif
|
|
|
|
#if CONFIG_TUNER
|
2012-12-16 03:26:03 +00:00
|
|
|
MENUITEM_RETURNVALUE(fm, ID2P(LANG_FM_RADIO), GO_TO_FM,
|
2007-03-03 13:52:14 +00:00
|
|
|
item_callback, Icon_Radio_screen);
|
2007-03-01 11:14:46 +00:00
|
|
|
#endif
|
2012-12-16 03:26:03 +00:00
|
|
|
MENUITEM_RETURNVALUE(menu_, ID2P(LANG_SETTINGS), GO_TO_MAINMENU,
|
2007-03-03 13:52:14 +00:00
|
|
|
NULL, Icon_Submenu_Entered);
|
2007-03-01 11:14:46 +00:00
|
|
|
MENUITEM_RETURNVALUE(bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS),
|
2012-12-16 03:26:03 +00:00
|
|
|
GO_TO_RECENTBMARKS, item_callback,
|
2007-03-03 13:52:14 +00:00
|
|
|
Icon_Bookmark);
|
2011-07-20 14:11:15 +00:00
|
|
|
MENUITEM_RETURNVALUE(playlists, ID2P(LANG_CATALOG), GO_TO_PLAYLISTS_SCREEN,
|
2011-01-29 01:01:12 +00:00
|
|
|
NULL, Icon_Playlist);
|
|
|
|
MENUITEM_RETURNVALUE(system_menu_, ID2P(LANG_SYSTEM), GO_TO_SYSTEM_SCREEN,
|
|
|
|
NULL, Icon_System_menu);
|
|
|
|
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
struct menu_item_ex root_menu_;
|
|
|
|
static struct menu_callback_with_desc root_menu_desc = {
|
|
|
|
item_callback, ID2P(LANG_ROCKBOX_TITLE), Icon_Rockbox };
|
2014-02-13 11:01:13 +00:00
|
|
|
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
static struct menu_table menu_table[] = {
|
|
|
|
/* Order here represents the default ordering */
|
|
|
|
{ "bookmarks", &bookmarks },
|
|
|
|
{ "files", &file_browser },
|
2007-03-07 04:36:02 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
{ "database", &db_browser },
|
2007-03-07 04:36:02 +00:00
|
|
|
#endif
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
{ "wps", &wps_item },
|
2012-12-16 03:26:03 +00:00
|
|
|
{ "settings", &menu_ },
|
2007-03-01 11:14:46 +00:00
|
|
|
#ifdef HAVE_RECORDING
|
2012-12-16 03:26:03 +00:00
|
|
|
{ "recording", &rec },
|
2007-03-01 11:14:46 +00:00
|
|
|
#endif
|
|
|
|
#if CONFIG_TUNER
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
{ "radio", &fm },
|
2007-03-01 11:14:46 +00:00
|
|
|
#endif
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
{ "playlists", &playlists },
|
|
|
|
{ "plugins", &rocks_browser },
|
|
|
|
{ "system_menu", &system_menu_ },
|
|
|
|
{ "shortcuts", &shortcut_menu },
|
|
|
|
};
|
|
|
|
#define MAX_MENU_ITEMS (sizeof(menu_table) / sizeof(struct menu_table))
|
|
|
|
static struct menu_item_ex *root_menu__[MAX_MENU_ITEMS];
|
|
|
|
|
2014-02-13 11:01:13 +00:00
|
|
|
struct menu_table *root_menu_get_options(int *nb_options)
|
|
|
|
{
|
|
|
|
*nb_options = MAX_MENU_ITEMS;
|
|
|
|
|
|
|
|
return menu_table;
|
|
|
|
}
|
|
|
|
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
void root_menu_load_from_cfg(void* setting, char *value)
|
|
|
|
{
|
2012-12-16 03:26:03 +00:00
|
|
|
char *next = value, *start, *end;
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
unsigned int menu_item_count = 0, i;
|
|
|
|
bool main_menu_added = false;
|
|
|
|
|
2012-02-26 22:34:37 +00:00
|
|
|
if (*value == '-')
|
|
|
|
{
|
|
|
|
root_menu_set_default(setting, NULL);
|
|
|
|
return;
|
|
|
|
}
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
root_menu_.flags = MENU_HAS_DESC | MT_MENU;
|
|
|
|
root_menu_.submenus = (const struct menu_item_ex **)&root_menu__;
|
|
|
|
root_menu_.callback_and_desc = &root_menu_desc;
|
|
|
|
|
|
|
|
while (next && menu_item_count < MAX_MENU_ITEMS)
|
|
|
|
{
|
|
|
|
start = next;
|
|
|
|
next = strchr(next, ',');
|
|
|
|
if (next)
|
|
|
|
{
|
|
|
|
*next = '\0';
|
|
|
|
next++;
|
|
|
|
}
|
2012-12-16 03:26:03 +00:00
|
|
|
start = skip_whitespace(start);
|
|
|
|
if ((end = strchr(start, ' ')))
|
|
|
|
*end = '\0';
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
for (i=0; i<MAX_MENU_ITEMS; i++)
|
|
|
|
{
|
|
|
|
if (*start && !strcmp(start, menu_table[i].string))
|
|
|
|
{
|
|
|
|
root_menu__[menu_item_count++] = (struct menu_item_ex *)menu_table[i].item;
|
|
|
|
if (menu_table[i].item == &menu_)
|
|
|
|
main_menu_added = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!main_menu_added)
|
|
|
|
root_menu__[menu_item_count++] = (struct menu_item_ex *)&menu_;
|
|
|
|
root_menu_.flags |= MENU_ITEM_COUNT(menu_item_count);
|
2012-03-02 19:33:13 +00:00
|
|
|
*(bool*)setting = true;
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
char* root_menu_write_to_cfg(void* setting, char*buf, int buf_len)
|
|
|
|
{
|
|
|
|
(void)setting;
|
|
|
|
unsigned i, written, j;
|
|
|
|
for (i = 0; i < MENU_GET_COUNT(root_menu_.flags); i++)
|
|
|
|
{
|
|
|
|
for (j=0; j<MAX_MENU_ITEMS; j++)
|
|
|
|
{
|
|
|
|
if (menu_table[j].item == root_menu__[i])
|
|
|
|
{
|
2012-12-16 03:26:03 +00:00
|
|
|
written = snprintf(buf, buf_len, "%s, ", menu_table[j].string);
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
buf_len -= written;
|
|
|
|
buf += written;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
void root_menu_set_default(void* setting, void* defaultval)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
(void)defaultval;
|
|
|
|
|
|
|
|
root_menu_.flags = MENU_HAS_DESC | MT_MENU;
|
|
|
|
root_menu_.submenus = (const struct menu_item_ex **)&root_menu__;
|
|
|
|
root_menu_.callback_and_desc = &root_menu_desc;
|
|
|
|
|
|
|
|
for (i=0; i<MAX_MENU_ITEMS; i++)
|
|
|
|
{
|
|
|
|
root_menu__[i] = (struct menu_item_ex *)menu_table[i].item;
|
|
|
|
}
|
|
|
|
root_menu_.flags |= MENU_ITEM_COUNT(MAX_MENU_ITEMS);
|
2012-03-02 19:33:13 +00:00
|
|
|
*(bool*)setting = false;
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
}
|
2012-12-16 03:26:03 +00:00
|
|
|
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
bool root_menu_is_changed(void* setting, void* defaultval)
|
|
|
|
{
|
|
|
|
(void)defaultval;
|
2012-03-02 19:33:13 +00:00
|
|
|
return *(bool*)setting;
|
main menu: Add the ability to hide and reorder the main menu items.
To change the shown menu items add the line "root_menu_order:<items>" into your config.cfg
<items> can be any of:
bookmarks, files, database, wps, settings, recording, radio, playlists, plugins, system_menu, shortcuts
Manual entry by Alexander Levin
Change-Id: Ie7f4bfb0f795184de094d05fc341a6cedd1c0cde
Reviewed-on: http://gerrit.rockbox.org/104
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-02-09 10:21:40 +00:00
|
|
|
}
|
2007-03-01 11:14:46 +00:00
|
|
|
|
2020-07-19 17:42:04 +00:00
|
|
|
static int item_callback(int action,
|
|
|
|
const struct menu_item_ex *this_item,
|
|
|
|
struct gui_synclist *this_list)
|
2007-03-01 11:14:46 +00:00
|
|
|
{
|
2020-07-19 17:42:04 +00:00
|
|
|
(void)this_list;
|
2007-03-01 11:14:46 +00:00
|
|
|
switch (action)
|
|
|
|
{
|
2007-07-11 02:22:03 +00:00
|
|
|
case ACTION_TREE_STOP:
|
|
|
|
return ACTION_REDRAW;
|
2007-03-01 11:14:46 +00:00
|
|
|
case ACTION_REQUEST_MENUITEM:
|
|
|
|
#if CONFIG_TUNER
|
|
|
|
if (this_item == &fm)
|
|
|
|
{
|
|
|
|
if (radio_hardware_present() == 0)
|
|
|
|
return ACTION_EXIT_MENUITEM;
|
|
|
|
}
|
2012-12-16 03:26:03 +00:00
|
|
|
else
|
2007-03-01 11:14:46 +00:00
|
|
|
#endif
|
|
|
|
if (this_item == &bookmarks)
|
|
|
|
{
|
|
|
|
if (global_settings.usemrb == 0)
|
|
|
|
return ACTION_EXIT_MENUITEM;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return action;
|
|
|
|
}
|
2007-03-05 13:36:00 +00:00
|
|
|
static int get_selection(int last_screen)
|
|
|
|
{
|
2009-08-03 01:42:08 +00:00
|
|
|
int i;
|
|
|
|
int len = ARRAYLEN(root_menu__);
|
|
|
|
for(i=0; i < len; i++)
|
2007-03-05 13:36:00 +00:00
|
|
|
{
|
2012-12-16 03:26:03 +00:00
|
|
|
if (((root_menu__[i]->flags&MENU_TYPE_MASK) == MT_RETURN_VALUE) &&
|
2007-03-05 13:36:00 +00:00
|
|
|
(root_menu__[i]->value == last_screen))
|
|
|
|
{
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2007-03-01 11:14:46 +00:00
|
|
|
|
2007-03-29 14:19:28 +00:00
|
|
|
static inline int load_screen(int screen)
|
|
|
|
{
|
|
|
|
/* set the global_status.last_screen before entering,
|
|
|
|
if we dont we will always return to the wrong screen on boot */
|
|
|
|
int old_previous = last_screen;
|
|
|
|
int ret_val;
|
2011-06-01 14:41:49 +00:00
|
|
|
enum current_activity activity = ACTIVITY_UNKNOWN;
|
2007-03-29 14:19:28 +00:00
|
|
|
if (screen <= GO_TO_ROOT)
|
|
|
|
return screen;
|
|
|
|
if (screen == old_previous)
|
|
|
|
old_previous = GO_TO_ROOT;
|
|
|
|
global_status.last_screen = (char)screen;
|
|
|
|
status_save();
|
2011-06-01 14:41:49 +00:00
|
|
|
|
|
|
|
if (screen == GO_TO_BROWSEPLUGINS)
|
|
|
|
activity = ACTIVITY_PLUGINBROWSER;
|
|
|
|
else if (screen == GO_TO_MAINMENU)
|
|
|
|
activity = ACTIVITY_SETTINGS;
|
2011-08-07 08:39:56 +00:00
|
|
|
else if (screen == GO_TO_SYSTEM_SCREEN)
|
|
|
|
activity = ACTIVITY_SYSTEMSCREEN;
|
2011-06-01 14:41:49 +00:00
|
|
|
|
|
|
|
if (activity != ACTIVITY_UNKNOWN)
|
|
|
|
push_current_activity(activity);
|
|
|
|
|
2007-03-29 14:19:28 +00:00
|
|
|
ret_val = items[screen].function(items[screen].param);
|
2011-06-01 14:41:49 +00:00
|
|
|
|
|
|
|
if (activity != ACTIVITY_UNKNOWN)
|
|
|
|
pop_current_activity();
|
|
|
|
|
2007-03-31 21:59:57 +00:00
|
|
|
last_screen = screen;
|
2007-03-29 14:19:28 +00:00
|
|
|
if (ret_val == GO_TO_PREVIOUS)
|
|
|
|
last_screen = old_previous;
|
|
|
|
return ret_val;
|
|
|
|
}
|
2007-04-12 15:28:51 +00:00
|
|
|
static int load_context_screen(int selection)
|
|
|
|
{
|
|
|
|
const struct menu_item_ex *context_menu = NULL;
|
2011-08-07 08:39:56 +00:00
|
|
|
int retval = GO_TO_PREVIOUS;
|
|
|
|
push_current_activity(ACTIVITY_CONTEXTMENU);
|
2007-04-25 10:41:17 +00:00
|
|
|
if ((root_menu__[selection]->flags&MENU_TYPE_MASK) == MT_RETURN_VALUE)
|
2007-04-12 15:28:51 +00:00
|
|
|
{
|
|
|
|
int item = root_menu__[selection]->value;
|
|
|
|
context_menu = items[item].context_menu;
|
|
|
|
}
|
|
|
|
/* special cases */
|
|
|
|
else if (root_menu__[selection] == &info_menu)
|
|
|
|
{
|
|
|
|
context_menu = &system_menu;
|
|
|
|
}
|
2012-12-16 03:26:03 +00:00
|
|
|
|
2007-04-12 15:28:51 +00:00
|
|
|
if (context_menu)
|
2011-08-07 08:39:56 +00:00
|
|
|
retval = do_menu(context_menu, NULL, NULL, false);
|
|
|
|
pop_current_activity();
|
|
|
|
return retval;
|
2007-04-12 15:28:51 +00:00
|
|
|
}
|
2007-10-12 04:20:20 +00:00
|
|
|
|
2020-07-28 14:58:34 +00:00
|
|
|
static int load_plugin_screen(char *plug_path, void* plug_param)
|
2010-06-09 04:25:41 +00:00
|
|
|
{
|
|
|
|
int ret_val;
|
2012-12-16 03:26:03 +00:00
|
|
|
int old_previous = last_screen;
|
2010-06-09 04:25:41 +00:00
|
|
|
last_screen = next_screen;
|
|
|
|
global_status.last_screen = (char)next_screen;
|
|
|
|
status_save();
|
2012-12-16 03:26:03 +00:00
|
|
|
|
2020-07-28 14:58:34 +00:00
|
|
|
switch (plugin_load(plug_path, plug_param))
|
2010-09-01 14:12:14 +00:00
|
|
|
{
|
|
|
|
case PLUGIN_GOTO_WPS:
|
|
|
|
ret_val = GO_TO_WPS;
|
|
|
|
break;
|
2020-08-01 02:45:10 +00:00
|
|
|
case PLUGIN_GOTO_PLUGIN:
|
|
|
|
ret_val = GO_TO_PLUGIN;
|
|
|
|
break;
|
2010-09-01 14:12:14 +00:00
|
|
|
case PLUGIN_OK:
|
2010-06-09 09:41:16 +00:00
|
|
|
ret_val = audio_status() ? GO_TO_PREVIOUS : GO_TO_ROOT;
|
2010-09-01 14:12:14 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ret_val = GO_TO_PREVIOUS;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-06-09 04:25:41 +00:00
|
|
|
if (ret_val == GO_TO_PREVIOUS)
|
|
|
|
last_screen = (old_previous == next_screen) ? GO_TO_ROOT : old_previous;
|
|
|
|
return ret_val;
|
|
|
|
}
|
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
void root_menu(void)
|
|
|
|
{
|
|
|
|
int previous_browser = GO_TO_FILEBROWSER;
|
|
|
|
int selected = 0;
|
2012-12-16 03:26:03 +00:00
|
|
|
|
2011-06-01 14:41:49 +00:00
|
|
|
push_current_activity(ACTIVITY_MAINMENU);
|
2007-03-01 11:14:46 +00:00
|
|
|
|
|
|
|
if (global_settings.start_in_screen == 0)
|
2007-03-29 14:19:28 +00:00
|
|
|
next_screen = (int)global_status.last_screen;
|
|
|
|
else next_screen = global_settings.start_in_screen - 2;
|
2014-04-15 07:34:22 +00:00
|
|
|
#if CONFIG_TUNER
|
|
|
|
add_event(PLAYBACK_EVENT_START_PLAYBACK, rootmenu_start_playback_callback);
|
|
|
|
#endif
|
2014-03-14 22:15:16 +00:00
|
|
|
add_event(PLAYBACK_EVENT_TRACK_CHANGE, rootmenu_track_changed_callback);
|
2007-03-07 01:16:25 +00:00
|
|
|
#ifdef HAVE_RTC_ALARM
|
2012-12-16 03:26:03 +00:00
|
|
|
if ( rtc_check_alarm_started(true) )
|
2007-03-07 01:16:25 +00:00
|
|
|
{
|
|
|
|
rtc_enable_alarm(false);
|
2007-03-29 14:19:28 +00:00
|
|
|
next_screen = GO_TO_WPS;
|
2007-03-07 01:16:25 +00:00
|
|
|
#if CONFIG_TUNER
|
|
|
|
if (global_settings.alarm_wake_up_screen == ALARM_START_FM)
|
2007-03-29 14:19:28 +00:00
|
|
|
next_screen = GO_TO_FM;
|
2007-03-07 01:16:25 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_RECORDING
|
|
|
|
if (global_settings.alarm_wake_up_screen == ALARM_START_REC)
|
2007-03-07 01:59:29 +00:00
|
|
|
{
|
|
|
|
recording_start_automatic = true;
|
2007-03-29 14:19:28 +00:00
|
|
|
next_screen = GO_TO_RECSCREEN;
|
2007-03-07 01:59:29 +00:00
|
|
|
}
|
2007-03-07 01:16:25 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif /* HAVE_RTC_ALARM */
|
|
|
|
|
2020-09-17 18:53:29 +00:00
|
|
|
#if defined(HAVE_HEADPHONE_DETECTION) || defined(HAVE_LINEOUT_DETECTION)
|
|
|
|
if (next_screen == GO_TO_WPS && global_settings.unplug_autoresume)
|
|
|
|
{
|
|
|
|
next_screen = GO_TO_ROOT;
|
2007-03-08 00:37:58 +00:00
|
|
|
#ifdef HAVE_HEADPHONE_DETECTION
|
2020-09-17 18:53:29 +00:00
|
|
|
if (headphones_inserted())
|
|
|
|
next_screen = GO_TO_WPS;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_LINEOUT_DETECTION
|
|
|
|
if (lineout_inserted())
|
|
|
|
next_screen = GO_TO_WPS;
|
2007-03-08 00:37:58 +00:00
|
|
|
#endif
|
2020-09-17 18:53:29 +00:00
|
|
|
}
|
|
|
|
#endif /*(HAVE_HEADPHONE_DETECTION) || (HAVE_LINEOUT_DETECTION)*/
|
2007-03-08 00:37:58 +00:00
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
while (true)
|
|
|
|
{
|
2007-03-29 14:19:28 +00:00
|
|
|
switch (next_screen)
|
2007-03-01 11:14:46 +00:00
|
|
|
{
|
2007-03-27 06:38:11 +00:00
|
|
|
case MENU_ATTACHED_USB:
|
|
|
|
case MENU_SELECTED_EXIT:
|
|
|
|
/* fall through */
|
2007-03-01 11:14:46 +00:00
|
|
|
case GO_TO_ROOT:
|
2007-03-07 10:13:07 +00:00
|
|
|
if (last_screen != GO_TO_ROOT)
|
|
|
|
selected = get_selection(last_screen);
|
iBasso DX50/DX90: Major code cleanup and reorganization.
Reorganization
- Separated iBasso devices from PLATFORM_ANDROID. These are now standlone
hosted targets. Most device specific code is in the
firmware/target/hosted/ibasso directory.
- No dependency on Android SDK, only the Android NDK is needed.
32 bit Android NDK and Android API Level 16.
- Separate implementation for each device where feasible.
Code cleanup
- Rewrite of existing code, from simple reformat to complete reimplementation.
- New backlight interface, seperating backlight from touchscreen.
- Rewrite of device button handler, removing unneeded code and fixing memory
leaks.
- New Debug messages interface logging to Android adb logcat (DEBUGF, panicf,
logf).
- Rewrite of lcd device handler, removing unneeded code and fixing memory leaks.
- Rewrite of audiohw device handler/pcm interface, removing unneeded code and
fixing memory leaks, enabling 44.1/48kHz pthreaded playback.
- Rewrite of power and powermng, proper shutdown, using batterylog results
(see http://gerrit.rockbox.org/r/#/c/1047/).
- Rewrite of configure (Android NDK) and device specific config.
- Rewrite of the Android NDK specific Makefile.
Misc
- All plugins/games/demos activated.
- Update tinyalsa to latest from https://github.com/tinyalsa/tinyalsa.
Includes
- http://gerrit.rockbox.org/r/#/c/993/
- http://gerrit.rockbox.org/r/#/c/1010/
- http://gerrit.rockbox.org/r/#/c/1035/
Does not include http://gerrit.rockbox.org/r/#/c/1007/ due to new backlight
interface and new option for hold switch, touchscreen, physical button
interaction.
Rockbox needs the iBasso DX50/DX90 loader for startup, see
http://gerrit.rockbox.org/r/#/c/1099/
The loader expects Rockbox to be installed in /mnt/sdcard/.rockbox/. If
/mnt/sdcard/ is accessed as USB mass storage device, Rockbox will exit
gracefully and the loader will restart Rockbox on USB disconnect.
Tested on iBasso DX50.
Compiled (not tested) for iBasso DX90.
Compiled (not tested) for PLATFORM_ANDROID.
Change-Id: I5f5e22e68f5b4cf29c28e2b40b2c265f2beb7ab7
2015-02-02 20:44:29 +00:00
|
|
|
#if (CONFIG_PLATFORM&PLATFORM_ANDROID)
|
2010-11-03 14:34:57 +00:00
|
|
|
/* When we are in the main menu we want the hardware BACK
|
|
|
|
* button to be handled by Android instead of rockbox */
|
|
|
|
android_ignore_back_button(true);
|
|
|
|
#endif
|
2008-03-26 03:35:24 +00:00
|
|
|
next_screen = do_menu(&root_menu_, &selected, NULL, false);
|
iBasso DX50/DX90: Major code cleanup and reorganization.
Reorganization
- Separated iBasso devices from PLATFORM_ANDROID. These are now standlone
hosted targets. Most device specific code is in the
firmware/target/hosted/ibasso directory.
- No dependency on Android SDK, only the Android NDK is needed.
32 bit Android NDK and Android API Level 16.
- Separate implementation for each device where feasible.
Code cleanup
- Rewrite of existing code, from simple reformat to complete reimplementation.
- New backlight interface, seperating backlight from touchscreen.
- Rewrite of device button handler, removing unneeded code and fixing memory
leaks.
- New Debug messages interface logging to Android adb logcat (DEBUGF, panicf,
logf).
- Rewrite of lcd device handler, removing unneeded code and fixing memory leaks.
- Rewrite of audiohw device handler/pcm interface, removing unneeded code and
fixing memory leaks, enabling 44.1/48kHz pthreaded playback.
- Rewrite of power and powermng, proper shutdown, using batterylog results
(see http://gerrit.rockbox.org/r/#/c/1047/).
- Rewrite of configure (Android NDK) and device specific config.
- Rewrite of the Android NDK specific Makefile.
Misc
- All plugins/games/demos activated.
- Update tinyalsa to latest from https://github.com/tinyalsa/tinyalsa.
Includes
- http://gerrit.rockbox.org/r/#/c/993/
- http://gerrit.rockbox.org/r/#/c/1010/
- http://gerrit.rockbox.org/r/#/c/1035/
Does not include http://gerrit.rockbox.org/r/#/c/1007/ due to new backlight
interface and new option for hold switch, touchscreen, physical button
interaction.
Rockbox needs the iBasso DX50/DX90 loader for startup, see
http://gerrit.rockbox.org/r/#/c/1099/
The loader expects Rockbox to be installed in /mnt/sdcard/.rockbox/. If
/mnt/sdcard/ is accessed as USB mass storage device, Rockbox will exit
gracefully and the loader will restart Rockbox on USB disconnect.
Tested on iBasso DX50.
Compiled (not tested) for iBasso DX90.
Compiled (not tested) for PLATFORM_ANDROID.
Change-Id: I5f5e22e68f5b4cf29c28e2b40b2c265f2beb7ab7
2015-02-02 20:44:29 +00:00
|
|
|
#if (CONFIG_PLATFORM&PLATFORM_ANDROID)
|
2010-11-03 14:34:57 +00:00
|
|
|
android_ignore_back_button(false);
|
|
|
|
#endif
|
2007-03-29 14:19:28 +00:00
|
|
|
if (next_screen != GO_TO_PREVIOUS)
|
|
|
|
last_screen = GO_TO_ROOT;
|
2007-03-01 11:14:46 +00:00
|
|
|
break;
|
2007-03-06 13:35:15 +00:00
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
case GO_TO_PREVIOUS:
|
2007-03-29 14:19:28 +00:00
|
|
|
next_screen = last_screen;
|
2007-03-01 11:14:46 +00:00
|
|
|
break;
|
2007-03-06 13:35:15 +00:00
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
case GO_TO_PREVIOUS_BROWSER:
|
2007-03-29 14:19:28 +00:00
|
|
|
next_screen = previous_browser;
|
2007-03-01 11:14:46 +00:00
|
|
|
break;
|
2007-03-06 13:35:15 +00:00
|
|
|
|
2007-03-01 11:14:46 +00:00
|
|
|
case GO_TO_PREVIOUS_MUSIC:
|
2007-03-29 14:19:28 +00:00
|
|
|
next_screen = previous_music;
|
2007-03-01 11:14:46 +00:00
|
|
|
break;
|
2007-04-12 15:28:51 +00:00
|
|
|
case GO_TO_ROOTITEM_CONTEXT:
|
|
|
|
next_screen = load_context_screen(selected);
|
|
|
|
break;
|
2020-08-01 02:45:10 +00:00
|
|
|
case GO_TO_PLUGIN:
|
2020-07-28 14:58:34 +00:00
|
|
|
{
|
2020-08-01 02:45:10 +00:00
|
|
|
char *key;
|
|
|
|
switch (last_screen)
|
|
|
|
{
|
|
|
|
case GO_TO_ROOT:
|
|
|
|
key = ID2P(LANG_START_SCREEN);
|
|
|
|
break;
|
|
|
|
case GO_TO_WPS:
|
|
|
|
key = ID2P(LANG_OPEN_PLUGIN_SET_WPS_CONTEXT_PLUGIN);
|
|
|
|
break;
|
|
|
|
case GO_TO_SHORTCUTMENU:
|
|
|
|
key = ID2P(LANG_SHORTCUTS);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
key = ID2P(LANG_OPEN_PLUGIN);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
open_plugin_get_entry(key, &open_plugin_entry);
|
|
|
|
char *path = open_plugin_entry.path;
|
|
|
|
char *param = open_plugin_entry.param;
|
|
|
|
if (param[0] == '\0')
|
|
|
|
param = NULL;
|
|
|
|
|
|
|
|
next_screen = load_plugin_screen(path, param);
|
|
|
|
|
|
|
|
previous_browser = (next_screen != GO_TO_WPS) ? GO_TO_FILEBROWSER : GO_TO_PLUGIN;
|
2010-06-09 04:25:41 +00:00
|
|
|
break;
|
2020-07-28 14:58:34 +00:00
|
|
|
}
|
2007-03-29 14:19:28 +00:00
|
|
|
default:
|
2007-03-09 16:54:35 +00:00
|
|
|
#ifdef HAVE_TAGCACHE
|
2014-04-15 07:34:22 +00:00
|
|
|
/* With !HAVE_TAGCACHE previous_browser is always GO_TO_FILEBROWSER */
|
|
|
|
if (next_screen == GO_TO_FILEBROWSER || next_screen == GO_TO_DBBROWSER)
|
2007-03-29 14:19:28 +00:00
|
|
|
previous_browser = next_screen;
|
2007-03-09 16:54:35 +00:00
|
|
|
#endif
|
2014-04-15 07:34:22 +00:00
|
|
|
#if CONFIG_TUNER
|
|
|
|
/* With !CONFIG_TUNER previous_music is always GO_TO_WPS */
|
|
|
|
if (next_screen == GO_TO_WPS || next_screen == GO_TO_FM)
|
2007-03-29 14:19:28 +00:00
|
|
|
previous_music = next_screen;
|
2014-04-15 07:34:22 +00:00
|
|
|
#endif
|
2007-03-29 14:19:28 +00:00
|
|
|
next_screen = load_screen(next_screen);
|
|
|
|
break;
|
|
|
|
} /* switch() */
|
2007-03-01 11:14:46 +00:00
|
|
|
}
|
|
|
|
}
|