7 #include "hildon-widgets/hildon-program.h"
8 #include "hildon-widgets/hildon-window.h"
11 #include <gmyth/gmyth_recorder.h>
12 #include <gmyth/gmyth_backendinfo.h>
13 #include <gmyth/gmyth_tvchain.h>
14 #include <gmyth/gmyth_remote_util.h>
17 #include "mmyth_tvplayer.h"
20 cb_destroy(GtkWidget * widget, gpointer data)
22 MMythUi *mmyth_ui = (MMythUi *) data;
24 if (mmyth_ui->tvplayer != NULL) {
25 if (mmyth_tvplayer_is_playing(mmyth_ui->tvplayer))
26 mmyth_tvplayer_stop_playing(mmyth_ui->tvplayer);
29 mmyth_ui_finalize(mmyth_ui);
36 debug_error_func(const gchar * log_domain, GLogLevelFlags log_level,
37 const gchar * message, gpointer user_data)
40 * leave this with NO print out messages, once you need to disable
43 // g_print ( "[%s] DEBUG messages disabled!\n", __FUNCTION__ );
48 main(gint argc, gchar * argv[])
53 HildonProgram *program = NULL;
64 gtk_init(&argc, &argv);
65 gst_init(&argc, &argv);
67 g_log_set_default_handler(debug_error_func, NULL);
71 * Init libmmyth context
76 #ifndef MAEMO_PLATFORM
78 * create the main window
80 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
81 gtk_widget_set_size_request(window, MAIN_WINDOW_WIDTH,
83 gtk_window_set_title(GTK_WINDOW(window), "Mythtv Frontend");
86 * Creating Hildonized main view
88 program = HILDON_PROGRAM(hildon_program_get_instance());
89 window = hildon_window_new();
91 // g_signal_connect(G_OBJECT(window), "delete_event", gtk_main_quit,
94 hildon_program_add_window(program, HILDON_WINDOW(window));
95 g_set_application_name("Maemo Mythtv");
99 * Initializes MMyth Widgets
101 #ifdef MAEMO_PLATFORM
102 mmyth_ui = mmyth_ui_initialize(program, window);
104 mmyth_ui = mmyth_ui_initialize(window);
107 // mmyth_ui->loop = g_main_loop_new (NULL, FALSE);
110 * Connect destroy signal handling
112 g_signal_connect(window, "destroy", G_CALLBACK(cb_destroy), mmyth_ui);
115 * Shows main window and start gtk loop
117 gtk_widget_show(window);