Commit Graph

20 Commits

Author SHA1 Message Date
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 240ae7e21a audio: Remove duplicates from the recent playqueue
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:02 -04:00
Anna Schumaker e8d63a15cf audio: Add a function to toggle playing
This will be used by the gui when the spacebar is pressed by the user.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:01 -04:00
Anna Schumaker e752e0f826 audio: Don't escape filepaths
This will actually be done automatically by the gstreamer code.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:01 -04:00
Anna Schumaker dfbb98b2c6 audio: Escape filepaths before loading
This is for filepaths containing special characters.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:01 -04:00
Anna Schumaker 03b44b9e16 Update play count
When a track finishes, I tell the library to update playcount.  Then,
the library triggers a callback to the playqueue deck telling it to
update.

This patch also finds and prints the track that causes a gstreamer
error.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:01 -04:00
Anna Schumaker d240ff44bc playqueue: Change cur when tracks are directly selected
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:01 -04:00
Anna Schumaker 2962d792d7 playqueue: Add flags to disable sorting
The history playqueue should never change sort order, so use this flag
to prevent user changes.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:00 -04:00
Anna Schumaker 6659f18de3 audio: Load tracks by trackid
Used to select specific tracks to play.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:00 -04:00
Anna Schumaker 00706cc33f playqueue: Add a flag to disable unnecessary callbacks
The history and collection playqueues are never saved to disk, so I only
care about saving when a flag is changed.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:00 -04:00
Anna Schumaker 6446b7e5ad audio: Access function for recent playqueue
The recent playqueue is needed for the history tab.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:00 -04:00
Anna Schumaker 2b57be8c66 audio: Send on_pause() callback when autopausing
Also seek to 0 when choosing the next track.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:59 -04:00
Anna Schumaker 1c99042efd audio: Add callbacks for changing pause status
When the count is changed or pausing finishes, I trigger this callback
to notify the UI.  I also added in a line to enable pausing any time the
count is incremented.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:59 -04:00
Anna Schumaker c346a5860a gui: Implement control buttons
Play, pause, stop and so on.  I also update labels and progress bars
during playback.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:59 -04:00
Anna Schumaker 22cb20d4ce audio: Change state to NULL before quitting
This prevents a possible hang when de-initializing gstreamer.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:58 -04:00
Anna Schumaker 5c5e4a1a66 audio: Implement the previous() function
To iterate backwards through the list of recently played songs.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -04:00
Anna Schumaker bd2aaf73d1 audio: Updates for spec changes
This is mostly to add in checks for try / catch style error handling.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:56:57 -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