Index: libs/libmythtv/eit.cpp
===================================================================
--- libs/libmythtv/eit.cpp	(revision 13457)
+++ libs/libmythtv/eit.cpp	(working copy)
@@ -142,7 +142,7 @@
         "      manualid = 0       AND "
         "      ( ( starttime >= :STIME1 AND starttime <  :ETIME1 ) OR "
         "        ( endtime   >  :STIME2 AND endtime   <= :ETIME2 ) )");
-    query.bindValue(":CHANID", chanid);
+    query.bindValue(":CHANID", (uint)chanid);
     query.bindValue(":STIME1", starttime);
     query.bindValue(":ETIME1", endtime);
     query.bindValue(":STIME2", starttime);
@@ -355,7 +355,7 @@
         "WHERE chanid    = :CHANID AND "
         "      starttime = :OLDSTART ");
 
-    query.bindValue(":CHANID",      chanid);
+    query.bindValue(":CHANID",      (uint)chanid);
     query.bindValue(":OLDSTART",    match.starttime);
     query.bindValue(":TITLE",       ltitle.utf8());
     query.bindValue(":SUBTITLE",    lsubtitle.utf8());
@@ -515,7 +515,7 @@
 
     QString cattype = myth_category_type_to_string(category_type);
 
-    query.bindValue(":CHANID",      chanid);
+    query.bindValue(":CHANID",      (uint)chanid);
     query.bindValue(":TITLE",       title.utf8());
     query.bindValue(":SUBTITLE",    subtitle.utf8());
     query.bindValue(":DESCRIPTION", description.utf8());
@@ -561,7 +561,7 @@
         "FROM channel "
         "WHERE chanid    = :CHANID");
 
-    query.bindValue(":CHANID",      chanid);
+    query.bindValue(":CHANID",      (uint)chanid);
 
     if (!query.exec())
     {
Index: libs/libmythtv/NuppelVideoPlayer.cpp
===================================================================
--- libs/libmythtv/NuppelVideoPlayer.cpp	(revision 13457)
+++ libs/libmythtv/NuppelVideoPlayer.cpp	(working copy)
@@ -73,6 +73,7 @@
 #undef GetFileSize
 #ifdef CONFIG_CYGWIN
 #undef DialogBox
+#undef GetCurrentTime
 #endif
 #endif
 
@@ -5638,12 +5639,7 @@
     if (ringBuffer->isDVD())
     {
         if (!ringBuffer->DVD()->IsInMenu())
-#ifndef CONFIG_CYGWIN
             secsplayed = ringBuffer->DVD()->GetCurrentTime();
-#else
-            // DVD playing non-functional under windows for now
-            secsplayed = 0;
-#endif
     }
     else
         secsplayed = ((float)framesPlayed / video_frame_rate);
Index: libs/libmythtv/NuppelVideoRecorder.cpp
===================================================================
--- libs/libmythtv/NuppelVideoRecorder.cpp	(revision 13457)
+++ libs/libmythtv/NuppelVideoRecorder.cpp	(working copy)
@@ -735,6 +735,9 @@
  */
 bool NuppelVideoRecorder::MJPEGInit(void)
 {
+#if defined(CONFIG_CYGWIN)
+    VERBOSE(VB_IMPORTANT, LOC_ERR + "Not supported under Cygwin yet" + ENO);
+#else
     bool we_opened_fd = false;
     int init_fd = fd;
     if (init_fd < 0)
@@ -777,6 +780,7 @@
     }
 
     VERBOSE(VB_IMPORTANT, LOC_ERR + "MJPEG not supported by device");
+#endif
     return false;
 }
 
@@ -895,6 +899,11 @@
 
 bool NuppelVideoRecorder::Open(void)
 {
+#if defined(CONFIG_CYGWIN)
+    VERBOSE(VB_IMPORTANT, LOC_ERR + "Not supported under Cygwin yet" + ENO);
+    errored = true;
+    return false;
+#else
     if (channelfd>0)
         return true;
 
@@ -970,10 +979,14 @@
 
     channelfd = fd;
     return true;
+#endif
 }
 
 void NuppelVideoRecorder::StartRecording(void)
 {
+#if defined(CONFIG_CYGWIN)
+    VERBOSE(VB_IMPORTANT, LOC_ERR + "Not supported under Cygwin yet" + ENO);
+#else
     if (lzo_init() != LZO_E_OK)
     {
         VERBOSE(VB_IMPORTANT, LOC_ERR + "lzo_init() failed, exiting");
@@ -1214,10 +1227,14 @@
 
     recording = false;
     close(fd);
+#endif
 }
 
 void NuppelVideoRecorder::DoV4L2(void)
 {
+#if defined(CONFIG_CYGWIN)
+    VERBOSE(VB_IMPORTANT, LOC_ERR + "Not supported under Cygwin yet" + ENO);
+#else
     struct v4l2_format     vfmt;
     struct v4l2_buffer     vbuf;
     struct v4l2_requestbuffers vrbuf;
@@ -1542,10 +1559,14 @@
     recording = false;
     close(fd);
     close(channelfd);
+#endif
 }
 
 void NuppelVideoRecorder::DoMJPEG(void)
 {
+#if defined(CONFIG_CYGWIN)
+    VERBOSE(VB_IMPORTANT, LOC_ERR + "Not supported under Cygwin yet" + ENO);
+#else
     struct mjpeg_params bparm;
 
     if (ioctl(fd, MJPIOC_G_PARAMS, &bparm) < 0)
@@ -1673,6 +1694,7 @@
             
     recording = false;
     close(fd);
+#endif
 }
 
 int NuppelVideoRecorder::SpawnChildren(void)
@@ -2590,6 +2612,9 @@
 
 void NuppelVideoRecorder::doVbiThread(void)
 {
+#if defined(CONFIG_CYGWIN)
+    VERBOSE(VB_IMPORTANT, LOC_ERR + "Not supported under Cygwin yet" + ENO);
+#else
     //VERBOSE(VB_IMPORTANT, LOC + "vbi begin");
     struct VBIData vbicallbackdata;
     struct vbi *pal_tt = NULL;
@@ -2730,6 +2755,7 @@
         cc_close(ntsc_cc);
 
     //VERBOSE(VB_RECORD, LOC + "vbi end");
+#endif
 }
 
 
Index: libs/libmythtv/videoout_dx.h
===================================================================
--- libs/libmythtv/videoout_dx.h	(revision 13457)
+++ libs/libmythtv/videoout_dx.h	(working copy)
@@ -1,7 +1,7 @@
 #ifndef VIDEOOUT_DX_H_
 #define VIDEOOUT_DX_H_
 
-/* ACK! <windows.h> and <ddraw.h> should only be in cpp's compiled in
+/* HACK! <windows.h> and <ddraw.h> should only be in cpp's compiled in
  * windows only. Some of the variables in VideoOutputDX need to be
  * moved to a private class before removing these includes though.
  */
Index: libs/libmythtv/libmythtv.pro
===================================================================
--- libs/libmythtv/libmythtv.pro	(revision 13457)
+++ libs/libmythtv/libmythtv.pro	(working copy)
@@ -27,6 +27,7 @@
 DEPENDPATH  += ../libmythlivemedia/UsageEnvironment/include
 DEPENDPATH  += ../libmythlivemedia/UsageEnvironment
 
+cygwin:LIBS += -L./ -lmythui-$${LIBVERSION} -lGdi32 -L../libmythfreemheg -lmythfreemheg-$${LIBVERSION}
 LIBS += -L../libmyth -L../libavutil -L../libavcodec -L../libavformat 
 LIBS += -L../libmythmpeg2 -L../libmythdvdnav
 LIBS += -lmyth-$${LIBVERSION} -lmythavutil-$${LIBVERSION}
@@ -42,17 +43,25 @@
 }
 
 cygwin {
-  QMAKE_EXTENSION_SHLIB=$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+	target.path = $${PREFIX}/bin
+	implib.target = libmythui-$${LIBVERSION}$$QMAKE_EXTENSION_CYGWIN
+	implib.commands = test -e libmythui-$${LIBVERSION}$$QMAKE_EXTENSION_CYGWIN || dlltool --input-def ../libmythui/libmythui.def --dllname cygmythui-$${LIBVERSION}-0.$$QMAKE_EXTENSION_SHLIB --output-lib libmythui-$${LIBVERSION}$$QMAKE_EXTENSION_CYGWIN -k
+	QMAKE_EXTRA_UNIX_TARGETS += implib
+	POST_TARGETDEPS += libmythui-$${LIBVERSION}$$QMAKE_EXTENSION_CYGWIN
+	TARGETDEPS += ../libmyth/libmyth-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+	TARGETDEPS += ../libavutil/libmythavutil-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+	TARGETDEPS += ../libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+	TARGETDEPS += ../libavformat/libmythavformat-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+	TARGETDEPS += ../libmythfreemheg/libmythfreemheg-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+} else {
+	TARGETDEPS += ../libmyth/libmyth-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
+	TARGETDEPS += ../libavutil/libmythavutil-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
+	TARGETDEPS += ../libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
+	TARGETDEPS += ../libavformat/libmythavformat-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
 }
-
-TARGETDEPS += ../libmyth/libmyth-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
-TARGETDEPS += ../libavutil/libmythavutil-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
-TARGETDEPS += ../libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
-TARGETDEPS += ../libavformat/libmythavformat-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
 TARGETDEPS += ../libmythmpeg2/libmythmpeg2-$${LIBVERSION}.$${QMAKE_EXTENSION_LIB}
 TARGETDEPS += ../libmythdvdnav/libmythdvdnav-$${LIBVERSION}.$${QMAKE_EXTENSION_LIB}
 
-
 DEFINES += _LARGEFILE_SOURCE
 QMAKE_CXXFLAGS_RELEASE += $${FREETYPE_CFLAGS}
 QMAKE_CXXFLAGS_DEBUG += $${FREETYPE_CFLAGS}
@@ -94,7 +103,6 @@
     QMAKE_LFLAGS_SHLIB += -seg1addr 0xC9000000
 }
 
-cygwin:QMAKE_LFLAGS_SHLIB += -Wl,--noinhibit-exec
 cygwin:DEFINES += _WIN32
 
 # Enable Linux Open Sound System support
Index: libs/libmythtv/videodev_myth.h
===================================================================
--- libs/libmythtv/videodev_myth.h	(revision 13457)
+++ libs/libmythtv/videodev_myth.h	(working copy)
@@ -11,6 +11,14 @@
 typedef uint8_t  __u8; 
 typedef uint32_t __u64; 
 typedef int32_t  __s64;  // HACK. Non 64bit FreeBSD kernels require this for ioctls
+#elif defined(CONFIG_CYGWIN)
+#include <sys/types.h>
+typedef uint32_t __u32; 
+typedef uint16_t __u16; 
+typedef int32_t  __s32; 
+typedef uint8_t  __u8; 
+typedef uint64_t __u64; 
+typedef int64_t  __s64;
 #else
 #include <linux/types.h>
 #include <linux/version.h>
Index: libs/libmythtv/videoout_dx.cpp
===================================================================
--- libs/libmythtv/videoout_dx.cpp	(revision 13457)
+++ libs/libmythtv/videoout_dx.cpp	(working copy)
@@ -18,6 +18,8 @@
 #include "../libavcodec/avcodec.h"
 }
 
+#define PRINT_FOURCC(c) ((char) (c & 0xFF)) << ((char) ((c >> 8) & 0xFF)) << ((char) ((c >> 16) & 0xFF)) << ((char) ((c >> 24) & 0xFF))
+
 const int kNumBuffers = 31;
 const int kNeedFreeFrames = 1;
 const int kPrebufferFramesNormal = 12;
@@ -159,7 +161,7 @@
     VideoOutput::Init(width, height, aspect, winid,
                       winx, winy, winw, winh, embedid);
 
-    wnd = winid;
+    wnd = (HWND)winid;
 
     XJ_width  = width;
     XJ_height = height;
@@ -792,7 +794,7 @@
 
     /* Create the actual brush */
     SetClassLong(wnd, GCL_HBRBACKGROUND,
-                  (LONG)CreateSolidBrush(rgb_colorkey));
+                  (LONG)CreateSolidBrush((COLORREF)rgb_colorkey));
     InvalidateRect(wnd, NULL, TRUE);
     //DirectXUpdateRects(true);
 
@@ -1349,7 +1351,7 @@
         int diff_x  = display_visible_rect.left();
         diff_x     -= display_video_rect.left();
         int diff_w  = display_video_rect.width();
-        diff_x     -= display_visible_rect.width()
+        diff_x     -= display_visible_rect.width();
 
         rect_src.left  += (XJ_width * diff_x) / display_video_rect.width();
         rect_src.right -= ((XJ_width * (diff_w - diff_x)) /
@@ -1367,6 +1369,8 @@
         rect_dest.top    = display_visible_rect.top();
         rect_dest.bottom = display_visible_rect.bottom();
 
+        int diff_x  = display_visible_rect.left();
+        diff_x     -= display_video_rect.left();
         int diff_y  = display_visible_rect.top();
         diff_y     -= display_video_rect.top();
         int diff_h  = display_video_rect.height();
Index: libs/libavformat/libavformat.pro
===================================================================
--- libs/libavformat/libavformat.pro	(revision 13457)
+++ libs/libavformat/libavformat.pro	(working copy)
@@ -13,7 +13,10 @@
 
 LIBS += $$LOCAL_LIBDIR_X11
 
-cygwin :LIBS += -lz
+cygwin {
+	LIBS += -lz
+	target.path = $${PREFIX}/bin
+}
 
 QMAKE_CLEAN += $(TARGET) $(TARGETA) $(TARGETD) $(TARGET0) $(TARGET1) $(TARGET2)
 
Index: libs/libmythui/mythmainwindow.cpp
===================================================================
--- libs/libmythui/mythmainwindow.cpp	(revision 13457)
+++ libs/libmythui/mythmainwindow.cpp	(working copy)
@@ -520,11 +520,9 @@
     fonTweak = gContext->GetNumSetting("QtFonTweak", 0);
 
     bool hideCursor = gContext->GetNumSetting("HideMouseCursor", 1);
-#ifdef QWS
-#if QT_VERSION >= 0x030300
+#if defined(QWS) && QT_VERSION >= 0x030300 && !defined(CONFIG_CYGWIN)
     QWSServer::setCursorVisible(!hideCursor);
 #endif
-#endif
 
     if (gContext->GetNumSetting("RunFrontendInWindow", 0))
         d->does_fill_screen = false;
@@ -537,7 +535,11 @@
         flags = Qt::WStyle_Customize  |
                 Qt::WStyle_NoBorder;
     else
+#if defined(CONFIG_CYGWIN)
+		flags = Qt::WStyle_Customize | Qt::WStyle_DialogBorder | Qt::WStyle_Title | Qt::WStyle_SysMenu;
+#else
         flags = Qt::WStyle_Customize | Qt::WStyle_NormalBorder;
+#endif
 
     // Workarounds for Qt/Mac bugs
 #ifdef Q_WS_MACX
@@ -574,6 +576,9 @@
     // Set cursor call must come after Show() to work on some systems.
     setCursor((hideCursor) ? (Qt::BlankCursor) : (Qt::ArrowCursor));
 
+#if defined(CONFIG_CYGWIN)
+	if (d->does_fill_screen)
+#endif
     move(d->xbase, d->ybase);
 }
 
@@ -995,7 +1000,7 @@
                                           int            mediaType,
                                           const QString &extensions)
 {
-#ifndef _WIN32
+#ifndef CONFIG_CYGWIN
     if (d->mediaHandlerMap.count(destination) == 0) 
     {
         MHData mhd = { callback, mediaType, destination, description };
@@ -1017,7 +1022,7 @@
        VERBOSE(VB_GENERAL, QString("%1 is already registered as a media "
                                    "handler.").arg(destination));
     }
-#endif // !_WIN32
+#endif // !CONFIG_CYGWIN
 }
 
 void MythMainWindow::RegisterMediaPlugin(const QString &name, 
Index: libs/libmythui/mythpainter_ogl.cpp
===================================================================
--- libs/libmythui/mythpainter_ogl.cpp	(revision 13457)
+++ libs/libmythui/mythpainter_ogl.cpp	(working copy)
@@ -15,7 +15,7 @@
 #include <OpenGL/glext.h>
 #endif
 
-#ifdef _WIN32
+#if defined(CONFIG_CYGWIN)
 #include <GL/glext.h>
 #endif
 
Index: libs/libmythui/libmythui.def
===================================================================
--- libs/libmythui/libmythui.def	(revision 0)
+++ libs/libmythui/libmythui.def	(revision 0)
@@ -0,0 +1,20 @@
+LIBRARY
+EXPORTS
+;	GetMythMainWindow()
+	_Z17GetMythMainWindowv
+;	DestroyMythMainWindow()
+	_Z21DestroyMythMainWindowv
+;	MythMainWindow::NormalizeFontSize(int)
+	_ZN14MythMainWindow17NormalizeFontSizeEi
+;	MythMainWindow::TranslateKeyPress(QString const&, QKeyEvent*, QStringList&, bool)
+	_ZN14MythMainWindow17TranslateKeyPressERK7QStringP9QKeyEventR11QStringListb
+;	MythMainWindow::detach(QWidget*)
+	_ZN14MythMainWindow6detachEP7QWidget
+;	MythMainWindow::attach(QWidget*)
+	_ZN14MythMainWindow6attachEP7QWidget
+;	MythMainWindow::RegisterKey(QString const&, QString const&, QString const&, QString const&)
+	_ZN14MythMainWindow11RegisterKeyERK7QStringS2_S2_S2_ @ 737
+;	MythMainWindow::GetKey(QString const&, QString const&) const
+	_ZNK14MythMainWindow6GetKeyERK7QStringS2_
+;	MythMainWindow::currentWidget()
+	_ZN14MythMainWindow13currentWidgetEv

Property changes on: libs/libmythui/libmythui.def
___________________________________________________________________
Name: svn:executable
   + *

Index: libs/libmythui/libmythui.pro
===================================================================
--- libs/libmythui/libmythui.pro	(revision 13457)
+++ libs/libmythui/libmythui.pro	(working copy)
@@ -71,4 +71,7 @@
     DEFINES += USE_LIRC
 }
 
-cygwin:DEFINES += _WIN32
+cygwin {
+	LIBS += $$LOCAL_LIBDIR_X11
+	target.path = $${PREFIX}/bin
+}
\ No newline at end of file
Index: libs/libmyth/mythcontext.cpp
===================================================================
--- libs/libmyth/mythcontext.cpp	(revision 13457)
+++ libs/libmyth/mythcontext.cpp	(working copy)
@@ -37,9 +37,12 @@
 
 // These defines provide portability for different
 // plugin file names.
-#ifdef CONFIG_DARWIN
+#if defined(CONFIG_DARWIN)
 const QString kPluginLibPrefix = "lib";
 const QString kPluginLibSuffix = ".dylib";
+#elif defined(CONFIG_CYGWIN)
+const QString kPluginLibPrefix = "lib";
+const QString kPluginLibSuffix = ".dll";
 #else
 const QString kPluginLibPrefix = "lib";
 const QString kPluginLibSuffix = ".so";
Index: libs/libmyth/qmdcodec.cpp
===================================================================
--- libs/libmyth/qmdcodec.cpp	(revision 13457)
+++ libs/libmyth/qmdcodec.cpp	(working copy)
@@ -473,7 +473,7 @@
             data[count] == '\t' || data[count] == ' ') )
         count++;
 
-#ifdef _WIN32
+#if defined(CONFIG_CYGWIN)
     if ( strnicmp(data+count, "begin", 5) == 0 )
 #else
 	if ( strncasecmp(data+count, "begin", 5) == 0 )
Index: libs/libmyth/screensaver.cpp
===================================================================
--- libs/libmyth/screensaver.cpp	(revision 13457)
+++ libs/libmyth/screensaver.cpp	(working copy)
@@ -3,7 +3,7 @@
 #include "screensaver.h"
 #include "screensaver-null.h"
 
-#ifdef _WIN32
+#if defined(CONFIG_CYGWIN)
 #undef Q_WS_X11 /* Even if we have an X server in WIN32, don't use X11... */
 #endif // _WIN32
 
Index: libs/libmyth/audiooutput.cpp
===================================================================
--- libs/libmyth/audiooutput.cpp	(revision 13457)
+++ libs/libmyth/audiooutput.cpp	(working copy)
@@ -8,7 +8,7 @@
 #include "audiooutput.h"
 
 /* Required to define BOOL first with friendly _WINDEF_H */
-#ifdef _WIN32
+#if defined(CONFIG_CYGWIN)
 #include <windows.h>
 #endif
 
Index: libs/libmyth/util-x11.cpp
===================================================================
--- libs/libmyth/util-x11.cpp	(revision 13457)
+++ libs/libmyth/util-x11.cpp	(working copy)
@@ -6,6 +6,10 @@
 #include "config.h" // for CONFIG_DARWIN
 #include "mythcontext.h"
 
+#if defined(CONFIG_CYGWIN)
+#undef Q_WS_X11 /* Even if we have an X server in WIN32, don't use X11... */
+#endif // CONFIG_CYGWIN
+
 QMutex x11_lock;
 
 #ifdef Q_WS_X11
Index: libs/libmyth/libmyth.pro
===================================================================
--- libs/libmyth/libmyth.pro	(revision 13457)
+++ libs/libmyth/libmyth.pro	(working copy)
@@ -73,10 +73,16 @@
 }
 
 cygwin {
-    QMAKE_LFLAGS_SHLIB += -Wl,--noinhibit-exec
     DEFINES += _WIN32
-    #HEADERS += mediamonitor-windows.h
-    #SOURCES += mediamonitor-windows.cpp
+    HEADERS += mediamonitor-windows.h mythhdd.h   mythcdrom.h
+    SOURCES += mediamonitor-windows.cpp mythhdd.cpp mythcdrom.cpp
+	LIBS += $$LOCAL_LIBDIR_X11
+	target.path = $${PREFIX}/bin
+	LIBS += -L./ -lmythui-$${LIBVERSION}
+	implib.target = libmythui-$${LIBVERSION}$$QMAKE_EXTENSION_CYGWIN
+	implib.commands = test -e libmythui-$${LIBVERSION}$$QMAKE_EXTENSION_CYGWIN || dlltool --input-def ../libmythui/libmythui.def --dllname cygmythui-$${LIBVERSION}-0.$$QMAKE_EXTENSION_SHLIB --output-lib libmythui-$${LIBVERSION}$$QMAKE_EXTENSION_CYGWIN -k
+	QMAKE_EXTRA_UNIX_TARGETS += implib
+	POST_TARGETDEPS += libmythui-$${LIBVERSION}$$QMAKE_EXTENSION_CYGWIN
 }
 
 macx {
Index: libs/libmyth/mediamonitor-windows.h
===================================================================
--- libs/libmyth/mediamonitor-windows.h	(revision 13457)
+++ libs/libmyth/mediamonitor-windows.h	(working copy)
@@ -4,9 +4,9 @@
 class MediaMonitorWindows : public MediaMonitor
 {
   public:
-    MediaMonitorWindows(QObject* par, unsigned long interval, bool allowEject)
-        : MediaMonitor(par, interval, allowEject) {};
+    MediaMonitorWindows(QObject* par, unsigned long interval, bool allowEject);
 
     QStringList GetCDROMBlockDevices(void);
+    virtual bool AddDevice(MythMediaDevice* pDevice);
 };
 #endif // MYTH_MEDIA_MONITOR_WINDOWS_H
Index: libs/libmyth/mediamonitor-windows.cpp
===================================================================
--- libs/libmyth/mediamonitor-windows.cpp	(revision 13457)
+++ libs/libmyth/mediamonitor-windows.cpp	(working copy)
@@ -5,10 +5,12 @@
 
 #include "mythmediamonitor.h"
 #include "mediamonitor-windows.h"
+#include "mythcontext.h"
 #include "mythcdrom.h"
 #include "mythhdd.h"
+#define _WIN32_WINNT 0x0500
+#include <windows.h>
 
-
 /**
  * \class MediaMonitorWindows
  *
@@ -20,31 +22,39 @@
                                          bool allowEject)
                    : MediaMonitor(par, interval, allowEject)
 {
-    for (each device)
-        if (device.isRemovable())
-        {
-            MythMediaDevice  *media;
-    
-            if (device.isCDorDVD())
-                media = MythCDROM::get(this, device.letter(),
-                                       false, AllowEject);
-            else
-                media = MythHDD::Get(this, device.letter(),
-                                     false, allowEject);
+	char strDrives[128];
+	if (::GetLogicalDriveStrings(sizeof(strDrives), strDrives)) {
+		for (char* driveName = strDrives; *driveName; driveName += strlen(driveName) + 1) {
+			UINT type = ::GetDriveType(driveName);
+			if (type == DRIVE_REMOVABLE || type == DRIVE_CDROM)
+			{
+				MythMediaDevice  *media;
+	    
+				if (type == DRIVE_CDROM)
+					media = MythCDROM::get(this, driveName, false, allowEject);
+				else
+					media = MythHDD::Get(this, driveName, false, allowEject);
 
-            if (!media)
-            {
-                VERBOSE(VB_IMPORTANT,
-                        "Error. Couldn't create MythMediaDevice.");
-                return;
-            }
+				if (!media)
+				{
+					VERBOSE(VB_IMPORTANT,
+							"Error. Couldn't create MythMediaDevice.");
+					return;
+				}
 
-            // We store the volume name to improve
-            // user activities like ChooseAndEjectMedia().
-            media->setVolumeID(device.volName());
+				// We store the volume name to improve
+				// user activities like ChooseAndEjectMedia().
+				char volumeName[256];
+				if (GetVolumeNameForVolumeMountPoint(driveName, volumeName, sizeof(volumeName))) {
+					media->setVolumeID(volumeName);
+				} else {
+					media->setVolumeID(driveName);
+				}
 
-            AddDevice(media);
-        }
+				AddDevice(media);
+			}
+		}
+	}
 }
 
 
@@ -52,10 +62,49 @@
 {
     QStringList  list;
 
+	char strDrives[128];
+	if (::GetLogicalDriveStrings(sizeof(strDrives), strDrives)) {
+		for (char* driveName = strDrives; *driveName; driveName += strlen(driveName) + 1) {
+			if (::GetDriveType(driveName) == DRIVE_CDROM)
+				list.append(driveName);
+		}
+	}
 
-    for (each device)
-        if (device.isCDorDVD())
-            list.append(device.letter());
-
     return list;
 }
+
+// Given a media deivce add it to our collection.
+bool MediaMonitorWindows::AddDevice(MythMediaDevice* pDevice)
+{
+    if ( ! pDevice )
+    {
+        VERBOSE(VB_IMPORTANT, "Error - MediaMonitorUnix::AddDevice(null)");
+        return false;
+    }
+
+    //
+    // Check if this is a duplicate of a device we have already added
+    //
+    QValueList<MythMediaDevice*>::const_iterator itr = m_Devices.begin();
+    for (; itr != m_Devices.end(); ++itr)
+    {
+        if ((*itr)->getDevicePath() == pDevice->getDevicePath())
+		{
+            VERBOSE(VB_MEDIA, "MediamonitorWindows::AddDevice() -- " +
+                    QString("Not adding '%1', it appears to be a duplicate.")
+                    .arg(pDevice->getDevicePath()));
+
+            return false;
+        }
+    }
+
+    pDevice->setDeviceModel(pDevice->getDevicePath());
+
+	QMutexLocker locker(&m_DevicesLock);
+    connect(pDevice, SIGNAL(statusChanged(MediaStatus, MythMediaDevice*)), 
+            this, SLOT(mediaStatusChanged(MediaStatus, MythMediaDevice*)));
+    m_Devices.push_back( pDevice );
+    m_UseCount[pDevice] = 0;
+
+    return true;
+}
Index: libs/libs.pro
===================================================================
--- libs/libs.pro	(revision 13457)
+++ libs/libs.pro	(working copy)
@@ -8,7 +8,7 @@
 # Directories
 SUBDIRS += libavutil libavcodec libavformat libmythsamplerate 
 SUBDIRS += libmythsoundtouch libmythmpeg2 libmythdvdnav
-SUBDIRS += libmyth libmythtv libmythui libmythfreemheg
+SUBDIRS += libmythfreemheg libmyth libmythtv libmythui
 SUBDIRS += libmythupnp
 SUBDIRS += libmythlivemedia
 
Index: libs/libavcodec/libavcodec.pro
===================================================================
--- libs/libavcodec/libavcodec.pro	(revision 13457)
+++ libs/libavcodec/libavcodec.pro	(working copy)
@@ -23,7 +23,10 @@
     }
 }
 
-cygwin:LIBS += -lz
+cygwin {
+	LIBS += -lz
+	target.path = $${PREFIX}/bin
+}
 
 QMAKE_CFLAGS_DEBUG += -O
 
Index: libs/libavutil/libavutil.pro
===================================================================
--- libs/libavutil/libavutil.pro	(revision 13457)
+++ libs/libavutil/libavutil.pro	(working copy)
@@ -20,6 +20,10 @@
     }
 }
 
+cygwin {
+	target.path = $${PREFIX}/bin
+}
+
 QMAKE_CFLAGS_DEBUG += -O
 
 QMAKE_CLEAN += $(TARGET) $(TARGETA) $(TARGETD) $(TARGET0) $(TARGET1) $(TARGET2)
Index: libs/libmythdvdnav/dvdnav.h
===================================================================
--- libs/libmythdvdnav/dvdnav.h	(revision 13457)
+++ libs/libmythdvdnav/dvdnav.h	(working copy)
@@ -369,7 +369,7 @@
 dvdnav_status_t dvdnav_time_search(dvdnav_t *self, 
 				   uint64_t time, uint search_to_nearest_cell);
 
-int dvdnav_time_search_within_cell(dvdnav_t *self,
+dvdnav_status_t dvdnav_time_search_within_cell(dvdnav_t *self,
                    int relative_time);
 /*
  * Stop playing current position and play the "GoUp"-program chain.
Index: libs/libmythfreemheg/libmythfreemheg.pro
===================================================================
--- libs/libmythfreemheg/libmythfreemheg.pro	(revision 13457)
+++ libs/libmythfreemheg/libmythfreemheg.pro	(working copy)
@@ -24,3 +24,6 @@
 
 LIBS += $$EXTRA_LIBS
 
+cygwin {
+	target.path = $${PREFIX}/bin
+}
\ No newline at end of file
Index: libs/libmythupnp/ssdp.cpp
===================================================================
--- libs/libmythupnp/ssdp.cpp	(revision 13457)
+++ libs/libmythupnp/ssdp.cpp	(working copy)
@@ -52,7 +52,7 @@
 
     // Setup SearchSocket
 
-    m_Sockets[ SocketIdx_Search ]->bind( INADDR_ANY, m_nSearchPort ); 
+    m_Sockets[ SocketIdx_Search ]->bind( (uint)INADDR_ANY, m_nSearchPort ); 
 
     m_pNotifyTask   = NULL;
 
Index: libs/libmythupnp/libmythupnp.pro
===================================================================
--- libs/libmythupnp/libmythupnp.pro	(revision 13457)
+++ libs/libmythupnp/libmythupnp.pro	(working copy)
@@ -49,14 +49,18 @@
 }
 
 cygwin {
-  QMAKE_EXTENSION_SHLIB=$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+	target.path = $${PREFIX}/bin
+	TARGETDEPS += ../libmyth/libmyth-$${LIBVERSION}.$$QMAKE_EXTENSION_SHLIB$$QMAKE_EXTENSION_CYGWIN
+	TARGETDEPS += ../libmythtv/libmythtv-$${LIBVERSION}.$$QMAKE_EXTENSION_SHLIB$$QMAKE_EXTENSION_CYGWIN
+	TARGETDEPS += ../libavcodec/libmythavcodec-$${LIBVERSION}.$$QMAKE_EXTENSION_SHLIB$$QMAKE_EXTENSION_CYGWIN
+	TARGETDEPS += ../libavformat/libmythavformat-$${LIBVERSION}.$$QMAKE_EXTENSION_SHLIB$$QMAKE_EXTENSION_CYGWIN
+} else {
+	TARGETDEPS += ../libmyth/libmyth-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
+	TARGETDEPS += ../libmythtv/libmythtv-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
+	TARGETDEPS += ../libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
+	TARGETDEPS += ../libavformat/libmythavformat-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
 }
 
-TARGETDEPS += ../libmyth/libmyth-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
-TARGETDEPS += ../libmythtv/libmythtv-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
-TARGETDEPS += ../libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
-TARGETDEPS += ../libavformat/libmythavformat-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
-
 inc.path = $${PREFIX}/include/mythtv/upnp/
 
 inc.files  = httprequest.h upnp.h ssdp.h taskqueue.h bufferedsocketdevice.h
Index: programs/mythuitest/mythuitest.pro
===================================================================
--- programs/mythuitest/mythuitest.pro	(revision 13457)
+++ programs/mythuitest/mythuitest.pro	(working copy)
@@ -1,6 +1,6 @@
 INCLUDEPATH += ../../libs/libmythui ../../libs/libmyth
 
-LIBS += -L../../libs/libmyth -L../../libs/libmythui
+LIBS += -L../../libs/libmythui -L../../libs/libmyth 
 
 include ( ../../config.mak )
 include ( ../../settings.pro )
@@ -17,6 +17,10 @@
 isEmpty(QMAKE_EXTENSION_LIB) {
   QMAKE_EXTENSION_LIB=a
 }
+cygwin {
+  QMAKE_EXTENSION_SHLIB=$$QMAKE_EXTENSION_SHLIB$$QMAKE_EXTENSION_CYGWIN
+}
+
 TARGETDEPS += ../../libs/libmythui/libmythui-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
 TARGETDEPS += ../../libs/libmyth/libmyth-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
 
Index: programs/programs-libs.pro
===================================================================
--- programs/programs-libs.pro	(revision 13457)
+++ programs/programs-libs.pro	(working copy)
@@ -3,10 +3,10 @@
 INCLUDEPATH += ../../libs/libmythupnp ../../libs/libmythui
 INCLUDEPATH += ../../libs/libmythlivemedia
 
+LIBS += -L../../libs/libmythui
 LIBS += -L../../libs/libmyth -L../../libs/libmythtv
 LIBS += -L../../libs/libavutil -L../../libs/libavcodec -L../../libs/libavformat
 LIBS += -L../../libs/libmythfreemheg
-LIBS += -L../../libs/libmythui
 LIBS += -L../../libs/libmythupnp
 LIBS += -L../../libs/libmythlivemedia
 
@@ -25,7 +25,8 @@
 }
 
 cygwin {
-  QMAKE_EXTENSION_SHLIB=$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+  QMAKE_EXTENSION_SHLIB=$$QMAKE_EXTENSION_SHLIB$${QMAKE_EXTENSION_CYGWIN}
+  LIBS += -lGdi32
 }
 
 TARGETDEPS += ../../libs/libmythui/libmythui-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
Index: programs/mythfrontend/statusbox.cpp
===================================================================
--- programs/mythfrontend/statusbox.cpp	(revision 13457)
+++ programs/mythfrontend/statusbox.cpp	(working copy)
@@ -1324,7 +1324,7 @@
     // weighted average loads
     contentLines[count].append(".   " + QObject::tr("Load") + ": ");
 
-#ifdef _WIN32
+#if defined(CONFIG_CYGWIN)
     contentLines[count].append(
         QObject::tr("unknown") + " - getloadavg() " + QObject::tr("failed"));
 #else // if !_WIN32
Index: programs/mythtranscode/replex/replex.pro
===================================================================
--- programs/mythtranscode/replex/replex.pro	(revision 13457)
+++ programs/mythtranscode/replex/replex.pro	(working copy)
@@ -27,6 +27,13 @@
   QMAKE_EXTENSION_SHLIB=so
 }
 
+cygwin {
+  QMAKE_EXTENSION_SHLIB=$$QMAKE_EXTENSION_SHLIB$$QMAKE_EXTENSION_CYGWIN
+  LIBS += -L../../../libs/libavcodec -lmythavcodec-$${LIBVERSION}
+  LIBS += -L../../../libs/libavutil -lmythavutil-$$LIBVERSION
+  LIBS += $$EXTRA_LIBS
+}
+
 TARGETDEPS += ../../../libs/libavformat/libmythavformat-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
 TARGETDEPS += ../../../libs/libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
 TARGETDEPS += ../../../libs/libavutil/libmythavutil-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
Index: programs/mythbackend/mainserver.cpp
===================================================================
--- programs/mythbackend/mainserver.cpp	(revision 13457)
+++ programs/mythbackend/mainserver.cpp	(working copy)
@@ -2111,6 +2111,7 @@
 
     QStringList strlist;
 
+#if !defined(CONFIG_CYGWIN)
     double loads[3];
     if (getloadavg(loads,3) == -1)
         strlist << "getloadavg() failed";
@@ -2118,6 +2119,9 @@
         strlist << QString::number(loads[0])
                 << QString::number(loads[1])
                 << QString::number(loads[2]);
+#else
+    strlist << "getloadavg() not supported";
+#endif
 
     SendResponse(pbssock, strlist);
 }
Index: programs/mythbackend/httpstatus.cpp
===================================================================
--- programs/mythbackend/httpstatus.cpp	(revision 13457)
+++ programs/mythbackend/httpstatus.cpp	(working copy)
@@ -357,6 +357,7 @@
  
     storage.setAttribute("fsids", ids); 
 
+#if !defined(CONFIG_CYGWIN)
     // load average ---------------------
 
     double rgdAverages[3];
@@ -367,7 +368,7 @@
         load.setAttribute("avg2", rgdAverages[1]);
         load.setAttribute("avg3", rgdAverages[2]);
     }
-
+#endif
  
     //temperature ----------------- 
     // Try ACPI first, then lmsensor 2nd 
Index: programs/mythbackend/backendutil.cpp
===================================================================
--- programs/mythbackend/backendutil.cpp	(revision 13457)
+++ programs/mythbackend/backendutil.cpp	(working copy)
@@ -4,7 +4,7 @@
 #if defined(CONFIG_DARWIN) || defined(__FreeBSD__)
 #include <sys/param.h>
 #include <sys/mount.h>
-#elif __linux__
+#elif __linux__ || defined(CONFIG_CYGWIN)
 #include <sys/vfs.h>
 #endif
 
Index: programs/mythtv-setup/mythtv-setup.pro
===================================================================
--- programs/mythtv-setup/mythtv-setup.pro	(revision 13457)
+++ programs/mythtv-setup/mythtv-setup.pro	(working copy)
@@ -25,3 +25,7 @@
         QMAKE_POST_LINK = ../../contrib/OSX/makebundle.sh mythtv-setup
     }
 }
+
+cygwin {
+  LIBS += -L../../libs/libmyth -lmyth-$$LIBVERSION
+}
\ No newline at end of file
Index: filters/postprocess/postprocess.pro
===================================================================
--- filters/postprocess/postprocess.pro	(revision 13457)
+++ filters/postprocess/postprocess.pro	(working copy)
@@ -4,7 +4,7 @@
 INCLUDEPATH += ../../libs/libmythtv
 DEPENDPATH  += ../../libs/libmythtv
 
-SOURCES += filter_postprocess.c
+SOURCES += filter_postprocess.c ../../libs/libavcodec/libpostproc/postprocess.c
 
 # Lots of symbols like pp_free_context, pp_free_mode, pp_get_context, pp_help
 # are used but not defined, which sometimes prevents linking on OS X.
Index: filters/filter-avcodec.pro
===================================================================
--- filters/filter-avcodec.pro	(revision 13457)
+++ filters/filter-avcodec.pro	(working copy)
@@ -13,5 +13,10 @@
 isEmpty(QMAKE_EXTENSION_SHLIB) {
     QMAKE_EXTENSION_SHLIB=so
 }
-TARGETDEPS += ../../libs/libavutil/libmythavutil-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
-TARGETDEPS += ../../libs/libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
+cygwin {
+	TARGETDEPS += ../../libs/libavutil/libmythavutil-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+	TARGETDEPS += ../../libs/libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}$${QMAKE_EXTENSION_CYGWIN}
+} else {
+	TARGETDEPS += ../../libs/libavutil/libmythavutil-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
+	TARGETDEPS += ../../libs/libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
+}
