Commit Graph

1962 Commits

Author SHA1 Message Date
Bryan Schumaker f76021be99 tests: Remove the debug output file
I changed print to compile in the dprint() function when the testing
flag is enabled.  This allows tests to have the same output regardless
of debugging status.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker a190047648 design: Add unit test library documentation
This will make it easier to keep track of what functions are available.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker 0ed8e48668 tests: Various improvements
- Don't be verbose when removing files.
- Reverse diff order so output makes more sense.
- Only strip whitespace from the end of lines.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker 328c6f70e8 file: Implement reading and writing
- Inherit from fstream to gain access to << and >> operators.
- Make the file version accessable to the outside world.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker ecd56831f6 file: Open and close files
- Support OPEN_READ and OPEN_WRITE
- Update the design to accomidate for error checking
- Add lib/test.cpp containing basic functions that can be used for
  testing

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker e0a32c10ac lib: Add basic file class
The class resolves the path to the ocarina directory based on the file
hint provided.  NOTE: compile-debug.good and compile.good resolve paths
to my home directory.  Other users will need to change the values for
the test to pass.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker 307bc88cb6 design: Update file design
I'm starting to implement file access.  I've reread the design and
updated a few things to make it easier to test.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker 72c7261ac8 design: Sort potential nodes by name
This will give some better stability to the design document, since
entries won't shift around based on python memory locations.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker c65e0bdb2a build: Change CONFIG_* variables into a class
The class is in charge of resetting fields at will, and will be able to
maintain everything easier than if I were to do it by hand.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:52 -04:00
Bryan Schumaker 13a0d25e8f build: Only create a single build environment
I was using a debug and a release environment for programs, that way
both versions of tests could be checked.  Instead, it'll be simpler to
only use a single environment and then control debug information using
CONFIG_DEBUG.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker e13b4afa60 design: Break doc into pieces
Each component has its own text file.  I merge everything together with
simple dependency resolution so I can figure out implementation order
easier.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker b5d3a663e0 print: Print the Ocarina version to a file
The basic/print.cpp test will write version information to a file using
both dprint() and print().

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 7c67d062df build: Make it easier to change command line macros
I store release and debug options in a list so that env.Replace() can be
used to set, modify, and restore values.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker cf7f1f726f build: Rename config variables
I'm giving them a CONFIG_ prefix.  I also made version.h a real file
that uses a config variable.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 38c074d898 build: Improve aliasing for tests
scons tests - Compile all tests
scons tests/basic - Compile basic tests
scons tests/basic/print - Compile text printing test

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker d8c8ea1bbf Design: Put in idle queue information
This is needed for scheduling files to load later.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker f75ba5a2b8 tests: Add a basic test
This test checks for the version.h file and then compiles it with and
without debugging enabled.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 101648dc0a Remove old include files
I'm going to replace them with new files for Ocarina 6.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 15df2ed075 Remove newgui
I'm not going to use this code anymore.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 04d4aca772 Design: Add version and printing info
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 0b2fc03f19 design: Rework playlists, add filtering
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker b786b44a49 design: Add in gstreamer thoughts
Because a music player should be able to play music :)

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 310c9ad395 Design: Create a preferences namespace
This will be used to store various values for the user.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 5312853b86 Design: Create a File class
This class will manage save files so paths don't need to be resolved in
multiple places.  I'll also use it for reading and writing with version
information.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker fc40a9f77f Design: Update groups
Groups now use an index to manage their data.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 5a7fcdb305 Design: Create an index class
This will be used for groups, both stored and temporary.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 08b0513578 Improve on file format text
I think it's cleaner now.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 59f08cfc51 Design: Update library information
I decided to put the library into a namespace to keep the code clean.  I
also added an update algorithm and made minor naming changes.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 2ea1ea8d26 Database design
I've decided to make my own "database" tailored for things I need to do.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 80e00dd914 Design: Rethink groups and add in future ideas
I renamed "tags" to "groups" to avoid confusion with ID3 tags.  I also
thought out a better plan for eventually implementing user defined tags
so that I can build up to them with testing along the way.  With any
luck, I won't overwhelm myself with features =).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 2b145f2dab Update design
I remembered that I don't like SQL, so managing my own library database
is probably better.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker b7ee8a0f78 design: Work on playlist design
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker e4fa2155b9 Start a design document for Ocarina 6
Up until now I've just been coding whatever I feel like without thinking
about it too much.  This time I'm actually going to come up with an
ocarina design and then implement it according to the document.  The doc
can then act as a reference for how and why things are done for future
work.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 7dc88a1e46 newgui: Capture key presses on the window
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 3c60dbdbae newgui: Set a window title and icon
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00
Bryan Schumaker 5eb24ee04f newgui: Load the gtk builder file
Right now it's just a toplevel window.  I also added a script for
launching the new gui without needing to manually set the environment
variable.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker f6cb19145d libsaria: Remove app name from init data
I only have one application so there is no point in having a way to
create multiple application directories.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 14432e216d newgui: Create and display a window
Nothing to complicated yet.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 78e9c744fd newgui: Start rewriting the gui
The plan is to port everything to gtkmm since using the C functions is
beginning to get annoying.  Compile the new code using `scons newgui`
for now.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker e4d73fee48 libsaria: Rename IdleTask::run_task()
I think that just calling it run() is better.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 9c72e56261 libsaria: Remove idle::do_task()
It's a 2 line function that was used in only one place.  Time to remove
it and simplify the surrounding code.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 2f2c9cdf68 libsaria: Move idle.cpp to libsaria/
The idle queue code is all one file now, so it can exist directly in libsaria/

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 5bc357be18 libsaria: Remove operator[] for strings
Public member variables is easier.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker d79eefc8b2 libsaria: Remove operator[] for uint values
Public access to variables is easier.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 29718ceb12 libsaria: Remove operator[] for int values
Public access to these variables is easier.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 56dd54f114 libsaria: Remove operator[] for Track.banned
Public access to this variable is simpler and probably more efficient.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker aaf1205078 libsaria: Make some track variables public
This should be easier than making a bunch of getters or setters.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 05bbad5444 libsaria: Resizing a vector invalidates pointers
I was keeping a vector of objects, and then pass pointers to these
objects around everywhere.  HOWEVER, when vectors are resized they
allocate new memory and copy things over invalidating iterators and
pointers to the original objects.  This can cause memory corruption
issues when I try to use a pointer to an object that no longer exists.

The simple solution?  Allocate tracks dynamically and then store the
pointer in the library path.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker c094f9791f libsaria: Set correct library version
Otherwise we'll only read the first 124-ish songs and then stop...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00
Bryan Schumaker 9043183807 libsaria: Remove old idle task stuff
I handle the idle task stuff inside the idle layer, hiding it from
everything else.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:50 -04:00