Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Widget: Recording duration #1220

Closed
wants to merge 322 commits into from

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Mar 20, 2017

I'd like to introduce a simple label widget that displays the duration of a running recording in the skin, apart from Recording section in Library.
A while ago I filed a wishlist bug but noone with more C++ experience & spare time picked this up so far.
Newbie that I am, I couldn't make something from the hints @daschuer posted, so I tried to learn from WTime widget (simple widget) and dlgrecording.cpp (queries recordingmanager for recDurationString). Right now I fail to set up the header file correctly.
Is this approach promising at all? If yes, I'd appreciate very much if someone could explain that header file.

Be-ing and others added 30 commits February 2, 2017 21:03
Unfortunately, there does not seem to be a way to let the skin shrink further without causing it to be displayed at that minimum size with a fresh config file.
@daschuer
Copy link
Member

For your current approach, you need to pass the RecordingManager here:

if (!(m_pWidgetParent = m_pSkinLoader->loadDefaultSkin(this, m_pKeyboard,
and here
LegacySkinParser legacy(m_pConfig, pKeyboard, pPlayerManager,
similar to m_pVCManager and WSpinny

In general, I would prefer a ControlObject based solution passing the unformatted values around and format them at the using element. This would for example also allow to access the values from scripts.
However this is somwhat more work.

@ronso0
Copy link
Member Author

ronso0 commented Mar 21, 2017

Thanks for your help! I will try that tonight.

In general, I would prefer a ControlObject based solution passing the unformatted values around and format them at the using element. This would for example also allow to access the values from scripts.
However this is somwhat more work.

Okay, I see the advantage. Are there plans to use scripts for something other than controllers, skin maybe?
I recall how long it took me to work on brake/softStart so I took the easier appearing way here...

ronso0 and others added 22 commits March 21, 2017 15:27
Move some initialization code into EffectUnit.setCurrentUnit and call
setCurrentUnit on construction to ensure that state of show_focus and
show_parameters are set correctly when toggling units. Also refactor
code for showing/hiding focus controls in skin to a callback connected
to show_parameters so it gets triggered by clicking the show_parameters
button in skins as well as effectFocusButton on the controller.
@ronso0
Copy link
Member Author

ronso0 commented Mar 22, 2017

Woohoo, it's working! Can't tell if the code okay, as well.
To test it, I put it behind Rec button in Tango.

Last recordings duration is visible for a second when new recording is started.
Seconds seem to flip over irregularly, like in Library > Recording.

Now that I tried it a few times, I think it might be handy to have a all-in-one widget, actually a dynamic button that handles [Recording],toggle_recording, displays [custom_text][recording duration] when recording and would clear when the recording is stopped. Text could be defined with , and , that way the button could be designed for available space or even translated.
But this won't happen in this PR, if I can do it at all.

@ronso0
Copy link
Member Author

ronso0 commented Mar 22, 2017

...messed this up with local compile. F#*!
I'll close this and start over. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants