Commit Graph

757 Commits

Author SHA1 Message Date
Bryan Schumaker
761842869e ocarina: Show and hide the idle bar
I check the size of the idle queue during the timeout poll and then
enable the progress bar.  When the queue size reaches zero I hide the
bar again.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-04 13:31:47 -04:00
Bryan Schumaker
fdecd7bbdf ocarina: Get the progress bar working again
This was easy, just copy over the old code to status.cpp.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-04 11:57:31 -04:00
Bryan Schumaker
4a764fcc8d ocarina: Remove old controls code
This has already been reimplemented in gtk builder.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-03 08:09:03 -04:00
Bryan Schumaker
54d1ff991d ocarina: Set the length label
The length label is part of the gtk builder description.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-03 08:00:08 -04:00
Bryan Schumaker
5a1b8555db ocarina: Clean out old gtk and button code
Now that I'm using gtk builder I don't need gtk convenience functions.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-03 07:52:08 -04:00
Bryan Schumaker
22e64d64ca ocarina: Connect signals to buttons
And also
- Show / hide the play and pause buttons
- Remove the scrollbar from the now playing display

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-02 08:34:46 -04:00
Bryan Schumaker
90355962e4 ocarina: Initialize playlists during startup
I plan on replacing the playlist code eventually, but for now I want to
see how everything looks.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-08-01 08:19:31 -04:00
Bryan Schumaker
9eb181d263 ocarina: Add in the slider and position / duration labels
Only the duration label changes, I don't do anything with the others
yet.  I'll work on it later (once I get the rest of the UI converted
over).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-30 07:59:27 -04:00
Bryan Schumaker
ff0f4a2c66 ocarina: Add back Title / Artist / Album labels
Using GtkBuilder now...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 16:04:22 -04:00
Bryan Schumaker
037577850f ocarina: Add the timeout poll back
I want to create the now playing widgets next, so this is needed now.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 15:19:55 -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
681aa4b611 libsaria: Remove flags from initdata
I wasn't doing anything with these, so they're just getting in the way
and increasing complexity.  This change also allows me to remove the
"enabled" variable from the idle queue.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 14:31:35 -04:00
Bryan Schumaker
59b79b6575 ocarina: Begin switching to GtkBuilder for the UI
I feel that hand-written UI code is slowing me down, so I'm going to
switch to using glade / GtkBuilder to manage the UI as much as possible.
So far, I create, show, and destroy a window.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-29 11:27:50 -04:00
Bryan Schumaker
1ba1c72e3f libsaria: Use a flags variable for initdata
I was using multiple boolean fields, but I think it'll be easier to set
up a single bit-flag field instead.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-07-01 11:24:06 -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
fbcc660bd6 build: Create a configuration script
Users set values here to be used by the build system.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-28 11:34:37 -04:00
Bryan Schumaker
cc32587917 build: Create an ocarina Sconscript file
This file will set up building the ocarina/ subdirectory.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-27 10:36:45 -04:00
Bryan Schumaker
4afce6300c Turn off library paths
I set the "visible" field to "false" and then remove each track from the
library playlist.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-23 07:48:10 -04:00
Bryan Schumaker
057bce8809 Show last played date on each playlist tab
I like to know when I last listened to a song.

Signed-off-by: Bryan Schumaker <bjchuma@gmail.com>
2012-05-19 20:09:21 -04:00
Bryan Schumaker
ca9f3e6cf9 Show the play count in the playlist renderer
I created a new renderer function for updating tracks when they change.
Using this, I can show the new playcount of tracks as it is incremented.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-19 19:47:11 -04:00
Bryan Schumaker
e874345596 ocarina: Ban and unban songs using delete key
Banning: Use the delete key on selected tracks from the library tab.
Unbanning: Use the delete key on selected tracks from the banned tab.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-19 18:48:08 -04:00
Bryan Schumaker
01b5eeb10f ocarina: Make "add to playlist" menu items
These menu items add tracks to a specific playlist instead of creating a
new one.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-19 18:35:05 -04:00
Bryan Schumaker
0e6632ce45 ocarina: Use yes / no images for banning songs
I think this makes more sense than using the GTK_STOCK_DIALOG_ERROR for
both states.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 12:17:45 -04:00
Bryan Schumaker
dea787d576 ocarina: Disable tab label text when playlists are disabled
To make it more obvious which playlists are disabled when you are on
other tabs.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 12:11:19 -04:00
Bryan Schumaker
d74d008223 ocarina: Change disable playlist button image
I do this whenever the playlist disabled flag changes.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 12:05:03 -04:00
Bryan Schumaker
706f07b6f7 ocarina: Disable playlist widgets with a playlist
To emphasize that the playlist has been disabled.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 11:57:28 -04:00
Bryan Schumaker
973b5d3d31 Save playlist disabled status to file
This allows me to restore it when restarting ocarina.  I also need to
notify the renderer that the playlist status has changed so I can change
the button state.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 11:51:52 -04:00
Bryan Schumaker
35d71efe58 Disable temporary playlists
When a playlist is disabled I won't pick songs from it until the user
re-enables it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 11:25:51 -04:00
Bryan Schumaker
f6cdcae79c ocarina: Create a make_toggle_button_data() function
Used to pass extra data to the toggle function.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 11:24:38 -04:00
Bryan Schumaker
01e63da4f7 ocarina: Don't show playlist tabs immediately
Instead, I want to show them when they have tracks added to them.  This
keeps the banned tab from being shown and then hidden right away during
startup.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 10:46:38 -04:00
Bryan Schumaker
376fe67115 ocarina: Bugfix the ban button
- Use g_signal_connect() when creating toggle buttons
- Only set the banned state on a track if it has changed

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-18 10:39:26 -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
bd171423a6 ocarina: Hide empty playlists
If the playlist size == 0, then we don't need to show it.  This hides
the banned list when it doesn't contain any songs.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 13:28:55 -04:00
Bryan Schumaker
4718bf77f3 Change playlists when the ban button is pressed
I remove the track from the library playlist and add it to the banned
list.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 13:15:36 -04:00
Bryan Schumaker
bb7a662f92 Ban songs in the library
Right now, this just toggles the "banned" field in the Track class and
then skips to the next track.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 13:00:03 -04:00
Bryan Schumaker
ea7b66ae6d libsaria: Read file from pipe
Scripts should write commands to a temporary file and then write the
path to that file to the application pipe.  I can then write results of
the command to this file before exiting.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-17 11:51:36 -04:00
Bryan Schumaker
a7570cc80a ocarina: Tell gtk to look for data coming in over the pipe
This gives me a chance to read it without needing to poll for changes.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-15 11:33:29 -04:00
Bryan Schumaker
8f1de2745e libsaria: Create functions for opening and closing pipes
I'm going to use the pipe with shell scripts for remote-controlling
ocarina (possibly through a web interface).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-15 11:23:47 -04:00
Bryan Schumaker
463cef95dd libsaria: Create an initdata struct for initializing
Passing individual variables through works for a small number of
variables, but passing a struct makes it easier to add new arguments.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-15 11:06:43 -04:00
Bryan Schumaker
36bd2c2b66 Reorder playlists in the playlist deck
This allows me to change playback order without having to delete old
playlists and make new ones.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-14 11:21:10 -04:00
Bryan Schumaker
874f999adf ocarina: Close button modifications
- Set relief to none
- Remove the inner-border to make the button smaller

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-14 10:30:23 -04:00
Bryan Schumaker
2dd1e362d1 Created a "delete playlist" button
On the libsaria side, I created a function for finding and deleting a
playlist pointer.  On the ocarina side, I added a button to each
playlist tab to remove the tab.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 13:48:22 -04:00
Bryan Schumaker
d03e38ffbb ocarina: Add a make_button_data() function
Used for passing extra data through the button clicked callback.  I also
use this patch to remove the extra GdkEvent argument passed to buttons,
since this argument isn't actually part of the callback...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 13:36:42 -04:00
Bryan Schumaker
5363cfac82 libsaria: Garbage collect the playlist deck
I do this after choosing the next song and after tracks are removed from
each playlist.  This allows me to remove playlists as they empty.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 12:09:39 -04:00
Bryan Schumaker
c3ba90f900 libsaria: Tell tracks if they should play when loaded
This should set the gst pipeline to the correct state when the song is
loaded, rather than pausing after telling it to play.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-05-13 11:07:00 -04:00
Bryan Schumaker
18e0daeb17 ocarina: Remove more commented out and disabled code
- The old header functions
- The old callback header file
- The old shortcut registering system
- The old main() code

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-13 08:22:44 -04:00
Bryan Schumaker
3b705515c2 ocarina: Remove old songlist code
I've been wanting to do this for a long time.  I don't think I need it
anymore, so it can all be safely removed.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-13 08:19:20 -04:00
Bryan Schumaker
3287cde11e ocarina: Find selected indicies
Used for removing tracks from temporary playlists.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-13 08:05:01 -04:00
Bryan Schumaker
900cac7e45 ocarina: Improve right click menu
I can now create new playlists at either the front or back of the
playlist deck.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-12 08:06:39 -04:00
Bryan Schumaker
97427af922 Create new playlists in front
The "S" or "Q" shortcut will create a new playlist on the front of the
deck, "s" or "q" creates a shortcut on the back of the deck.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-10 08:04:29 -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
b2c17bd54a libsaria: Create a get_playlist() function
I don't want to keep creating functions for doing things to playlists.
Instead, I'd rather just get the playlist directly.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-09 08:00:12 -04:00
Bryan Schumaker
261316fb5f libsaria: Clean out header files
Remove things that aren't being used anymore.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:20 -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
8869b2aaed ocarina: Use pause_count
This allows me to say "pause in N songs" instead of limiting it pausing
only after the next song.

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
d6b8044ad3 ocarina: Hit "Delete" to remove tracks from a specific playlist
Yay keyboard shortcuts!

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:19 -04:00
Bryan Schumaker
b6cf10bf61 ocarina: Update library path when row is activated
This can either be a double-click or pressing "enter" on a selected row.

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
97fcff5c18 ocarina: Smaller progress bar
I learned how to set custom gtk_rc styles to configure the idle task
progress bar.  Now that it's smaller, I also moved it to the very bottom
of the window.

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
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
72522aab56 ocarina: Make playlist notebook tabs scrollable
If the user shrinks the window, the scroll arrows will appear for
navigation.

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
14c35e5810 ocarina: Set current duration using new format function
This gives me the correct answer right away.  I also re-set the time
whenever a new playlist is created to keep the new tab from changing the
time.

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
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
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
3cbeb85828 ocarina: Don't scroll if (index < number of visible rows)
This prevents a possible slow down / infinite loop (I never actually let
it finish)

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
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
7b527bc4e3 ocarina: Move progress bar and control buttons
I moved it above the "ribbon" to match what I had in 5.7

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
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
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
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
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
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
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
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
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
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
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
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
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
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
Bryan Schumaker
4448ba7ce1 libsaria: Turn the library::Renderer into a library::Driver
This will provide a 2-way notification system, rather than just going
from libsaria to the UI.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
ae9074103a libsaria: Create new LibraryPaths
The UI calls the library::add_path() function to create a new
LibraryPath structure to be managed by the library.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
7c8ef5508e libsaria: Comment out most of the library
I want to gradually re-add everything and clean it up as I go along.  To
help with this, I comment out the old code so I can use it as a
reference while writing new code.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
e2cac7fda0 ocarina: Remove text from library buttons
Instead, I show the same information using tooltips.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
06e613d901 ocarina: Don't assume scrolled windows for footer pages
This made the footer too big, in my opinion.  I have some other ideas
for how to fix it, though.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
81da1743a5 ocarina: Add footer pages to scrolled windows
This will allow them to scroll if they get too big.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:15 -04:00
Bryan Schumaker
8f43bf62e4 ocarina: Created footer tabs
I'm going to use a ribbon-ish interface for the footer and work the
settings pages in with the now playing widgets to make things easier to
find.  Right now, I created everything with placeholders.

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
c0df8f2e2b libsaria: Take idle callback func during libsaria init
This allows me to enable the idle queue if the function pointer is not
NULL.

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
02740d1feb libsaria: Remove initflags and comment out init() functions
Instead, I pass a string with the name of the application being run.
This will be used to have separate applications using libsaria.

This commit also comments out most of the libsaria and ocarina init
functions until I can revise and clean up everything.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:14 -04:00
Bryan Schumaker
9aeae532d3 Ocarina: Set path prefix better
The string class already has functions for what I need, so I might as
well use them...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:14 -04:00
Bryan Schumaker
d764489e89 libsaria: Create init flags
I eventually plan on creating more cpp binaries that link with libsaria
for pipe actions and other things.  It's helpful to only initialize the
parts of libsaria that I intend to use.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:14 -04:00
Bryan Schumaker
37bcb47de2 libsaria: Check the top of the stack through a function
The UI shortcuts may remove songs from the queue with no way of
notifying the stack layer.  The UI should call the stack_top_pop()
function to check if the top playlist is empty and ready for removal.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-03-05 08:23:00 -05:00
Bryan Schumaker
ed3254813c libsaria: Playlist tells renderer where to insert tracks
Now renderers don't need to track this on their own, and renderers will
update as tracks are added.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-03-05 07:47:55 -05:00
Bryan Schumaker
981b64a635 libsaira: Pass a flag if renderers should be deleted
Not all renderers are created dynamically, so I made a way of telling
the playlist system if renderers should be deleted.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-03-04 10:13:44 -05:00
Bryan Schumaker
83897633ce Dynamically allocate queue playlists
I only allow one queue instance right now, but this allows me to remove
the queue directory since it is no longer needed.  I also removed the
QUEUE_REFRESH callback since all this is handled through the libsaria
playlist code.  All that's left is reloading saved playlists on startup.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-03-03 14:19:33 -05:00
Bryan Schumaker
d7725d9068 ocarina: Allocate SongLists when they are needed
Right now it's just for a single queue, but I should be able to expand
this once I enable more stacking in the backend.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-03-02 08:09:35 -05:00
Bryan Schumaker
c23c4a2740 ocarina: Add tabs from Songlist init()
If Songlists manage this, then I can have them remove their pages
through on_playlist_empty().

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-28 08:16:25 -05:00
Bryan Schumaker
d41c64c798 ocarina: Remove the Page class
This patch does two things.  First, I remove the Page class and let each
notebook page manage itself.  Second, I created functions to add the
header and footer to a GtkWidget and then prepend the page in the
notebook (so it adds pages as if it was a stack).

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-27 11:31:33 -05:00
Bryan Schumaker
e03dfb33b8 libsaria: Remove indices from the queue
This replaces the "remove id" ability and replaces it with a "remove
index" ability.  Removing an index will remove the correct song in the
case that the same song has been added multiple times.  I also modified
the UI to remove rows at a specific index.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-25 13:50:56 -05:00
Bryan Schumaker
6637a82573 ocarina: Remove the SongListFuncs struct
I can get everything I need using playlists and renderers, so I can
safely remove this bit of code (I never really liked it anyway...).  I
have to keep around the queue::size() function for a little bit longer,
since choosing the next song still uses it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-25 10:52:35 -05:00
Bryan Schumaker
f7d7589882 libsaria: Remove library and queue iterator functions
I don't need these now that I have playlist renderers, so I might as
well rip out the code while I'm thinking about it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-25 10:11:26 -05:00
Bryan Schumaker
4ebfd8a33b libsaria: Use a tighter loop to fill in the playlist
Rather than exposing iterator functions, I now have a function to walk
the playlist and call the renderer insert() function for each track.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-25 10:04:19 -05:00
Bryan Schumaker
f795af5d6c libsaria: Created a playlist renderer
This class will be given a Playlist and will be in charge of calling
Playlist functions.  I eventually plan on expanding this to allow the
playlist to call renderer functions instead of using my current callback
system.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-25 09:45:27 -05: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
46ae66634e Ocarina: Check for a current alsa device before setting
Otherwise we set a C++ string to NULL and it throws an exception...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-09 08:04:01 -05:00
Bryan Schumaker
9ead002ab8 ocarina: Add stop as a pipe action
Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-09 08:03:54 -05:00
Bryan Schumaker
234626ea81 ocarina: Escape tooltip text
GTK was printing a warning whenever a non-escaped string was hovered
over.  The tooltip was also empty.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:24:07 -05:00
Bryan Schumaker
cefbf36415 ocarina: Free strings created by g_markup_escape_text()
This function returns a newly allocated string, so I can't set it
directly to a C++ string since this will leak memory.  Instead, I need
to keep the char* pointer around to free it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:19:48 -05:00
Bryan Schumaker
280baa7572 libsaria: Allow different UIs to use a different pipe
The UI now passes in a string to use as the filename.  In addition, I
store the filename and remove it when the application is closed.  If the
pipe already exists, then I return the path without creating a new one.

Pipes will only be removed by the application that creates them.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:13 -05:00
Bryan Schumaker
0aa8b950a9 ocarina: Scroll to saved song
I save the song before refreshing the library so I can scroll back to
it.  This way the user isn't interrupted too much...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-02-08 08:11:13 -05:00