Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  alternative to sublines, useful?
« previous next »
  • Print
Pages: [1]

Author Topic: alternative to sublines, useful?  (Read 4455 times)

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
alternative to sublines, useful?
« on: April 19, 2010, 06:22:07 AM »
Here is my idea. add a new tag which auto increments every X ms to possibly make sublines easier to understand/use.

example: %?xx5<a|b|c|d> would be the equivalent of %t5a;%t5b;%t5c;%t5d   (show a for 5s then b for 5s etc, repeat).

The advantage would be obviously less code and easier to read? disadvantage would be all parts would display for the same amount of time.

it would be dead simple to add, so if anyone thinks this would be useful speak up, or I'll forget about it :)
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Yotto

  • Artist
  • Member
  • *
  • Posts: 826
  • Every Silver Lining has a Cloud
    • My Blog
Re: alternative to sublines, useful?
« Reply #1 on: April 19, 2010, 08:27:33 AM »
Would it hurt to have both? I would assume it would add to the memory footprint.

I for one am not a fan of the current subline code. It does make others' WPSs hard to read.
Logged
Pulp Audio Weekly - Where we talk about News, Reviews, and pretty much anything else we feel like discussing.

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: alternative to sublines, useful?
« Reply #2 on: April 19, 2010, 10:42:46 AM »
I meant in addition, not a replacement.
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: alternative to sublines, useful?
« Reply #3 on: April 19, 2010, 11:04:11 AM »
Do we really need an increasing number of ways to do the same thing?

It seems like creating duplicates of identical functionality just opens the doors up to having the WPS code balloon. Shouldn't it generally be attempted to only add things that actually add new functionality?
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: alternative to sublines, useful?
« Reply #4 on: April 19, 2010, 11:20:45 AM »
http://www.rockbox.org/tracker/task/11210
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: alternative to sublines, useful?
« Reply #5 on: April 19, 2010, 11:26:07 AM »
heading to bed, but I think you cant put images in the current sublines (they wont be cleared when it is not their turn) which this would allow
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: alternative to sublines, useful?
« Reply #6 on: April 19, 2010, 11:28:41 AM »
I've seen WPSes with animated images. I'm pretty sure I've seen it even as far back as dancepuffduo using, if I recall, mono bitmaps before we even had grayscale images.

Besides, wouldn't that mean the solution is to fix it for use within the current method for doing alternating sublines, rather than splitting the functionality between the two (one can do different times per line, the other can do images, but you can't do both with a single method...)
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: alternative to sublines, useful?
« Reply #7 on: April 19, 2010, 01:44:33 PM »
JdGordon is correct (sortof), you *can* put images in the current subline syntax, but the current subline code won't clear the images if it isn't their turn to be displayed.

However when I'm using sublines to display images it is almost always an animation and draws the next image overtop of the previous one, so unless you use transparency in your images...this isn't a problem.

The one problem I have with this is the fact that it can only have one time increment, as in some (or most actually) of my animations I will display image A for 200ms, image B for 1 second, image C for 500ms etc.

Other than that, I think it could be useful in *some* areas of my code at least, to save massive subline lines and cut down the total size of my WPS/SBS by a little, but as I stated previously I could only use it when all the sublines share the same display period, like for my Now Playing/Next Track info.

I could at least use this tag in *some* places but the fact that I couldn't use it in *all* the places I require sublines I think might make it harder for someone else to read my code, as there would be two distinct syntaxes doing essentially the same thing.

I definitely think it is worth including, but not necessarily to make the code any easier to read, just for the fact that it can cut back a little bit of bloat in some areas at least.

As long as it is included as well as, in not in place of, the regular subline tags...I don't see a problem with it going in at all.
Though, apparently others do...so "meh"  ;)


[St.]
« Last Edit: April 19, 2010, 01:49:07 PM by [St.] »
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: alternative to sublines, useful?
« Reply #8 on: April 19, 2010, 01:48:08 PM »
It seems odd to argue for adding *mandatory* bloat so as to cut back on *optional* bloat.
Logged

Offline audio-i

  • Artist
  • Member
  • *
  • Posts: 266
Re: alternative to sublines, useful?
« Reply #9 on: April 19, 2010, 03:16:36 PM »
Quote from: [St.] on April 19, 2010, 01:44:33 PM
However when I'm using sublines to display images it is almost always an animation and draws the next image overtop of the previous one, so unless you use transparency in your images...this isn't a problem.
That problem can be avoided if you alternate (equally sized and placed) viewports instead of images; the replacing viewport clears completely the preceding one (or overwrites it, I don't know), even if it contains images with transparencies. That way you can even alternate images and text (accurate text placing would be restricted though)

If I'm understanding this right, the new tag would mean an improvement in that sense because no equally sized alternating viewports would be needed, or it would even be possible to alternate the elements (such as images and/or text), but would force the alternating intervals to be equal, which in my opinion, is a huge restriction. The other arguments, making alternating easier to code on WPSs and easier to read for others, are nice, but in my opinion secondary.
« Last Edit: April 19, 2010, 03:29:15 PM by audio-i »
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: alternative to sublines, useful?
« Reply #10 on: April 19, 2010, 08:23:32 PM »
Quote from: JdGordon on April 19, 2010, 10:42:46 AM
I meant in addition, not a replacement.
Quote from: Llorean on April 19, 2010, 01:48:08 PM
It seems odd to argue for adding *mandatory* bloat so as to cut back on *optional* bloat.

read, comprehend, reply (or don't)
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline pixelma

  • Rockbox Expert
  • Member
  • *
  • Posts: 645
Re: alternative to sublines, useful?
« Reply #11 on: April 20, 2010, 01:38:49 AM »
If you read this together with [St.]'s and Llorean's previous post, it makes perfect sense to me - "mandatory" bloat would be something everyone has to suffer because of an unnecessary tag just to be able to "internally clean up" a few themes where their creators chose long sublines.

I still don't understand how that should help with readability much and no-one has come up with an example. The most unreadable lines are those used for animations, e.g. in iCatcher and JdGordon said in IRC that the suggested way would not improve this and iCatcher would not be a good example, so what is? Where do you gain readability by changing:
Code: [Select]
%t4*very long line with a few conditionals*;%t4*very long line with a few conditionals*;%t4*very long line with a few conditionals*;%t4*very long line with a few conditionals*
to
Code: [Select]
%?ta4<*very long line with a few conditionals*|*very long line with a few conditionals*|*very long line with a few conditionals*|*very long line with a few conditionals*>

After seeing this here I'd even argue that the usual conditional syntax can make it harder to read if you have conditionals in the parts because you have to think twice if | belongs to a conditional inside or to the surrounding %ta. And as been said you lose the possibility to assign different timeouts, - for the possibility to throw out %t4 or maybe %t0.5 (which it seems is not what makes these lines complicated). Finally, the bitmaps not cleared when it's not their "turn" only affects bitmaps that are not on the same line (in the end on the WPS) or at different spots. Since I never heard complaints and people successfully using sublines for animations all the time, this seems to be a non-issue to me.

So, all in all, I'm not convinced about this tag's usefulness yet, which was the initial question. Feel free to find good examples and I might change my opinion.
« Last Edit: April 20, 2010, 01:46:11 AM by pixelma »
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: alternative to sublines, useful?
« Reply #12 on: April 20, 2010, 03:10:55 AM »
the bloat argument is just outright STUPID. it adds a tiny amount to the bin size.

If anyone who actually does do themes thinks this would be useful then PM me. I'm closing this thread
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  alternative to sublines, useful?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.105 seconds with 15 queries.