1
/***************************************************************************
2
setup.cpp - description
5
copyright : (C) 2000 by Volker Schroer
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* based on the work of Moe Wheatly, AE4JY *
16
***************************************************************************/
19
extern bool checkcom(char *s);
20
extern int getVolume(int Device);
21
extern int getOutputVolume();
23
Setup::Setup(QWidget *parent, const char *name) : FSetup(parent,name,TRUE)
28
demoMode=settings.DemoMode;
29
DemoMode->setChecked(demoMode);
32
DemoInputMode->show();
33
DemoInputMode->setButton(settings.DemoTypeNumber);
36
DemoInputMode->hide();
40
UserCallSign->setText(settings.callsign);
43
SendFile->setText(settings.StationFile);
46
TimeOffset->setText(s.setNum(settings.timeoffset));
49
ButtonName->setText(settings.ButtonName);
51
// Corresponding ButtonFile
52
ButtonFile->setText(settings.ButtonFile);
53
// Input Source (Ugly coding)
54
if (settings.InputSource == SOUND_MIXER_MIC)
55
InputSelect->setButton(0);
56
if (settings.InputSource == SOUND_MIXER_LINE)
57
InputSelect->setButton(1);
58
InputSource = settings.InputSource;
59
setInputSource(InputSource);
62
level = getVolume(settings.InputSource);
63
InputLevel->setValue(level);
66
OutputLevel->setValue(getOutputVolume());
69
slashed0=settings.slashed0;
70
slashedZero->setChecked(slashed0);
74
if(!checkcom("/dev/ttyS0"))
78
if(!checkcom("/dev/ttyS1"))
81
if(!checkcom("/dev/ttyS2"))
85
if(!checkcom("/dev/ttyS3"))
88
PTTControl->setButton(ptt);
90
// Number of receive windows
91
RxChannels->setValue(settings.RxChannels);
98
/** Sets the Demomode on or off */
99
void Setup::setDemoMode(bool mode)
105
void Setup::setComPort(int port)
110
void Setup::setSlashed0(bool zero)
116
void Setup::setInputLevel(int SelectedLevel)
120
setVolume(InputSource,level);
124
void Setup::setOutputLevel(int level)
127
setOutputVolume(level);
129
/** Activates/Deactivates the SubWindow for the different Demo's */
130
void Setup::activateTypeWindow(bool type)
134
DemoInputMode->show();
139
DemoInputMode->hide();
143
/** Selects the type of the input file
145
2 text , sample rate 11025 */
146
void Setup::selectDemoType(int type)
148
DemoTypeNumber = type;
152
void Setup::selectInput(int source)
156
setInputSource(SOUND_MIXER_MIC);
157
InputSource=SOUND_MIXER_MIC;
161
setInputSource(SOUND_MIXER_LINE);
162
InputSource=SOUND_MIXER_LINE;
165
setInputLevel(level);