SourceForge has been redesigned. Learn more.

Adding a progress bar for jingles/effects

  • Brian Millham

    Brian Millham - 2013-03-11

    I just started looking at adding a progress bar for jingles/effects. Not as complex as for the main players, just to show how much of the jingle has been played.

    Here's a screenshot of a simple version:

    I haven't worked out yet how to update the progress bar with the real-time jingle info.

    I originally was going to add the progress bar to the Effects button, but decided against it. What I'd rather see in the button is to allow multi-line text, and even cooler would be a count of how many times the jingle/effect has been used (maybe reset when IDJC it started. But this is a different request…)

    Does this seem like a good idea?

  • Stephen Fairchild

    It's all good.

    The vertical progress bar is the right way to go. The get_media_metadata method can probably be made a free function which would make it easy to use to get the effects track length and also fill in the button text which can be done using a format string with the user still able to do the final edit. Multi line is a good idea since gtk is dong a poor job of equal sizing the buttons.

    Statistics belong in their own tab and tracks played could become an optional main tab feature with a complete list of tracks played per player and the metadata based list that we currently have being available in the statistics tab. I could make the tracks played viewer become switchable to left, right, both combined, both by crossfader, both in split pane using the statistics tab info.

    Let's have  a minutes of dead air streamed statistic!!! Number of seconds lost for words (LOL). At some stage I plan to add a dead air alarm.

  • Brian Millham

    Brian Millham - 2013-03-18

    I just submitted a patch for this feature.

    I made use of get_media_metadata by making a few changes. I added an option, get_length to have get_media_metadata only return the length of the track. I also changed IDJC_Media_Player so it could be created without an associated player. That was the quickest way (and the least amount of changes to the original code) that I could come up with to allow using get_media_metadata.

    I noticed that get_media_metadata seems to only return a round number for the length of a track, and with effects, I have some that are like 1.6 seconds long. So to make the progress more accurate, it will adjust the progress after the first time the effect is played (it learns the real length of the effect). Also, once the effect length is know, get_media_metadata will not be called if the effect is played again.

    Also, I added changing the Effect button label to bold text after the effect is played. That way, you can tell if you used it. (State is not saved after exiting IDJC).

    I'm not sure how efficient it is to have a IDJC_Media_Player object attached to each Effect object. I've been testing it for a while, and it doesn't seem to have any memory or CPU usage issues that I can see.

    I have not yet tested adding/changing effects, but I don't think that it will be a problem.

    I still need to look at having the text wrap in the Effects buttons (or even allowing Pango markup)

  • Stephen Fairchild

    I merged a patch for this feature.

  • Brian Millham

    Brian Millham - 2013-03-19

    I just submitted a new patch for this to fix a bug, and an enhancement.

    The bug is that since the length of the effect is saved from play to play, changing the effect to a new file did not see the new length until the effect is played again, causing the progress to be off for the first play. The patch fixes this.

    Also, I noticed that you changed get_media_metadata to return a fractional length, so I removed the code to try and adjust the length of the effect after playing it. I had only added that to get guess as the fractional length, so it doesn't seem to be needed now.

  • Brian Millham

    Brian Millham - 2013-03-22

    I just submitted a simple patch to enable multi-line text for the Effect buttons. It bases the text wrap on the original button size request (set_size_request) since there appears to be no real way in gtk 2.x to get the actual size of a widget.

  • Brian Millham

    Brian Millham - 2013-03-25

    I just added a patch to enhance the effects progress. The new patch adds to the Jingles tab (I changed it to Effects to be consistent). It's easier to explain with a couple of pictures:

    Playing one Effect:

    Playing two Effects:

    This only happens if the Main Players tab is active. If the Effects (Jingles) tab is active, then the tab text is not changed.


Log in to post a comment.