From 99799bcc32f2c1e25238d9624db8ae08f8450640 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Sat, 18 Jan 2014 11:00:08 -0500 Subject: [PATCH] design: Add future ideas Signed-off-by: Anna Schumaker --- design.txt | 64 ++++++++++++++++++++++++++++++++++++----------- design/footer.txt | 42 +++++++++++++++++++++---------- 2 files changed, 79 insertions(+), 27 deletions(-) diff --git a/design.txt b/design.txt index 69733ed6..359980a5 100644 --- a/design.txt +++ b/design.txt @@ -112,10 +112,12 @@ Callbacks: (lib/callback.cpp) with no-op default values and filled in by the user through the get_callbacks() function. + - Callback functions: struct Callbacks { void (*on_library_add)(unsigned int, library :: Library *); void (*on_library_update)(unsigned int, library :: Library *); + void (*on_library_track_add)(); }; static struct Callbacks callbacks; @@ -835,6 +837,9 @@ Playqueue: (lib/playqueue.cpp) Erase tracks[playqueue_id] from the tracks vector. length -= track.length. + void Playqueue :: del_track(unsigned int track_id); + Erase all tracks with track id track_id. + void Playqueue :: set_flag(playqueue_flags flag); void Playqueue :: unset_flag(playqueue_flags flag); Set or unset the given flag. @@ -895,14 +900,23 @@ Deck: (lib/deck.cpp) The playqueue deck is used to hold the temporary playqueues created by the user. + This module also controls the library playqueue, which should be updated + using the on_library_track_add() and on_library_track_del() callback + functions. The library playqueue will always have PQ_ENABLED and + PQ_REPEAT set. This playlist will default to PQ_RANDOM unset. + - Deck: list deck; + Playqueue library_pq; - File << deck.size() << endl; + File << library_pq.random << deck.size() << endl; File << deck[0] << endl; File << deck[N] << endl; - API + void deck :: init(); + Set up callbacks used by the library. + void deck :: read(File &); void deck :: write(File &); Read or write the playqueue file. This will be called @@ -929,6 +943,9 @@ Deck: (lib/deck.cpp) If the playqueue is empty after calling next(), remove it from the deck. + If there are no playqueues on the deck, play a song from the + library playqueue. + If there are no playable IDs, throw -EEXIST. void deck :: reset(); @@ -939,6 +956,9 @@ Deck: (lib/deck.cpp) This function only exists if CONFIG_TEST is enabled. Print out helpful stats about the current state of the playqueue deck. + Playqueue *deck :: get_library_pq(); + Return the library playqueue. + Audio: (lib/audio.cpp) @@ -1075,10 +1095,10 @@ Future work: Hint: If feature B depends on A, implement A in 6.x and B in 6.x+1 - - New default groups: (6.1) + - New default groups: Unplayed tracks - - Categories: (6.1) + - Categories: Use these to make "groups of groups" for better organization. Different categories can include Album, Artist and Genere dynamic groups in addition to user created groups (see below) @@ -1086,15 +1106,15 @@ Future work: The Artist, Album and Genre "tables" can be used to populate these categories. - - User created song groups: (6.2) + - User created song groups: Basic add and remove features can be implemented using the Library and Banned Songs groups. This will give me a chance to test saving groups on a small scale before letting users create anything they want. - - Save a user's playlist as a group: (6.2) + - Save a user's playlist as a group: - - Library defragment: (6.1) + - Library defragment: Ocarina 6.0 will leave holes in the library when tracks are deleted, potentially leading to fragmentation and larger-than- needed file sizes. A "defragment" utility can be created to @@ -1103,25 +1123,25 @@ Future work: To help with fixing groups, a mapping of (old values) -> (new values) should be kept. - - Fix track durations: (6.1) + - Fix track durations: Some tracks in my library are tagged with the wrong duration, so fix them as they are played. - - Track tag editor: (6.2) + - Track tag editor: Make a pop-up window for editing the tags of a track. Be sure to update the library information and the on-disk file. - - Album art: (6.1) + - Album art: (easy) Start with album art fetching script (hard) Build in to Ocarina - - Playlist custom sorting: (6.1) + - Playlist custom sorting: Click column headers to choos sort order Keep a list of fields that the user has selected and place new fields in the front of this list. Use a recursive stable sort to do the sorting. - - Better design file format: (6.1) + - Better design file format: Todo list in each document instead of all at once in the footer. Leave the Todo list out of the official "design document" and keep it in each individual section instead. @@ -1129,13 +1149,13 @@ Future work: Code formatting? Checkbox for when features are done? (reference commit) - - Copy a song group to a different directory: (6.x) + - Copy a song group to a different directory: This can be useful for keeping an external device (like an Android phone) updated with the music you want to listen to. Complications: I have an mp3 mirror of all my music, and I want the mp3s to be synced. Perhaps track mirrors in Ocarina? - - Mirror directory: (6.x) + - Mirror directory: I rip music to .flac, but keep an mp3 mirror directory to sync to other computers and phones. An Ocarina tool to manage a COMPLETE library mirror might be a good idea so I no longer @@ -1143,13 +1163,15 @@ Future work: script, a cron job, and maybe a "mirror this track" option in the library? Perhaps create a mirror group? - - Extra testing ideas: (6.1) + - Extra testing ideas: - Run tests through valgrind to help find memory leaks - Some way to enable / disable tests during development - Run tests based on dependencies - Fix tests that will only work on my computer - Double check that all inputs and outputs are tested - Simple testing library? + - Stop tests on failure + - Test callbacks - Preferences: - Set default sort @@ -1166,3 +1188,17 @@ Future work: External script to calculate values? Calculate value after first playback? Store in library :: Track structure + + - Autosave databases + Artist, album, genere and library path don't change often so + saving on every add / remove won't be a huge performance hit + and may actually be more efficient in the long run. + + - Scons improvements: + Why does everything compile with the same CONFIG_* parameters? + Cleanups to tests/Sconscript + Global dependency resolution (rather than having multiple ways + in lib/ design/ and tests/) + + - Playqueue and database inherit from common class + - "About" dialog diff --git a/design/footer.txt b/design/footer.txt index 6c0e1b51..17e0c588 100644 --- a/design/footer.txt +++ b/design/footer.txt @@ -9,10 +9,10 @@ Future work: Hint: If feature B depends on A, implement A in 6.x and B in 6.x+1 - - New default groups: (6.1) + - New default groups: Unplayed tracks - - Categories: (6.1) + - Categories: Use these to make "groups of groups" for better organization. Different categories can include Album, Artist and Genere dynamic groups in addition to user created groups (see below) @@ -20,15 +20,15 @@ Future work: The Artist, Album and Genre "tables" can be used to populate these categories. - - User created song groups: (6.2) + - User created song groups: Basic add and remove features can be implemented using the Library and Banned Songs groups. This will give me a chance to test saving groups on a small scale before letting users create anything they want. - - Save a user's playlist as a group: (6.2) + - Save a user's playlist as a group: - - Library defragment: (6.1) + - Library defragment: Ocarina 6.0 will leave holes in the library when tracks are deleted, potentially leading to fragmentation and larger-than- needed file sizes. A "defragment" utility can be created to @@ -37,25 +37,25 @@ Future work: To help with fixing groups, a mapping of (old values) -> (new values) should be kept. - - Fix track durations: (6.1) + - Fix track durations: Some tracks in my library are tagged with the wrong duration, so fix them as they are played. - - Track tag editor: (6.2) + - Track tag editor: Make a pop-up window for editing the tags of a track. Be sure to update the library information and the on-disk file. - - Album art: (6.1) + - Album art: (easy) Start with album art fetching script (hard) Build in to Ocarina - - Playlist custom sorting: (6.1) + - Playlist custom sorting: Click column headers to choos sort order Keep a list of fields that the user has selected and place new fields in the front of this list. Use a recursive stable sort to do the sorting. - - Better design file format: (6.1) + - Better design file format: Todo list in each document instead of all at once in the footer. Leave the Todo list out of the official "design document" and keep it in each individual section instead. @@ -63,13 +63,13 @@ Future work: Code formatting? Checkbox for when features are done? (reference commit) - - Copy a song group to a different directory: (6.x) + - Copy a song group to a different directory: This can be useful for keeping an external device (like an Android phone) updated with the music you want to listen to. Complications: I have an mp3 mirror of all my music, and I want the mp3s to be synced. Perhaps track mirrors in Ocarina? - - Mirror directory: (6.x) + - Mirror directory: I rip music to .flac, but keep an mp3 mirror directory to sync to other computers and phones. An Ocarina tool to manage a COMPLETE library mirror might be a good idea so I no longer @@ -77,13 +77,15 @@ Future work: script, a cron job, and maybe a "mirror this track" option in the library? Perhaps create a mirror group? - - Extra testing ideas: (6.1) + - Extra testing ideas: - Run tests through valgrind to help find memory leaks - Some way to enable / disable tests during development - Run tests based on dependencies - Fix tests that will only work on my computer - Double check that all inputs and outputs are tested - Simple testing library? + - Stop tests on failure + - Test callbacks - Preferences: - Set default sort @@ -100,3 +102,17 @@ Future work: External script to calculate values? Calculate value after first playback? Store in library :: Track structure + + - Autosave databases + Artist, album, genere and library path don't change often so + saving on every add / remove won't be a huge performance hit + and may actually be more efficient in the long run. + + - Scons improvements: + Why does everything compile with the same CONFIG_* parameters? + Cleanups to tests/Sconscript + Global dependency resolution (rather than having multiple ways + in lib/ design/ and tests/) + + - Playqueue and database inherit from common class + - "About" dialog