bmerry / leftfeet Goto Github PK
View Code? Open in Web Editor NEWRhythmbox plugin that generates a playlist for social dancing
License: GNU General Public License v3.0
Rhythmbox plugin that generates a playlist for social dancing
License: GNU General Public License v3.0
Need to test whether having a song which does not match any of the genres in the play queue will cause an issue when generating new songs. I think it will be okay (from eyeballing the code), but could potentially go wrong either in lf_site (must return an empty genre list) or in repulsion (must handle an empty genre list).
Currently if not enough songs could be found for a genre, we return a dummy that takes 1 second. A small interval makes sure that we don't run too short, but can also make rhythmbox appear to be hung if we run out of everything (which is normally what a new user will find before configuration. Instead, the generator should be able to accept a None
return value and stop asking for that genre.
Currently cubic time. It could be improved to quadratic time by doing incremental calculation of scores. Sub-quadratic may also be possible by using a balanced binary tree for the scores for each genre.
Hi,
I've had a quick play with this on Rhythmbox 3 which uses python3
Thus I've run a 2to3 across the .py files and change the Loader instruction in the .plugin file to python3.
First observation - the Tools menu option "Generate playlist" - that didnt really stand out for me to be a "left feet" menu option - can you consider adding "Left Feet" to the menu name?
other errors seen in the terminal when running:
/home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/__init__.py:192: PyGTKDeprecationWarning: The "buttons" argument must be a Gtk.ButtonsType enum value. Please use the "add_buttons" method for adding buttons. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations Gtk.STOCK_OK, Gtk.ResponseType.OK /home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/__init__.py:192: PyGTKDeprecationWarning: The "flags" argument for dialog construction is deprecated. Please use initializer keywords: modal=True and/or destroy_with_parent=True. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations Gtk.STOCK_OK, Gtk.ResponseType.OK /usr/lib/python3/dist-packages/gi/overrides/Gtk.py:497: PyGTKDeprecationWarning: The keyword(s) "parent" have been deprecated in favor of "transient_for" respectively. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations self._init(*args, **new_kwargs) /home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/__init__.py:202: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keywords for n_rows, n_columns or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations table = Gtk.Table(len(genres.genres), 2) /home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/__init__.py:211: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keywords for label or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations table.attach(Gtk.Label(_(g.name)), 0, 1, i, i + 1, 0) /home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/__init__.py:212: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keywords for value, lower, upper, step_increment, page_increment or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations adj = Gtk.Adjustment(freq, 0.0, 100.0, 1.0, 10.0) /home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/__init__.py:223: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keywords for label or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations hbox.pack_start(Gtk.Label(_('Minutes')), False, False, 0) /home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/__init__.py:224: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keywords for value, lower, upper, step_increment, page_increment or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations self.duration_minutes = Gtk.Adjustment(240, 0, 400, 1, 10) Traceback (most recent call last): File "/home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/__init__.py", line 177, in generate_response self.generate() File "/home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/__init__.py", line 151, in generate songs = generator.generate_songs(freqs, duration, factory) File "/home/dad/.local/share/rhythmbox/plugins/leftfeet/leftfeet/generator.py", line 119, in generate_songs raise ValueError('Must have at least one non-zero frequency') ValueError: Must have at least one non-zero frequency
The latter non-zero frequency was because I just hit OK without changing the slider bars - maybe throw up a messagebox instead?
After changing the first slider to be non-zero and entering 60 minuts and hit OK rhythmbox hung. No obvious errors in rhythmbox -d trace (no output generated). Any thoughts?
Ubuntu 14.04 Trusty
In some cases there are a mix of cases uses in genre tags in songs. At the moment this is handled via genre_aliases
in specific instances, but it would be simpler to just force everything into lowercase as a general solution.
Feature request from UCT: filter out anything with lossy encoding at less than 128kbps. Will need to check how lossless files are represented in the DB.
e.g. might want to start with more beginner-level dances then ramp up later.
For some reason, the "Remove from playlist" context item is grayed out.
Songs recently played are excluded, but a song that is currently playing or is scheduled to play will not be.
This probably requires some revamping of the interface to have the generator ask for a song object, along with introspection methods to query its time and genre[s].
e.g. if the existing playlist ends with a boogie, we shouldn't start the new items with one.
This probably just requires putting them into multiple places in by_genre, but also having the right mechanisms to prevent them being used multiple times.
Needs a bit of padding, particularly around the number spin-button
Mostly done, but needs better naming, valid_song needs to move, and it needs to be possible to load this from the user dir.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.