I noticed the drawing section however I think there will be two main issues with it.
Firstly Direct2D, GDI+ and DirectX have totally different drawing methods and it would be best to let them draw it in their own special ways. This would give the best speed boost (and quality). Possible file outputs would be able to tag onto the GDI system for many things I guess (unless you would rather use the file types' features instead of bitmaps).
Also this would allow the control to be totally separate of the drawing process which means they can operate by themselves.
I think this is the overall structure that I'm looking towards:
Part A:
Clean PlayerScreenUserInterface2 (maybe lets start with version 3?).
- Remove all drawing code
- Make it contain only the controls/key frames
- Make it responsible for setting values to be used by rendering/decoding etc.
Part B:
Create a new form that is responsible for video output.
- This allows for it to have it's own message handler (useful for cleaning up direct2D/X class on closing which other controls have trouble doing).
- Minimum drawing requirements
- Only one in the application (so multiple videos are rendered on the same form, even where there is more than one PlayerScreenUserInterface). This should allow for easily adding more videos, blending etc., and not need the PlayerScreenUserInterface to be aware of each other.
- Maybe it could also come to a point where you could position, size the videos over each other with dragging.
- Single GDI+ print, Direct2D/X process for the whole application (not two/3/4 separate ones).
Create a buffer class
- Should be one for each video
- Input/output system.
- Responds to the decoder if more input is require.
- Responds to the drawing system if new image to draw.
- Fills up when opening a video (maybe by calling the decoder which checks if input required, then keeps filling it up till no more input to this class is required).
- Based on some style on linked list system (first in, first out). I don't know if C# has a type for this.
Create a drawing data class
- Should be one for each video
- Stores all objects to be drawn on the video image (as data, not bitmaps).
- PlayerScreenUserInterface will add the objects to be draw, remove them or clear them (as the user interacts).
- Render will call for a list of the objects to be drawn, and render them onto its video image which the class belongs.
Part C:
Clean timer:
- Should run in its own thread (understand it does).
- On call will tell the drawing class to render images/data to screen.
- On call will tell the decoding class to check the buffer and fill it up.
Create a decoding class:
- Runs in its own thread.
- Checks the buffer class, and if told it needs to be filled up, will place an image into the buffer class (until it knows the class is full or the next timer tick).
- Called by timer, or by video loading.
Create a drawing class:
- Runs in its own thread.
- Checks the buffers have a new image to output.
- Passes the images and drawing data to the output class (like Direct2D/X, GDI+), including where on the screen they should be draws.
- This means it can tell images to be drawn next to each other, over top of each other etc.
Create the output classes:
- Called by the drawing class.
- Set-up the output if not already.
- Draws the images in their locations and draws objects on them using the drawing data.