Re: [Rhythmbox-devel] My Rhythmbox Hacking ToDo

Le vendredi 25 mars 2005 à 18:31 +1100, James Livingston a écrit :
> On Fri, 2005-03-25 at 07:53 +0100, Gabriel de Perthuis wrote:
> <automatic playlist criteria>
> > You could use indentation in the widget:
> > 
> > Songs that are [either|...]     [Add condition]
> > 	[rated|...] [over|...] [3]
> > 	or [by|...] [morcheeba] ("contains" can be the default)
> > 	or [both|...]            [add condition]
> > 		[by|...] [jay jay johanson]
> > 		and [not|...] [named|...] [on the radio]
> > 
> > Or you could just accept a natural syntax (and i18n it):
> > rated over 3 OR by Morcheeba OR (by jay jay johanson AND NOT named on
> > the radio)
> > With an example it would be easy to understand, and faster than a UI.
> The former would probably be easier to do; parsing natural syntax when
> i18n comes into play is probably hairy. I don't actually know, having
> never done it, but I imagine you'd have to parse it in the current
> language, store it in a specific one (i.e. English) and display it in
> the current one. Possibly it's simple, but I wouldn't have a clue.
I think you write a .lex, compile it into a C source, add a N_() around
AND, OR, by... keywords to internationalise them, and use it as your
lexer. Then use yacc with the language independent result. Maybe you can
directly use N_() in the .lex .
To print it, you use N_() again.
I shouldn't have mentioned i18n, it isn't really more complicated.

> Looking at a section of my "playlists.xml" file:
> <playlist name="Good" type="automatic" limit-count="0" limit-size="0">
>   <conjunction>
>     <equals prop="type">0</equals>
>     <subquery>
>       <conjunction>
>         <greater prop="rating">3.000000</greater>
>       </conjunction>
>     </subquery>
>   </conjunction>
> </playlist>
> So the playlists already support this in their definition; I'll have a
> go later and see whether Rhythmbox actually handles this (in which case
> it's just the UI missing), or whether Rhythmbox doesn't actually support
> more complex definitions yet.
It's just the UI missing, in widgets/rb-query-creator.c, load_query and get_query .

> Also: does anyone know why the playlists always have the check for
> type=0?

They don't accept webradios, because webradios play indefinitely so they
don't make sense in playlists. Things like streamripper may be able to
split a webradio into songs though, but I haven't tried and it would
require creating another type.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]