Hi Thomas,

thank you for the helpful ideas!

Am 13.06.20 um 18:55 schrieb Thomas Elmiger:
> Hi folks,
> 
> First: I like this neat little audio player, this is a really cool idea, 
> Florian, thanks for making it!
> 
> Second: After testing shortly with Josiah’s example (I like the Leonard 
> Cohen songs) I came to the conclusion that it would be the job of SoundCite 
> to use something like the TW state mechanism 
> <https://tiddlywiki.com/#StateMechanism> in order to retain or restore the 
> state of a song during the TW (re)rendering process. The strex macro does 
> it in that way, this is why you can open a strex element, close the 
> tiddler, search for the tiddler and reopen it – and taddaaah! – strex 
> elements have the same state as before.
> 
> As the tabs as well as standard tiddlers demonstrate, it is a TW thing and 
> not the problem of neither the tabs or the strex macro. To test the 
> standard tiddler case you can go to Leonard Cohen 
> <https://tidbits.wiki/soundcite/soundcite.html> and play a tune there. 
> Close the tiddler, then search for "Leonard" and reopen the tiddler. TW 
> will render all the contents again. So now the soundcite macro should check 
> for the associated sound file, if it is already playing and adjust the 
> play-button accordingly. But it doesn’t and shows the initial state with 
> the play button.

Yeah, you're right, the soundcite macro does not manage it's state which
I now see would be the proper way to solve this. I first hoped for the
strex macro to implement something similar to the tab macro's "retain"
option, but there still would be issues with other features that do not
retain the elements. And, as you say, that's just not the way TW is
designed.

> How would this work? When I hit play, a new tiddler should be created: 
> title: 
> $:/state/soundcite/https://ia801205.us.archive.org/16/items/LeonardCohen-YouWantItDarker2016/01YouWantItDarker.mp3
> text: playing
> 
> Based on this state tiddler, the macro could know about the button to 
> display on rerendering.
> 
> Honestly I have no clue about other states that would be nice to have: 
> paused at [time], ended, ... maybe in a field you could save a counter for 
> how many times a song has been played. Would all that be possible via JS?
> 
> Third: A hint about CamelCase linking. I think it would be possible to 
> switch that off for your script tiddlers only by applying Pragma rules 
> <https://tiddlywiki.com/#Pragma>, but I never found out where you would be 
> able to look them up. Maybe others can help here. 

Thanks for pointing me in the right directions! I will look into the
state mechanism and the pragmas, but it may take some time until I come
up with something...

> All the best,
> Thomas (the one who built strex)

Kind regards,
Florian

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3103448e-bd32-1aaf-53d8-ba270f2f69ef%40anche.no.

Reply via email to