Repository navigation
frontend: Update scene collection support for relative positioning - #11824
Conversation
RytoEX
left a comment
There was a problem hiding this comment.
Nits/Questions. Will wait on testing, or will test if I can make time.
|
From a visual review, this looks okay. Would appreciate a second glance or testing from others. |
|
Are either of these scenarios covered?
|
In scenario 1 nothing happens - the scene collection is loaded as-is and the app will use "absolute positioning" and the migration menu item should become enabled. Migration resolution is ignored for scene collections that are not of the v2 variant, it is expected not to be "there". In scenario 2 nothing happens as well - a v2 variant without a The "rules" as they appeared to me from the original implementation were:
|
In scenario 1, I am not getting the "Set/Reset Base Resolution" menu item enabled. |
RytoEX
left a comment
There was a problem hiding this comment.
If I am on a 1080p Scene Collection and profile, and I switch to a 4K SC that is version 1, no resolution, no migration_resolution, then updateRemigrationMenuItem is called with 0x02 (Relative). So isAbsoluteCoordinateMode is false, and the menu item remains disabled. This differs from current behavior on master.
RytoEX
left a comment
There was a problem hiding this comment.
Seems to work fine with the latest pushes.
Description
Updates the implementation of relative positioning code for scene collections by making the scene collection version and migration resolution part of the scene collection data model and removing it from the global
OBSBasicapplication state.Also implements #11630 within this updated implementation.
Additionally the following safeguards have been added:
user.inifile, but also if the value is an empty stringMotivation and Context
This is a first iterative step to move from global application states into an encapsulated data class. To that end the following new data models have been added in the
OBSnamespace:SceneCollection- a simple scene collection class that contains name, file path, version, and migration resolution of a scene collection found on diskRect- a generic rectangle class that stores width and height asdoublevalues and provides comparison operators as well as safe conversions from other types when constructing or updating an instance of a rectangle (usingstatic_assert, using an incompatible type - namely a type that cannot be cast todouble- will result in a compile error).The new
OBS::Rectallows for simpler comparisons between resolutions and ensures that "width" and "height" are always considered and combination even in code and not just logically or by convention.Instead of storing a migration resolution in the global state of the
OBSBasicinstance, it is now a value on aSceneCollectioninstance and can be updated/changed accordingly.Suggested Next Steps
Because scene collection objects were immutable before, use of
std::optionaland simpler value semantics were sufficient. With scene collections now becoming mutable objects, the copies provided bystd::optionallead to unintuitive API behaviour.Thus the
SceneCollectionscontainer itself should become a proper class by itself with common container semantics (mainly iterator-based access) which will make working with actual scene collection references more straight-forward (while retaining value semantics).How Has This Been Tested?
Tested with several scene collections:
1, resolution, but no migration resolution2, resolution, and migration resolution set2, but no resolution and migration resolution setCall To Action
I'd appreciate if a Windows-based maintainer could check:
wchar_tTypes of changes
Checklist: