From 5159cd2beb2e87806a5b54e9991b7895285c9d3e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 01:04:16 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- interfaces/tdemediaplayer/CMakeLists.txt | 2 +- interfaces/tdemediaplayer/Makefile.am | 4 +- .../kfileaudiopreview/CMakeLists.txt | 46 ------- .../tdemediaplayer/kfileaudiopreview/Makefile.am | 13 -- .../kfileaudiopreview/kfileaudiopreview.cpp | 146 --------------------- .../kfileaudiopreview/kfileaudiopreview.h | 64 --------- .../tdefileaudiopreview/CMakeLists.txt | 46 +++++++ .../tdemediaplayer/tdefileaudiopreview/Makefile.am | 13 ++ .../tdefileaudiopreview/tdefileaudiopreview.cpp | 146 +++++++++++++++++++++ .../tdefileaudiopreview/tdefileaudiopreview.h | 64 +++++++++ 10 files changed, 272 insertions(+), 272 deletions(-) delete mode 100644 interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt delete mode 100644 interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am delete mode 100644 interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp delete mode 100644 interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h create mode 100644 interfaces/tdemediaplayer/tdefileaudiopreview/CMakeLists.txt create mode 100644 interfaces/tdemediaplayer/tdefileaudiopreview/Makefile.am create mode 100644 interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp create mode 100644 interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.h (limited to 'interfaces/tdemediaplayer') diff --git a/interfaces/tdemediaplayer/CMakeLists.txt b/interfaces/tdemediaplayer/CMakeLists.txt index 00ab7f3d9..0c9355560 100644 --- a/interfaces/tdemediaplayer/CMakeLists.txt +++ b/interfaces/tdemediaplayer/CMakeLists.txt @@ -10,7 +10,7 @@ ################################################# if( ARTS_FOUND ) - add_subdirectory( kfileaudiopreview ) + add_subdirectory( tdefileaudiopreview ) endif( ARTS_FOUND ) include_directories( diff --git a/interfaces/tdemediaplayer/Makefile.am b/interfaces/tdemediaplayer/Makefile.am index 0b7aded07..91ed342bd 100644 --- a/interfaces/tdemediaplayer/Makefile.am +++ b/interfaces/tdemediaplayer/Makefile.am @@ -1,8 +1,8 @@ if include_ARTS -kfileaudiopreview_subdir = kfileaudiopreview +tdefileaudiopreview_subdir = tdefileaudiopreview endif -SUBDIRS = . $(kfileaudiopreview_subdir) +SUBDIRS = . $(tdefileaudiopreview_subdir) INCLUDES = -I$(srcdir)/.. $(all_includes) lib_LTLIBRARIES = libtdemediaplayer.la diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt b/interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt deleted file mode 100644 index 17485b65a..000000000 --- a/interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${ARTS_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/interfaces - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kio/kfile - ${CMAKE_SOURCE_DIR}/arts/kde -) - -link_directories( - ${TQT_LIBRARY_DIRS} - ${ARTS_LIBRARY_DIRS} -) - - -##### kfileaudiopreview ######################### - -set( target kfileaudiopreview ) - -set( ${target}_SRCS - kfileaudiopreview.cpp -) - -tde_add_kpart( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK tdemediaplayer-shared artskde-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am b/interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am deleted file mode 100644 index 4f88a0c87..000000000 --- a/interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -INCLUDES = -I$(top_srcdir)/interfaces/ -I$(top_srcdir)/arts/kde -I$(includedir)/arts $(all_includes) -METASOURCES = AUTO - -kde_module_LTLIBRARIES = kfileaudiopreview.la - -kfileaudiopreview_la_SOURCES = kfileaudiopreview.cpp -kfileaudiopreview_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version -no-undefined -kfileaudiopreview_la_LIBADD = $(top_builddir)/interfaces/tdemediaplayer/libtdemediaplayer.la $(top_builddir)/arts/kde/libartskde.la $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) - -noinst_HEADERS = kfileaudiopreview.h - -messages: - $(XGETTEXT) $(kfileaudiopreview_la_SOURCES) -o $(podir)/kfileaudiopreview.pot diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp b/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp deleted file mode 100644 index 1d83fc590..000000000 --- a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include "kfileaudiopreview.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -class KFileAudioPreviewFactory : public KLibFactory -{ -protected: - virtual TQObject *createObject( TQObject *parent, const char *name, - const char *className, const TQStringList & args) - { - Q_UNUSED(className); - Q_UNUSED(args); - return TQT_TQOBJECT(new KFileAudioPreview( dynamic_cast( parent ), name )); - } -}; - -K_EXPORT_COMPONENT_FACTORY( kfileaudiopreview, KFileAudioPreviewFactory ) - - -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - - -class KFileAudioPreview::KFileAudioPreviewPrivate -{ -public: - KFileAudioPreviewPrivate( TQWidget *parent ) - { - player = KParts::ComponentFactory::createInstanceFromQuery( "KMediaPlayer/Player", TQString(), TQT_TQOBJECT(parent) ); - } - - ~KFileAudioPreviewPrivate() - { - delete player; - } - - KMediaPlayer::Player *player; -}; - - -KFileAudioPreview::KFileAudioPreview( TQWidget *parent, const char *name ) - : KPreviewWidgetBase( parent, name ) -{ - TDEGlobal::locale()->insertCatalogue("kfileaudiopreview"); - - TQStringList formats = KDE::PlayObjectFactory::mimeTypes(); - // ### - TQStringList::ConstIterator it = formats.begin(); - for ( ; it != formats.end(); ++it ) - m_supportedFormats.insert( *it, (void*) 1 ); - - TQVGroupBox *box = new TQVGroupBox( i18n("Media Player"), this ); - TQVBoxLayout *layout = new TQVBoxLayout( this ); - layout->addWidget( box ); - - (void) new TQWidget( box ); // spacer - - d = new KFileAudioPreviewPrivate( 0L ); // not box -- being reparented anyway - if ( d->player ) // only if there actually is a component... - { - setSupportedMimeTypes( formats ); - KMediaPlayer::View *view = d->player->view(); - view->setEnabled( false ); - - // if we have access to the video widget, show it above the player - // So, reparent first the video widget, then the view. - if ( view->videoWidget() ) - { - TQHBox *frame = new TQHBox( box ); - frame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - frame->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); - view->videoWidget()->reparent( frame, TQPoint(0,0) ); - } - - view->reparent( box, TQPoint(0,0) ); - } - - m_autoPlay = new TQCheckBox( i18n("Play &automatically"), box ); - TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); - m_autoPlay->setChecked( config.readBoolEntry( "Autoplay sounds", true ) ); - connect( m_autoPlay, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggleAuto(bool)) ); -} - -KFileAudioPreview::~KFileAudioPreview() -{ - TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); - config.writeEntry( "Autoplay sounds", m_autoPlay->isChecked() ); - - delete d; -} - -void KFileAudioPreview::showPreview( const KURL &url ) -{ - if ( !d->player || !url.isValid() ) - return; - - KMimeType::Ptr mt = KMimeType::findByURL( url ); - bool supported = m_supportedFormats.find( mt->name() ); - d->player->view()->setEnabled( supported ); - if ( !supported ) - return; - - static_cast(d->player)->openURL( url ); - if ( m_autoPlay->isChecked() ) - d->player->play(); -} - -void KFileAudioPreview::clearPreview() -{ - if ( d->player ) - { - d->player->stop(); - d->player->closeURL(); - } -} - -void KFileAudioPreview::toggleAuto( bool on ) -{ - if ( !d->player ) - return; - - if ( on && m_currentURL.isValid() && d->player->view()->isEnabled() ) - d->player->play(); - else - d->player->stop(); -} - -void KFileAudioPreview::virtual_hook( int, void* ) -{} - -#include "kfileaudiopreview.moc" diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h b/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h deleted file mode 100644 index de48e4712..000000000 --- a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h +++ /dev/null @@ -1,64 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2003 Carsten Pfeiffer - - library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation, version 2. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KFILEAUDIOPREVIEW_H -#define KFILEAUDIOPREVIEW_H - -#include - -#include -#include - -class TQCheckBox; -class TQPushButton; -class TQLabel; - -class KFileDialog; -class KFileItem; - -/** - * Audio "preview" widget for the file dialog. - */ -class KFileAudioPreview : public KPreviewWidgetBase -{ - Q_OBJECT - -public: - KFileAudioPreview(TQWidget *parent = 0, const char *name = 0 ); - ~KFileAudioPreview(); - -public slots: - virtual void showPreview(const KURL &url); - virtual void clearPreview(); - -private slots: - void toggleAuto(bool); - -private: - TQDict m_supportedFormats; - KURL m_currentURL; - TQCheckBox *m_autoPlay; - -protected: - virtual void virtual_hook( int id, void* data ); -private: - class KFileAudioPreviewPrivate; - KFileAudioPreviewPrivate *d; -}; - -#endif // KFILEAUDIOPREVIEW_H diff --git a/interfaces/tdemediaplayer/tdefileaudiopreview/CMakeLists.txt b/interfaces/tdemediaplayer/tdefileaudiopreview/CMakeLists.txt new file mode 100644 index 000000000..8e561e1f3 --- /dev/null +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/CMakeLists.txt @@ -0,0 +1,46 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${ARTS_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/interfaces + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile + ${CMAKE_SOURCE_DIR}/arts/kde +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${ARTS_LIBRARY_DIRS} +) + + +##### tdefileaudiopreview ######################### + +set( target tdefileaudiopreview ) + +set( ${target}_SRCS + tdefileaudiopreview.cpp +) + +tde_add_kpart( ${target} AUTOMOC + SOURCES ${${target}_SRCS} + LINK tdemediaplayer-shared artskde-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/interfaces/tdemediaplayer/tdefileaudiopreview/Makefile.am b/interfaces/tdemediaplayer/tdefileaudiopreview/Makefile.am new file mode 100644 index 000000000..d73cf545f --- /dev/null +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/Makefile.am @@ -0,0 +1,13 @@ +INCLUDES = -I$(top_srcdir)/interfaces/ -I$(top_srcdir)/arts/kde -I$(includedir)/arts $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = tdefileaudiopreview.la + +tdefileaudiopreview_la_SOURCES = tdefileaudiopreview.cpp +tdefileaudiopreview_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version -no-undefined +tdefileaudiopreview_la_LIBADD = $(top_builddir)/interfaces/tdemediaplayer/libtdemediaplayer.la $(top_builddir)/arts/kde/libartskde.la $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) + +noinst_HEADERS = tdefileaudiopreview.h + +messages: + $(XGETTEXT) $(tdefileaudiopreview_la_SOURCES) -o $(podir)/tdefileaudiopreview.pot diff --git a/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp new file mode 100644 index 000000000..7dd746c4f --- /dev/null +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp @@ -0,0 +1,146 @@ +#include "tdefileaudiopreview.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +class KFileAudioPreviewFactory : public KLibFactory +{ +protected: + virtual TQObject *createObject( TQObject *parent, const char *name, + const char *className, const TQStringList & args) + { + Q_UNUSED(className); + Q_UNUSED(args); + return TQT_TQOBJECT(new KFileAudioPreview( dynamic_cast( parent ), name )); + } +}; + +K_EXPORT_COMPONENT_FACTORY( tdefileaudiopreview, KFileAudioPreviewFactory ) + + +/////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////// + + +class KFileAudioPreview::KFileAudioPreviewPrivate +{ +public: + KFileAudioPreviewPrivate( TQWidget *parent ) + { + player = KParts::ComponentFactory::createInstanceFromQuery( "KMediaPlayer/Player", TQString(), TQT_TQOBJECT(parent) ); + } + + ~KFileAudioPreviewPrivate() + { + delete player; + } + + KMediaPlayer::Player *player; +}; + + +KFileAudioPreview::KFileAudioPreview( TQWidget *parent, const char *name ) + : KPreviewWidgetBase( parent, name ) +{ + TDEGlobal::locale()->insertCatalogue("tdefileaudiopreview"); + + TQStringList formats = KDE::PlayObjectFactory::mimeTypes(); + // ### + TQStringList::ConstIterator it = formats.begin(); + for ( ; it != formats.end(); ++it ) + m_supportedFormats.insert( *it, (void*) 1 ); + + TQVGroupBox *box = new TQVGroupBox( i18n("Media Player"), this ); + TQVBoxLayout *layout = new TQVBoxLayout( this ); + layout->addWidget( box ); + + (void) new TQWidget( box ); // spacer + + d = new KFileAudioPreviewPrivate( 0L ); // not box -- being reparented anyway + if ( d->player ) // only if there actually is a component... + { + setSupportedMimeTypes( formats ); + KMediaPlayer::View *view = d->player->view(); + view->setEnabled( false ); + + // if we have access to the video widget, show it above the player + // So, reparent first the video widget, then the view. + if ( view->videoWidget() ) + { + TQHBox *frame = new TQHBox( box ); + frame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); + frame->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); + view->videoWidget()->reparent( frame, TQPoint(0,0) ); + } + + view->reparent( box, TQPoint(0,0) ); + } + + m_autoPlay = new TQCheckBox( i18n("Play &automatically"), box ); + TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); + m_autoPlay->setChecked( config.readBoolEntry( "Autoplay sounds", true ) ); + connect( m_autoPlay, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggleAuto(bool)) ); +} + +KFileAudioPreview::~KFileAudioPreview() +{ + TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); + config.writeEntry( "Autoplay sounds", m_autoPlay->isChecked() ); + + delete d; +} + +void KFileAudioPreview::showPreview( const KURL &url ) +{ + if ( !d->player || !url.isValid() ) + return; + + KMimeType::Ptr mt = KMimeType::findByURL( url ); + bool supported = m_supportedFormats.find( mt->name() ); + d->player->view()->setEnabled( supported ); + if ( !supported ) + return; + + static_cast(d->player)->openURL( url ); + if ( m_autoPlay->isChecked() ) + d->player->play(); +} + +void KFileAudioPreview::clearPreview() +{ + if ( d->player ) + { + d->player->stop(); + d->player->closeURL(); + } +} + +void KFileAudioPreview::toggleAuto( bool on ) +{ + if ( !d->player ) + return; + + if ( on && m_currentURL.isValid() && d->player->view()->isEnabled() ) + d->player->play(); + else + d->player->stop(); +} + +void KFileAudioPreview::virtual_hook( int, void* ) +{} + +#include "tdefileaudiopreview.moc" diff --git a/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.h b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.h new file mode 100644 index 000000000..de48e4712 --- /dev/null +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.h @@ -0,0 +1,64 @@ +/* This file is part of the KDE libraries + Copyright (C) 2003 Carsten Pfeiffer + + library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation, version 2. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KFILEAUDIOPREVIEW_H +#define KFILEAUDIOPREVIEW_H + +#include + +#include +#include + +class TQCheckBox; +class TQPushButton; +class TQLabel; + +class KFileDialog; +class KFileItem; + +/** + * Audio "preview" widget for the file dialog. + */ +class KFileAudioPreview : public KPreviewWidgetBase +{ + Q_OBJECT + +public: + KFileAudioPreview(TQWidget *parent = 0, const char *name = 0 ); + ~KFileAudioPreview(); + +public slots: + virtual void showPreview(const KURL &url); + virtual void clearPreview(); + +private slots: + void toggleAuto(bool); + +private: + TQDict m_supportedFormats; + KURL m_currentURL; + TQCheckBox *m_autoPlay; + +protected: + virtual void virtual_hook( int id, void* data ); +private: + class KFileAudioPreviewPrivate; + KFileAudioPreviewPrivate *d; +}; + +#endif // KFILEAUDIOPREVIEW_H -- cgit v1.2.1