24 | | ^(Describe your design here.)^ |
25 | | |
| 24 | The idea is to create a few classes in both the c++ and java sides and implement communication between them. |
| 25 | * In the java part: |
| 26 | * Create a class SwfdecCommunicator that will implement the communication between the java and c++ code: |
| 27 | * create a construct that takes a string - path to the c++ executable as its only argument |
| 28 | * create a method sendCommand that sends a command to the c++ executable and returns the result as a BufferedImage. For the purposes of this demo there are only two possible commands - one with code -1 meaning "terminate" and another with code 1 meaning "get next frame". |
| 29 | * Create a class FlashMovieDemo that will play the flash movie in a JFrame. This class will extend javax.awt.Component so that it can be added as a component in the Jframe object. |
| 30 | * create a main method that will perform the creation of the JFrame and will take care that it is repainted accordingly. |
| 31 | * In the c++ part: |
| 32 | * Create a class SwfdecCommunicator that will hold the SwfdecPlayer object needed to decode the swf file. |
| 33 | * create a constructor that takes as its only argument the url to the swf file. This method will create the SwfdecPalyer and take care that it is properly initialized. |
| 34 | * create a method setSize that sets the size of the player |
| 35 | * create a method outputToCairo that renders the current frame to a cairo object |
| 36 | * create a method advance that will advance the player to the next frame |
| 37 | * Create a class CairoHandler that handles the cairo object and takes care that it is properly destroyed. Make SwfdecCommunicator it's friend class so that it can render to the CairoHandlers cairo object. |
| 38 | * Create a main function that performs the demo. |