Commit Graph

1714 Commits

Author SHA1 Message Date
Bryan Schumaker
d0a1b9fdf8 libsaria: Save library
- Change WriteTask() to take an extra void pointer argument
- Pass library path pointer through WriteTask
- Store tracks to file named after library id.
- Remove newline from tags

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
ab687a49bc libsaria: Create library and track counters
I plan on using (library, track) ids as a way of storing playlists.  I
made both counters unsigned ints, since I'm willing to bet that people
won't have 4,294,967,295 songs or library paths...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
41dac97711 libsaria: Remove old library files
I was keeping them for reference, but I don't need them anymore.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
ac3964de01 libsaria: Randomly pick next song from library
I'll eventually allow more playlists to be stacked, but for now picking
from the library is easy.  I may eventually add in a way to pick
sequentially from a set.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
07c365fcc0 libsaria: Add library playlist to to stack
I do this during library::init()

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
3d7082e6f9 libsaria: Remove some old audio code
Not needed anymore with recent changes.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
6bae34e487 libsaria: Added stopping
pause() and seek_to(0).  I also added a button in Ocarina.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
0061e0bec6 Ocarina: Seek using progress bar
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
595806ec0f libsaria: Reenabled seeking
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
d6d455ab7f ocarina: Update slider as track plays
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
70ef389aab libsaria: Find audio position and duration
Used for update a slider in the UI.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
53425485d6 libsaria: Preserve the current playback state when changing tracks
This makes something new play when we want it to...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
4f68e6b26d ocarina: Show and hide the play / pause buttons
Based on the current gstreamer state.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
fe76a8d30a libsaria: Add play(), pause() and get_state() functions
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
e3c44146ff ocarina: Show information on the currently playing track
I update it using the main timeout loop, but only if the current track
pointer has changed.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
f1bbbbcc5c libsaria: Play a track using Track::play_now()
It loads and begins playback.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
5163447638 libsaria: Remove most audio code
It'll be re-added as I review it all.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
a0d509cdff ocarina: Look for double clicking treeview rows
I now have direct access to the track that was selected, so I created a
dummy function to play it (to be filled in soon).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
570b483b9b ocarina: Set playlist tab label justify
I like the centered look better.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
9464e0d33d ocarina: Watch for insert() operations in the Playlist
And update the GtkListStore when we see these calls.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
6bb3cd38a4 libsaria: Notify playlist renderers when new tracks are added
For sets, I keep a sorted list and merge-sort the new songs.  I also
created insert_prepare() and insert_done() functions to tell the UI that
we are about to insert (this gives me a chance to call the
freeze_child_notify() and thaw_child_notify() in GTK).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
50f2f99074 ocarina: Created treeview and liststore
Track information will be stored in these structures.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
abac8883c3 libsaria: Give playlists a name
Right now this must be set when a new playlist is constructed.  I can
eventually change this to use a default name based on what type of
playlist has been created.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
cdd2fe1af5 Add a playlist renderer
The renderer doesn't actually render anything yet, but it is statically
defined in ocarina/playlist.cpp and it will eventually display the
library.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
b1eb47006d libsaria: Move the renderer into the playlist namespace
This makes more sense to me conceptually than having a class called
PlaylistRenderer.  I also commented out a lot of code, so the renderer
doesn't do anything right now.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
59789ebc85 ocarina: Begin to set up for playlist code
I'm going to re-implement my old SongList class as a PlaylistRenderer,
so for now I create a new directory and a new header file.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
6d709e3a18 libsaria: Add sorted songs to the Set playlist
I sort the subset of tracks to be added, and then use insertion sort to
add them to the playlist object.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
cfc50cf745 libsaria: Added Set playlist type
I think inheritance is easier than passing a bunch of flags and then
deciding what to do.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
29cb7f7a47 libsaria: Create a static playlist for the library
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
dfb5c09260 libsaria: Remove most of the playlist class
I'm going to clean it up too, so I've removed everything for now to
slowly re-add later.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
01d4819d15 libsaria: Add fields for play count and last played date
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
c38eaccf3a libsaria: Find audio information, too
Length, bitrate and various other fields.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
97a0bb7260 libsaria: Find song file tags
I don't pull out the audio properties yet, but I do find artist, album,
title and everything else that I can.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
011db26d92 libsaria: Pass library path to Track()
This will eventually be used to determine if the track is visible based
on library path visibility.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
b0c76f4b11 Notify when library paths have been updated
This gives the UI a chance to set the new path or new size.  I also
updated Ocarina to show the library path size in its liststore row.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
8f666fe10c libsaria: Add new tracks to library paths during update
Right now the Track added is empty, but I'll fill it in soon enough.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
a944869093 libsaria: Clean out the Track class for re-implementation
This also removed the other `typedef sid_t` left in the header file.
I'll re-add in functions and variables as I need them, and hopefully
keep things working more efficiently.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
d77b06f267 libsaria: Remove sid_t type
I was using the sid_t to lookups for tracks and library paths.  I think
I can simplify things by storing pointers in the UI rather than using
id numbers.  This will give me direct access to whatever it is I want to
manipulate.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
230a31a5a7 libsaria: Divide scan file list into smaller chunks
Each chunk is given to a new ScanTask to process.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
f5462da461 Find files to add to the library
I created a new "list_dir()" function to recursively list directory
contents.  I plan on using this to find songs to add to the library, but
it could also be modified to read playlists and library paths in the
appdir.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:16 -04:00
Bryan Schumaker
2c830af7fa Create a progress bar for idle tasks
Whenever a task is queued, I increment a counter.  When it is run, I
increment a different counter.  This allows me to track the idle queue
completion percentage.  I also created a progress bar for Ocarina to
display in the toes of the footer.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
03d35fee77 libsaria: Only use the library::Driver for notifications
This allows other tools to be written to modify the library of a
currently running program without having to create a library driver
instance.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
a029a30d3a ocarina: Track more library information
I may need to look up library paths by ID, so I added library id as a
liststore field.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
e1b410845d ocarina: Set child propertys for GtkNotebook
The set_tab_packing() function is deprecated, so I might as well just
use the real way to do this...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
032caad800 ocarina: Poll for idle queue tasks
I'm going to need a polling loop for the progress bar.  I might as well
only create one poll() function that is used to do everything...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
30e2003a27 libsaria: Find library id from inode number
I want to eventually use this to create a library file for each library
path.  The "visible" field will be used to enable and disable different
paths during run time.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
0a8600fd01 ocarina: Added placehold for controls
So I know what will eventually go there.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
a0b9c16178 ocarina: Use treeview to show library paths
My old settings page was basically doing this already, but in a slightly
more complicated way...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
ca161d3340 ocarina: Decrese the tab border
This makes tab labels smaller!

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
ecd9a28add ocarina: Return FALSE from the configure event
This tells gtk to continue processing the signal and actually redraw the
window...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00