Commit 8254e807 authored by Craig Watson's avatar Craig Watson

Fixed compilation on Windows;

The project didn't compile on Windows.. list of modifications:

- Added essential changes that hadn't been committed / pushed (Qt4->Qt5
changes; other misc. changes by Abdel)
- Temporarily disabled podcasts, as the modules don't compile with Qt5.2/
5.5

Currently, the application compiles on Windows, with MSVC2010 32-bit
parent ce521ede
...@@ -124,6 +124,8 @@ win32 { ...@@ -124,6 +124,8 @@ win32 {
system(echo "$$LONG_VERSION" > $$BUILD_DIR/longversion) system(echo "$$LONG_VERSION" > $$BUILD_DIR/longversion)
system(echo "$$SVN_VERSION" > $$BUILD_DIR/svnversion) system(echo "$$SVN_VERSION" > $$BUILD_DIR/svnversion)
DEFINES += NOMINMAX # avoids compilation error in qdatetime.h
} }
macx { macx {
......
...@@ -646,7 +646,7 @@ bool UBApplication::isFromWeb(QString url) ...@@ -646,7 +646,7 @@ bool UBApplication::isFromWeb(QString url)
{ {
bool res = true; bool res = true;
if( url.startsWith("uniboardTool://") || if( url.startsWith("OpenboardTool://") ||
url.startsWith("file://") || url.startsWith("file://") ||
url.startsWith("/")){ url.startsWith("/")){
res = false; res = false;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "UBWindowCaptureDelegate_win.h" #include "UBWindowCaptureDelegate_win.h"
#include <windows.h> #include <windows.h>
#include <QDialog>
#include "core/memcheck.h" #include "core/memcheck.h"
...@@ -79,7 +80,7 @@ int UBWindowCaptureDelegate::execute() ...@@ -79,7 +80,7 @@ int UBWindowCaptureDelegate::execute()
mutex.lock(); mutex.lock();
sleep.wait(&mutex, 200); sleep.wait(&mutex, 200);
mutex.unlock(); mutex.unlock();
mCapturedPixmap = QPixmap::grabWindow(mCurrentWindow); mCapturedPixmap = QPixmap::grabWindow((WId)mCurrentWindow);
return QDialog::Accepted; return QDialog::Accepted;
} }
else else
......
...@@ -126,11 +126,12 @@ void UBPlatformUtils::setDesktopMode(bool desktop) ...@@ -126,11 +126,12 @@ void UBPlatformUtils::setDesktopMode(bool desktop)
} }
void UBPlatformUtils::setWindowNonActivableFlag(QWidget* widget, bool nonAcivable) void UBPlatformUtils::setWindowNonActivableFlag(QWidget* widget, bool nonAcivable)
{ {/*
long exStyle = (nonAcivable) ? GetWindowLong(widget->winId(), GWL_EXSTYLE) | WS_EX_NOACTIVATE long exStyle = (nonAcivable) ? GetWindowLong(widget->winId(), GWL_EXSTYLE) | WS_EX_NOACTIVATE
: GetWindowLong(widget->winId(), GWL_EXSTYLE) & ~WS_EX_NOACTIVATE; : GetWindowLong(widget->winId(), GWL_EXSTYLE) & ~WS_EX_NOACTIVATE;
SetWindowLong(widget->winId(), GWL_EXSTYLE, exStyle); SetWindowLong(widget->winId(), GWL_EXSTYLE, exStyle);
*/
} }
#define KEYBTDECL(s1, s2, clSwitch) KEYBT(s1, s2, clSwitch, 0, 0, KEYCODE(s1), KEYCODE(s2)) #define KEYBTDECL(s1, s2, clSwitch) KEYBT(s1, s2, clSwitch, 0, 0, KEYCODE(s1), KEYCODE(s2))
......
...@@ -47,7 +47,7 @@ UBRubberBand::UBRubberBand(Shape s, QWidget * p) ...@@ -47,7 +47,7 @@ UBRubberBand::UBRubberBand(Shape s, QWidget * p)
customStyle = NULL; customStyle = NULL;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
customStyle = new QWindowsXPStyle(); customStyle = QStyleFactory::create("windows");
#elif defined(Q_OS_OSX) #elif defined(Q_OS_OSX)
customStyle = QStyleFactory::create("macintosh"); customStyle = QStyleFactory::create("macintosh");
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
......
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include "windowsmedia/UBWindowsMediaVideoEncoder.h" // #include "windowsmedia/UBWindowsMediaVideoEncoder.h"
#include "windowsmedia/UBWaveRecorder.h" // #include "windowsmedia/UBWaveRecorder.h"
#elif defined(Q_OS_OSX) #elif defined(Q_OS_OSX)
#include "quicktime/UBQuickTimeVideoEncoder.h" #include "quicktime/UBQuickTimeVideoEncoder.h"
#include "quicktime/UBAudioQueueRecorder.h" #include "quicktime/UBAudioQueueRecorder.h"
...@@ -304,7 +304,7 @@ void UBPodcastController::start() ...@@ -304,7 +304,7 @@ void UBPodcastController::start()
applicationMainModeChanged(UBApplication::applicationController->displayMode()); applicationMainModeChanged(UBApplication::applicationController->displayMode());
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
mVideoEncoder = new UBWindowsMediaVideoEncoder(this); //deleted on stop //mVideoEncoder = new UBWindowsMediaVideoEncoder(this); //deleted on stop
#elif defined(Q_OS_OSX) #elif defined(Q_OS_OSX)
mVideoEncoder = new UBQuickTimeVideoEncoder(this); //deleted on stop mVideoEncoder = new UBQuickTimeVideoEncoder(this); //deleted on stop
#endif #endif
...@@ -794,7 +794,7 @@ QStringList UBPodcastController::audioRecordingDevices() ...@@ -794,7 +794,7 @@ QStringList UBPodcastController::audioRecordingDevices()
QStringList devices; QStringList devices;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
devices = UBWaveRecorder::waveInDevices(); //devices = UBWaveRecorder::waveInDevices();
#elif defined(Q_OS_OSX) #elif defined(Q_OS_OSX)
devices = UBAudioQueueRecorder::waveInDevices(); devices = UBAudioQueueRecorder::waveInDevices();
#endif #endif
......
...@@ -13,13 +13,13 @@ SOURCES += src/podcast/UBPodcastController.cpp \ ...@@ -13,13 +13,13 @@ SOURCES += src/podcast/UBPodcastController.cpp \
win32 { win32 {
SOURCES += src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp \ # SOURCES += src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp \
src/podcast/windowsmedia/UBWindowsMediaFile.cpp \ # src/podcast/windowsmedia/UBWindowsMediaFile.cpp \
src/podcast/windowsmedia/UBWaveRecorder.cpp # src/podcast/windowsmedia/UBWaveRecorder.cpp
#
HEADERS += src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.h \ # HEADERS += src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.h \
src/podcast/windowsmedia/UBWindowsMediaFile.h \ # src/podcast/windowsmedia/UBWindowsMediaFile.h \
src/podcast/windowsmedia/UBWaveRecorder.h # src/podcast/windowsmedia/UBWaveRecorder.h
} }
macx { macx {
......
...@@ -63,7 +63,7 @@ bool UBWaveRecorder::init(const QString& waveInDeviceName) ...@@ -63,7 +63,7 @@ bool UBWaveRecorder::init(const QString& waveInDeviceName)
{ {
if (waveInGetDevCaps(i, &caps, sizeof(caps)) == MMSYSERR_NOERROR) if (waveInGetDevCaps(i, &caps, sizeof(caps)) == MMSYSERR_NOERROR)
{ {
QString deviceName = QString:: fromUtf16(caps.szPname); QString deviceName = QString::fromWCharArray(caps.szPname);
if (deviceName == waveInDeviceName) if (deviceName == waveInDeviceName)
{ {
...@@ -237,7 +237,7 @@ QStringList UBWaveRecorder::waveInDevices() ...@@ -237,7 +237,7 @@ QStringList UBWaveRecorder::waveInDevices()
{ {
if (waveInGetDevCaps(i, &caps, sizeof(caps)) == MMSYSERR_NOERROR) if (waveInGetDevCaps(i, &caps, sizeof(caps)) == MMSYSERR_NOERROR)
{ {
devices << QString::fromUtf16(caps.szPname); devices << QString::fromWCharArray(caps.szPname);
} }
else else
{ {
...@@ -253,7 +253,7 @@ QStringList UBWaveRecorder::waveInDevices() ...@@ -253,7 +253,7 @@ QStringList UBWaveRecorder::waveInDevices()
if (mixerGetDevCaps(i, &caps, sizeof(caps)) == MMSYSERR_NOERROR) if (mixerGetDevCaps(i, &caps, sizeof(caps)) == MMSYSERR_NOERROR)
{ {
qDebug() << "Mixer: " << QString::fromUtf16(caps.szPname); qDebug() << "Mixer: " << QString::fromWCharArray(caps.szPname);
} }
} }
......
...@@ -383,7 +383,7 @@ bool UBWindowsMediaFile::appendVideoFrame(const QImage& pImage, long mstimestamp ...@@ -383,7 +383,7 @@ bool UBWindowsMediaFile::appendVideoFrame(const QImage& pImage, long mstimestamp
INSSBuffer *sampleBuffer = 0; INSSBuffer *sampleBuffer = 0;
if (FAILED(mWMWriter->AllocateSample(pImage.numBytes(), &sampleBuffer))) if (FAILED(mWMWriter->AllocateSample(pImage.byteCount(), &sampleBuffer)))
{ {
setLastErrorMessage("Unable to allocate memory for new video frame"); setLastErrorMessage("Unable to allocate memory for new video frame");
return false; return false;
...@@ -400,7 +400,7 @@ bool UBWindowsMediaFile::appendVideoFrame(const QImage& pImage, long mstimestamp ...@@ -400,7 +400,7 @@ bool UBWindowsMediaFile::appendVideoFrame(const QImage& pImage, long mstimestamp
} }
const uchar * imageBuffer = pImage.bits(); const uchar * imageBuffer = pImage.bits();
memcpy((void*) rawBuffer, imageBuffer, pImage.numBytes()); memcpy((void*) rawBuffer, imageBuffer, pImage.byteCount());
HRESULT hrWriteSample = mWMWriter->WriteSample(mVideoInputIndex, msToSampleTime(mstimestamp), 0, sampleBuffer); HRESULT hrWriteSample = mWMWriter->WriteSample(mVideoInputIndex, msToSampleTime(mstimestamp), 0, sampleBuffer);
......
...@@ -30,8 +30,9 @@ ...@@ -30,8 +30,9 @@
#include <QtCore> #include <QtCore>
#include <wmsdk.h> #include <wmsbuffer.h>
#include <wmsdk.h>
class UBWindowsMediaFile : public QObject class UBWindowsMediaFile : public QObject
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment