-
Notifications
You must be signed in to change notification settings - Fork 344
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
Add grid view scroll sound and adjust sound theming #669
base: master
Are you sure you want to change the base?
Conversation
- Add scroll sound to the grid view using new syntax - textlist property "scrollSound" is kept for backward compatibility but overrode by new syntax - Play sounds "back" and "launch" in a more consistent way
@@ -713,7 +740,7 @@ Can be created as an extra. | |||
* `fontPath` - type: PATH. | |||
* `fontSize` - type: FLOAT. | |||
* `scrollSound` - type: PATH. | |||
- Sound that is played when the list is scrolled. | |||
- **Deprecated**: Use global property `sound name="scroll"` instead. Sound that is played when the list is scrolled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I read the code. This still works, which is a good choice, but I imagine that the majority of themes use this, so I'd rather not mark this as deprecated but rather as a fallback option (which seems to be what the code uses it for).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New themes should use global property sound name="scroll"
, "scrollSound" can still be used for backward compatibility. Maybe "deprecated" is not the right word, if you have a better suggestion I will take it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a fallback, I suppose - if you don't have a global setting defined for the system, it will use this one. I like the way you explain it - it can still be used for backward compatibility.
I don't have a strong opinion, but I'm mindful of there existing hundreds of themes right now, potentially using the previous syntax, and on the flipside, not wanting to risk this being effectively removed at some point.
@@ -151,12 +152,14 @@ bool SystemView::input(InputConfig* config, Input input) | |||
case VERTICAL_WHEEL: | |||
if (config->isMappedLike("up", input)) | |||
{ | |||
listInput(-1); | |||
if (listInput(-1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what cases will listInput return false in the wheel - doesn't it loop around? Is the "if" needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
listInput return lastCursorPos != newCursorPos so it made sense to me to handle it like this, to directly tie the scroll sound to the "cursor changed position" event. Maybe I can add an intermediary var to make the code look more explicit. That or maybe put the scroll sound up in the IList, since ImageGridComponent, TextListComponent and SystemView all inherit from the IList. The pb is the IList don't have anything to do with theme, so that would have to be set from the child class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I suppose you're using the "if" to cater for the case where the list only has one item, so that the sound doesn't play if the same element stays selected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idk if there is other edge case where this can happen. But I think it's more logic to tie the scroll sound to if the cursor moved or not, than tie it directly to user input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
return true; | ||
} | ||
if (config->isMappedLike("down", input)) | ||
{ | ||
listInput(1); | ||
if (listInput(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment.
@@ -165,19 +168,22 @@ bool SystemView::input(InputConfig* config, Input input) | |||
default: | |||
if (config->isMappedLike("left", input)) | |||
{ | |||
listInput(-1); | |||
if (listInput(-1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same - won't repeat for the others.
@@ -419,6 +428,9 @@ void SystemView::getViewElements(const std::shared_ptr<ThemeData>& theme) | |||
if (sysInfoElem) | |||
mSystemInfo.applyTheme(theme, "system", "systemInfo", ThemeFlags::ALL); | |||
|
|||
mScrollSound = Sound::getPath(theme, "system", "scroll"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem to be set in applyTheme - is there a case where sysInfoElem doesn't exist yet we'll reload these sounds without applying the theme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - just re-read: probably it's the other way around - you only want to set these if the new theme is applied, then (meaning, inside the if)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "if" is only there to make sure the ThemeElement is not null, Sound::getPath already do that check and return an empty string if it happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that the getPath getter is safe. Still, unless there is a use case for the sound to be updated when the theme is not, this is a case where these should be inside the if.
I take it that mScrollSound and mLaunchSound are initialized somewhere else with default values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean. The 2 "if" that we see before just check if the theme element is here and if it is, it is applied. The "systemInfo" is just a sub element of the system theme, just like the sound.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it - nevermind.
config->isMappedLike("down", input)) | ||
listInput(0); | ||
config->isMappedLike("down", input)) { | ||
if (listInput(0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we playing the sound on scroll and on stopping the scroll? I believe this is run when the button is released - is this deliberate?
Thanks for this. I read the code and added a few remarks, as I am not especially familiar with this part of the code so the side effects aren't clear. |
@pjft Thanks for the input. I think this also need more testing to get feedback from designers and users, there is a few points that I'm not sure about, for example:
|
I agree with @pjft about keeping the existing Personally, I don't see the need for the |
@cmitu Maybe there is a little misunderstanding here:
Beside that, I agree with you on fast system switch and scroll sound for folder entering (and maybe exiting but that would change behavior for older themes). |
@@ -101,12 +102,12 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) | |||
return true; | |||
}else if(config->isMappedTo("b", input)) | |||
{ | |||
Sound::getFromTheme(getTheme(), getName(), "back")->play(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a change in the feature set - can you elaborate? It seems we're now adding the "back" sound when changing from the system view to the carousel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the game* view to the system* view.
Thanks. For the suggestions, I agree that entering a folder should use the scroll sound instead. Undecided about the quick system select, to be honest, as I don't have a strong opinion either way. |
This is an area of ES that I have not touched much, so I can't really give any input on this. |
I'll take a closer look and test soon, but it looks good to me. |
Current behavior in normal text. Changes in bold. Suggestions in italic.
Game list views
TextListComponent
's own propertyscrollSound
. It is not removed. If both are defined, the global scroll sound is used. Add scroll sound to the Grid view. Maybe games views could use the SYSTEM scroll sound when using quick system changeSystem view
Syntax:
You can test it by using my modified version of @lilbud 's material theme that you can find here
It should fix #485 and #155 and the numerous requests people did on the forum to add scroll sounds to the grid view.
Tests and feedbacks from users and theme designers would be highly appreciated.