add_definitions(-DQT_STRICT_ITERATORS)
endif(NOT MSVC)
-if(APPLE)
- set(mac_SRCS
- app_mac.cpp
- mac/GrowlInterface.cpp
- )
- # Notification Center Appeared in 10.8, or Darwin 12
- if( CMAKE_SYSTEM_VERSION VERSION_GREATER "11.9.9")
- list(APPEND mac_SRCS mac/MacSystemNotify.mm)
- add_definitions(-DHAVE_NOTIFICATION_CENTER)
- endif()
-
- include_directories ( services/lastfm/ )
- set( MAC_FILES_DIR ${CMAKE_SOURCE_DIR}/src/mac )
-endif(APPLE)
-
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
)
if (PYTHONINTERP_FOUND)
- execute_process(COMMAND "${PYTHON_EXECUTABLE}" ${CMAKE_SOURCE_DIR}/src/scripting/scriptengine/PHAACG2.py
- ${CMAKE_SOURCE_DIR}/src/scripting/scriptengine
+ execute_process(COMMAND "${PYTHON_EXECUTABLE}" ${PROJECT_SOURCE_DIR}/src/scripting/scriptengine/PHAACG2.py
+ ${PROJECT_SOURCE_DIR}/src/scripting/scriptengine
${CMAKE_BINARY_DIR}/scriptconsole)
install(FILES ${CMAKE_BINARY_DIR}/scriptconsole/AutoComplete.txt
DESTINATION ${DATA_INSTALL_DIR}/amarok/scriptconsole)
if( LIBMYGPO_QT_FOUND )
set( EXTRA_LIBS ${LIBMYGPO_QT_LIBRARIES} )
- include_directories( ${LIBMYGPO_QT_INCLUDE_DIRS} ${LIBMYGPO_QT_INCLUDE_DIRS}/../ )
+ include_directories( ${LIBMYGPO_QT_INCLUDE_DIRS} ${LIBMYGPO_QT_INCLUDE_DIRS}/../ )
endif( LIBMYGPO_QT_FOUND )
if( LIBLASTFM_FOUND )
target_link_libraries(amaroklib ${QT_QTTEST_LIBRARY})
endif()
-if(WIN32)
- target_link_libraries(amaroklib ${QT_QTWEBKIT_LIBRARY})
-endif(WIN32)
-if(APPLE)
- target_link_libraries(amaroklib "/System/Library/Frameworks/Foundation.framework")
- SET_TARGET_PROPERTIES(amaroklib PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
-endif(APPLE)
-
set_target_properties(amaroklib PROPERTIES VERSION 1.0.0 SOVERSION 1 )
install(TARGETS amaroklib ${INSTALL_TARGETS_DEFAULT_ARGS} )
include_directories( ../../..
- ${CMAKE_SOURCE_DIR}/src/context
- ${CMAKE_SOURCE_DIR}/src/network
+ ${PROJECT_SOURCE_DIR}/src/context
+ ${PROJECT_SOURCE_DIR}/src/network
${CMAKE_CURRENT_BINARY_DIR}/../../.. # for amarok_config.h
)
+++ /dev/null
-/****************************************************************************************
- * Copyright (c) 2008 Leo Franchi <lfranchi@kde.org> *
- * *
- * This program is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License as published by the Free Software *
- * Foundation; either version 2 of the License, or (at your option) any later *
- * version. *
- * *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License along with *
- * this program. If not, see <http://www.gnu.org/licenses/>. *
- ****************************************************************************************/
-
-#include "GrowlInterface.h"
-
-#include "amarokconfig.h"
-#include "App.h"
-#include "core/support/Debug.h"
-#include "EngineController.h"
-#include "core/meta/Meta.h"
-#include "core/meta/support/MetaUtility.h" // for secToPrettyTime
-#include "SvgHandler.h"
-#include "TrayIcon.h"
-
-GrowlInterface::GrowlInterface( QString appName ) :
- m_appName( appName )
-{
- EngineController *engine = The::engineController();
-
- connect( engine, SIGNAL(trackChanged(Meta::TrackPtr)),
- this, SLOT(show(Meta::TrackPtr)) );
-}
-
-void
-GrowlInterface::show( Meta::TrackPtr track )
-{
- DEBUG_BLOCK
- QString text;
- if( !track || track->playableUrl().isEmpty() )
- text = i18n( "No track playing" );
- else
- {
- text = track->prettyName();
- if( track->artist() && !track->artist()->prettyName().isEmpty() )
- text = track->artist()->prettyName() + " - " + text;
- if( track->album() && !track->album()->prettyName().isEmpty() )
- text += "\n (" + track->album()->prettyName() + ") ";
- else
- text += '\n';
- if( track->length() > 0 )
- text += Meta::msToPrettyTime( track->length() );
- }
-
- if( text.isEmpty() )
- text = track->playableUrl().fileName();
-
- if( text.startsWith( "- " ) ) //When we only have a title tag, _something_ prepends a fucking hyphen. Remove that.
- text = text.mid( 2 );
-
- if( text.isEmpty() ) //still
- text = i18n("No information available for this track");
-
- if( App::instance()->trayIcon() )
- {
- if( track && track->album() )
- {
- App::instance()->trayIcon()->setIconByPixmap( The::svgHandler()->imageWithBorder( track->album(), 100, 5 ) );
- }
- App::instance()->trayIcon()->showMessage( "Amarok", text, QString() );
- }
-
-}
+++ /dev/null
-/****************************************************************************************
- * Copyright (c) 2008 Leo Franchi <lfranchi@kde.org> *
- * *
- * This program is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License as published by the Free Software *
- * Foundation; either version 2 of the License, or (at your option) any later *
- * version. *
- * *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License along with *
- * this program. If not, see <http://www.gnu.org/licenses/>. *
- ****************************************************************************************/
-
-#ifndef AMAROK_GROWL_INTERFACE_H
-#define AMAROK_GROWL_INTERFACE_H
-
-
-
-#include <QObject>
-#include <QString>
-#include <QImage>
-
-#include "core/support/Debug.h"
-#include "core/meta/forward_declarations.h"
-#include "EngineController.h"
-
- // NOTE if not on mac, this whole file is useless, so not even going to try
-class GrowlInterface : QObject
-{
- Q_OBJECT
-
- public:
- GrowlInterface( QString appName );
-
- protected slots:
- void show( Meta::TrackPtr );
-
- private:
- QString m_appName;
- Meta::TrackPtr m_currentTrack;
-
-};
-
-#endif
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>${MACOSX_BUNDLE_INFO_STRING}</string>
- <key>CFBundleIconFile</key>
- <string>${MACOSX_BUNDLE_ICON_FILE}</string>
- <key>CFBundleIdentifier</key>
- <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleLongVersionString</key>
- <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
- <key>CFBundleName</key>
- <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
- <key>CFBundleSignature</key>
- <string>ROK2</string>
- <key>CFBundleVersion</key>
- <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
- <key>CSResourcesFileMapped</key>
- <true/>
- <key>LSRequiresCarbon</key>
- <true/>
- <key>NSHumanReadableCopyright</key>
- <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
- <key>CFBundleDocumentTypes</key>
- <array>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>mp3</string>
- <string>MP3</string>
- </array>
- <key>CFBundleTypeMIMETypes</key>
- <array>
- <string>audio/mpeg</string>
- </array>
- <key>CFBundleTypeOSTypes</key>
- <array>
- </array>
- <key>CFBundleTypeName</key>
- <string>MPEGAudioLayer3</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>ogg</string>
- </array>
- <key>CFBundleTypeMIMETypes</key>
- <array>
- <string>audio/ogg</string>
- </array>
- <key>CFBundleTypeOSTypes</key>
- <array>
- </array>
- <key>CFBundleTypeName</key>
- <string>OggVorbisFile</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>oga</string>
- </array>
- <key>CFBundleTypeMIMETypes</key>
- <array>
- <string>audio/ogg</string>
- </array>
- <key>CFBundleTypeOSTypes</key>
- <array>
- </array>
- <key>CFBundleTypeName</key>
- <string>OggAudioFile</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>flac</string>
- </array>
- <key>CFBundleTypeMIMETypes</key>
- <array>
- <string>audio/flac</string>
- </array>
- <key>CFBundleTypeName</key>
- <string>FLACAudioFile</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>m4a</string>
- </array>
- <key>CFBundleTypeOSTypes</key>
- <array>
- </array>
- <key>CFBundleTypeMIMETypes</key>
- <array>
- <string>audio/mp4</string>
- </array>
- <key>CFBundleTypeName</key>
- <string>MPEG-4AudioFile</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>m4b</string>
- </array>
- <key>CFBundleTypeOSTypes</key>
- <array>
- </array>
- <key>CFBundleTypeMIMETypes</key>
- <array>
- <string>audio/mp4</string>
- </array>
- <key>CFBundleTypeName</key>
- <string>MPEG-4AudioBookFile</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>wma</string>
- </array>
- <key>CFBundleTypeOSTypes</key>
- <array>
- </array>
- <key>CFBundleTypeMIMETypes</key>
- <array>
- <string>audio/x-ms-wma</string>
- </array>
- <key>CFBundleTypeName</key>
- <string>WindowsMediaAudio</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>m3u</string>
- </array>
- <key>CFBundleTypeOSTypes</key>
- <array>
- </array>
- <key>CFBundleTypeMIMETypes</key>
- <array>
- <string>audio/x-mpegurl</string>
- </array>
- <key>CFBundleTypeName</key>
- <string>M3UAudioPlaylist</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- </array>
- <key>CFBundleURLTypes</key>
- <array>
- <dict>
- <key>CFBundleURLSchemes</key>
- <array>
- <string>amarok</string>
- </array>
- <key>CFBundleTypeOSTypes</key>
- <array>
- </array>
- <key>CFBundleURLName</key>
- <string>org.kde.amarok.amarok-url</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- </dict>
- </array>
-</dict>
-</plist>
+++ /dev/null
-/****************************************************************************************
- * Copyright (c) 2014 Daniel Meltzer <parallelgrapefruit@gmail.com> *
- * Based on Code from the Quassel OS X Backend.
- * *
- * This program is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License as published by the Free Software *
- * Foundation; either version 2 of the License, or (at your option) any later *
- * version. *
- * *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License along with *
- * this program. If not, see <http://www.gnu.org/licenses/>. *
- ****************************************************************************************/
-
-#ifndef AMAROK_MACSYSTEMNOTIFY_H
-#define AMAROK_MACSYSTEMNOTIFY_H
-
-
-
-#include <QObject>
-#include <QString>
-
-#include "core/support/Debug.h"
-#include "core/meta/forward_declarations.h"
-#include "EngineController.h"
-
-class OSXNotify : QObject
-{
- Q_OBJECT
-
- public:
- OSXNotify( QString appName );
-
- protected slots:
- void show( Meta::TrackPtr );
-
- private:
- QString m_appName;
- Meta::TrackPtr m_currentTrack;
-
-};
-
-#endif
-
+++ /dev/null
-/****************************************************************************************
- * Copyright (c) 2014 Daniel Meltzer <parallelgrapefruit@gmail.com *
- * *
- * This program is free software; you can redistribute it and/or modify it under *
- * the terms of the GNU General Public License as published by the Free Software *
- * Foundation; either version 2 of the License, or (at your option) any later *
- * version. *
- * *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY *
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
- * PARTICULAR PURPOSE. See the GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License along with *
- * this program. If not, see <http://www.gnu.org/licenses/>. *
- ****************************************************************************************/
-
-#include "MacSystemNotify.h"
-
-#include "amarokconfig.h"
-#include "App.h"
-#include "CoverManager/CoverCache.h"
-#include "core/support/Debug.h"
-#include "EngineController.h"
-#include "core/meta/Meta.h"
-#include "core/meta/support/MetaUtility.h" // for secToPrettyTime
-#include "SvgHandler.h"
-#include "TrayIcon.h"
-
-#import <Foundation/NSUserNotification.h>
-#import <ApplicationServices/ApplicationServices.h>
-
-namespace {
- void SendNotifactionCenterMessage(NSString* title, NSString* subtitle, NSString *informativeText, NSImage *image)
- {
- NSUserNotificationCenter* center =
- [NSUserNotificationCenter defaultUserNotificationCenter];
- NSUserNotification *notification =
- [[NSUserNotification alloc] init];
-
- [center removeAllDeliveredNotifications]; // Clear the previous one before sending another
- [notification setTitle: title];
- [notification setSubtitle: subtitle];
- [notification setInformativeText: informativeText];
- [notification setContentImage: image];
-
- [center deliverNotification: notification];
-
- [notification release];
- }
-}
-
-OSXNotify::OSXNotify(QString appName): QObject()
- , m_appName( appName )
-{
- EngineController *engine = The::engineController();
-
- connect( engine, SIGNAL(trackChanged(Meta::TrackPtr)),
- this, SLOT(show(Meta::TrackPtr)) );
-}
-
-void
-OSXNotify::show( Meta::TrackPtr track )
-{
- DEBUG_BLOCK
- QString text;
- QString albumString;
- QString artistString;
- QPixmap albumImage;
- if( !track || track->playableUrl().isEmpty() )
- text = i18n( "No track playing" );
- else
- {
- text = track->prettyName();
- if( track->artist() && !track->artist()->prettyName().isEmpty() )
- artistString = track->artist()->prettyName();
- if( track->album() && !track->album()->prettyName().isEmpty() )
- albumString = track->album()->prettyName();
- if( track->length() > 0 )
- {
- text += " (";
- text += Meta::msToPrettyTime( track->length() );
- text += ')';
- }
-
- if( text.isEmpty() )
- text = track->playableUrl().fileName();
-
- albumImage = The::coverCache()->getCover( track->album(), 100 );
- }
-
- if( text.startsWith( "- " ) ) //When we only have a title tag, _something_ prepends a fucking hyphen. Remove that.
- text = text.mid( 2 );
-
- if( text.isEmpty() ) //still
- text = i18n("No information available for this track");
-
- NSImage *nImage = 0;
- if( !albumImage.isNull() )
- {
- CGImageRef cgImage = albumImage.toMacCGImageRef();
- nImage = [[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize];
- CFRelease(cgImage);
- }
- if( artistString.isEmpty() )
- artistString = i18n( "Unknown" );
- if( albumString.isEmpty() )
- albumString = i18n( "Unknown" );
- NSString *title =[[NSString alloc] initWithUTF8String: artistString.toUtf8().constData() ];
- NSString *subTitle = [[NSString alloc] initWithUTF8String: albumString.toUtf8().constData() ];
- NSString *songTitle = [[NSString alloc] initWithUTF8String: text.toUtf8().constData() ];
- SendNotifactionCenterMessage( songTitle, title, subTitle, nImage );
-}