00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef KARTSCONFIG_H
00027 #define KARTSCONFIG_H
00028
00029 #include <kapplication.h>
00030
00031 #include <tqbuttongroup.h>
00032 #include <tqcheckbox.h>
00033 #include <tqlabel.h>
00034 #include <tqlineedit.h>
00035 #include <tqradiobutton.h>
00036 #include <tqtimer.h>
00037
00038 #include <kcmodule.h>
00039 #include <knuminput.h>
00040 #include <kprogress.h>
00041
00042 #include "generaltab.h"
00043 #include "hardwaretab.h"
00044
00045
00046 class KProcess;
00047 class DeviceManager;
00048
00049 class KArtsModule : public KCModule
00050 {
00051 Q_OBJECT
00052
00053 public:
00054
00055 KArtsModule(TQWidget *parent=0, const char *name=0);
00056 ~KArtsModule();
00057 void saveParams( void );
00058
00059 void load();
00060 void load( bool useDefaults );
00061 void save();
00062 void defaults();
00063
00064 bool artsdIsRunning();
00065
00066 private slots:
00067
00068 void slotChanged();
00069 void slotTestSound();
00070 void slotArtsdExited(KProcess* proc);
00071 void slotProcessArtsdOutput(KProcess* p, char* buf, int len);
00072
00073
00074 private:
00075
00076 void updateWidgets ();
00077 void calculateLatency();
00078 TQString createArgs(bool netTrans,bool duplex, int fragmentCount,
00079 int fragmentSize,
00080 const TQString &deviceName,
00081 int rate, int bits, const TQString &audioIO,
00082 const TQString &addOptions, bool autoSuspend,
00083 int suspendTime);
00084 int userSavedChanges();
00085
00086 TQCheckBox *startServer, *startRealtime, *networkTransparent,
00087 *fullDuplex, *customDevice, *customRate, *autoSuspend;
00088 TQLineEdit *deviceName;
00089 TQSpinBox *samplingRate;
00090 KIntNumInput *suspendTime;
00091 generalTab *general;
00092 hardwareTab *hardware;
00093 KConfig *config;
00094 DeviceManager *deviceManager;
00095 int latestProcessStatus;
00096 int fragmentCount;
00097 int fragmentSize;
00098 bool configChanged;
00099 bool realtimePossible;
00100
00101 class AudioIOElement {
00102 public:
00103 AudioIOElement(const TQString &name, const TQString &fullName)
00104 : name(name), fullName(fullName) {;}
00105 TQString name;
00106 TQString fullName;
00107 };
00108
00109 void initAudioIOList();
00110 TQPtrList<AudioIOElement> audioIOList;
00111
00112 void restartServer();
00113 bool realtimeIsPossible();
00114 };
00115
00116
00117 class KStartArtsProgressDialog : public KProgressDialog
00118 {
00119 Q_OBJECT
00120 public:
00121 KStartArtsProgressDialog(KArtsModule *parent, const char *name,
00122 const TQString &caption, const TQString &text);
00123 public slots:
00124 void slotProgress();
00125 void slotFinished();
00126
00127 private:
00128 TQTimer m_timer;
00129 int m_timeStep;
00130 KArtsModule *m_module;
00131 bool m_shutdown;
00132 };
00133
00134 #endif
00135