I am designing a program responsible for a GUI (with the graphics and user input being managed within a typical update loop) which has several states:
The default state is an animation which continuously runs despite any user input.
A notification state can be invoked which displays a notification instead of the animation. Notifications have a timeout which should-self close after that time and return to the default animation, it could also be closed prematurely by user input or by another notification of greater priority.
There is also a presentation mode which plays a video clip and should self-close and return to the default state after it ends. However, an important notification can also pause the video and be displayed, after which the video should resume, and return to the default animation once it ends.
More states are envisioned in the future although their requirements have not yet been defined. But as you can see, the architecture should be extensible with the ability for more states being added in. Therefore, each state should be able to control it's own lifecycle and invoked state changes for the GUI. For each state transition the screen should also fade out the current state and face in the next one.
My question is what kind of OOP architecture can be used to achieve this (as opposed to if/then statements in the update loop)? Are there any design patterns (perhaps state pattern) that can achieve this?
Note: It is being developed with SFML and c++.