Commit Graph

756 Commits

Author SHA1 Message Date
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
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
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
0b9beac1c3 ocarina: Include bash completion script as part of build
I can't believe I forgot this...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:49 -04:00
Bryan Schumaker
acb0334122 libsaria: Move deck::next() to deck.cpp
And extra variables / functions needed by next().

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-18 12:03:26 -05:00
Bryan Schumaker
1205a94aa7 ocarina: Adjust scroling with j and k
When scrolling I think it's important to show a few rows that are coming
up next so users know they can stop scrolling and not need to reverse.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-08 08:11:19 -05:00
Bryan Schumaker
33c80788b8 libsaria: Rewrite playlist filtering
I used to use my own inverted index implementation, which makes sense if
I'm searching all songs for a specific match.  Instead, GTK was visiting
each track and asking "does this song match?" and this requires a
different implementation.  So rather than make an index, instead I have
each track generate substrings for its tags and then I compare filter
text against the substring set.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-04 09:17:22 -05:00
Bryan Schumaker
e1930b0c88 libsaria: Create functions for checking and setting flags
I also replace a few PLAYLIST_* notifications with a generic
PLAYLIST_CHANGED notification for when small changes occur.  I think
that using set_flag() and check_flag() will make code cleaner and easier
to maintain.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 22:58:26 -04:00
Bryan Schumaker
671dd7eb3a libsaria: Remove PLAYLIST_SIZE notification
Instead, the UI should change the size during PLAYLIST_ADD and
PLAYLIST_RM.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 21:58:53 -04:00
Bryan Schumaker
cf8ded7d5d libsaria: Remove name field from playlists
I know what playlists are library, recent and banned.  All others are
just named "Playlist" so there is no need to set up a name variable.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-11-03 15:34:13 -04:00
Bryan Schumaker
0a4e4d9085 libsaria: Use [] to access track string properties
This finishes the job I started in the last commit.  Once again, I use
an enum of string properties to determine the right field to return.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-10-31 17:42:57 -04:00
Bryan Schumaker
a606830f7b libsaria: Use [] to access track properties (not string)
Rathen than using a bunch of get_PROPERTY_NAME() functions, I think it's
cleaner to use dictionary-like indexing to access properties.  This
patch converts most track access functions, but I haven't gotten around
to strings yet.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-10-31 17:29:12 -04:00
Bryan Schumaker
21313e9b52 ocarina: Add a sort button
I also respond to the PLAYLIST_SORTED notification so we do the right
thing when loading a playlist during startup.  I don't put the sort
button on the library, recent list or banned list because I don't think
these lists should ever be sorted.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-17 08:18:13 -04:00
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
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
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
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
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
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
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
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
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