00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "mythtv/mythcontext.h"
00015
00016 #include "PhoneSettings.h"
00017 #include <qfile.h>
00018 #include <qdialog.h>
00019 #include <qcursor.h>
00020 #include <qdir.h>
00021 #include <qimage.h>
00022
00023 #include "config.h"
00024
00025
00026
00027
00028
00029 static HostComboBox *WebcamDevice()
00030 {
00031 HostComboBox *gc = new HostComboBox("WebcamDevice", true);
00032 gc->setLabel(QObject::tr("Webcam device"));
00033 QDir dev("/dev", "video*", QDir::Name, QDir::System);
00034 gc->fillSelectionsFromDir(dev);
00035 gc->setHelpText(QObject::tr("Select the device path your webcam is "
00036 "using. If you have a capture card it may be using "
00037 "/dev/video so try dev/video1"));
00038 return gc;
00039 };
00040
00041 static HostComboBox *TxResolution()
00042 {
00043 HostComboBox *gc = new HostComboBox("TxResolution");
00044 gc->setLabel(QObject::tr("Transmit Resolution"));
00045 gc->addSelection("176x144");
00046 gc->addSelection("128x96");
00047 gc->addSelection("704x576");
00048 gc->addSelection("352x288");
00049 gc->setHelpText(QObject::tr("Size of video window to transmit; higher "
00050 "resolutions require more bandwidth."));
00051 return gc;
00052 };
00053
00054 static HostComboBox *CaptureResolution()
00055 {
00056 HostComboBox *gc = new HostComboBox("CaptureResolution");
00057 gc->setLabel(QObject::tr("Capture Resolution"));
00058 gc->addSelection("352x288");
00059 gc->addSelection("320x240");
00060 gc->addSelection("176x144");
00061 gc->addSelection("160x120");
00062 gc->addSelection("128x96");
00063 gc->addSelection("704x576");
00064 gc->addSelection("640x480");
00065 gc->setHelpText(QObject::tr("Size of video source from your webcam. Choose "
00066 "a value compatible with your webcam hardware. Choose "
00067 "higher values to digitally pan/zoom before "
00068 "transmission."));
00069 return gc;
00070 };
00071
00072 static HostSpinBox *TransmitFPS()
00073 {
00074 HostSpinBox *gc = new HostSpinBox("TransmitFPS", 1, 30, 1);
00075 gc->setLabel(QObject::tr("Transmit Frames/Second"));
00076 gc->setValue(5);
00077 gc->setHelpText(QObject::tr("Number of webcam frames/sec to transmit, from "
00078 "1 to 30. Higher numbers create better results but use "
00079 "more bandwidth."));
00080 return gc;
00081 };
00082
00083 static HostLineEdit *TransmitBandwidth()
00084 {
00085 HostLineEdit *gc = new HostLineEdit("TransmitBandwidth");
00086 gc->setLabel(QObject::tr("Max Transmit Bandwidth Kbps"));
00087 gc->setValue("256");
00088 gc->setHelpText(QObject::tr("Enter the upspeed bandwidth of your local WAN in Kbps. "));
00089 return gc;
00090 };
00091
00092
00093
00094
00095
00096 static HostSpinBox *TimeToAnswer()
00097 {
00098 HostSpinBox *gc = new HostSpinBox("TimeToAnswer", 0, 30, 1);
00099 gc->setLabel(QObject::tr("Time to Answer"));
00100 gc->setValue(10);
00101 gc->setHelpText(QObject::tr("The time in seconds a call rings before being "
00102 "automatically answered and diverted to a VXML script."
00103 " Set to 0 to disable this feature."));
00104 return gc;
00105 };
00106
00107 static HostLineEdit *DefaultVxmlUrl()
00108 {
00109 HostLineEdit *gc = new HostLineEdit("DefaultVxmlUrl");
00110 gc->setLabel(QObject::tr("Default VXML URL"));
00111 gc->setValue("http://127.0.0.1/vxml/index.vxml");
00112 gc->setHelpText(QObject::tr("The URL to retrieve a VXML script which can "
00113 "be used to prompt for leaving a voicemail etc. Leave "
00114 "blank if you have no HTTP server and a default Voicemail "
00115 "script will be used."));
00116 return gc;
00117 };
00118
00119 static HostLineEdit *DefaultVoicemailPrompt()
00120 {
00121 HostLineEdit *gc = new HostLineEdit("DefaultVoicemailPrompt");
00122 gc->setLabel(QObject::tr("Default Voicemail Prompt"));
00123 gc->setValue(QObject::tr("I am not at home, please leave a message after "
00124 "the tone"));
00125 gc->setHelpText(QObject::tr("Either a text message to be read by the TTS "
00126 "engine or the filename of a .wav file to be played to "
00127 "callers. Only used where the above setting is blank."));
00128 return gc;
00129 };
00130
00131 static HostComboBox *TTSVoice()
00132 {
00133 HostComboBox *gc = new HostComboBox("TTSVoice", true);
00134 gc->setLabel(QObject::tr("Text to Speech Voice"));
00135 #ifdef FESTIVAL_SUPPORT
00136 QDir festDir(FESTIVAL_HOME "lib/voices/english/",
00137 "[a-z]*;[A-Z]*", QDir::Name, QDir::Dirs);
00138
00139 gc->fillSelectionsFromDir(festDir, false);
00140
00141 festDir = QDir("/usr/share/festival/voices/english/",
00142 "[a-z]*;[A-Z]*", QDir::Name, QDir::Dirs);
00143
00144 gc->fillSelectionsFromDir(festDir, false);
00145 #endif
00146 gc->setHelpText(QObject::tr("Choose a voice to use from the Text To Speech "
00147 "library. "));
00148 return gc;
00149 };
00150
00151
00152
00153
00154 static HostCheckBox *SipRegisterWithProxy()
00155 {
00156 HostCheckBox *gc = new HostCheckBox("SipRegisterWithProxy");
00157 gc->setLabel(QObject::tr("Login to a SIP Server"));
00158 gc->setValue(true);
00159 gc->setHelpText(QObject::tr("Allows you to register with services such as "
00160 "Free World Dialup; or with applications like Asterisk. "
00161 "Restart mythfrontend if you change this."));
00162 return gc;
00163 };
00164
00165 static HostLineEdit *SipProxyName()
00166 {
00167 HostLineEdit *gc = new HostLineEdit("SipProxyName");
00168 gc->setLabel(QObject::tr("SIP Server DNS Name"));
00169 gc->setValue("fwd.pulver.com");
00170 gc->setHelpText(QObject::tr("Name of the Proxy, such as fwd.pulver.com for "
00171 "Free World Dialup."));
00172 return gc;
00173 };
00174
00175 static HostLineEdit *SipProxyAuthName()
00176 {
00177 HostLineEdit *gc = new HostLineEdit("SipProxyAuthName");
00178 gc->setLabel(QObject::tr("Sign-in Name"));
00179 gc->setValue("");
00180 gc->setHelpText(QObject::tr("Your username for authentication with the "
00181 "SIP Server. For FWD this is your FWD number."));
00182 return gc;
00183 };
00184
00185 static HostLineEdit *SipProxyAuthPassword()
00186 {
00187 HostLineEdit *gc = new HostLineEdit("SipProxyAuthPassword");
00188 gc->setLabel(QObject::tr("Password"));
00189 gc->setValue("");
00190 gc->setHelpText(QObject::tr("Your password for authentication with the "
00191 "SIP Server."));
00192 return gc;
00193 };
00194
00195 static HostLineEdit *SipLocalPort()
00196 {
00197 HostLineEdit *gc = new HostLineEdit("SipLocalPort");
00198 gc->setLabel(QObject::tr("SIP Local Port"));
00199 gc->setValue("5060");
00200 gc->setHelpText(QObject::tr("The port on this machine to use. You may need "
00201 "to make these different for each Mythfrontend and setup "
00202 "your firewall to let this port through."));
00203 return gc;
00204 };
00205
00206 static HostComboBox *MicrophoneDevice()
00207 {
00208 HostComboBox *gc = new HostComboBox("MicrophoneDevice", true);
00209 gc->setLabel(QObject::tr("Microphone device"));
00210 QDir dev("/dev", "dsp*", QDir::Name, QDir::System);
00211 gc->addSelection("None");
00212 gc->fillSelectionsFromDir(dev);
00213 gc->setHelpText(QObject::tr("Select the device path for your microphone. "
00214 "Currently this CANNOT be the same device as used for "
00215 "audio output."));
00216 return gc;
00217 };
00218
00219 static HostSpinBox *PlayoutAudioCall()
00220 {
00221 HostSpinBox *gc = new HostSpinBox("PlayoutAudioCall", 10, 300, 5);
00222 gc->setLabel(QObject::tr("Jitter Buffer (Audio Call)"));
00223 gc->setValue(40);
00224 gc->setHelpText(QObject::tr("Size of the playout buffer in ms for an audio call. "));
00225 return gc;
00226 };
00227
00228 static HostSpinBox *PlayoutVideoCall()
00229 {
00230 HostSpinBox *gc = new HostSpinBox("PlayoutVideoCall", 10, 300, 5);
00231 gc->setLabel(QObject::tr("Jitter Buffer (Video Call)"));
00232 gc->setValue(110);
00233 gc->setHelpText(QObject::tr("Size of the playout buffer in ms for a video call. "
00234 "This should be bigger than for an audio call because "
00235 "CPU usage causes jitter and to sync video & audio."));
00236 return gc;
00237 };
00238
00239 static HostLineEdit *MySipName()
00240 {
00241 HostLineEdit *gc = new HostLineEdit("MySipName");
00242 gc->setLabel(QObject::tr("My Display Name"));
00243 gc->setValue(QObject::tr("Me"));
00244 gc->setHelpText(QObject::tr("My common name to display when I call other "
00245 "people. "));
00246 return gc;
00247 };
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259 static HostLineEdit *CodecPriorityList()
00260 {
00261 HostLineEdit *gc = new HostLineEdit("CodecPriorityList");
00262 gc->setLabel(QObject::tr("Codecs Supported"));
00263 gc->setValue("GSM;G.711u;G.711a");
00264 gc->setHelpText(QObject::tr("The list of codecs to use, in the preferred "
00265 "order separated by semicolon. Supported codecs are "
00266 "G.711u, G.711a and GSM."));
00267 return gc;
00268 };
00269
00270 static HostLineEdit *SipBindInterface()
00271 {
00272 HostLineEdit *gc = new HostLineEdit("SipBindInterface");
00273 gc->setLabel(QObject::tr("SIP Network Interface"));
00274 gc->setValue("eth0");
00275 gc->setHelpText(QObject::tr("Enter the name of the network to bind to e.g. "
00276 "eth0"));
00277 return gc;
00278 };
00279
00280 static HostComboBox *NatTraversalMethod()
00281 {
00282 HostComboBox *gc = new HostComboBox("NatTraversalMethod");
00283 gc->setLabel(QObject::tr("NAT Traversal Method"));
00284 gc->addSelection("None");
00285 gc->addSelection("Manual");
00286 gc->addSelection("Web Server");
00287 gc->setHelpText(QObject::tr("Method to use for NAT traversal; needs a "
00288 "Frontend restart after changing. Choose NONE if you have "
00289 "a public IP address, choose MANUAL if your ISP always "
00290 "gives you the same public address and manually enter this "
00291 "address below. Choose Web Server if you have a dynamic "
00292 "NAT address and enter a web address like "
00293 "http://checkip.dyndns.org below. "));
00294 return gc;
00295 };
00296
00297 static HostLineEdit *NatIpAddress()
00298 {
00299 HostLineEdit *gc = new HostLineEdit("NatIpAddress");
00300 gc->setLabel(QObject::tr("NAT IP Address"));
00301 gc->setValue(QObject::tr("http://checkip.dyndns.org"));
00302 gc->setHelpText(QObject::tr("If you selected MANUAL above, then enter your "
00303 "Public IP Address here. If you selected WEB Server above "
00304 "then enter your web server URL here."));
00305 return gc;
00306 };
00307
00308 static HostLineEdit *AudioLocalPort()
00309 {
00310 HostLineEdit *gc = new HostLineEdit("AudioLocalPort");
00311 gc->setLabel(QObject::tr("Audio RTP Port"));
00312 gc->setValue("21232");
00313 gc->setHelpText(QObject::tr("Enter the port to use for Audio RTP; an even "
00314 "number between 1024 and 32767. If you have a firewall you "
00315 "should enable UDP through the firewall on this port."));
00316 return gc;
00317 };
00318
00319 static HostLineEdit *VideoLocalPort()
00320 {
00321 HostLineEdit *gc = new HostLineEdit("VideoLocalPort");
00322 gc->setLabel(QObject::tr("Video RTP Port"));
00323 gc->setValue("21234");
00324 gc->setHelpText(QObject::tr("Enter the port to use for Video RTP; an even "
00325 "number between 1024 and 32767. If you have a firewall you "
00326 "should enable UDP through the firewall on this port."));
00327 return gc;
00328 };
00329
00330 static HostCheckBox *SipAutoanswer()
00331 {
00332 HostCheckBox *gc = new HostCheckBox("SipAutoanswer");
00333 gc->setLabel(QObject::tr("Auto-Answer"));
00334 gc->setValue(false);
00335 gc->setHelpText(QObject::tr("When the MythFrontend is in the MythPhone "
00336 "plugin, setting this automatically answers all incoming "
00337 "calls. There is no security yet."));
00338 return gc;
00339 };
00340
00341
00342
00343
00344
00345
00346
00347 MythPhoneSettings::MythPhoneSettings()
00348 {
00349
00350 VerticalConfigurationGroup* sipProxySet = new VerticalConfigurationGroup(false);
00351 sipProxySet->setLabel(QObject::tr("SIP Proxy Settings"));
00352 sipProxySet->addChild(SipRegisterWithProxy());
00353 sipProxySet->addChild(SipProxyName());
00354 sipProxySet->addChild(SipProxyAuthName());
00355 sipProxySet->addChild(SipProxyAuthPassword());
00356 sipProxySet->addChild(MySipName());
00357 sipProxySet->addChild(SipAutoanswer());
00358 addChild(sipProxySet);
00359
00360 VerticalConfigurationGroup* sipSet = new VerticalConfigurationGroup(false);
00361 sipSet->setLabel(QObject::tr("IP Settings"));
00362 sipSet->addChild(SipBindInterface());
00363 sipSet->addChild(SipLocalPort());
00364 sipSet->addChild(NatTraversalMethod());
00365 sipSet->addChild(NatIpAddress());
00366 sipSet->addChild(AudioLocalPort());
00367 sipSet->addChild(VideoLocalPort());
00368 addChild(sipSet);
00369
00370 VerticalConfigurationGroup* audioSet = new VerticalConfigurationGroup(false);
00371 audioSet->setLabel(QObject::tr("AUDIO Settings"));
00372 audioSet->addChild(MicrophoneDevice());
00373 audioSet->addChild(CodecPriorityList());
00374 audioSet->addChild(PlayoutAudioCall());
00375 audioSet->addChild(PlayoutVideoCall());
00376 addChild(audioSet);
00377
00378 VerticalConfigurationGroup* webcamSet = new VerticalConfigurationGroup(false);
00379 webcamSet->setLabel(QObject::tr("WEBCAM Settings"));
00380 webcamSet->addChild(WebcamDevice());
00381 webcamSet->addChild(TxResolution());
00382 webcamSet->addChild(TransmitFPS());
00383 webcamSet->addChild(TransmitBandwidth());
00384 webcamSet->addChild(CaptureResolution());
00385 addChild(webcamSet);
00386
00387 VerticalConfigurationGroup* vxmlSet = new VerticalConfigurationGroup(false);
00388 vxmlSet->setLabel(QObject::tr("VXML Settings"));
00389 vxmlSet->addChild(TimeToAnswer());
00390 vxmlSet->addChild(DefaultVxmlUrl());
00391 vxmlSet->addChild(DefaultVoicemailPrompt());
00392 vxmlSet->addChild(TTSVoice());
00393 addChild(vxmlSet);
00394 }
00395
00396
00397