Project Title ---------------------------------------------------------------------------------------------------------------------------------------------- A Rockbox Feature Addition: Multiple Recording Directory Support for iRiver iHP-120 Author ---------------------------------------------------------------------------------------------------------------------------------------------- Allen Young (IntelliCoder) allen2002@cox.net Project Current Status ---------------------------------------------------------------------------------------------------------------------------------------------- 1. The source codes are fully written, tested, and debugged on iRiver iHP-120. The base source codes are 2007/05/13 release. 2. The source codes have been proof-read several times. It is an author's hunch that the feature will work on other players without any modifications to the code. Project Overview ---------------------------------------------------------------------------------------------------------------------------------------------- Currently, Rockbox (ver. r13064-070408, 2007/05/13 release) supports only two types of recording directories. /recording and the currently selected directory. Despite the improved option to choose a random directory as the recording destination using the "currently directory" option compared to the native iRiver firmware, it is still insufficient to turn iHP-120 into a fully-organizable voice recorder due to one key limitation: The mechanism to change recording directories still is not fast nor convenient enough. Specialized voice recorders support fast-switching between multiple directories often with a single button for improved voice file organization. The objective of this project is to add features to Rockbox so that it is possible to switch between user-defined directories with a press of button or two on iRiver iHP-120. Usage Scenario ---------------------------------------------------------------------------------------------------------------------------------------------- Let's suppose the user has many things going on his life and prefers to dictate his thoughts instead of writing them down for various reasons. For example, at a given moment, he is working on two business presentations, managing two projects, writing codes for one project, and dating four girls named Jennifer, Rachael, Suzanne, and Evey. Plans, ideas, and urges to practice verbal deliveries for any of these matters can pop up anywhere, and he obviously does not want to put all of them in a single directory nor want to spend time later to organize them on his PC. When he records a thought or idea, it must go into the proper directory at the time of recording. The only way to achieve this goal with the present version of Rockbox is to (if the current directory is selected as the recording directory) is to press the STOP button from the WRS (While Recording Screen) to get to the main menu, navigate to select the Files menu item, press the navigator button, navigate to the directory of interest, press the A-B button to get back to the main menu, navigate to select the Recording, press the navigator button to select Recording to get into the WRS (While Recording Screen), then finally press the PLAY button to start recording. Too cumbersome, especially if he wants or needs to switch between directories often. Instead, with the proposed feature addition, the user should be able to switch between the user-defined recording directories from the WRS (While Recording Screen). User-Interface Changes ---------------------------------------------------------------------------------------------------------------------------------------------- 1. Add a line above "Volume" option on the WRS, which is titled "Directory." The user can select the line using Up/Down, and alternate between the pre-designated recording directories using Left/Right. The currently selected directory on this line is the destination for the current recording. 2. The user can change the recording directory from WRS only when the player is in the stop mode. During recording or pause, the user cannot change the recording directory using the Directory option on the WRS. 3. To facilitate managing the pre-designated recording directory list, modify the menu item "Directory" under Recording Settings. In the modified "Directory" menu, the first line is titled "Remove All." The second line is titled "/recording" (The default recording directory). The third line is titled "Current Directory." All the lines at and below the third line are pre-designated recording directories. "/recording" and "Current Directory" has the same functionalities as before. When any of the user-defined recording directories are highlighted, the user can press MENU button to remove the directory from the list. Selecting "Remove All" will remove all the user-defined recording directories. Clicking left button will exit the Directory menu. 4. A directory can be added as a user-defined recording directory by clicking "Add as Recording Directory" option in its context menu. Implementation Issues / Design Decisions ---------------------------------------------------------------------------------------------------------------------------------------------- 1. The player needs to keep a list of the recording directories in memory while in WRS (alternatively, it can hit the disk every time the user changes the current recording directory from WRS, if it must). The plugin buffer is used to achieve this purpose. It will be analogous to the playlist. In fact, much of the mechanisms to do so are inspired from the playlist viewing mechanism. 2. No change to the config block. For the user-defined directories, global_settings.rec_directory >= 2. Rather, it uses the existing config block architecture and uses a new database file called ./rec_path to keep track of the user-defined recording directories. 3. It seems that during recording the player takes over the entire audio buffer. It is ASSUMED that the audio buffer means mp3 buffer. Therefore, it is ASSUMED that the plugin buffer is unusued during recording. The plugin buffer is where the recording folder names are kept while on WRS. During the test phase, no problem has been detected that could arise from these assumptions. 4. Currently, 15 user-defined folders are supported. This value can be easily increased by changing MAX... However, refer to the comment in ... recording.c Changed Files ---------------------------------------------------------------------------------------------------------------------------------------------- 1. /apps/recorder/recording.h 2. /apps/recorder/recording.c 3. /apps/onplay.c 4. /apps/menus/recording_menu.c 5. /apps/settings.h (just a line of comment) Required Improvements before Commit (the author does not have the expertise to do these) ---------------------------------------------------------------------------------------------------------------------------------------------- 1. Add a GUI language token with description "Add as Recording Directory" in .lang files and update the MENUITEM_FUNCTION(add_as_rec_dir_item...) statement in onplay.c. 2. Add a GUI language token with description "Remove All" in .lang files and update the selected_item == 0 case in rec_path_callback_name() in recording.c 3. Add a GUI language token with description "Error accessing recording directory DB " in .lang files and update the ./rec_path access error message displays in rec_path_init(), rec_path_save(), rec_path_load(), and rec_path_insert() in recording.c. (This could be optional in short term). Optional Future Improvements ---------------------------------------------------------------------------------------------------------------------------------------------- 1. Add a new menu item named "Directory Options" in Recording Settings menu with the following items. Support User-define Directories: YES/NO (Default YES) Removal Confirmation YES/NO (Default NO) Full Directory Name: YES/NO (Default NO) Display Add as Recording Directory: YES/NO (Default YES) Last Words ---------------------------------------------------------------------------------------------------------------------------------------------- Much gratitude and bravo to the Rockbox community to making such a wonderful project available. Remaining tasks 0. Tackle the implementation issue #4. Add a code in rec_path_inser() if necessary to handle overflow. 1. Build the patches and proof read them for the last time, build the final distribution, and backup the source codes and the distribution package on the backup computer. 2. submit the patches along with the design document. 3. leave comments in feature requests. 4. done!