Commit Graph

2248 Commits

Author SHA1 Message Date
Anna Schumaker 8d8e9262d6 library: Initial backend updates
I do not make any of the library spec changes yet, instead I update the
backend code so it compiles and still works with the changes I have made
so far.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker e484653d71 design: Draft out library changes
I added in an update_all() button and combined two identical database
structures.  Hopefully this will help to clean up the code.

I also added in wording for how to use the idle queue to scan paths.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 114c22bb12 playlist: Implement reachitecting of playlists
I changed the two playlists that are supported, added in exception
handling, and removed the list() function since I will always know the
names of playlists.  I also rename everything to "playlist" from
"group".

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 914473e10a Rename playlist and group source files
Playlist -> playqueue
Group -> playlist

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker ee100c0238 filter: Implement a "to lowercase" function
This function will convert the provided text to lowercase.  This really
isn't a filter function, but the filter already implements a lowercase
cache that should be useful.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker acd8bd7b23 database: Implement updates to match my current design
- Force the primary key to be a string
- Throw error codes rather than 0

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker ab8c15ecb7 file: Implement minor design changes
I had been returning success / failed boolean values for various
operations.  I think it's better to throw an exception in these
"exceptional" circumstances since error values can give more information
about why a function failed.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker dd87ec022c gitignore updates
I want glade temporary files to be ignored by git.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker e4364e6ea2 gui: Add a button for importing a legacy library
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 0760b1fecd design: Add information about testing library importing
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker f7a7710482 design: Rename a few subsystems
- Playlist -> playqueue.  Playqueue sounds more temporary, which better
  represents how I intend this code to be used.
- Groups -> playlist.  A playlist is the accepted term for what I am
  trying to create here.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 31e6bcef3b design: Modifications needed by the GUI
This patch writes out various modifications the GUI will require the
back-end library to make.  This includes:

- Rename playlists to playqueues and groups to playlists.
- Make library information accessable.
- Use try/catch style errors instead of returning bool in a few places.
- Extra playqueue accessablity functions.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker e1d527f077 design: Update design.txt
This matches the current state of the backend library and does not have
any tweaks for the GUI.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker 2c243194d7 gui: Create a glade file
I've taken a first pass at the Ocarina 6.0 GUI.  The backend will need
some tweaking before this design can be used.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 0281a7653d libsaria: Remove libsaria
My new implementation puts everything under lib/ instead of treating the
backend library as a different project.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker c65c8b06f2 audio: Implement pause after N tracks feature
This patch implements the pause-after-N-tracks feature.  I also included
various improvements to the audio code.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker ee9a98737a audio: New features and improvements
- Seek(), position() and duration() functions are implemented
  - There are bugs in the test program :(
- Clean up next()

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker edbdd1c66f audio: Begin implementing audio code
I have written play(), pause(), next() and seek_to() so far.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker b8b215be35 deck: Save and restore the playlist deck
The read and write functions will be called by a higher up layer, so I
need to open the file manually in the test.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 83a8b5ae1d deck: Implement next()
I make sure to remove empty playlists from the deck and throw an error
if there are no playable tracks on the deck.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker fecc10ab5e deck: Implement basic deck features
- Add playlists
- Remove playlists
- Rearrange playlists
- Get a playlist based on id

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 0c01751946 playlist: Implement next()
Random and sequential next, for both locked and unlocked playlists.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 168f08392d playlist: Implement read() and write()
The file will be passed in by the deck layer, since it stores multiple
files.  I just fake up a file in test_2() that is used for storing the
playlist.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 3a478ddba7 playlist: Implement playlist modification functions
I can now add and remove tracks, in addition to asking for the playlist
size.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 2d13b74c12 playlist: Create the initial playlist class
Right now it just knows the value of its flags variable.  More to come
soon!

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 9aa2bc7df1 design: Split playlist design
To keep the design readable, I split the playlist class (playlist.txt)
from the playlist deck (deck.txt).

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker a3cf5daa18 library: Test adding new files to a directory
I recreate the directory deleted in test 6c and make sure everything is
added back to the database in new rows.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker ff0fead24e database: Mark new entries valid based on id
I was using _size as an index into the database, but _size represents
the total number of valid rows and not the id of the new item.  If a row
is deleted _size will decrease and the wrong entries will be marked
valid.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker b759b9743d library: Implement library path validation
I scan the track database and remove files that no longer exist.  I
don't yet add in new tracks found in the directories.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker e0f28cb366 library: Strip whitespace from genre and tracks
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 98f97b723a library: Update test 4
I made sure it's working and updated the expected output.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker a50d8f6e0a database: Allow templated keys to the database index
This allows me to have a std::pair<> as a key if needed.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker eaafaeb7d4 library: Updates for new database design
I need a templated primary key system to group together albums with
years.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 99718ade43 filter: Update filter test for Index class removal
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 23d0b008e5 group: Updates for Index class removal
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 97d889531a index: Remove the index class
This patch updates the design so indexes are built upon databases using
a special IndexEntry.  I also updated the tests/index/ test to match
the new system, but I have not updated filter or group tests yet.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker f0533ef663 database: Make all databases unique
I require entries to have a "primary key" that is stored in a map to
make it easy to find database rows by key.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker c2bc99ad9b design: Design out the index class
I made a few modifications to the database, and introduced an
"IndexEntry" database type to do the exact same thing :)

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 3a47fc1549 Prefs: Remove preferences design
I think I can get by without this now ...

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 91dac2e6b9 Design: Various updates
Add more to the Library, Playlist and Audio design to match how I expect
the GUI to use the backend.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:56 -04:00
Anna Schumaker 4fc09978dc library: Lookup a song by id
If the id is valid, I fill out a song structure and return true.
If the id is invalid, I return false.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker e314248f10 library: Find tags for each track
This is each song's track number, play count, and anything else specific
to a single file.  After updating, save all the changed databases.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker 846810fa2f library: Clean up database entry creation
Passing the TagLib :: Tag pointer is much easier and cuts down on extra
arguments to each constructor.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker 3f943aa1d6 library: Find album and genre tags
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker 10fd3292fd library: Scan a directory
I don't build up a complete set of databases yet, but I do create the
Artist name database to use later.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker 81429b0229 library: Add support for saving and restoring the library
Eventually these functions may have to become idle tasks, but for now I
write to disk whenever the library_db is changed and then read from disk
by calling the init() function.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker 9ddbaf0b97 library: Implement basic path management
I can add and remove root-level directories from the library database.
I do not save the database when modified, and I don't yet run an update
on all the files.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker fc3b5db59e database: Fix multiple issues
- Check if we are finding the "last" iterator in an empty database
- Better print() descriptions
- Print test return codes that aren't 0 to help find segfaults

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker 8ccbad20cc database: Mark rows valid when inserted
It doesn't make sense to need to set this value outside of the database
code like I had been doing.  So when a new row is inserted mark it as
valid right away.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00
Anna Schumaker 6d94e78d23 database: Add a function for clearing databases
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:55 -04:00