/***************************************************************************
                          artscontrolapplet_private.h  -  description
                             -------------------
    begin                : Don Jan 30 2003
    copyright            : (C) 2003 by Arnold Krille
    email                : arnold@arnoldarts.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef ARTSCONTROLAPPLET_PRIVATE_H
#define ARTSCONTROLAPPLET_PRIVATE_H

#include "artscontrolapplet.h"

#include <tqobject.h>

#include <tqlayout.h>
#include <tqlabel.h>
#include <tqslider.h>
#include <tqpushbutton.h>
#include <tdepopupmenu.h>
#include <tdeaction.h>
#include <tqfont.h>

#include <kartsserver.h>
#include <kartsdispatcher.h>
#include <kartsfloatwatch.h>
#include <kartswidget.h>
#include <artsflow.h>
#include <connect.h>
#include <artsmoduleseffects.h>
#include <tdelibs_export.h>

#include "artsactions.h"

#include "fftscopeview.h"

class VolumeSlider;

class KDE_EXPORT ArtsControlAppletPrivate : public TQObject {
   TQ_OBJECT
  
private:
	ArtsControlApplet *_parent;
	ArtsActions* _artsactions;
public:
	TQBoxLayout *layout;
	KArtsServer *arts;
	KArtsDispatcher *dispatcher;
	Arts::StereoVolumeControl volume;
	bool barts, bInUpdate;
	FFTScopeView *svinline;

	KArtsWidget *vuw;
	Arts::StereoVolumeControlGui vu;

	TDEPopupMenu *menu;
	TDEAction *_showSV, *_showSVinline, *_showAM, *_showArtsStatus, *_showMidiManager, *_showEnvironment, *_showMediaTypes, *_moreBars, *_lessBars;
	TDEAction *_styleNormalBars, *_styleFireBars, *_styleLineBars, *_styleLEDs, *_styleAnalog, *_styleSmall;

	ArtsControlAppletPrivate( ArtsControlApplet *parent )
	    : TQObject(parent)
	    , _parent( parent )
	    , barts( false )
	    , bInUpdate( false )
	{
		arts = new KArtsServer( 0 );
		dispatcher = new KArtsDispatcher( 0 );
		if( ! arts->server().isNull() ) barts = true;
		if( barts ) volume = arts->server().outVolume();
		svinline=0;

		_artsactions = new ArtsActions( arts, 0, parent );

		menu = new TDEPopupMenu( 0 );
		_showSV = _artsactions->actionScopeView();
		_showSV->plug( menu );
		_showSVinline = new TDEAction( i18n( "Toggle &Inline FFT Scope" ), "artscontrol", TDEShortcut(), this, TQ_SLOT( SVinline() ), this );
		_showSVinline->plug( menu );
		_showAM = _artsactions->actionAudioManager();
		_showAM->plug( menu );
		_showArtsStatus = _artsactions->actionArtsStatusView();
		_showArtsStatus->plug( menu );
		_showMidiManager = _artsactions->actionMidiManagerView();
		_showMidiManager->plug( menu );
		_showEnvironment = _artsactions->actionEnvironmentView();
		_showEnvironment->plug( menu );
		_showMediaTypes = _artsactions->actionMediaTypesView();
		_showMediaTypes->plug( menu );
		menu->insertSeparator();
		menu->insertItem( i18n( "VU-Style" ), _artsactions->stylemenu() );
		connect( _artsactions, TQ_SIGNAL( styleNormal() ), this, TQ_SLOT( styleNormalBars() ) );
		connect( _artsactions, TQ_SIGNAL( styleFire() ), this, TQ_SLOT( styleFireBars() ) );
		connect( _artsactions, TQ_SIGNAL( styleLine() ), this, TQ_SLOT( styleLineBars() ) );
		connect( _artsactions, TQ_SIGNAL( styleLED() ), this, TQ_SLOT( styleLEDs() ) );
		connect( _artsactions, TQ_SIGNAL( styleAnalog() ), this, TQ_SLOT( styleAnalog() ) );
		connect( _artsactions, TQ_SIGNAL( styleSmall() ), this, TQ_SLOT( styleSmall() ) );
	}
	~ArtsControlAppletPrivate() {
		if ( svinline ) SVinline();
	}
public slots:
	void SVinline(); // ScopeView inline
	void moreBars();
	void lessBars();
	void styleNormalBars();
	void styleFireBars();
	void styleLineBars();
	void styleLEDs();
	void styleAnalog();
	void styleSmall();
};
#endif
