qtms/tsrc/qttmstestapp/src/qttmstestapp.cpp
changeset 62 b276843a15ba
equal deleted inserted replaced
58:c76ea6caa649 62:b276843a15ba
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: Telephony Multimedia Service - QTmsTestApp
       
    15  *
       
    16  */
       
    17 
       
    18 #include "qtmstestengine.h"
       
    19 #include "ctmstestengine.h"
       
    20 #include "mtmstestengine.h"
       
    21 #include "qttmstestapp.h"
       
    22 
       
    23 #define CHECKENGINE if(!iTmsEngine){QMessageBox::critical(0, tr("Error"),\
       
    24                                    tr("Engine not ready."),\
       
    25                                    QMessageBox::Ok);\
       
    26                                    return;}
       
    27 
       
    28 TmsTestApp::TmsTestApp(QWidget *parent) :
       
    29     QMainWindow(parent)
       
    30     {
       
    31     mainContainer = new QWidget(this);
       
    32     setCentralWidget(mainContainer);
       
    33 
       
    34     iTmsEngine = NULL;
       
    35 
       
    36     statusDisplay = new QTextEdit(mainContainer);
       
    37 
       
    38     statusDisplay->setReadOnly(true);
       
    39 
       
    40     statusDisplay->setAlignment(Qt::AlignTop);
       
    41 
       
    42     statusDisplay->setTextColor(QColor(Qt::black));
       
    43     statusDisplay->setText("Qt TMS test app");
       
    44 
       
    45     QPalette p = statusDisplay->palette();
       
    46     p.setColor(QPalette::Base, QColor(Qt::white));
       
    47     statusDisplay->setPalette(p);
       
    48     QGridLayout *layout = new QGridLayout;
       
    49 
       
    50     layout->addWidget(statusDisplay);
       
    51     statusDisplay->setForegroundRole(QPalette::Foreground);
       
    52 
       
    53     mainContainer->setLayout(layout);
       
    54 
       
    55     createActions();
       
    56     createMenus();
       
    57     }
       
    58 
       
    59 TmsTestApp::~TmsTestApp()
       
    60     {
       
    61     delete iTmsEngine;
       
    62     }
       
    63 
       
    64 void TmsTestApp::createActions()
       
    65     {
       
    66     //Select engine
       
    67     qtmsengine = new QAction(tr("QT TMS"),this);
       
    68     connect(qtmsengine, SIGNAL(triggered()), this, SLOT(qtmsengineslot()));
       
    69     tmsengine  = new QAction(tr("TMS"),this);
       
    70     connect(tmsengine, SIGNAL(triggered()), this, SLOT(tmsengineslot()));
       
    71 
       
    72     //Call type actions
       
    73     cscall = new QAction(tr("CS"), this);
       
    74     connect(cscall, SIGNAL(triggered()), this, SLOT(cscallslot()));
       
    75     ipcall = new QAction(tr("IP"), this);
       
    76     connect(ipcall, SIGNAL(triggered()), this, SLOT(ipcallslot()));
       
    77 
       
    78     //Stream actions
       
    79     pcmdec = new QAction(tr("PCM-16"),this);
       
    80     connect(pcmdec, SIGNAL(triggered()), this, SLOT(pcmdecslot()));
       
    81     amrdec = new QAction(tr("AMR-NB"),this);
       
    82     connect(amrdec, SIGNAL(triggered()), this, SLOT(amrdecslot()));
       
    83     g711dec = new QAction(tr("G711"),this);
       
    84     connect(g711dec, SIGNAL(triggered()), this, SLOT(g711decslot()));
       
    85     g729dec = new QAction(tr("G729"),this);
       
    86     connect(g729dec, SIGNAL(triggered()), this, SLOT(g729decslot()));
       
    87     ilbcdec = new QAction(tr("iLBC"),this);
       
    88     connect(ilbcdec, SIGNAL(triggered()), this, SLOT(ilbcdecslot()));
       
    89 
       
    90     pcmenc = new QAction(tr("PCM-16"),this);
       
    91     connect(pcmenc, SIGNAL(triggered()), this, SLOT(pcmencslot()));
       
    92     amrenc = new QAction(tr("AMR-NB"),this);
       
    93     connect(amrenc, SIGNAL(triggered()), this, SLOT(amrencslot()));
       
    94     g711enc = new QAction(tr("G711"),this);
       
    95     connect(g711enc, SIGNAL(triggered()), this, SLOT(g711encslot()));
       
    96     g729enc = new QAction(tr("G729"),this);
       
    97     connect(g729enc, SIGNAL(triggered()), this, SLOT(g729encslot()));
       
    98     ilbcenc = new QAction(tr("iLBC"),this);
       
    99     connect(ilbcenc, SIGNAL(triggered()), this, SLOT(ilbcencslot()));
       
   100 
       
   101     downlinkformats = new QAction(tr("Get downlink formats"),this);
       
   102     connect(downlinkformats, SIGNAL(triggered()), this, SLOT(downlinkformatsslot()));
       
   103     strmdnstart = new QAction(tr("Start Dnlink"), this);
       
   104     connect(strmdnstart, SIGNAL(triggered()), this, SLOT(strmdnstartslot()));
       
   105     strmdnstop = new QAction(tr("Stop Dnlink"), this);
       
   106     connect(strmdnstop, SIGNAL(triggered()), this, SLOT(strmdnstopslot()));
       
   107     strmdnclose = new QAction(tr("Close Dnlink"), this);
       
   108     connect(strmdnclose, SIGNAL(triggered()), this, SLOT(strmdncloseslot()));
       
   109 
       
   110     uplinkformats = new QAction(tr("Get uplink formats"),this);
       
   111     connect(uplinkformats, SIGNAL(triggered()), this, SLOT(uplinkformatsslot()));
       
   112     strmupstart = new QAction(tr("Start Uplink"), this);
       
   113     connect(strmupstart, SIGNAL(triggered()), this, SLOT(strmupstartslot()));
       
   114     strmupstop = new QAction(tr("Stop Uplink"), this);
       
   115     connect(strmupstop, SIGNAL(triggered()), this, SLOT(strmupstopslot()));
       
   116     strmupclose = new QAction(tr("Close Uplink"), this);
       
   117     connect(strmupclose, SIGNAL(triggered()), this, SLOT(strmupcloseslot()));
       
   118 
       
   119     //Routing actions
       
   120     availoutputact = new QAction(tr("Available outputs"), this);
       
   121     connect(availoutputact, SIGNAL(triggered()), this, SLOT(availoutputslot()));
       
   122     currentoutputact = new QAction(tr("Current Device Output"), this);
       
   123     connect(currentoutputact, SIGNAL(triggered()), this, SLOT(currentoutputslot()));
       
   124     handsetact = new QAction(tr("Select HandSet"), this);
       
   125     connect(handsetact, SIGNAL(triggered()), this, SLOT(handsetslot()));
       
   126     loudspkract = new QAction(tr("Select Loudspkr"), this);
       
   127     connect(loudspkract, SIGNAL(triggered()), this, SLOT(loudspkrslot()));
       
   128     wiredact = new QAction(tr("Select Wired accessory"), this);
       
   129     connect(wiredact, SIGNAL(triggered()), this, SLOT(wiredslot()));
       
   130     btact = new QAction(tr("Select BlueTooth"), this);
       
   131     connect(btact, SIGNAL(triggered()), this, SLOT(btslot()));
       
   132     ttyact = new QAction(tr("Select TTY"), this);
       
   133     connect(ttyact, SIGNAL(triggered()), this, SLOT(ttyslot()));
       
   134 
       
   135     //Stream gain effect actions
       
   136     stmgainact = new QAction(tr("Get gain"), this);
       
   137     connect(stmgainact, SIGNAL(triggered()), this, SLOT(stmgainslot()));
       
   138     stmmaxgainact = new QAction(tr("Get max gain"), this);
       
   139     connect(stmmaxgainact, SIGNAL(triggered()), this, SLOT(stmmaxgainslot()));
       
   140     stmsetgainact = new QAction(tr("Set gain"), this);
       
   141     connect(stmsetgainact, SIGNAL(triggered()), this, SLOT(stmsetgainslot()));
       
   142     stmmutegainact = new QAction(tr("Mute mic"), this);
       
   143     connect(stmmutegainact, SIGNAL(triggered()), this, SLOT(stmmutegainslot()));
       
   144 
       
   145     //Stream vol effect actions
       
   146     stmvolact = new QAction(tr("Get vol"), this);
       
   147     connect(stmvolact, SIGNAL(triggered()), this, SLOT(stmvolslot()));
       
   148     stmmaxvolact = new QAction(tr("Get max vol"), this);
       
   149     connect(stmmaxvolact, SIGNAL(triggered()), this, SLOT(stmmaxvolslot()));
       
   150     stmsetvolact = new QAction(tr("Set vol"), this);
       
   151     connect(stmsetvolact, SIGNAL(triggered()), this, SLOT(stmsetvolslot()));
       
   152     stmmutevolact = new QAction(tr("Mute spkr"), this);
       
   153     connect(stmmutevolact, SIGNAL(triggered()), this, SLOT(stmmutevolslot()));
       
   154 
       
   155     //Global vol effects actions
       
   156     globalvolact = new QAction(tr("Get global vol"), this);
       
   157     connect(globalvolact, SIGNAL(triggered()), this, SLOT(globalvolslot()));
       
   158     globalmaxvolact = new QAction(tr("Get global max vol"), this);
       
   159     connect(globalmaxvolact, SIGNAL(triggered()), this, SLOT(globalmaxvolslot()));
       
   160     globalsetvolact = new QAction(tr("Set global vol"), this);
       
   161     connect(globalsetvolact, SIGNAL(triggered()), this, SLOT(globalsetvolslot()));
       
   162 
       
   163     //Global gain effects actions
       
   164     globalgainact = new QAction(tr("Get global gain"), this);
       
   165     connect(globalgainact, SIGNAL(triggered()), this, SLOT(globalgainslot()));
       
   166     globalmaxgainact = new QAction(tr("Get global max gain"), this);
       
   167     connect(globalmaxgainact, SIGNAL(triggered()), this, SLOT(globalmaxgainslot()));
       
   168     globalsetgainact = new QAction(tr("Set global gain"), this);
       
   169     connect(globalsetgainact, SIGNAL(triggered()), this, SLOT(globalsetgainslot()));
       
   170 
       
   171     //Decoder settings
       
   172     togglecng = new QAction(tr("ToggleCng G711/iLBC"), this);
       
   173     connect(togglecng,SIGNAL(triggered()), this ,SLOT(togglecngslot()));
       
   174     getcng = new QAction(tr("GetCng G711/iLBC"), this);
       
   175     connect(getcng,SIGNAL(triggered()), this ,SLOT(getcngslot()));
       
   176     toggleplc = new QAction(tr("Toggle PLC G711"), this);
       
   177     connect(toggleplc,SIGNAL(triggered()), this ,SLOT(toggleplcslot()));
       
   178     getplc = new QAction(tr("Get PLC G711"), this);
       
   179     connect(getplc,SIGNAL(triggered()), this ,SLOT(getplcslot()));
       
   180     setalawdecg711 = new QAction(tr("Set ALaw G711"), this);
       
   181     connect(setalawdecg711,SIGNAL(triggered()), this ,SLOT(setalawdecg711slot()));
       
   182     setulawdecg711 = new QAction(tr("Set uLaw G711"), this);
       
   183     connect(setulawdecg711,SIGNAL(triggered()), this ,SLOT(setulawdecg711slot()));
       
   184     getmodedecg711 = new QAction(tr("Get mode G711"), this);
       
   185     connect(getmodedecg711,SIGNAL(triggered()), this ,SLOT(getmodegdec711slot()));
       
   186     set20msdecilbc = new QAction(tr("Set 20ms frm iLBC"), this);
       
   187     connect(set20msdecilbc,SIGNAL(triggered()), this ,SLOT(set20msdecilbcslot()));
       
   188     set30msdecilbc = new QAction(tr("Set 30ms frm iLBC"), this);
       
   189     connect(set30msdecilbc,SIGNAL(triggered()), this ,SLOT(set30msdecilbcslot()));
       
   190     getmodedecilbc = new QAction(tr("Getmode iLBC"), this);
       
   191     connect(getmodedecilbc,SIGNAL(triggered()), this ,SLOT(getmodedecilbcslot()));
       
   192 
       
   193     //Encoder settings
       
   194     getsupportedbr = new QAction(tr("Get supported bitrates"), this);
       
   195     connect(getsupportedbr,SIGNAL(triggered()), this ,SLOT(getsupportedbrslot()));
       
   196     setminbr = new QAction(tr("Set min br"), this);
       
   197     connect(setminbr,SIGNAL(triggered()), this ,SLOT(setminbrslot()));
       
   198     setmaxbr = new QAction(tr("Set max br"), this);
       
   199     connect(setmaxbr,SIGNAL(triggered()), this ,SLOT(setmaxbrslot()));
       
   200     getbr = new QAction(tr("Get br"), this);
       
   201     connect(getbr,SIGNAL(triggered()), this ,SLOT(getbrslot()));
       
   202     togglevad = new QAction(tr("Toggle VAD"), this);
       
   203     connect(togglevad,SIGNAL(triggered()), this ,SLOT(togglevadslot()));
       
   204     getvad = new QAction(tr("Get VAD"), this);
       
   205     connect(getvad,SIGNAL(triggered()), this ,SLOT(getvadslot()));
       
   206     setalawencg711 = new QAction(tr("Set ALaw G711"), this);
       
   207     connect(setalawencg711,SIGNAL(triggered()), this ,SLOT(setalawencg711slot()));
       
   208     setulawencg711 = new QAction(tr("Set uLaw G711"), this);
       
   209     connect(setulawencg711,SIGNAL(triggered()), this ,SLOT(setulawencg711slot()));
       
   210     getmodeencg711 = new QAction(tr("Get mode G711"), this);
       
   211     connect(getmodeencg711,SIGNAL(triggered()), this ,SLOT(getmodeencg711slot()));
       
   212     set20msencilbc = new QAction(tr("Set 20ms fr iLBC"), this);
       
   213     connect(set20msencilbc,SIGNAL(triggered()), this ,SLOT(set20msencilbcslot()));
       
   214     set30msencilbc = new QAction(tr("Set 30ms fr iLBC"), this);
       
   215     connect(set30msencilbc,SIGNAL(triggered()), this ,SLOT(set30msencilbcslot()));
       
   216     getmodeencilbc = new QAction(tr("Get mode iLBC"), this);
       
   217     connect(getmodeencilbc,SIGNAL(triggered()), this ,SLOT(getmodeencilbcslot()));
       
   218 
       
   219     //DTMF actions
       
   220     dtmfdninit = new QAction(tr("Init DTMF Dnlink"), this);
       
   221     connect(dtmfdninit, SIGNAL(triggered()), this, SLOT(dtmfdninitslot()));
       
   222     dtmfdnplay = new QAction(tr("Play DTMF Dnlink"), this);
       
   223     connect(dtmfdnplay, SIGNAL(triggered()), this, SLOT(dtmfdnplayslot()));
       
   224     dtmfdnstop = new QAction(tr("Stop DTMF Dnlink"), this);
       
   225     connect(dtmfdnstop, SIGNAL(triggered()), this, SLOT(dtmfdnstopslot()));
       
   226     dtmfupinit = new QAction(tr("Init DTMF Uplink"), this);
       
   227     connect(dtmfupinit, SIGNAL(triggered()), this, SLOT(dtmfupinitslot()));
       
   228     dtmfupplay = new QAction(tr("Play DTMF Uplink"), this);
       
   229     connect(dtmfupplay, SIGNAL(triggered()), this, SLOT(dtmfupplayslot()));
       
   230     dtmfupstop = new QAction(tr("Stop DTMF Uplink"), this);
       
   231     connect(dtmfupstop, SIGNAL(triggered()), this, SLOT(dtmfupstopslot()));
       
   232 
       
   233     //Inband tones actions
       
   234     inbandbusy = new QAction(tr("Busy"), this);
       
   235     connect(inbandbusy,SIGNAL(triggered()), this ,SLOT(inbandbusyslot()));
       
   236     inbandpathnotaval = new QAction(tr("RadioPath Not Available"), this);
       
   237     connect(inbandpathnotaval,SIGNAL(triggered()), this ,SLOT(inbandpathnotavilslot()));
       
   238     inbandcongestion = new QAction(tr("Congestion"), this);
       
   239     connect(inbandcongestion,SIGNAL(triggered()), this ,SLOT(inbandcongestionslot()));
       
   240     inbandspecialinfo = new QAction(tr("Special Info"), this);
       
   241     connect(inbandspecialinfo,SIGNAL(triggered()), this ,SLOT(inbandspecialinfoslot()));
       
   242     inbandreorder = new QAction(tr("Reorder"), this);
       
   243     connect(inbandreorder,SIGNAL(triggered()), this ,SLOT(inbandreorderslot()));
       
   244     inbandremotealert = new QAction(tr("Remote alert"), this);
       
   245     connect(inbandremotealert,SIGNAL(triggered()), this ,SLOT(inbandremotealertslot()));
       
   246     inbandcallwait = new QAction(tr("Call waiting"), this);
       
   247     connect(inbandcallwait,SIGNAL(triggered()), this ,SLOT(inbandcallwaitslot()));
       
   248     inbanddatacall = new QAction(tr("Data Call"), this);
       
   249     connect(inbanddatacall,SIGNAL(triggered()), this ,SLOT(inbanddatacallslot()));
       
   250     inbandnoseq = new QAction(tr("No sequence"), this);
       
   251     connect(inbandnoseq,SIGNAL(triggered()), this ,SLOT(inbandnoseqslot()));
       
   252     inbandbeepseq = new QAction(tr("Beep seq"), this);
       
   253     connect(inbandbeepseq,SIGNAL(triggered()), this ,SLOT(inbandbeepseqslot()));
       
   254     inbandstop = new QAction(tr("Stop"), this);
       
   255     connect(inbandstop,SIGNAL(triggered()), this ,SLOT(inbandstopslot()));
       
   256 
       
   257     //Ring tone actions
       
   258     rtplay = new QAction(tr("Play"), this);
       
   259     connect(rtplay, SIGNAL(triggered()), this, SLOT(rtplayslot()));
       
   260     rtpause = new QAction(tr("Pause"), this);
       
   261     connect(rtpause, SIGNAL(triggered()), this, SLOT(rtpauseslot()));
       
   262     rtmute = new QAction(tr("Mute"), this);
       
   263     connect(rtmute, SIGNAL(triggered()), this, SLOT(rtmuteslot()));
       
   264     rtstop = new QAction(tr("Stop"), this);
       
   265     connect(rtstop, SIGNAL(triggered()), this, SLOT(rtstopslot()));
       
   266     rtdeinit = new QAction(tr("Deinit"), this);
       
   267     connect(rtdeinit, SIGNAL(triggered()), this, SLOT(rtdeinitslot()));
       
   268     rtprofile = new QAction(tr("Current Profile"), this);
       
   269     connect(rtprofile, SIGNAL(triggered()), this, SLOT(rtprofileslot()));
       
   270     rtaudiofile = new QAction(tr("Audio File"), this);
       
   271     connect(rtaudiofile, SIGNAL(triggered()), this, SLOT(rtfileslot()));
       
   272     rttts = new QAction(tr("Profile with TTS"), this);
       
   273     connect(rttts, SIGNAL(triggered()), this, SLOT(rtttsslot()));
       
   274     rtsequence = new QAction(tr("Sequence"), this);
       
   275     connect(rtsequence, SIGNAL(triggered()), this, SLOT(rtsequenceslot()));
       
   276     rtbeep = new QAction(tr("Beep"), this);
       
   277     connect(rtbeep, SIGNAL(triggered()), this, SLOT(rtbeepslot()));
       
   278     rtsilent = new QAction(tr("Silent"), this);
       
   279     connect(rtsilent, SIGNAL(triggered()), this, SLOT(rtsilentslot()));
       
   280 
       
   281     onetouch = new QAction(tr("One Touch Loopback"),this);
       
   282     connect(onetouch,SIGNAL(triggered()), this ,SLOT(onetouchslot()));
       
   283 
       
   284     exitAction = new QAction(tr("&Exit"), this);
       
   285     connect(exitAction, SIGNAL(triggered()), this, SLOT(quit()));
       
   286     }
       
   287 
       
   288 void TmsTestApp::createMenus()
       
   289     {
       
   290     enginemenu = menuBar()->addMenu("Select Engine");
       
   291     enginemenu->addAction(qtmsengine);
       
   292     enginemenu->addAction(tmsengine);
       
   293 
       
   294     //Call type menu options
       
   295     QMenu* calltypemenu;
       
   296     calltypemenu = menuBar()->addMenu("CallType");
       
   297     calltypemenu->addAction(cscall);
       
   298     calltypemenu->addAction(ipcall);
       
   299 
       
   300     //Stream type menu options
       
   301     QMenu* strmdnmenu;
       
   302     strmdnmenu = menuBar()->addMenu("Downlink Stream");
       
   303 
       
   304     strmdnmenu->addAction(downlinkformats);
       
   305 
       
   306     QMenu* decodermenu;
       
   307     decodermenu = strmdnmenu->addMenu("Init Decoder...");
       
   308 
       
   309     decodermenu->addAction(pcmdec);
       
   310     decodermenu->addAction(amrdec);
       
   311     decodermenu->addAction(g711dec);
       
   312     decodermenu->addAction(g729dec);
       
   313     decodermenu->addAction(ilbcdec);
       
   314 
       
   315     strmdnmenu->addAction(strmdnstart);
       
   316     strmdnmenu->addAction(strmdnstop);
       
   317     strmdnmenu->addAction(strmdnclose);
       
   318 
       
   319     QMenu* speakermenu;
       
   320     speakermenu = strmdnmenu->addMenu("Speaker Settings");
       
   321     speakermenu->addAction(stmvolact);
       
   322     speakermenu->addAction(stmmaxvolact);
       
   323     speakermenu->addAction(stmsetvolact);
       
   324     speakermenu->addAction(stmmutevolact);
       
   325     QMenu* routingmenu;
       
   326     routingmenu = strmdnmenu->addMenu("Output device");
       
   327     routingmenu->addAction(availoutputact);
       
   328     routingmenu->addAction(currentoutputact);
       
   329     routingmenu->addAction(handsetact);
       
   330     routingmenu->addAction(loudspkract);
       
   331     routingmenu->addAction(wiredact);
       
   332     routingmenu->addAction(btact);
       
   333     routingmenu->addAction(ttyact);
       
   334 
       
   335     QMenu* decodersettings;
       
   336     decodersettings = strmdnmenu->addMenu("Decoder Settings");
       
   337     decodersettings->addAction(togglecng);
       
   338     decodersettings->addAction(getcng);
       
   339     decodersettings->addAction(toggleplc);
       
   340     decodersettings->addAction(getplc);
       
   341     decodersettings->addAction(setalawdecg711);
       
   342     decodersettings->addAction(setulawdecg711);
       
   343     decodersettings->addAction(getmodedecg711);
       
   344     decodersettings->addAction(set20msdecilbc);
       
   345     decodersettings->addAction(set30msdecilbc);
       
   346     decodersettings->addAction(getmodedecilbc);
       
   347 
       
   348     QMenu* strmupmenu;
       
   349     strmupmenu = menuBar()->addMenu("Uplink Stream");
       
   350 
       
   351     strmupmenu->addAction(uplinkformats);
       
   352     QMenu* encodermenu;
       
   353     encodermenu = strmupmenu->addMenu("Init Encoder...");
       
   354 
       
   355     strmupmenu->addAction(strmupstart);
       
   356     strmupmenu->addAction(strmupstop);
       
   357     strmupmenu->addAction(strmupclose);
       
   358 
       
   359     encodermenu->addAction(pcmenc);
       
   360     encodermenu->addAction(amrenc);
       
   361     encodermenu->addAction(g711enc);
       
   362     encodermenu->addAction(g729enc);
       
   363     encodermenu->addAction(ilbcenc);
       
   364 
       
   365     QMenu* micmenu;
       
   366     micmenu = strmupmenu->addMenu("Mic Settings");
       
   367     micmenu->addAction(stmgainact);
       
   368     micmenu->addAction(stmmaxgainact);
       
   369     micmenu->addAction(stmsetgainact);
       
   370     micmenu->addAction(stmmutegainact);
       
   371 
       
   372     QMenu* encodersettings;
       
   373     encodersettings = strmupmenu->addMenu("Encoder Settings");
       
   374     encodersettings->addAction(getsupportedbr);
       
   375     encodersettings->addAction(setminbr);
       
   376     encodersettings->addAction(setmaxbr);
       
   377     encodersettings->addAction(getbr);
       
   378     encodersettings->addAction(togglevad);
       
   379     encodersettings->addAction(getvad);
       
   380     encodersettings->addAction(setalawencg711);
       
   381     encodersettings->addAction(setulawencg711);
       
   382     encodersettings->addAction(getmodeencg711);
       
   383     encodersettings->addAction(set20msencilbc);
       
   384     encodersettings->addAction(set30msencilbc);
       
   385     encodersettings->addAction(getmodeencilbc);
       
   386 
       
   387     //DTMF tone player options
       
   388     QMenu* dtmfmenu;
       
   389     dtmfmenu =  menuBar()->addMenu("DTMF Tone player");
       
   390     dtmfmenu->addAction(dtmfdninit);
       
   391     dtmfmenu->addAction(dtmfdnplay);
       
   392     dtmfmenu->addAction(dtmfdnstop);
       
   393     dtmfmenu->addAction(dtmfupinit);
       
   394     dtmfmenu->addAction(dtmfupplay);
       
   395     dtmfmenu->addAction(dtmfupstop);
       
   396 
       
   397     //Inband tone options
       
   398     QMenu* inbandmenu;
       
   399     inbandmenu = menuBar()->addMenu("Inband Tones");
       
   400     inbandmenu->addAction(inbandbusy);
       
   401     inbandmenu->addAction(inbandpathnotaval);
       
   402     inbandmenu->addAction(inbandcongestion);
       
   403     inbandmenu->addAction(inbandspecialinfo);
       
   404     inbandmenu->addAction(inbandreorder);
       
   405     inbandmenu->addAction(inbandremotealert);
       
   406     inbandmenu->addAction(inbandcallwait);
       
   407     inbandmenu->addAction(inbanddatacall);
       
   408     inbandmenu->addAction(inbandnoseq);
       
   409     inbandmenu->addAction(inbandbeepseq);
       
   410     inbandmenu->addAction(inbandstop);
       
   411 
       
   412     QMenu* globalffectsmenu;
       
   413     globalffectsmenu = menuBar()->addMenu("Global Effects");
       
   414     globalffectsmenu->addAction(globalvolact);
       
   415     globalffectsmenu->addAction(globalmaxvolact);
       
   416     globalffectsmenu->addAction(globalsetvolact);
       
   417     globalffectsmenu->addAction(globalgainact);
       
   418     globalffectsmenu->addAction(globalmaxgainact);
       
   419     globalffectsmenu->addAction(globalsetgainact);
       
   420 
       
   421 
       
   422     QMenu* rtmenu;
       
   423     rtmenu = menuBar()->addMenu("RingTone Player");
       
   424     QMenu* rtmenuinit;
       
   425     rtmenuinit = rtmenu->addMenu("Init Player");
       
   426     rtmenuinit->addAction(rtprofile);
       
   427     rtmenuinit->addAction(rtaudiofile);
       
   428     rtmenuinit->addAction(rttts);
       
   429     rtmenuinit->addAction(rtbeep);
       
   430     rtmenuinit->addAction(rtsilent);
       
   431     rtmenu->addAction(rtplay);
       
   432     rtmenu->addAction(rtmute);
       
   433     rtmenu->addAction(rtpause);
       
   434     rtmenu->addAction(rtstop);
       
   435     rtmenu->addAction(rtdeinit);
       
   436 
       
   437     //One Touch Loopback
       
   438     menuBar()->addAction(onetouch);
       
   439 
       
   440     menuBar()->addAction(exitAction);
       
   441     }
       
   442 
       
   443 void TmsTestApp::qtmsengineslot()
       
   444     {
       
   445    	statusDisplay->append("Using QT TMS api");
       
   446    	iTmsEngine = QTmsTestEngine::NewL(statusDisplay);
       
   447 
       
   448     //After an engine has been selected hide option
       
   449     enginemenu->menuAction()->setVisible(false);
       
   450     }
       
   451 
       
   452 void TmsTestApp::tmsengineslot()
       
   453     {
       
   454     statusDisplay->append("Using openC TMS api");
       
   455     iTmsEngine = CTmsTestEngine::NewL(statusDisplay);
       
   456 
       
   457     //After an engine has been selected hide option
       
   458     enginemenu->menuAction()->setVisible(false);
       
   459     }
       
   460 
       
   461 void TmsTestApp::cscallslot()
       
   462     {
       
   463     CHECKENGINE
       
   464     iTmsEngine->SetCallType(TMS_CALL_CS);
       
   465     }
       
   466 void TmsTestApp::ipcallslot()
       
   467     {
       
   468     CHECKENGINE
       
   469     iTmsEngine->SetCallType(TMS_CALL_IP);
       
   470     }
       
   471 void TmsTestApp::downlinkformatsslot()
       
   472     {
       
   473     CHECKENGINE
       
   474     iTmsEngine->GetSupportedDownlinkFormats(ETrue);
       
   475     }
       
   476 void TmsTestApp::strmdnstartslot()
       
   477     {
       
   478     CHECKENGINE
       
   479     iTmsEngine->StartDownlink();
       
   480     }
       
   481 void TmsTestApp::strmdnstopslot()
       
   482     {
       
   483     CHECKENGINE
       
   484     iTmsEngine->StopDownlink();
       
   485     }
       
   486 void TmsTestApp::strmdncloseslot()
       
   487     {
       
   488     CHECKENGINE
       
   489     iTmsEngine->CloseDownlink();
       
   490     }
       
   491 void TmsTestApp::uplinkformatsslot()
       
   492     {
       
   493     CHECKENGINE
       
   494     iTmsEngine->GetSupportedUplinkFormats(ETrue);
       
   495     }
       
   496 void TmsTestApp::strmupstartslot()
       
   497     {
       
   498     CHECKENGINE
       
   499     iTmsEngine->StartUplink();
       
   500     }
       
   501 void TmsTestApp::strmupstopslot()
       
   502     {
       
   503     CHECKENGINE
       
   504     iTmsEngine->StopUplink();
       
   505     }
       
   506 void TmsTestApp::strmupcloseslot()
       
   507     {
       
   508     CHECKENGINE
       
   509     iTmsEngine->CloseUplink();
       
   510     }
       
   511 void TmsTestApp::dtmfdninitslot()
       
   512     {
       
   513     CHECKENGINE
       
   514     iTmsEngine->InitDTMFTonePlayerDnlink();
       
   515     }
       
   516 void TmsTestApp::dtmfdnplayslot()
       
   517     {
       
   518     CHECKENGINE
       
   519     iTmsEngine->DTMFTonePlayDnlink();
       
   520     }
       
   521 void TmsTestApp::dtmfdnstopslot()
       
   522     {
       
   523     CHECKENGINE
       
   524     iTmsEngine->CloseDTMFPlayerDnlink();
       
   525     }
       
   526 void TmsTestApp::dtmfupinitslot()
       
   527     {
       
   528     CHECKENGINE
       
   529     iTmsEngine->InitDTMFTonePlayerUplink();
       
   530     }
       
   531 void TmsTestApp::dtmfupplayslot()
       
   532     {
       
   533     CHECKENGINE
       
   534     iTmsEngine->DTMFTonePlayUplink();
       
   535     }
       
   536 void TmsTestApp::dtmfupstopslot()
       
   537     {
       
   538     CHECKENGINE
       
   539     iTmsEngine->CloseDTMFPlayerUplink();
       
   540     }
       
   541 void TmsTestApp::inbandbusyslot()
       
   542     {
       
   543     CHECKENGINE
       
   544     iTmsEngine->StartInbandTone(TMS_INBAND_USER_BUSY);
       
   545     }
       
   546  void TmsTestApp::inbandpathnotavilslot()
       
   547      {
       
   548      CHECKENGINE
       
   549      iTmsEngine->StartInbandTone(TMS_INBAND_RADIO_PATH_NOT_AVAIL);
       
   550      }
       
   551  void TmsTestApp::inbandcongestionslot()
       
   552      {
       
   553      CHECKENGINE
       
   554      iTmsEngine->StartInbandTone(TMS_INBAND_CONGESTION);
       
   555      }
       
   556  void TmsTestApp::inbandspecialinfoslot()
       
   557      {
       
   558      CHECKENGINE
       
   559      iTmsEngine->StartInbandTone(TMS_INBAND_SPECIAL_INFO);
       
   560      }
       
   561  void TmsTestApp::inbandremotealertslot()
       
   562     {
       
   563      CHECKENGINE
       
   564      iTmsEngine->StartInbandTone(TMS_INBAND_REMOTE_ALEARTING);
       
   565     }
       
   566 void TmsTestApp::inbanddatacallslot()
       
   567     {
       
   568     CHECKENGINE
       
   569     iTmsEngine->StartInbandTone(TMS_INBAND_DATA_CALL);
       
   570     }
       
   571 void TmsTestApp::inbandcallwaitslot()
       
   572     {
       
   573     CHECKENGINE
       
   574     iTmsEngine->StartInbandTone(TMS_INBAND_CALL_WAITING);
       
   575     }
       
   576 void TmsTestApp::inbandreorderslot()
       
   577     {
       
   578     CHECKENGINE
       
   579     iTmsEngine->StartInbandTone(TMS_INBAND_REORDER);
       
   580     }
       
   581 void TmsTestApp::inbandnoseqslot()
       
   582     {
       
   583     CHECKENGINE
       
   584     iTmsEngine->StartInbandTone(TMS_INBAND_NO_SEQUENCE);
       
   585     }
       
   586 void TmsTestApp::inbandbeepseqslot()
       
   587     {
       
   588     CHECKENGINE
       
   589     iTmsEngine->StartInbandTone(TMS_INBAND_BEEP_SEQUENCE);
       
   590     }
       
   591 void TmsTestApp::inbandstopslot()
       
   592     {
       
   593     CHECKENGINE
       
   594     iTmsEngine->StopInbandTone();
       
   595     }
       
   596 void TmsTestApp::globalvolslot()
       
   597     {
       
   598     CHECKENGINE
       
   599     iTmsEngine->GetGlobalVol();
       
   600     }
       
   601 void TmsTestApp::globalmaxvolslot()
       
   602     {
       
   603     CHECKENGINE
       
   604     iTmsEngine->GetGlobalMaxVol();
       
   605     }
       
   606 void TmsTestApp::globalsetvolslot()
       
   607     {
       
   608     CHECKENGINE
       
   609     iTmsEngine->SetGlobalVol();
       
   610     }
       
   611 void TmsTestApp::globalgainslot()
       
   612     {
       
   613     CHECKENGINE
       
   614     iTmsEngine->GetGlobalGain();
       
   615     }
       
   616 void TmsTestApp::globalmaxgainslot()
       
   617     {
       
   618     CHECKENGINE
       
   619     iTmsEngine->GetGlobalMaxGain();
       
   620     }
       
   621 void TmsTestApp::globalsetgainslot()
       
   622     {
       
   623     CHECKENGINE
       
   624     iTmsEngine->SetGlobalGain();
       
   625     }
       
   626 void TmsTestApp::stmgainslot()
       
   627     {
       
   628     CHECKENGINE
       
   629     iTmsEngine->GetGain();
       
   630     }
       
   631 void TmsTestApp::stmmaxgainslot()
       
   632     {
       
   633     CHECKENGINE
       
   634     iTmsEngine->GetMaxGain();
       
   635     }
       
   636 void TmsTestApp::stmsetgainslot()
       
   637     {
       
   638     CHECKENGINE
       
   639     iTmsEngine->SetMaxGain();
       
   640     }
       
   641 void TmsTestApp::stmmutegainslot()
       
   642     {
       
   643     CHECKENGINE
       
   644     iTmsEngine->MuteMic();
       
   645     }
       
   646 void TmsTestApp::stmvolslot()
       
   647     {
       
   648     CHECKENGINE
       
   649     iTmsEngine->GetVolume();
       
   650     }
       
   651 void TmsTestApp::stmmaxvolslot()
       
   652     {
       
   653     CHECKENGINE
       
   654     iTmsEngine->GetMaxVolume();
       
   655     }
       
   656 void TmsTestApp::stmsetvolslot()
       
   657     {
       
   658     CHECKENGINE
       
   659     iTmsEngine->SetMaxVolume();
       
   660     }
       
   661 void TmsTestApp::stmmutevolslot()
       
   662     {
       
   663     CHECKENGINE
       
   664     iTmsEngine->MuteSpeaker();
       
   665     }
       
   666 void TmsTestApp::handsetslot()
       
   667     {
       
   668     CHECKENGINE
       
   669     iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_HANDSET);
       
   670     }
       
   671 void TmsTestApp::loudspkrslot()
       
   672     {
       
   673     CHECKENGINE
       
   674     iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_LOUDSPEAKER);
       
   675     }
       
   676 void TmsTestApp::wiredslot()
       
   677     {
       
   678     CHECKENGINE
       
   679     iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_WIRED_ACCESSORY);
       
   680     }
       
   681 void TmsTestApp::btslot()
       
   682     {
       
   683     CHECKENGINE
       
   684     iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_ACCESSORY);
       
   685     }
       
   686 void TmsTestApp::ttyslot()
       
   687     {
       
   688     CHECKENGINE
       
   689     iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_ETTY);
       
   690     }
       
   691 void TmsTestApp::currentoutputslot()
       
   692     {
       
   693     CHECKENGINE
       
   694     iTmsEngine->GetAudioDevice();
       
   695     }
       
   696 void TmsTestApp::availoutputslot()
       
   697     {
       
   698     CHECKENGINE
       
   699     iTmsEngine->GetAvailableOutput();
       
   700     }
       
   701 void TmsTestApp::pcmdecslot()
       
   702     {
       
   703     CHECKENGINE
       
   704     iTmsEngine->SetDownlinkFormat(TMS_FORMAT_PCM);
       
   705     }
       
   706 
       
   707 void TmsTestApp::amrdecslot()
       
   708     {
       
   709     CHECKENGINE
       
   710     iTmsEngine->SetDownlinkFormat(TMS_FORMAT_AMR);
       
   711     }
       
   712 void TmsTestApp::g711decslot()
       
   713     {
       
   714     CHECKENGINE
       
   715     iTmsEngine->SetDownlinkFormat(TMS_FORMAT_G711);
       
   716     }
       
   717 void TmsTestApp::g729decslot()
       
   718     {
       
   719     CHECKENGINE
       
   720     iTmsEngine->SetDownlinkFormat(TMS_FORMAT_G729);
       
   721     }
       
   722 void TmsTestApp::ilbcdecslot()
       
   723     {
       
   724     CHECKENGINE
       
   725     iTmsEngine->SetDownlinkFormat(TMS_FORMAT_ILBC);
       
   726     }
       
   727 void TmsTestApp::pcmencslot()
       
   728     {
       
   729     CHECKENGINE
       
   730     iTmsEngine->SetUplinkFormat(TMS_FORMAT_PCM);
       
   731     }
       
   732 void TmsTestApp::amrencslot()
       
   733     {
       
   734     CHECKENGINE
       
   735     iTmsEngine->SetUplinkFormat(TMS_FORMAT_AMR);
       
   736     }
       
   737 void TmsTestApp::g711encslot()
       
   738     {
       
   739     CHECKENGINE
       
   740     iTmsEngine->SetUplinkFormat(TMS_FORMAT_G711);
       
   741     }
       
   742 void TmsTestApp::g729encslot()
       
   743     {
       
   744     CHECKENGINE
       
   745     iTmsEngine->SetUplinkFormat(TMS_FORMAT_G729);
       
   746     }
       
   747 void TmsTestApp::ilbcencslot()
       
   748     {
       
   749     CHECKENGINE
       
   750     iTmsEngine->SetUplinkFormat(TMS_FORMAT_ILBC);
       
   751     }
       
   752 void TmsTestApp::togglecngslot()
       
   753     {
       
   754     CHECKENGINE
       
   755     iTmsEngine->ToggleCng();
       
   756     }
       
   757 void TmsTestApp::getcngslot()
       
   758     {
       
   759     CHECKENGINE
       
   760     iTmsEngine->GetCng();
       
   761     }
       
   762 void TmsTestApp::toggleplcslot()
       
   763     {
       
   764     CHECKENGINE
       
   765     iTmsEngine->TogglePlc();
       
   766     }
       
   767 void TmsTestApp::getplcslot()
       
   768     {
       
   769     CHECKENGINE
       
   770     iTmsEngine->GetPlc();
       
   771     }
       
   772 void TmsTestApp::setalawdecg711slot()
       
   773     {
       
   774     CHECKENGINE
       
   775     iTmsEngine->SetDnLinkG711ALAW();
       
   776     }
       
   777 void TmsTestApp::setulawdecg711slot()
       
   778     {
       
   779     CHECKENGINE
       
   780     iTmsEngine->SetDnLinkG711uLAW();
       
   781     }
       
   782 void TmsTestApp::getmodegdec711slot()
       
   783     {
       
   784     CHECKENGINE
       
   785     iTmsEngine->GetDnLinkG711Mode();
       
   786     }
       
   787 void TmsTestApp::set20msdecilbcslot()
       
   788     {
       
   789     CHECKENGINE
       
   790     iTmsEngine->SetDnLinkILBC20MS();
       
   791     }
       
   792 void TmsTestApp::set30msdecilbcslot()
       
   793     {
       
   794     CHECKENGINE
       
   795     iTmsEngine->SetDnLinkILBC30MS();
       
   796     }
       
   797 void TmsTestApp::getmodedecilbcslot()
       
   798     {
       
   799     CHECKENGINE
       
   800     iTmsEngine->GetDnLinkILBCMode();
       
   801     }
       
   802 void TmsTestApp::getsupportedbrslot()
       
   803     {
       
   804     CHECKENGINE
       
   805     iTmsEngine->GetSupportedBitrates();
       
   806     }
       
   807 void TmsTestApp::setminbrslot()
       
   808     {
       
   809     CHECKENGINE
       
   810     iTmsEngine->SelectMinBitrate();
       
   811     }
       
   812 void TmsTestApp::setmaxbrslot()
       
   813     {
       
   814     CHECKENGINE
       
   815     iTmsEngine->SelectMaxBitrate();
       
   816     }
       
   817 void TmsTestApp::getbrslot()
       
   818     {
       
   819     CHECKENGINE
       
   820     iTmsEngine->GetBitrate();
       
   821     }
       
   822 void TmsTestApp::togglevadslot()
       
   823     {
       
   824     CHECKENGINE
       
   825     iTmsEngine->ToggleVad();
       
   826     }
       
   827 void TmsTestApp::getvadslot()
       
   828     {
       
   829     CHECKENGINE
       
   830     iTmsEngine->GetVad();
       
   831     }
       
   832 void TmsTestApp::setalawencg711slot()
       
   833     {
       
   834     CHECKENGINE
       
   835     iTmsEngine->SetUpLinkG711ALAW();
       
   836     }
       
   837 void TmsTestApp::setulawencg711slot()
       
   838     {
       
   839     CHECKENGINE
       
   840     iTmsEngine->SetUpLinkG711uLAW();
       
   841     }
       
   842 void TmsTestApp::getmodeencg711slot()
       
   843     {
       
   844     CHECKENGINE
       
   845     iTmsEngine->GetUpLinkG711Mode();
       
   846     }
       
   847 void TmsTestApp::set20msencilbcslot()
       
   848     {
       
   849     CHECKENGINE
       
   850     iTmsEngine->SetUpLinkILBC20MS();
       
   851     }
       
   852 void TmsTestApp::set30msencilbcslot()
       
   853     {
       
   854     CHECKENGINE
       
   855     iTmsEngine->SetUpLinkILBC30MS();
       
   856     }
       
   857 void TmsTestApp::getmodeencilbcslot()
       
   858     {
       
   859     CHECKENGINE
       
   860     iTmsEngine->GetUpLinkILBCMode();
       
   861     }
       
   862 void TmsTestApp::rtplayslot()
       
   863     {
       
   864     CHECKENGINE
       
   865     iTmsEngine->PlayRingTone();
       
   866     }
       
   867 void TmsTestApp::rtpauseslot()
       
   868     {
       
   869     CHECKENGINE
       
   870     iTmsEngine->PauseVideoRingTone();
       
   871     }
       
   872 void TmsTestApp::rtmuteslot()
       
   873     {
       
   874     CHECKENGINE
       
   875     iTmsEngine->MuteRingTone();
       
   876     }
       
   877 void TmsTestApp::rtstopslot()
       
   878     {
       
   879     CHECKENGINE
       
   880     iTmsEngine->StopRingTone();
       
   881     }
       
   882 void TmsTestApp::rtdeinitslot()
       
   883     {
       
   884     CHECKENGINE
       
   885     iTmsEngine->DeinitRingTonePlayer();
       
   886     }
       
   887 void TmsTestApp::rtprofileslot()
       
   888     {
       
   889     CHECKENGINE
       
   890     iTmsEngine->InitRingTonePlayerFromProfiles();
       
   891     }
       
   892 void TmsTestApp::rtfileslot()
       
   893     {
       
   894     CHECKENGINE
       
   895     iTmsEngine->InitRingTonePlayerFromFile();
       
   896     }
       
   897 void TmsTestApp::rtttsslot()
       
   898     {
       
   899     CHECKENGINE
       
   900     iTmsEngine->InitRingToneWithTTS();
       
   901     }
       
   902 void TmsTestApp::rtbeepslot()
       
   903     {
       
   904     CHECKENGINE
       
   905     iTmsEngine->InitRingToneBeepOnce();
       
   906     }
       
   907 void TmsTestApp::rtsequenceslot()
       
   908     {
       
   909     CHECKENGINE
       
   910     iTmsEngine->InitRingToneSequencePlayer();
       
   911     }
       
   912 void TmsTestApp::rtsilentslot()
       
   913     {
       
   914     CHECKENGINE
       
   915     iTmsEngine->InitRingToneSilent();
       
   916     }
       
   917 void TmsTestApp::onetouchslot()
       
   918     {
       
   919     CHECKENGINE
       
   920     iTmsEngine->OneTouchLoopback();
       
   921     }
       
   922 
       
   923 #include "../tmp/moc_qttmstestapp.cpp"
       
   924 
       
   925