Commit Graph

2272 Commits

Author SHA1 Message Date
Anna Schumaker 38086f1e28 Update PKGBUILD and .gitignore
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-04-20 11:38:46 -04:00
Anna Schumaker 2f8dfa8f4b Ocarina 6.0
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-04-20 11:14:13 -04:00
Anna Schumaker 8e9bc79e51 Set queue length on startup
Queues are read from disk *before* libraries are read, meaning we can't
calculate the length right away.  But if we don't calculate the length,
then the first time a track is removed from a queue the length will be
set to (0 - track_length).  This is wrong.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-04-11 08:28:03 -04:00
Anna Schumaker 2eca396042 Rename config -> Sconstruct
I only had config so I could easily refer to the original Sconstruct.  I
don't need that anymore =)

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 21:09:49 -04:00
Anna Schumaker 887051e5c1 Add a `scons install` option
scons -c install to uninstall.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 20:37:46 -04:00
Anna Schumaker cbe725d891 lib: Don't try to load a track that doesn't exist
This was causing me to throw an exception that never got caught.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 19:32:46 -04:00
Anna Schumaker 8d29ce7169 library: Use track id directly
Calculating through the iterator may lead to unexpected problems.  We
already know the id of every database entry, so we might as well use it
directly.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 19:28:04 -04:00
Anna Schumaker d28b3300f5 library: Put a space between track length and title
If a title began with a number then the number would be read as part of
the length, adding extra time.  So a track with length "100" and title
"42 abcde" would be read back as having length "10042" and title "abcde"

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 19:27:02 -04:00
Anna Schumaker 163d823c19 database: Don't write out unnecessary spaces
When items are deleted from a database we write out a line representing
"invalid entry".  This patch changes the invalid entry line from "0 " to
"0"

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 19:22:51 -04:00
Anna Schumaker 22322a9b12 playqueue: Correctly check for play count when sorting
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-08 08:26:15 -04:00
Anna Schumaker ad1c3d6f9d library: Scan fixes
- Double check that track->valid == true before notifying the UI that
  there is a new track.
- Use primary_key() instead of manually calculating the full filepath.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-08 08:15:32 -04:00
Anna Schumaker a470b88a46 library: Save after library validation
Otherwise we won't remember what songs we forgot!

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-08 08:12:04 -04:00
Anna Schumaker 9b417e10aa library: Properly check if a track is in the database
The iterator will be set to db.end(), so we should verify that it IS
this value.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-08 08:09:09 -04:00
Anna Schumaker 0d6dc76eb7 Update PKGBUILD
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-06 19:57:06 -04:00
Anna Schumaker 92e580b904 Create a .desktop file
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-06 19:57:06 -04:00
Anna Schumaker 9f54c23995 database: don't iterate if there are no entries
Checking the valid bit could lead to a segmentation fault.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-06 19:57:06 -04:00
Anna Schumaker b75d13838f database: Properly test for double-removal
I found that databases were always decrementing _size when remove() was
called.  This patch fixes the bug by checking if the entry is valid
before removal.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-06 19:57:06 -04:00
Anna Schumaker fc07e28201 library: Don't save length strings to disk
Recalculating this doesn't change the runtime significantly, so we might
as well save some disk space.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-06 19:57:06 -04:00
Anna Schumaker 1e09406730 library: Don't attach artist_id to albums
This was an unnecessary field, and might potentally result in album
duplication.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-06 19:57:06 -04:00
Anna Schumaker 2960b72967 audio: Save and load current trackid
Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-06 19:57:06 -04:00
Anna Schumaker 81f3ef458f database: Each DatabaseEntry should know its id
This will let me set up a Track class that has pointers to the
corresponding artist, album and genre information without needing to
know their IDs directly.  Having this information available means I
won't need to keep a "join struct" when doing lookups - instead I can
return a pointer to a Track class that already knows everything.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:06 -04:00
Anna Schumaker 14879b03fd idle: Update design and unit test
I didn't have any changes to make to the IdleQueue itself, but I did
need to update the unit test and reword a few things in the design.

Signed-off-by: Anna Schuamker <schumaker.anna@gmail.com>
2014-04-06 19:57:06 -04:00
Anna Schumaker 58ed47b37c filter: Update design and rewrite the unit test
- filter :: add() now returns the lowercased text
- Don't cache lowercased strings
- Remove functions depending on CONFIG_TEST

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:06 -04:00
Anna Schumaker 7eddaac14e Remove some text from DESIGN
Because it is all in TODO already.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:06 -04:00
Anna Schumaker 08a69c2c81 Update the license
The SimPL was essentially a reworded GPL v2 license, so we might as well
have the original GPL v2 text.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:06 -04:00
Anna Schumaker 1b34a9a8a0 index: Update the index design
I updated the design and rewrote the unit tests.  This creates something
more consistent with how I ended up using the index.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker fc8dc9d55e database: Design and test updates
I add:
- Autosaving option
- Real iterators
- Better accessor functions

The new design and unit test also allows me to remove the 300,000+ line
"database.good" file that the old tests were based on.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker b251f27bb5 file: Don't use throw / catch to report errors
Needing to use throw / catch was getting in the way.  Instead, check for
a boolean return value.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 959cac0fe1 Database: Update design for database entries
I changed primary_key() into a function since it is only called once,
and there is no point in using more mmemory than I need to.  I also
created a basic unit test for everything that database entries are
supposed to do.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker f7d08724a3 design: Cleanups to each section
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 0386b24309 Small file test cleanup
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 972eb3c2aa tests: Only enable CONFIG_TEST if we are building tests
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker c263e0e524 tests: Change executable names
Make them end with .run so my .gitignore will pick them up.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 336024bae9 file: Update design and create a new unit test
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 3359cbae6f version: Update version test
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker e2fd4773da Update design info for versions
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 73d3c68e9f error: Update design
To make sure all the info is up to date.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 0cf38aaf56 Introduce README
README has basic commands for building / cleaning
I also update the DESIGN file a bit.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 5109d629ae TODO: Remove already implemented features
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker dd1db4645a Rename files
This matches how other projects do things.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker a20407f2c0 Remove bin/ during clean
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 2e727ed704 gui: Add a switch to enable / disable queues
I also select the first enabled queue during startup.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 1394aaf37c gui: Show the first tab on startup
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 9b0499b3ce gui: Add to queue menu items
This commit finishes my tab rewrite.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 239c03b1ac playlist: playqueue should not remove tracks
I was double clicking tracks in the gui, and they were removed from the
playqueue!  This patch fixes that.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 3c8e967895 gui: Connect a menu item for creating new queues
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker a529d569f6 gui: Implement add to {favorites, banned} menu items
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 2abc498fde gui: Rename wires.cpp
I think gui.cpp is a better name, since this file controls most of the
random gui components.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 44d1fcd1ad ocarina: Remove old ocarina code
I don't need it anymore, so it is just taking up space.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00
Anna Schumaker 968d723ec7 gui: Add a window icon
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:04 -04:00