Logo Search packages:      
Sourcecode: jacktrip version File versions  Download package

void Settings::startJackTrip (  )

Todo:
Change this, just here to test

Definition at line 276 of file Settings.cpp.

References JackTrip::appendProcessPlugin(), JackTrip::CLIENT, JackTrip::CLIENTTOPINGSERVER, DataProtocol::EMPTY, DataProtocol::JAMLINK, mBufferQueueLength, mDataProtocol, mEmptyHeader, mJackTrip, mJackTripMode, mJackTripServer, mJamLink, mLoopBack, mNumChans, mPeerAddress, mPortNum, mRedundancy, mUnderrrunZero, JackTrip::setAllPorts(), JackTrip::setClientName(), JackTrip::setPacketHeaderType(), JackTrip::setPeerAddress(), JackTrip::setUnderRunMode(), JackTrip::start(), and JackTrip::ZEROS.

{

  ///\todo Change this, just here to test
  if ( mJackTripServer ) {
    UdpMasterListener* udpmaster = new UdpMasterListener;
    udpmaster->start();
    
    //---Thread Pool Test--------------------------------------------
    /*
    cout << "BEFORE START" << endl;
    ThreadPoolTest* thtest = new ThreadPoolTest();
    // QThreadPool takes ownership and deletes 'hello' automatically
    QThreadPool::globalInstance()->start(thtest);

    cout << "AFTER START" << endl;
    sleep(2);
    thtest->stop();
    QThreadPool::globalInstance()->waitForDone();
    */
    //---------------------------------------------------------------
  }
  
  else {
    
    //JackTrip jacktrip(mJackTripMode, mDataProtocol, mNumChans,
    //          mBufferQueueLength, mAudioBitResolution);
    mJackTrip = new JackTrip(mJackTripMode, mDataProtocol, mNumChans,
                       mBufferQueueLength, mRedundancy, mAudioBitResolution);
    
    // Change client name if different from default
    if (mClientName != NULL) {
      mJackTrip->setClientName(mClientName);
    }

    // Set buffers to zero when underrun
    if ( mUnderrrunZero ) {
      cout << "Setting buffers to zero when underrun..." << endl;
      cout << gPrintSeparator << std::endl;
      mJackTrip->setUnderRunMode(JackTrip::ZEROS);
    }
    
    // Set peer address in server mode
    if ( mJackTripMode == JackTrip::CLIENT || mJackTripMode == JackTrip::CLIENTTOPINGSERVER ) {
      mJackTrip->setPeerAddress(mPeerAddress.toLatin1().data()); }
    
    // Set Ports
    cout << "SETTING ALL PORTS" << endl;
    mJackTrip->setAllPorts(mPortNum);

    // Set in JamLink Mode
    if ( mJamLink ) {
      cout << "Running in JamLink Mode..." << endl;
      cout << gPrintSeparator << std::endl;
      mJackTrip->setPacketHeaderType(DataProtocol::JAMLINK);
    }

    // Set in EmptyHeader Mode
    if ( mEmptyHeader ) {
      cout << "Running in EmptyHeader Mode..." << endl;
      cout << gPrintSeparator << std::endl;
      mJackTrip->setPacketHeaderType(DataProtocol::EMPTY);
    }

    // Add Plugins
    if ( mLoopBack ) {
      cout << "Running in Loop-Back Mode..." << endl;
      cout << gPrintSeparator << std::endl;
      //std::tr1::shared_ptr<LoopBack> loopback(new LoopBack(mNumChans));
      //mJackTrip->appendProcessPlugin(loopback.get());

      LoopBack* loopback = new LoopBack(mNumChans);
      mJackTrip->appendProcessPlugin(loopback);

      // ----- Test Karplus Strong -----------------------------------
      //std::tr1::shared_ptr<NetKS> loopback(new NetKS());
      //mJackTrip->appendProcessPlugin(loopback);
      //loopback->play();
      //NetKS* netks = new NetKS;
      //mJackTrip->appendProcessPlugin(netks);
      //netks->play();
      // -------------------------------------------------------------
    }
    
    // Start JackTrip
    mJackTrip->start();
    
    /* 
       sleep(10);
       cout << "Stoping JackTrip..." << endl;
       mJackTrip->stop();
    */
  }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index