Commit Graph

48 Commits

Author SHA1 Message Date
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
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
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
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
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
d27a1fb7ba ocarina: Implement switch-to-page-n keyboard shortcut
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-02 12:20:43 -04:00
Bryan Schumaker
e6c44bf1a9 ocarina: Respond to "Return" as a shortcut
I think it'll be useful to change focus to the current treeview through
a shortcut.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 10:37:08 -04:00
Bryan Schumaker
694bcb83d7 ocarina: Removed dead code from window.cpp
Most of this was already commented out, but I also took the time to
figure out what header files are no longer needed.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 10:28:04 -04:00
Bryan Schumaker
0d5941d72f ocarina: Only print out unhandled keys
I'll know if a shortcut key is pressed, so I only want to print out
unhandled keys so I know their names.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 10:25:42 -04:00
Bryan Schumaker
5a9f4f4bca ocarina: Add shortcuts for switching directly to a playlist
Since I don't have dynamic playlists re-implemented yet, I just swtch
between the library, recent, and banned playlists.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 10:18:46 -04:00
Bryan Schumaker
be67f81782 ocarina: Respond to "slash" keypress
This allows easier access to the filter entry, since clicking it is too
slow.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 10:04:52 -04:00
Bryan Schumaker
55431421bf ocarina: Reenable some keyboard shortcuts
I have to track if a filter-text entry has focus to do this properly,
otherwise using a shortcut key while searching a playlist will trigger
that shortcut.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-09-01 09:48:11 -04:00
Bryan Schumaker
c026686a1b ocarina: Store maximization and size of window
Re-enable and clean up the code I used to have.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-31 10:30:25 -04:00
Bryan Schumaker
4585d90a32 ocarina: Remove window.h and lots of gtk shortcuts
The shortcuts were hiding more than they probably should have, and I
didn't have much using them.  The only function in window.h that I'm
going to use is init_window(), so I'll just declare it in ocarina.h.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 15:11:36 -04:00
Bryan Schumaker
1ddcb9f2fc ocarina: Initialize the window from window.cpp
Eventually this will support all the same features of the old ocarina
window...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 15:01:20 -04:00
Bryan Schumaker
7cc5cded9f libsaria: Directly set version in version.h
Rather than building it up as part of a function call

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-02 12:16:34 -04:00
Bryan Schumaker
80cf0bb28e ocarina: Use files in the lib directory
I copy images and other files to lib/ocarina/ during the build to make
installing easier.  The lib directory should always be relative to the
bin (executable) path, so I can easily find the lib path based on
executable path (/proc/self/exe).

I can also use this to find bugs in the buld process, such as adding a
file to the images/ directory but forgetting to add it as an install
target.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-06-02 10:41:04 -04:00
Bryan Schumaker
ed33881a25 ocarina: Created a shortcut for switching to the banned list
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 13:31:02 -04:00
Bryan Schumaker
4c33ba82ec ocarina: Find keypad numbers
I needed to strip out the "KP_" at the beginning.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-09 08:07:35 -04:00
Bryan Schumaker
6f69392e5f ocarina: Use "N" for going to previous track
This matches the vim keybinding, which explains why I kept trying to use
it instead of "p"...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-09 08:02:16 -04:00
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
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
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
6f3397c1a4 ocarina: Remove old code from window.cpp
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
b977832f3c ocarina: Use g_signal_connect() for the window
I was using connect_after(), but somewhere along the line the space bar
was getting lost.  Instead, I only connect the number keys using
g_signal_connect_after() so treeview shortcuts continue to work.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -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
d23469dfa7 ocarina: Added toggle_play() shortcut
Spacebar!

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
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
Bryan Schumaker
3d11ea47ba ocarina: Create default content for the window
I'm not using a notebook as the main widget anymore.  I'm also setting
the content directly, rather than getting the widget from the body code
and setting it in the window code.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
ca35bfd46f ocarina: Track the window's maximized state
I need to do some hacky things if the maximization changes.  First, I
need to track the old (w, h) values and restore them in the preferences
since the configure-event will resize the window before the maximize
signal is given.  Next, I need to ignore the next configure event since
it'll overwrite the preferences with the size of the window when it was
maximized.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
5c618de4df ocarina: Capture window resizing
I store the new size of the window in the preferences and use it the
next time ocarina starts up.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
a0da654fc6 ocarina: Resize window to match preference
I initialize the window size preferences to (800, 600) and then resize
the window to match.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:14 -04:00
Bryan Schumaker
3c19e4a3d9 ocarina: set window title and icon
I do this from the window init function using default values, rather
than pass it as a parameter to the init function.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:14 -04:00
Bryan Schumaker
5817effdde ocarina: Fix up include files and begin new window code
I combined the ocarina.h and gtk.h header files into one single file.  I
also began writing new window managing code under a window namespace for
code separation.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:14 -04:00
Bryan Schumaker
1933689d4f Added copyright lines to everything
I probably should have done this earlier... oh well

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-19 17:17:24 -05:00
Bryan Schumaker
983ce59efb ocarina: Added keyboard shortcuts
Now I don't need to click in the GUI to do things.  I never realized how
much I missed these until now.
2011-12-17 09:44:24 -05:00
Bryan Schumaker
7c79aab787 ocarina: Create initial namespace
Namespaces make code easier to follow, and remove the need to mangle the
beginning of function names by using ocarina_*() or libsaria_*().  In
other words: "namespaces are one honking good idea.  Let's have more of
them!"
2011-10-29 15:47:00 -04:00
Bryan Schumaker
155e436259 ocarina: Set window title and icon during init()
I was setting these through other function calls, but it's easier (and
cleaner) to do it all in the initial init() call.
2011-10-22 08:55:32 -04:00
Bryan Schumaker
2110319176 ocarina: Resize window
I resized the window to 800 x 600, and then changed the main tabs to
fill up the entire space.
2011-09-09 08:23:43 -04:00
Bryan Schumaker
7b48c3311d ocarina: Rename gui/ to ocarina/
I think ocarina/ is a better name for this directory, and now that I've
named the executable "ocarina.bin" I can do this again.  I also added
functions for creating a page footer with the basic controls.
2011-09-07 08:12:02 -04:00