fix root dir type
[melted_gui] / src / instance.c
index 6749c62..df64987 100644 (file)
 #include <gdk/gdkkeysyms.h>
 #include <pthread.h>
 
+#if defined(__MINGW32__)
+#include <winsock2.h>
+#endif
+
 #include "instance.h"
 #include "ui.h"
 #include "opts.h"
@@ -39,6 +43,7 @@
 #include "player.h"
 #include "library.h"
 #include "playlist.h"
+#include "control.h"
 
 GtkTargetEntry drag_targets[] = { { (char*) "application/playlist_item_t", 0, 0 } };
 
@@ -159,10 +164,10 @@ static gboolean playlist_grid_key(GtkWidget *widget, GdkEventKey *event, gpointe
             };
             break;
         case GDK_KEY_space:
-//            omnplay_ctl(app, BUTTON_PLAYER_PLAY);
+            control_route(app, BUTTON_PLAYER_PLAY);
             return TRUE;
         case GDK_KEY_Return:
-//            omnplay_ctl(app, BUTTON_PLAYER_CUE);
+            control_route(app, BUTTON_PLAYER_CUE);
             return TRUE;
         case GDK_KEY_Insert:
 //            omnplay_playlist_item_add(app, 0);
@@ -240,7 +245,7 @@ static gboolean instance_button_click(instance_t* app, control_buttons_t button)
         case BUTTON_PLAYER_PLAY:
         case BUTTON_PLAYER_PAUSE:
         case BUTTON_PLAYER_STOP:
-//            omnplay_ctl(app, button);
+            control_route(app, button);
             break;
         case BUTTON_LIBRARY_ADD:
             playlist_item_add_from_library(app, 0);
@@ -320,6 +325,13 @@ void instance_init(instance_t* app)
     int i;
     pthread_mutexattr_t attr;
 
+#if defined(__MINGW32__)
+    WORD wVersionRequested;
+    WSADATA wsaData;
+    wVersionRequested = MAKEWORD(2, 2);
+    WSAStartup(wVersionRequested, &wsaData);
+#endif
+
     gtk_signal_connect( GTK_OBJECT( app->window ), "delete-event",
         GTK_SIGNAL_FUNC(on_main_window_delete_event), app);