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:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  "Fade on stop/pause" duration control (was: Plug-in for audio fade?)
« previous next »
  • Print
Pages: 1 2 [3] 4

Author Topic: "Fade on stop/pause" duration control (was: Plug-in for audio fade?)  (Read 12725 times)

Offline chrisjj

  • Member
  • *
  • Posts: 276
Re: Plug-in for audio fade?
« Reply #30 on: April 27, 2010, 05:00:14 PM »
> "Might do" is different from "will do" though.

Agreed :)

> If you added a duration option to fade on stop/pause, what else would be missing?

Normal (immediate) "Play" - I just discovered that "Fade on stop/pause" actually does Fade on stop/pause & play, whereas I need Play to remain immediate.

> You've been told that no plugin exists currently to do what you want

So I have - apologies.

> you've been told how you could accomplish similar effect

Crossfade? The snag with that is it is not on-command - once enabled, it applies to all track switches.

> and that you'd otherwise have to edit the source code.

I'll come back to that possibility when I've learned more. Thanks!

« Last Edit: April 27, 2010, 05:02:47 PM by chrisjj »
Logged

Offline soap

  • Member
  • *
  • Posts: 1679
  • Creature of habit.
Re: Plug-in for audio fade?
« Reply #31 on: April 27, 2010, 05:37:08 PM »
Quote from: chrisjj on April 27, 2010, 05:00:14 PM
> you've been told how you could accomplish similar effect

Crossfade? The snag with that is it is not on-command - once enabled, it applies to all track switches.

Noticing the emphasis on "on-command" I need to clarify one question:
Are you saying you want fade-to-pause/stop assigned to a button independent of the normal pause/stop button so that you can fade with one button and not fade with another?
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way

Offline chrisjj

  • Member
  • *
  • Posts: 276
Re: Plug-in for audio fade?
« Reply #32 on: April 27, 2010, 06:13:11 PM »
> Noticing the emphasis on "on-command" I need to clarify one question:
> Are you saying you want fade-to-pause/stop assigned to a button
> independent of the normal pause/stop button so that you can
> fade with one button and not fade with another?

No I'm not saying that. But for the fact fade-to-pause/stop mode affects Play, then I'd need only the fade period lengthened for my requirements to be fully met by just the normal pause/stop button.
Logged

Offline soap

  • Member
  • *
  • Posts: 1679
  • Creature of habit.
Re: Plug-in for audio fade?
« Reply #33 on: April 27, 2010, 06:27:29 PM »
So, just to be sure I'm clear, a setting that when enabled turns the normal "abrupt" stop/pause into a gentle fade out stop/pause?  But no fade in.

Correct?
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way

Offline chrisjj

  • Member
  • *
  • Posts: 276
Re: Plug-in for audio fade?
« Reply #34 on: April 27, 2010, 06:41:55 PM »
> So, just to be sure I'm clear, a setting that when enabled turns the
> normal "abrupt" stop/pause into a gentle fade out stop/pause?  But no fade in.

Yes, except there's no requirement for this to be on a setting -  I'd be happy with this being a build option.
Logged

Offline soap

  • Member
  • *
  • Posts: 1679
  • Creature of habit.
Re: Plug-in for audio fade?
« Reply #35 on: April 27, 2010, 08:13:55 PM »
Rockbox does not tend to do build-time options.  (Though one could obviously tweak the code in such a manner.)

What it sounds like an agreeable option for you would be is to expand on the previously discussed "Fade on stop / pause" option.  An expansion which expanded the length of fade and added an option to Fade on stop / pause, play, or both .

Does this sound like the idea in a nutshell?  (Not saying it will get done, but at least we can clearly define the goal)?
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way

Offline chrisjj

  • Member
  • *
  • Posts: 276
Re: Plug-in for audio fade?
« Reply #36 on: April 27, 2010, 08:44:22 PM »
> What it sounds like an agreeable option for you would be is to expand on the previously discussed "Fade on stop /
> pause" option.  An expansion which expanded the length of fade and added an option to Fade on stop / pause, play, or both .
>
> Does this sound like the idea in a nutshell?

That would certainly meet my requirements.

But perhaps the following would simpler and meet more of the requirements of others:

Setting for duration of "Fade on stop/pause" up
Setting for duration of "Fade on stop/pause" down.

And perhaps the same time would be a good time to improve both the UI label "Fade on stop/pause" and the CGF label "volume fade", changing to "Fade on stop/pause/play."

> (Not saying it will get done, but at least we can clearly define the goal)?

Sure!
« Last Edit: April 28, 2010, 08:54:21 AM by chrisjj »
Logged

Offline soap

  • Member
  • *
  • Posts: 1679
  • Creature of habit.
Re: "Fade on stop/pause" duration control (was: Plug-in for audio fade?)
« Reply #37 on: April 28, 2010, 08:41:39 PM »
Ok, I don't feel the meta discussion on quoting is needed, nor appropriate, in this thread and I'm going to shit-can it.

Quote abuse (or lack of quoting) is such a rare event that I also don't feel it needs stickied, and suggest that staff PM "offenders" in the future and not clutter an otherwise functional thread.

Two posts on the quoting topic is sufficient.  Eight is outright silly.

Edit:  PM me if you have good reason to see this thread unlocked.  I personally feel the original topic has reached a conclusion / agreement.

« Last Edit: April 28, 2010, 08:46:14 PM by soap »
Logged
Rockbox Forum Guidelines
The Rockbox Manual
How to Ask Questions the Smart Way

Offline chrisjj

  • Member
  • *
  • Posts: 276
Re: Plug-in for audio fade?
« Reply #38 on: December 16, 2016, 11:06:51 PM »
Quote from: chrisjj on April 27, 2010, 07:19:01 AM
I want a command (e.g. single keypress) that when issued triggers RB to do a fade to silence. I.e. to take the volume of the audio steadily down to zero.

It seems Crossfade on manual would do this for me https://archive.is/KEfsp#selection-515.0-520.0 . However crossfade seems brokens at the moment http://forums.rockbox.org/index.php/topic,51605.0.html .
« Last Edit: December 28, 2016, 06:00:55 PM by chrisjj »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 730
Re: "Fade on stop/pause" duration control (was: Plug-in for audio fade?)
« Reply #39 on: December 28, 2016, 03:50:11 PM »
And A lua x-mas present for you as well  :D

Code: [Select]
--Bilgus 12-2016
TIMEOUT = rb.HZ/4
SOUND_VOLUME = 0 --This is a CONSTANT
local vol_min = -60 --rb.sound_min(SOUND_VOLUME)

function cfg_num_setting(str_name)
local file = io.open(rb.ROCKBOX_DIR .. "/config.cfg", "r")
    if not file then
        return nil
    end
local value = nil
local contents = file:read("*all")

    i, j = string.find(contents, str_name .. ":")
    if j ~= nil then
        file:seek ("set", rb.atoi(j))
        value = file:read ("*num")
    end
    file:close() -- GC takes care of this if you would've forgotten it
    return value
end

local volume = cfg_num_setting("volume")
    if volume == nil then
        volume = rb.sound_default(SOUND_VOLUME)
    end

local vol_orig = volume


    if rb.pcm_is_playing() then
        while (volume > vol_min) do
            rb.sleep(TIMEOUT)
            rb.yield()
            volume = volume - 1
            rb.sound_set(SOUND_VOLUME, volume);
        end
        rb.audio_pause()
        rb.sleep(rb.HZ)
        rb.sound_set(SOUND_VOLUME, vol_orig); -- Set back to original so it doesn't get overwritten in config.cfg
        os.exit()

    else
        volume = vol_min
        rb.sound_set(SOUND_VOLUME, volume);
        rb.sleep(rb.HZ)
        rb.audio_resume()
        while (volume < vol_orig) do
            rb.sleep(TIMEOUT)
            rb.yield()
            volume = volume + 1
            rb.sound_set(SOUND_VOLUME, volume);
        end
        rb.sound_set(SOUND_VOLUME, vol_orig);

        os.exit()
    end
* pause_resume_fade.lua.txt (1.51 kB - downloaded 92 times.)
Logged

Offline chrisjj

  • Member
  • *
  • Posts: 276
Re: "Fade on stop/pause" duration control (was: Plug-in for audio fade?)
« Reply #40 on: December 28, 2016, 07:49:01 PM »
Thanks. On the ZEN simulator, that Lua script gives me this error in the GUI http://i.imgur.com/EGgZmmJ.png and the console:

Code: [Select]
/Bilgus_Keyfade.lua:31: attempt to call field 'pcm_is_playing' (a nil value)
stack traceback:
        /Bilgus_Keyfade.lua:31: in main chunk
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 730
Re: "Fade on stop/pause" duration control (was: Plug-in for audio fade?)
« Reply #41 on: December 28, 2016, 08:31:46 PM »
just tried downloading the file and installed on the zen sim it worked fine, make sure it has 'if rb.pcm_is_playing() then'
if you are in doubt take a screen shot of the file open on your pc
Logged

Offline chrisjj

  • Member
  • *
  • Posts: 276
Re: "Fade on stop/pause" duration control (was: Plug-in for audio fade?)
« Reply #42 on: December 28, 2016, 08:37:59 PM »
Quote from: Bilgus on December 28, 2016, 08:31:46 PM
just tried downloading the file and installed on the zen sim it worked fine,

Coo. I get the fail even on the default config.

Quote from: Bilgus on December 28, 2016, 08:31:46 PM
make sure it has 'if rb.pcm_is_playing() then' if you are in doubt take a screen shot of the file open on your pc

No doubt, but here it is anyway: http://i.imgur.com/VHEEbcB.png
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 730
Re: "Fade on stop/pause" duration control (was: Plug-in for audio fade?)
« Reply #43 on: December 28, 2016, 10:11:15 PM »
weird  maybe you don't have that function available???, What version is the rom on the sim you are using?
 try replacing   'if rb.pcm_is_playing() then'
with
Code: [Select]
AUDIO_STATUS_PLAY = 1
    if rb.audio_status() == AUDIO_STATUS_PLAY then
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 730
Re: "Fade on stop/pause" duration control (was: Plug-in for audio fade?)
« Reply #44 on: December 29, 2016, 03:45:46 PM »
I'm working on a configurable fade to stop fade to play plugin now..
Logged

  • Print
Pages: 1 2 [3] 4
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  "Fade on stop/pause" duration control (was: Plug-in for audio fade?)
 

  • SMF 2.0.18 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.055 seconds with 21 queries.