Commit Graph

2065 Commits

Author SHA1 Message Date
Bryan Schumaker d785b91c46 ocarina: Add a random button to playlists
I reused my old dice png from several releases ago.  This implements the
"switch a playlist from set to queue and back again" feature that I
wanted.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-16 10:34:46 -04:00
Bryan Schumaker 848faa2bc6 libsaria: Move library random into a preference variable
Rather than hardcode this as a flag, if I set this through the
preferences code users can change the value.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-16 10:28:56 -04:00
Bryan Schumaker bf5b8a3bdd libsaria: Remove PlaylistType in favor of flags
Flags let me manually set properties after the playlist has been
created, rather than needing to decide upfront with no way of converting
to something else.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 20:25:09 -04:00
Bryan Schumaker a730eaa2cc libsaria: Remove other playlist types
They were nice for queue vs set, but I'd rather just reintroduce the
random button.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 16:55:02 -04:00
Bryan Schumaker 64b5b78a42 libsaria: Move the next() function into the Playlist class
I plan on removing the extra playlist classes to simplify code a bit, so
this function needs to be implemented for everything.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 16:38:33 -04:00
Bryan Schumaker 0600556ca4 libsaria: Replace add_track() and friends
I created simpler functions using the push_front() / push_back() names
that stl uses.  If we're a set-type playlist, then call the
insert_sorted function instead.  I also remove unnecessary bulk-inserts
of a single track.  Packing and unpacking a list each time seems stupid.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 16:22:50 -04:00
Bryan Schumaker a8f18478fa libsaria: Turn recent playlist into a MRU list
Basically, don't list duplicates.  If a song on the list is added again,
instead I move it to the top of the list.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-14 13:31:59 -04:00
Bryan Schumaker fc7a27c99f ocarina: Change the ban button to my old thumbs up / thumbs down image
These images still work, and banning songs is the reason that I found
them in the first place!

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 22:47:33 -04:00
Bryan Schumaker 31339bed2f ocarina: Add in bash command completion
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 22:47:33 -04:00
Bryan Schumaker 8a08967a48 Simplify remote commands
- Read a command from the pipe, rather than reading a file with a
  command in it.
- Use a single ocarina script for all commands, rather than several two
  line scripts.
- Change ocarina.bin to point to ocarina instead of ocarina-player for
  convenience.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 22:47:31 -04:00
Bryan Schumaker 4bf66921df Improve build scripts
The build system hadn't been touched in a while, so it needed some
cleaning up.  I moved ocarina-specific files into the ocarina/ directory
and use the ocarina/Sconscript to set up build commands.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 22:14:50 -04:00
Bryan Schumaker 11b421dfbb Remove old screenshot directory and image
THese are screenshots from 2010 and the early Ocarina 4.x days, so
they're somewhat out of date...  I also remove a crude ocarina icon that
I'm surprised is still around.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-13 19:42:08 -04:00
Bryan Schumaker 0d2191da13 libsaria: Remove path/
This was old code that had been replaced by fs.cpp months ago.  I must
have forgotten about removing the rest of it...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-12 08:27:06 -04:00
Bryan Schumaker 258875bdb8 libsaria: Move header files out of include/libsaria/
Ocarina no longer has a header file subdirectory so there is no reason
to have a libsaria subdirectory anymore.  Putting header files directly
in the include/ directory is a bit simpler.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-12 08:15:31 -04:00
Bryan Schumaker 267d6084d1 Begin Ocarina 5.11 2012-09-12 07:59:07 -04:00
Bryan Schumaker d59402b6b8 Ocarina 5.10 2012-09-10 08:05:04 -04:00
Bryan Schumaker 97fbd569e9 ocarina: Show and hide the recent and banned lists
Users may not always want to see them, and now I don't have an empty
"settings" tab.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 13:44:01 -04:00
Bryan Schumaker a9d875e05e libsaria: Better prefs::init() function
The preference may be set to zero by the user but default to a non-zero
value.  This can cause frustration on both the user and developer ends.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 13:42:05 -04:00
Bryan Schumaker 83e3763083 libsaria: Remove songs from the library playlist when they are reaped
It's useful to keep the UI in sync with the backend...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 12:58:41 -04:00
Bryan Schumaker 4d764eeb00 libsaria: Add tracks to the lib_playlist when scanning
I was trying to add an empty list, rather than track items.  This caused
the library count to increase (on the library path tab), but the library
playlist was never given track pointers so you had to restart ocarina to
see songs.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 12:48:12 -04:00
Bryan Schumaker 3df9d153f6 ocarina: Reenable the named pipe
I eventually want to use a unix socket so I can get bidirectional
access.  For now, I'll just reuse the old code.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-09 10:54:50 -04:00
Bryan Schumaker 42c6bdff0e ocarina: Created add-to-playlist menu items
For people who don't like keyboard shortcuts...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-08 10:09:57 -04:00
Bryan Schumaker 55cfdc5dba ocarina: Add a playlist right-click menu
Used to create new playlists, exactly the same as the menu in Ocarina
5.9.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-08 09:28:28 -04:00
Bryan Schumaker 5be817167b ocarina: Return index of searched track
And not the index of the current iterator.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-06 12:02:15 -04:00
Bryan Schumaker 442b6ffa50 ocarina: Change default window dimentions to (900, 600)
The 8:6 ratio looked ok, but 9:6 removes scrollbars with my current
font settings.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-06 11:59:08 -04:00
Bryan Schumaker 96ace25ffe ocarina: Respond to j and k even if treeviews aren't focused
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-06 11:52:31 -04:00
Bryan Schumaker 3acbbb048e ocarina: Focus the window when changing tabs
This prevents the entry widget from gaining focus when switching tabs.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:32:46 -04:00
Bryan Schumaker 11b685aeb0 libsaria: Remove playlist renderer
I have notifications to handle everything the renderer used to do, and
I've removed it from the UI side.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:22:43 -04:00
Bryan Schumaker 68aa523ba8 ocarina: Delete dynamically allocated playlist widgets
Plug the memory leak.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:18:46 -04:00
Bryan Schumaker 097b157c10 ocarina: Pass a playlist to set_length_label()
current_widgets() works based on the current tab number, and the
"switch-page" signal is triggered BEFORE the current page is updated in
the GtkNotebook structure.  This means that I was actually setting the
length based on the previous tab, and not the new one.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:15:58 -04:00
Bryan Schumaker 5f1fb2290a ocarina: Remove old playlist code
ocarina/playlist/ was the last subdirectory remaining in the ocarina
code, and I can finally remove it.  Thank you GtkBuilder!  At this
point, there is only one ocarina header file, so I move it to the main
ocarina directory.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-05 09:13:47 -04:00
Bryan Schumaker ef55c2f44a ocarina: Check if 0 songs were added to a playlist
If nothing was selected then we should tell the window to change tabs
instead.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-04 10:49:36 -04:00
Bryan Schumaker 7d4977aab8 ocarina: Delete selected songs from playlists
If the current playlist is the library or banned list, I toggle the
banned state.  Otherwise, I remove them from the current playlist.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-04 10:48:48 -04:00
Bryan Schumaker ba9ecd258b ocarina: Pass key presses directly to the playlist
This lets me remove the "if treeview is focused" special cases that keep
popping up in the window keypress handler.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-04 10:17:57 -04:00
Bryan Schumaker 88ea380f9c ocarina: Activate treeview rows when pressing enter
I already use "Return" for focusing the treeview from the main window or
from the filter entry.  If the treeview is already focused, I have it
begin playing whatever song is under the cursor.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-04 09:30:20 -04:00
Bryan Schumaker 50b4198001 Add a PLAYLIST_DISABLE notification
Disabled playlists are ignored when picking the next song.  I grey-out
the widgets on the UI when this notification is received.  I keep
filtering enabled this time (the entry was disabled too in Ocarina 5.9)

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-04 09:21:02 -04:00
Bryan Schumaker 3bb8053ea2 Add a close button to temporary playlists
I put it on the tab page this time, instead of in the tab label.  I
don't want wide tab labels, so I should eventually come up with a way of
closing playlists without having to change tabs.  Maybe a right-click
menu?

I also noticed that the libsaria delete_playlist() code didn't work, so
I simplified it a bit.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 13:34:06 -04:00
Bryan Schumaker e57b2891e6 ocarina: Clean out some unused playlist code
And comment out things I want to keep as reference so that things
compile.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 12:40:02 -04:00
Bryan Schumaker c46671b1fb Create a PLAYLIST_GOTO notification
To move the cursor to the current song.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 12:14:54 -04:00
Bryan Schumaker 9fb1d05376 Remove PLAYLIST_FILTER notification
It's easier to refilter automatically after setting the filter text,
rather than going through a bunch of function pointers to change the filter.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 11:02:46 -04:00
Bryan Schumaker 0290ea8710 ocarina: Bugfix the j and k keys a bit
Don't try to navigate when there are no visible tree views...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 10:33:27 -04:00
Bryan Schumaker 04b4967275 ocarina: Filter entries respond to the enter key
I use it to focus the treeview, basically the same thing the window
keypress handler does.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 10:09:47 -04:00
Bryan Schumaker ee7d9fa8ff ocarina: Remove old window.cpp code
It was commented out and unused.  I also commented out the "Unhandled
key: " message to keep from filling up terminal screens when treeviews
respond to a keypress.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 10:08:45 -04:00
Bryan Schumaker ab2ba772fe ocarina: Use j and k for treeview navigation
This makes me even more vim-like!

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 09:59:29 -04:00
Bryan Schumaker 9b996a7bb1 ocarina: Store window height in ocarina.window.h
Width was a typo...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 09:55:38 -04:00
Bryan Schumaker df79e67f12 ocarina: Add songs to currently created playlists
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 09:24:18 -04:00
Bryan Schumaker 992539798b ocarina: Unselect rows when pressing the Escape key
The first time Escape is pressed, rows are unselected.  The second time
Escape is pressed, the toplevel window is selected.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-03 09:07:41 -04:00
Bryan Schumaker 9365881cb4 Reorder playlists
The user can drag-and-drop tabs to change their order in the libsaria
playlist deck.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 23:39:08 -04:00
Bryan Schumaker b125fa2595 ocarina: Store PlaylistTabs in a variable
This way I don't need to keep calling get_widget() and then casting to a
notebook.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 13:38:54 -04:00
Bryan Schumaker 5bce295251 Add a PLAYLIST_DELETE notification
Triggered when a playlist is garbage collected so the UI can remove the
tab.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 13:35:48 -04:00