summaryrefslogtreecommitdiffstats
path: root/krec/krecord_private.h
blob: 3be786c360ad8705334664a1383d018dcf4e97d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/***************************************************************************
    begin                : Mon Jun 17 2002
    copyright            : (C) 2002 by Arnold Krille
    email                : [email protected]
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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; version 2 of the License.               *
 *                                                                         *
 ***************************************************************************/

#ifndef KRECORD_PRIVATE_H
#define KRECORD_PRIVATE_H

#include <tqobject.h>

#include <kartsserver.h>
#include <kartsdispatcher.h>
#include <artsflow.h>
#include <artsgui.h>
#include <kartswidget.h>
#include <kurl.h>
#include <tqlayout.h>

#include "krecfileview.h"

class KRecord;
class KRecMainWidget;
class KRecFile;
class KRecExportItem;

class KAudioRecordStream;
class KAudioPlayStream;
class TDEConfig;
class ArtsActions;
class TDEAction;
class TDEActionMenu;
class TDEToggleAction;
class TDERecentFilesAction;

namespace KSettings { class Dialog; }

class KRecPrivate : public TQObject  {
   TQ_OBJECT
  
public:
	/// Constructor
	KRecPrivate( KRecord*, const char* =0 );
	/// Destructor
	~KRecPrivate();
public slots:
/*	/// Does nothing.
	void nothing() { }
	/// Starts Recording.
	void startRec();
	/// Starts Playback.
	void startPlay();
	/// ByteStreamSender informs of his playing.
	void playIsRunning() { playing=true; checkActions(); }
	/// ByteStreamSender informs of his playing.
	void playStops() { playing=false; checkActions(); }
	/// Stops Recording.
	void stopRec();

	/// If we can play or not.
	void canPlay( bool b ) { _canplay = b; checkActions(); }
	/// If we can record or not.
	void canRecord( bool b ) { _canrecord = b; checkActions(); }
*/

//	void startUpWindow( bool on );

	void showConfDialog();

	/// Checks all the Actions and sets Enabled/Disabled.
	void checkActions();

	/// Enables Play-thru from the AMAN_RECORD to the AMAN_PLAY.
	void playthru( bool );

	void newFile();
	void openFile();
	void saveFile();
	void saveAsFile();
	bool closeFile();
	void exportFile();
	void endExportFile();
	void endExportFile2();

	void toBegin();
	void toEnd();

	void forceTipOfDay();
	void execaRtsControl();
	void execKMix();
private:
	void pNewFile( KRecFile* );
	void pSaveFile( const TQString &);
public:
	TDEAction *aRecord, *aPlay, *aStop, *aExportFile;
	TDEAction *aBegin, *aEnd;
	TDEToggleAction *aThru, *aStartUpWindow;
	TDEAction *aExecaRtsControl, *aExecKMix;

	KSettings::Dialog *_confdlg;

	KArtsServer *server;
	KArtsDispatcher *dispatcher;
	KAudioPlayStream *m_playStream;
	KAudioRecordStream * m_recStream;

	Arts::StereoVolumeControl volumecontrol;
	Arts::StereoEffect comp;
	KArtsWidget *w;
	long vc_id, comp_id;
	ArtsActions *artsactions;

	bool b_arts, b_comp;

	KRecord *_impl;
	KRecMainWidget *mainwidget;

	KRecFile *_currentFile;

	KRecExportItem *_exportitem;
};

class KRecMainWidget : public TQWidget {
   TQ_OBJECT
  
public:
	KRecMainWidget( TQWidget* p, const char* n=0 ) : TQWidget( p,n ) {
		_layout = new TQBoxLayout( this, TQBoxLayout::LeftToRight, 2 );
		_kaw_volumecontrol = new KArtsWidget( this );
		_layout->addWidget( _kaw_volumecontrol, 0 );
		_fileview = new KRecFileView( this );
		_layout->addWidget( _fileview, 500 );
	}
	TQBoxLayout *_layout;
	KArtsWidget *_kaw_volumecontrol;
	Arts::Widget _artswidget;
	KRecFileView *_fileview;
};

#endif