diff --git a/.travis.yml b/.travis.yml index 57c4d39d1..b9f4e92a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,9 +24,7 @@ before_install: brew unlink python; brew install glib pkgconfig libffi protobuf protobuf-c qt gettext gnutls fftw; brew install sqlite --with-fts; - brew install gstreamer gst-plugins-base; - brew install gst-plugins-good --with-flac; - brew install gst-plugins-bad gst-plugins-ugly gst-libav; + brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav; brew install chromaprint; brew install libcdio libmtp libimobiledevice libplist; export Qt5_DIR=/usr/local/opt/qt5/lib/cmake; @@ -36,19 +34,19 @@ before_install: ls /usr/local/lib/gstreamer-1.0; fi before_script: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker exec build cmake -Hstrawberry -Bbuild -DENABLE_TRANSLATIONS=ON ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir build; cd build; cmake .. -DUSE_BUNDLE=ON -DENABLE_TRANSLATIONS=ON ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker exec build cmake -Hstrawberry -Bbuild ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir build; cd build; cmake .. -DUSE_BUNDLE=ON ; fi script: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker exec build make -C build -j8 ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make -j8; sudo make install; sudo ../dist/macos/macdeploy.py strawberry.app; - ../dist/macos/create-dmg.sh strawberry.app $CC_FOR_BUILD; + ../dist/macos/create-dmg.sh strawberry.app; fi after_success: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ls -lh strawberry.dmg; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$TRAVIS_BRANCH" == "master" ]]; then rsync -e "ssh -o StrictHostKeyChecking=no" -va strawberry*.dmg travis@echoes.jkvinge.net:/home/travis/builds/macos; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "$CC_FOR_BUILD" == "gcc" ]]; then rsync -e "ssh -o StrictHostKeyChecking=no" -va strawberry*.dmg travis@echoes.jkvinge.net:/home/travis/builds/macos; fi branches: except: diff --git a/dist/macos/macdeploy.py b/dist/macos/macdeploy.py index 051668bad..9cd4018d6 100755 --- a/dist/macos/macdeploy.py +++ b/dist/macos/macdeploy.py @@ -100,7 +100,8 @@ GSTREAMER_PLUGINS = [ 'libgsttaglib.so', 'libgstvorbis.so', 'libgstisomp4.so', - 'libgstlame.so', + #'libgstlame.so', + #'libgsttwolame.so', 'libgstlibav.so', ] @@ -465,7 +466,7 @@ def main(): FixPlugin(FindGstreamerPlugin('gst-plugin-scanner'), '.') FixPlugin(FindGioModule('libgiognutls.so'), 'gio-modules') - FixPlugin(FindGioModule('libgiognomeproxy.so'), 'gio-modules') + #FixPlugin(FindGioModule('libgiognomeproxy.so'), 'gio-modules') try: FixPlugin('strawberry-tagreader', '.') diff --git a/ext/gstmoodbar/CMakeLists.txt b/ext/gstmoodbar/CMakeLists.txt index af95daa67..fbc9a051b 100644 --- a/ext/gstmoodbar/CMakeLists.txt +++ b/ext/gstmoodbar/CMakeLists.txt @@ -9,6 +9,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${GLIB_INCLUDE_DIRS}) include_directories(${GOBJECT_INCLUDE_DIRS}) include_directories(${GSTREAMER_INCLUDE_DIRS}) +include_directories(${GSTREAMER_AUDIO_INCLUDE_DIRS}) include_directories(${FFTW3_INCLUDE_DIR}) set(SOURCES gstfastspectrum.cpp gstmoodbarplugin.cpp) diff --git a/ext/gstmoodbar/gstfastspectrum.cpp b/ext/gstmoodbar/gstfastspectrum.cpp index e79973a05..e2b7ae12a 100644 --- a/ext/gstmoodbar/gstfastspectrum.cpp +++ b/ext/gstmoodbar/gstfastspectrum.cpp @@ -22,6 +22,9 @@ #include #include +#include +#include + #include #include diff --git a/src/core/macsystemtrayicon.h b/src/core/macsystemtrayicon.h index 200821387..17172fea3 100644 --- a/src/core/macsystemtrayicon.h +++ b/src/core/macsystemtrayicon.h @@ -40,7 +40,7 @@ class MacSystemTrayIcon : public SystemTrayIcon { MacSystemTrayIcon(QObject *parent = nullptr); ~MacSystemTrayIcon(); - void SetupMenu(QAction *previous, QAction *play, QAction *stop, QAction *stop_after, QAction *next, QAction *mute, QAction *quit); + void SetupMenu(QAction *previous, QAction *play, QAction *stop, QAction *stop_after, QAction *next, QAction *mute, QAction *love, QAction *quit); void SetNowPlaying(const Song& song, const QString& image_path); void ClearNowPlaying(); diff --git a/src/core/macsystemtrayicon.mm b/src/core/macsystemtrayicon.mm index f59bcd1cc..2a0172a59 100644 --- a/src/core/macsystemtrayicon.mm +++ b/src/core/macsystemtrayicon.mm @@ -171,7 +171,7 @@ MacSystemTrayIcon::MacSystemTrayIcon(QObject* parent) MacSystemTrayIcon::~MacSystemTrayIcon() { } -void MacSystemTrayIcon::SetupMenu(QAction* previous, QAction* play, QAction* stop, QAction* stop_after, QAction* next, QAction* mute, QAction* quit) { +void MacSystemTrayIcon::SetupMenu(QAction* previous, QAction* play, QAction* stop, QAction* stop_after, QAction* next, QAction* mute, QAction* love, QAction* quit) { p_.reset(new MacSystemTrayIconPrivate()); SetupMenuItem(previous); @@ -182,6 +182,7 @@ void MacSystemTrayIcon::SetupMenu(QAction* previous, QAction* play, QAction* sto p_->AddSeparator(); SetupMenuItem(mute); p_->AddSeparator(); + SetupMenuItem(love); Q_UNUSED(quit); // Mac already has a Quit item. } diff --git a/src/widgets/qocoa_mac.h b/src/widgets/qocoa_mac.h new file mode 100644 index 000000000..2456d6612 --- /dev/null +++ b/src/widgets/qocoa_mac.h @@ -0,0 +1,56 @@ +/* +Copyright (C) 2011 by Mike McQuaid + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +#include +#include +#include +#include +#include +#include + +static inline NSString* fromQString(const QString &string) +{ + const QByteArray utf8 = string.toUtf8(); + const char* cString = utf8.constData(); + return [[NSString alloc] initWithUTF8String:cString]; +} + +static inline QString toQString(NSString *string) +{ + if (!string) + return QString(); + return QString::fromUtf8([string UTF8String]); +} + +static inline NSImage* fromQPixmap(const QPixmap &pixmap) +{ + CGImageRef cgImage = QtMac::toCGImageRef(pixmap); + return [[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize]; +} + +static inline void setupLayout(NSView *cocoaView, QWidget *parent) +{ + parent->setAttribute(Qt::WA_NativeWindow); + QVBoxLayout *layout = new QVBoxLayout(parent); + layout->setMargin(0); + layout->addWidget(new QMacCocoaViewContainer(cocoaView, parent)); +}