Commit Graph

851 Commits

Author SHA1 Message Date
Bryan Schumaker
c49a39ad46 Encode v1.3 library
This patch changes the encode functions to export a v1.3 library
2010-12-18 14:46:31 -05:00
Bryan Schumaker
cafc19fbed Don't set score when importing library
The score system has been replaced with a like / dislike system.  Score
is no longer an attribute that can be set.
2010-12-18 14:36:21 -05:00
Bryan Schumaker
8349efe8c7 Library export formatting changes
This patch rearranges the decode functions to put decoders for a single
version together.  I also removed some extra whitespace and clearly
labeled the decoding sections.
2010-12-18 14:33:17 -05:00
Bryan Schumaker
29152aca1d ToggleButton generic toggled signal
The ToggleButton should automatically respond to the toggled signal
2010-12-18 11:19:55 -05:00
Bryan Schumaker
d8c5814f5a ToggleButton tooltip 2010-12-18 11:17:58 -05:00
Bryan Schumaker
e1a709b6c3 Create ToggleButton class
The ToggleButton class is a base class for buttons to inherit from.  So
far, this is only the RandomButton, LikeButton, and DislikeButton
2010-12-18 11:15:12 -05:00
Bryan Schumaker
44ee38dd91 Remove pointless whitespace 2010-12-18 11:10:45 -05:00
Bryan Schumaker
a0d231e964 Move RandomButton()
This puts it closer to the like / dislike buttons, since they are all
toggle buttons
2010-12-18 11:09:41 -05:00
Bryan Schumaker
05297d850c Remove unused code from like / dislike buttons 2010-12-18 11:08:37 -05:00
Bryan Schumaker
a1293fb351 Draw like / dislike buttons
This patch adds the like and dislike buttons to the gui.
2010-12-18 11:05:53 -05:00
Bryan Schumaker
47dbd200ab Add like / dislike buttons
This patch adds buttons for liking and disliking a song.  I also use
this patch to add like / dislike icons.
2010-12-18 11:05:17 -05:00
Bryan Schumaker
0eb3a15783 Add functions for controlling "like"
This patch adds a function for getting the "like" status of the current
song.  It also changes the "set_like" function to use an event, rather
than just setting it.
2010-12-18 11:03:25 -05:00
Bryan Schumaker
f55cb44a64 Fix set_attr()
First, set_attr() needs to find the id of the current song.  Second, we
should save after changing attributes.
2010-12-18 11:02:32 -05:00
Bryan Schumaker
076e89783a Add save() to the Source class
This will allow us to save any changes made to the Source()
2010-12-18 11:01:44 -05:00
Bryan Schumaker
401241ac47 Track recent songs for sequential next too
Why was I only adding recent songs to the list when picking a random
song?  It really doesn't make any sense.  This patch tracks recent songs
any time next() is called in the playlist.
2010-12-18 09:36:01 -05:00
Bryan Schumaker
2d0643dd7b Just skip songs the user doesn't like
If the user doesn't like a song, we shouldn't have a 25% chance of
playing the song anyway.  We should just pick a different song.
2010-12-18 09:27:01 -05:00
Bryan Schumaker
0bcb444317 Remove score field
This patch removes the score field from the Track() class
2010-12-17 23:37:06 -05:00
Bryan Schumaker
7c2778614d Added control to set like value
First, this patch adds a function for setting attributes for the current
file.  Second, it adds a function for specifically setting the "like"
attribute.
2010-12-17 23:33:05 -05:00
Bryan Schumaker
d91c099723 Added set_attr to the Source() class
Having access to the set_attr function should allow us to change
attributes for the current track easily.
2010-12-17 23:28:55 -05:00
Bryan Schumaker
0c254aa957 Remove score changing code
I am switching to a like / dislike system, so I don't need to worry
about scores anymore.
2010-12-17 23:18:19 -05:00
Bryan Schumaker
6449b6badb Skip songs based on like, rather than score
I think I can get a better guess for what users like based on what they
tell me, rather than trying to analyze their playback habits.
2010-12-17 23:15:19 -05:00
Bryan Schumaker
da6b0fd3eb Add "like" field to the Track() class
This will allow the users to tell us if they do or don't like a song.
Songs default to None for unrated songs.
2010-12-17 23:06:46 -05:00
Bryan Schumaker
32e417e4b5 Remove the pause_after.py plugin
Pause after current song is now a built-in feature, so I don't need a
plugin too.
2010-12-17 23:02:35 -05:00
Bryan Schumaker
14a960372b Add pause after current song menu item 2010-12-17 23:02:16 -05:00
Bryan Schumaker
4e5995ec64 Added pause_after control to libsaria
This gives me a chance to remove it as a plugin.  I noticed that
sometimes I would hear a fraction of a second of music before the
pausing started.  This should fix that.
2010-12-17 23:00:45 -05:00
Bryan Schumaker
b5fef6ba3c Check if cur_source is None
We should do this before attempting to return an ID...
2010-12-17 08:31:22 -05:00
Bryan Schumaker
d380d0ec45 Use built-in selected_foreach
I also made a wrapper so I can do things with each selected ID.
2010-12-17 08:18:33 -05:00
Bryan Schumaker
23e93ee7ae Reorder shortcuts
If they are in arranged alphabetically the code is easier to read...
2010-12-17 08:09:02 -05:00
Bryan Schumaker
77130b0251 Added more shortcuts
I can now switch between the full and compact footer.  I can also goto
the current song.
2010-12-17 08:06:54 -05:00
Bryan Schumaker
07272cf65e Remove the timeout add function pointer
This is no longer needed for the filter entry, so I'll remove it
2010-12-16 22:42:07 -05:00
Bryan Schumaker
c2e7b1bc31 Escape key focuses nothing
Pressing the escape key will no longer focus the tabs, but instead will
focus nothing.  I think this is better visually.
2010-12-16 22:33:50 -05:00
Bryan Schumaker
10eafb61b5 Improved shortcut behavior
When we successfully execute a shortcut, we shouldn't let anything else
happen in the event path.  Therefore, I stop the key-press-event if it
is successfully handled.

This patch also adds shortcuts for seeking during playback.
2010-12-16 22:16:39 -05:00
Bryan Schumaker
f5e21df148 Button seeking controls
The gui seeking buttons should use the controls seeking functions,
rather than seeking through the audio layer directly.
2010-12-16 22:09:45 -05:00
Bryan Schumaker
3abc80bdc4 Add seeking to controls
Seeking should be part of controls, rather than existing independently
as part of the audio package.  This patch moves the seeking functions,
and removes the need to pass a specific number of seconds.
2010-12-16 22:08:26 -05:00
Bryan Schumaker
d45ea464ef Use a better shortcut system
The gtk.Entry() approach wasn't working.  My new way allows me to catch
keypresses directly from the window, rather than waiting for an entry to
change.
2010-12-16 22:02:34 -05:00
Bryan Schumaker
29665add24 Prevent gtk warning on startup
I need to check if the Source() has height 0 before scrolling.  A better
solution is to scroll when everything becomes visible, but I don't want
to figure that out right now... :P
2010-12-16 21:54:19 -05:00
Bryan Schumaker
243eb63f8a Don't keep saving window size
If the window size hasn't changed, we should not keep setting it.
2010-12-16 11:03:09 -05:00
Bryan Schumaker
b6c9c12ea9 Remove datetime module import
This was added to test timing changes for my recent pickle improvements.
2010-12-16 11:02:32 -05:00
Bryan Schumaker
84eb73d2a2 Pickling improvements
By using pickle correctly, I can now load in files significantly faster
than the old way.  Library loading times have gone from about 3 seconds
to 0.25 seconds.  I like this.
2010-12-16 09:29:06 -05:00
Bryan Schumaker
21083ab1f7 Hide filter entry by default 2010-12-15 22:29:31 -05:00
Bryan Schumaker
9d08c5ce36 Added basic keyboard shortcuts
This patch adds an entry for keyboard shortcuts.  Right now, I only
support play/pause, stop and next.  I eventually plan to add more,
though.
2010-12-15 22:28:07 -05:00
Bryan Schumaker
677240eabe Added toggle_play()
This function will call play() if audio is currently paused.  It will
call pause() all other times.
2010-12-15 22:26:45 -05:00
Bryan Schumaker
add6a61c30 Add body_box
The body_box is a vbox containing the main tabs (for now).  This will
soon be used for a keyboard shortcut entry, too.
2010-12-15 21:57:01 -05:00
Bryan Schumaker
aa8f7d6188 Remove filter delay
I don't think I need this anymore ... filtering still feels fast without
it.
2010-12-15 09:32:52 -05:00
Bryan Schumaker
c0a27fb02c Move update library button
I moved it to the other side of the clear button so that it's farther
away from the goto button.
2010-12-15 08:00:13 -05:00
Bryan Schumaker
ee53d76238 Added a comment 2010-12-14 22:53:29 -05:00
Bryan Schumaker
d57db55d46 Don't scroll if Source widget not realized
This was giving a gtk warning, and is fairly easy to check for.
2010-12-14 22:44:39 -05:00
Bryan Schumaker
bcc622f06c Scroll to middle
When scrolling on song change, it looks better if we go to the middle
rather than somewhere near the top.
2010-12-14 22:39:58 -05:00
Bryan Schumaker
5a17c9c76f Added button tooltips
This patch adds tooltips to ALL gui buttons
2010-12-14 21:34:26 -05:00
Bryan Schumaker
f74239a0e2 Add update button
When clicked, the entire library will be updated in the background.
2010-12-14 20:37:40 -05:00