Modified in accordance to coding guidelines for header and C files.
[glsdk/dual-decode.git] / include / gui.h
index e41c527018ba21ca08971667b42a4badb3e0ce9d..b5aaddd587ba70519129e5cda23e1ce2b03f7f28 100644 (file)
 #define __GUI_H__\r
 \r
 #include <gtk/gtk.h>\r
+#include <gst/gst.h>\r
 \r
 /******************************************************************************\r
\r
+                         Structure Definitions\r
\r
+*****************************************************************************/\r
+\r
+/**\r
  *     @brief                  This structure defines all the components and the signals\r
  *                                     for a Dual-Decode GUI window. There will be two such\r
  *                                     windows when the application is running \r
- ******************************************************************************/\r
+ */\r
 typedef struct{\r
 \r
        /*The Window and its delete-event signal handler*/\r
        GtkWidget *window;\r
        gulong windowCloseSignal;\r
\r
+    /*Image sink for the window*/\r
+    GstElement *sink;\r
 \r
        /*The Seekbar widget and the value-changed signal handler                       */\r
        /*value-changed handler is called when media is seeked using seekbar*/\r
@@ -71,7 +81,7 @@ typedef struct{
        GtkWidget *openButton;\r
        gulong openSignal;\r
 \r
-       /*media control buttons and clicked signal handlers*/\r
+       /*Media control buttons and clicked signal handlers*/\r
        GtkWidget *playButton;\r
        gulong playSignal;\r
        GtkWidget *pauseButton;\r
@@ -107,12 +117,19 @@ typedef struct{
        gint modeFlag;\r
 } GUIWindow;\r
 \r
+\r
+\r
+/******************************************************************************\r
+\r
+                                Macros\r
+\r
+ *****************************************************************************/\r
 /*To index the static GUIWindow and Pipeline structures                        */\r
 /*There are two of them, since it is a dual-decode application */\r
 #define DECODER_INDEX_SINGLE 0\r
 #define DECODER_INDEX_DOUBLE 1\r
 \r
-/*ratio of scrren size per window*/\r
+/*ratio of screen size per window*/\r
 #define SCREEN_WIDTH_FACTOR 3\r
 #define SCREEN_HEIGHT_FACTOR 2\r
 \r
@@ -132,48 +149,37 @@ typedef struct{
 \r
 #define TIME_LABEL_ORIGIN "--:--:--/--:--:--"\r
 \r
+#define FORWARD 3000000000\r
+#define REWIND 3000000000\r
 #define SWITCH_TEXT_SINGLE "Single Decode"\r
 #define SWITCH_TEXT_DUAL "Dual Decode"\r
 \r
 #define TIMER_INTERVAL 1000\r
 #define TIMER_SIGNAL_NONE 0\r
 \r
-/******************************************************************************\r
- *     @brief                  initialises GTK if X is present\r
- *\r
- *     @param[in,out] argc             number of command line arguments\r
- *     @param[in,out] argv             command line arguments\r
- *\r
- *     @return                 TRUE if X present, FALSE otherwise              \r
- *\r
- *     Called From             main()\r
- ******************************************************************************/\r
-gboolean DualDecode_initGUI(gint *argc, char **argv[]);\r
-\r
-/******************************************************************************\r
- *     @brief                  start the application\r
- *\r
- *     Called From             main()\r
- ******************************************************************************/\r
-void DualDecode_startApplication();\r
+/*The glade file to import widgets from*/\r
+#define GLADE_FILE "res/gui.xml"\r
 \r
 /******************************************************************************\r
- *     @brief                  stop the application and return to main()\r
- *\r
- *     Called From             delete-event handlers of the windows\r
- ******************************************************************************/\r
-void DualDecode_exitApplication();\r
\r
+              Statically used variables per GUI component file\r
 \r
-/*The glade file to import widgets from*/\r
-#define GLADE_FILE "resources/UI.glade"\r
+ *****************************************************************************/\r
 \r
-/*statically used variables per GUI component file*/\r
 static GError *error                   = NULL;\r
 static GtkBuilder *builder             = NULL;\r
 \r
-/*report and then free the error, if error is not NULL*/\r
-/*This function is called when a NULL is returned from*/\r
-/*an allocation function                              */\r
+/******************************************************************************\r
\r
+                        Static Inline functions\r
\r
+*****************************************************************************/\r
+\r
+/**\r
+ * Report and then free the error, if error is not NULL\r
+ *This function is called when a NULL is returned from\r
+ *an allocation function\r
+ */                              \r
 static inline void DualDecode_checkError(){\r
        if(NULL == error){\r
                g_printerr("GError Report : Unknown error\n");\r
@@ -191,7 +197,7 @@ static inline void DualDecode_builderClose() {
 }\r
 static inline void DualDecode_builderCreate() {\r
        builder = gtk_builder_new();\r
-       if(0 == gtk_builder_add_from_file(builder,GLADE_FILE,&error)){\r
+       if(0 == gtk_builder_add_from_file (builder,GLADE_FILE,&error)){\r
                DualDecode_checkError();\r
                DualDecode_builderClose();\r
        }\r
@@ -208,17 +214,19 @@ static inline GtkWidget *DualDecode_getWidget(const char *widget) {
        return retWidget;\r
 }\r
 \r
-/* get a widget exclusively from the builder                      */\r
-/* this will let the application create two instances             */\r
-/* of a widget defined in the glade file.                         */\r
-/*                                                                */\r
-/* For example : this macro can be used like -                    */\r
-/*                                                                */\r
-/* widget0 = DualDecode_getWidgetExclusive("applicationWindow")   */\r
-/* widget1 = DualDecode_getWidgetExclusive("applicationWindow")   */\r
-/*                                                                */\r
-/* this will create two different widgets with the same           */\r
-/* look and feel                                                  */\r
+/**\r
+ * Get a widget exclusively from the builder                      \r
+ * this will let the application create two instances             \r
+ * of a widget defined in the glade file.                         \r
+ *                                                                \r
+ * For example : this macro can be used like -                    \r
+ *                                                                \r
+ * widget0 = DualDecode_getWidgetExclusive("applicationWindow")   \r
+ * widget1 = DualDecode_getWidgetExclusive("applicationWindow")   \r
+ *                                                                \r
+ * this will create two different widgets with the same           \r
+ * look and feel                                                  \r
+ */\r
 \r
 static inline GtkWidget *DualDecode_getWidgetExclusive(const char *widget) {\r
        GtkWidget *retWidget = NULL;\r
@@ -227,4 +235,38 @@ static inline GtkWidget *DualDecode_getWidgetExclusive(const char *widget) {
        DualDecode_builderClose();\r
        return retWidget;\r
 }\r
+\r
+/******************************************************************************\r
\r
+                        Public functions declarations\r
\r
+******************************************************************************/\r
+\r
+/**\r
+ *     @brief                  initialises GTK if X is present\r
+ *\r
+ *     @param[in,out] argc             number of command line arguments\r
+ *     @param[in,out] argv             command line arguments\r
+ *\r
+ *     @return                 TRUE if X present, FALSE otherwise              \r
+ *\r
+ *     Called From             main()\r
+ */\r
+gboolean DualDecode_initGUI(gint *argc, char **argv[]);\r
+\r
+/**\r
+ *     @brief                  start the application\r
+ *\r
+ *     Called From             main()\r
+ */\r
+void DualDecode_startApplication();\r
+\r
+/**\r
+ *     @brief                  stop the application and return to main()\r
+ *\r
+ *     Called From             delete-event handlers of the windows\r
+ */\r
+void DualDecode_exitApplication();\r
+\r
+\r
 #endif /*__GUI_H__*/\r