Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about qt (old posts, page 5)

I knew not doing it was smarter, or how HTML5 and Qt do my work for me.

I wrote a while ago a RSS pro­gram called uRSSus. I ex­pect I am the on­ly us­er of it be­cause it has some prob­lems (all of them my fault ;-) but I re­al­ly like it.

For a while now I have want­ed it to have pod­cast sup­port. The thing is... that al­ways seemed like a lot of work. Sure, us­ing phonon I can cre­ate an au­dio play­er and ev­ery­thing, but...

I am us­ing a HTML wid­get to dis­play the post­s, so I would have to find a way to add the au­dio play­er to the UI and ... too much work.

So, to­day I woke up and thought... wait a minute... Qt's HTML wid­get is based on We­bkit. And We­bkit sup­ports HTM­L5. And HTM­L5 has an "au­dio" tag.

So, if I fixed uRSSus to fetch the en­clo­sure links, and added them in the database, and then added this to the post tem­plate:

<?py for enclosure in  post.enclosures: ?>
  <audio autobuffer="Yes" controls="controls" src=#{enclosure.href}></audio><br>
<?py #end ?>

Would­n't that ac­tu­al­ly work? Well, yeah!

urssus26

So there you have it, I was right not to im­ple­ment it, be­cause the eas­i­est way is to let Qt do it ;-)

24-hour app #1: Die Schere, a video editor

I have long known that ap­pli­ca­tion de­vel­op­ment is an ar­du­ous process. I have al­so long sus­pect­ed one of the rea­sons it's ar­du­ous is the de­vel­op­er. I should be more speci­fic, I am one of the rea­son­s.

That's be­cause I don't know what I am do­ing, and I don't mean that in the "I am a lame pro­gram­mer" sense (even if that's al­so true some­what), but in the sense that I lit­er­al­ly don't know what the app should look like, or what its fea­ture set should be.

So, I have de­cid­ed to em­bark on a se­ries of ex­per­i­ments I will call 24-hour app­s.

Here are the rules:

  • I shall cre­ate a neat ap­­pli­­ca­­tion, sta­ble, use­­ful, us­able and de­­cen­t-look­ing.

  • I shall do it in no more than 24 hours. Af­ter that time, it should be at least good enough for a pre­view re­lease, if not a be­­ta.

  • Those 24 hours can be split in two or three ses­­sions

  • Time spent do­ing icon­s, doc­s, etc, counts.

  • All de­vel­op­­ment shall be pub­­lic (I am us­ing github)

  • I must have a use for the re­­sult­ing ap­­pli­­ca­­tion, and it should be at least an ad­e­quate so­lu­­tion for that prob­lem.

So, what's the first pro­jec­t? I call it Die Schere (The Scis­sors in ger­man) and it's a video ed­i­tor.

It's not a kden­live re­place­men­t, it's just the video ed­i­tor I wish I had when I need­ed to glue a piece of one video with a piece of an­oth­er.

In the old, pre-dig­i­tal world, that was done us­ing a cut­ter and scotch tape. I want Die Schere to be as use­ful and com­pre­hen­si­ble as that was, but use­ful for clum­sy peo­ple like my­self.

Here is a video af­ter to­day's ses­sion, which last­ed 8 hours:

The ba­sic func­tions are there, even if lots of work is still need­ed.

  • You can load clips to work with them

  • You can cut clips (like us­ing a cut­ter!)

  • You can choose the cut points in­­ter­ac­­tive­­ly or by ed­it­ing a time

  • You can ar­range them (like us­ing scotch tape!)

  • You can gen­er­ate the out­­put video

As a back­end it's us­ing men­coder, but there's no rea­son it should­n't work with ffm­peg or melt if some­one writes 20 lines of code.

Bookrest: the stylesheet editor in action

As usu­al, a video show­ing it:

The cur­rent sta­tus is that the in­fra­struc­ture re­quired for the stylesheet ed­i­tor is in place:

  • I fig­ured out how to turn the StyleSheet ob­­ject back in­­­to a JSON stylesheet.

  • The changes are done and merged back in­­­to the same file.

  • There is UI for 3 of the 6 re­quired pieces. The mis­s­ing ones are text styles, em­bed­d­ed fonts, and con­­fig op­­tions (like, break sub­­sec­­tions to odd pages)

  • The UI for the whole app is pret­­ty rough, I am in full make-it-­­func­­tion­al mode right now. It will be rethought lat­er on.

Bookrest: it was meant to be a stylesheet editor.

In my orig­i­nal post about it I was re­fer­ring to Bookrest as a stylesheet ed­i­tor for rst2pdf, be­cause that's what I want­ed, a way to test style changes and see what they did.

Of course, one thing lead to an­oth­er and it's start­ing to look more like a word pro­ces­sor than any­thing else, but ... well, how about a stylesheet ed­i­tor?

Sure, you can use the "Style" tab, and ed­it at will, but that's not ex­act­ly fun for ev­ery­one.

So, let's work on one. Here's the video of the cur­rent sta­tus:

Of course, this is about 1/20th of the stylesheet ed­i­tor, but at least the di­a­log is there, and most of the re­main­ing work is wiring di­alogs, which is quick us­ing de­sign­er.


Contents © 2000-2023 Roberto Alsina