From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- arts/tools/artsactions.cpp | 191 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 arts/tools/artsactions.cpp (limited to 'arts/tools/artsactions.cpp') diff --git a/arts/tools/artsactions.cpp b/arts/tools/artsactions.cpp new file mode 100644 index 00000000..b75de027 --- /dev/null +++ b/arts/tools/artsactions.cpp @@ -0,0 +1,191 @@ +/* + + Copyright (C) 2003 Arnold Krille + + 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + */ + +#include "artsactions.h" + +#include +#include +#include +#include +#include +//#include + +#include + +#include "fftscopeview.h" +#include "audiomanager.h" +#include "statusview.h" +#include "midimanagerview.h" +#include "environmentview.h" +#include "mediatypesview.h" + +ArtsActions::ArtsActions( KArtsServer* server, KActionCollection* col, QWidget* parent, const char* name ) + : QObject( parent,name ) + , _kartsserver( server ) + , _actioncollection( col ) + , _a_sv( 0 ), _a_am( 0 ), _a_asv( 0 ), _a_mmv( 0 ), _a_ev( 0 ), _a_mtv( 0 ) +// , _a_morebars( 0 ), _a_lessbars( 0 ) + , _a_style_normal( 0 ), _a_style_fire( 0 ), _a_style_line( 0 ), _a_style_led( 0 ), _a_style_analog( 0 ), _a_style_small( 0 ) + , _stylemenu( 0 ) + , _sv( 0 ), _am( 0 ), _asv( 0 ), _mmv( 0 ), _ev( 0 ), _mtv( 0 ) +{ + //kdDebug()<insertCatalogue( "artscontrol" ); + if ( !_kartsserver ) _kartsserver = new KArtsServer( this ); +} + +ArtsActions::~ArtsActions() { + //kdDebug()<plug( _stylemenu ); + tmp = actionStyleFire(); tmp->plug( _stylemenu ); + tmp = actionStyleLine(); tmp->plug( _stylemenu ); + tmp = actionStyleLED(); tmp->plug( _stylemenu ); + tmp = actionStyleAnalog(); tmp->plug( _stylemenu ); + tmp = actionStyleSmall(); tmp->plug( _stylemenu ); + } + return _stylemenu; +} + +KAction* ArtsActions::actionMoreBars( const QObject* receiver, const char* slot, KActionCollection *actioncollection ) { + static KAction *_a_morebars = new KAction( i18n( "More Bars in VU-Meters" ), "up", KShortcut(), receiver, slot, actioncollection, "artssupport_morebars" ); + return _a_morebars; +} +KAction* ArtsActions::actionLessBars( const QObject* receiver, const char* slot, KActionCollection *actioncollection ) { + static KAction *_a_lessbars = new KAction( i18n( "Less Bars in VU-Meters" ), "down", KShortcut(), receiver, slot, actioncollection, "artssupport_lessbars" ); + return _a_lessbars; +} + +void ArtsActions::viewScopeView() { + if ( !_sv ) { + _sv = new FFTScopeView( _kartsserver->server() ); + connect( _sv, SIGNAL( closed() ), this, SLOT( viewScopeView() ) ); + } else { + delete _sv; + _sv = 0; + } +} +void ArtsActions::viewAudioManager() { + if ( !_am ) { + _am = new Gui_AUDIO_MANAGER(); + connect( _am, SIGNAL( closed() ), this, SLOT( viewAudioManager() ) ); + } else { + delete _am; + _am = 0; + } +} +void ArtsActions::viewArtsStatusView() { + if ( !_asv ) { + _asv = new ArtsStatusView( _kartsserver->server() ); + connect( _asv, SIGNAL( closed() ), this, SLOT( viewArtsStatusView() ) ); + } else { + delete _asv; + _asv = 0; + } +} +void ArtsActions::viewMidiManagerView() { + if ( !_mmv ) { + _mmv = new MidiManagerView(); + connect( _mmv, SIGNAL( closed() ), this, SLOT( viewMidiManagerView() ) ); + } else { + delete _mmv; + _mmv = 0; + } +} +void ArtsActions::viewEnvironmentView() { + if ( !_ev ) { + _ev = new EnvironmentView( defaultEnvironment() ); + connect( _ev, SIGNAL( closed() ), this, SLOT( viewEnvironmentView() ) ); + } else { + delete _ev; + _ev = 0; + } +} +void ArtsActions::viewMediaTypesView() { + if ( !_mtv ) { + _mtv = new MediaTypesView(); + connect( _mtv, SIGNAL( closed() ), this, SLOT( viewMediaTypesView() ) ); + } else { + delete _mtv; + _mtv = 0; + } +} + +#include "artsactions.moc" -- cgit v1.2.3