Bryan Schumaker
3caea974fe
ocarina: Refilter the playlist
...
I don't change what can play as a result, but at least I can find songs
again!
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker
235ac70033
libsaria: Move filter code
...
From index.cpp to filter.cpp. I also added in an "is_visible()"
function for testing visibility of tracks.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker
7820b28534
libsaria: Search the index
...
And notify the renderer to update
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker
556aad3344
libsaria: Introduce bare Index class
...
Right now I just add and remove songs from the index as they are added
and removed from the playlist.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker
2fb2f97a43
libsaria: Fix compile errors
...
g++ must have gotten updated...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -04:00
Bryan Schumaker
dc57109d9e
libsaria: Give access to pause_count
...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
9d271740aa
ocarina: Added automatic pause controls
...
Right now I just pause after the current song, but I eventually plan on
adding controls to pause after N songs.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
2cdfbde9be
libsaria: Implement pause after N tracks
...
I keep a counter that is decremented after every call to next(). When
it reaches zero, pause after loading the next song.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
31ab70b37d
libsaria: Remove tracks from a specific playlist
...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
659a2208b8
libsaria: Remove files that no longer exist
...
I scan a library path, do an lstat() and remove the files that can't be
found.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
a1819dd5f9
libsaria: Only add new files during a library scan
...
I simply check if the file is already in the library before tagging it.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
537dc3a22d
ocarina: Support removing library paths
...
Use the "Delete" key for now. I also added in using the plus key to add
new paths.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
6e97f04e85
libsaria: Remove library paths
...
- Delete the library file
- Remove tracks from each playlist
- Notify the renderer that tracks have been removed
- Notify library drivers that the path has been removed
- Remove the path from the list
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
a33e1e6d8d
ocarina: Use the playlist number
...
- Create new notebook page at number
- Show number to left of label
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
bc800057e0
libsaria: Expand on numbered playlists
...
- Renumber when new playlists are either added or removed
- Finding nth playlist is much easier now
- Insert new playlists right before the library
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
4e046beb20
libsaria: Introduce playlist numbers
...
To track where in the deck they are. Displaying and modifying them
comes next...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
5194130db4
libsaria: Rename playlist stack to playlist deck
...
I'm going to make it less stack-ish because I was getting confused.
Turns out people don't think people have a hard time thinking about song
order starting from the end... :-(
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
c5fe4546e2
libsaria: Format a duration (in seconds)
...
I turn it into a string "W days, X hours, Y minutes, Z seconds"
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
fcc48dbccb
ocarina: Show the length of the currently visible playlist
...
I should eventually format this better...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
e0ebe4c97f
libsaria: Track the length of playlists
...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
026b17a6a5
ocarina: Treeview keypresses
...
To add songs to already-created playlists.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
c6bf52a516
libsaria: Find nth playlist
...
Gives access to a specific playlist on the stack.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
6ae25ccdcb
libsaria: Created a toggle_play() function
...
Switches between playing and paused.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
f67cecef0e
ocarina: Add some keyboard shortcuts
...
0 - 9: Switch to playlist N
L / l: Switch to library
R / r: Switch to recent songs
N / n: Play next song
P / p: Play previous song
Escape: Give main window focus
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
691f74ee10
libsaria: Return nth renderer
...
Useful for switching to a specific list in the UI
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
6214136ee3
ocarina: Tab label improvements
...
- Respond to the renamed() callback
- Right-align / justify labels
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
2ae050fe47
libsaria: Automatically rename playlists when added or removed
...
The one on the top is always numbered "0"
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
5a272ef62e
libsaria: Playlists know their own type
...
Useful for dynamically renaming them (see next patch).
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
319d68e8d2
ocarina: Scroll to current song
...
Only on non-draining playlists when that playlist selects a song.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
acef058afa
libsaria: Tell playlist renderers to goto a specific index
...
I want to use this to scroll the library list when a new song is picked.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
4116cd3ed2
ocarina: Show recent songs playlist
...
I also needed to add in a change to focus the library by default.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
3b3beb4625
libsaria: Track recent songs using a playlist
...
This way people can see what has played recently and directly select
from a list. Generic playlist classes are awesome!
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
5dc215d69a
libsaria: Created Queue playlist class
...
This was much easier using inheritance...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
3f665712a1
Remove empty playlists when picking next song
...
Hopefully with fewer problems than 5.7 had...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
15aabfcff0
Create new playlists on the stack
...
- Only works for new sets
- Set a callback function when created
- Add a right-click menu to the ocarina treeview
- Remove songs from playlist when picking next song
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
78787d9cf5
libsaria: Play songs from outside the library
...
Pass in a file path and play! I even created a button as a notebook
action widget.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:18 -04:00
Bryan Schumaker
297f81213d
ocarina: Provide an open file button
...
To play random songs from the filesystem.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
cb663075bd
ocarina: Remove old button generating code and old footer
...
I now only have a single instance of the control buttons, so the old
code can be removed now. The footer has been completely replaced by now.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
2f26e5b869
libsaria: Remove old callback framework
...
I'm not using it anymore, so it can be removed.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
db3a9f8b02
libsaria: Clean out header files
...
I removed a lot of commented out code that won't be needed anymore.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
d6eb7ebb35
libsaria: Remove LibPath class
...
I'm using a simple struct for this now (see library.h).
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
c5a84807be
libsaria: Remove InFile and OutFile classes
...
I do this all through either appdir or Read / Write tasks
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
47fadb8113
libsaria: Remove IOTask
...
I have separate read and write tasks now
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
Bryan Schumaker
fad3019d83
libsaria: Reload a saved library
...
And add tracks to the library playlist.
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00
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
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
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
595806ec0f
libsaria: Reenabled seeking
...
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:17 -04:00