Example #1
0
CircularFixationPoint::CircularFixationPoint(const ParameterValueMap &parameters):
    CircleStimulus(parameters),
    CircularRegionTrigger(registerVariable(parameters[X_POSITION]),
                          registerVariable(parameters[Y_POSITION]),
                          registerVariable(parameters[FixationPoint::TRIGGER_WIDTH]),
                          VariablePtr(parameters[FixationPoint::TRIGGER_WATCH_X]),
                          VariablePtr(parameters[FixationPoint::TRIGGER_WATCH_Y]),
                          VariablePtr(parameters[FixationPoint::TRIGGER_FLAG]))
{ }
Example #2
0
FixationPoint::FixationPoint(const ParameterValueMap &parameters):
    RectangleStimulus(parameters),
    SquareRegionTrigger(registerVariable(parameters[X_POSITION]),
                        registerVariable(parameters[Y_POSITION]),
                        registerVariable(parameters[TRIGGER_WIDTH]),
                        VariablePtr(parameters[TRIGGER_WATCH_X]),
                        VariablePtr(parameters[TRIGGER_WATCH_Y]),
                        VariablePtr(parameters[TRIGGER_FLAG]))
{ }
NIDAQDigitalChannel::NIDAQDigitalChannel(const ParameterValueMap &parameters) :
    Component(parameters),
    portNumber(parameters[PORT_NUMBER]),
    numLinesInPort(parameters[NUM_LINES_IN_PORT])
{
    if (portNumber < 0) {
        throw SimpleException(M_IODEVICE_MESSAGE_DOMAIN, "Invalid port number");
    }
    
    if (numLinesInPort < 1) {
        throw SimpleException(M_IODEVICE_MESSAGE_DOMAIN, "Invalid number of lines in port");
    }
    if (numLinesInPort % 4 != 0) {
        mwarning(M_IODEVICE_MESSAGE_DOMAIN,
                 "Reported number of lines (%d) in port %d of NIDAQ device is not a multiple of 4",
                 numLinesInPort,
                 portNumber);
    }
    
    for (std::size_t lineNumber = 0; lineNumber < maxNumLines; lineNumber++) {
        const ParameterValue &lineParameter = parameters[getLineParameterName(lineNumber)];
        if (!lineParameter.empty()) {
            if (lineNumber >= numLinesInPort) {
                throw SimpleException(M_IODEVICE_MESSAGE_DOMAIN,
                                      "Requested line number exceeds number of lines in port");
            }
            lineVariables.at(lineNumber) = VariablePtr(lineParameter);
        }
    }
}
Example #4
0
GenericWindow::GenericWindow( intf_thread_t *pIntf, int left, int top,
                              bool dragDrop, bool playOnDrop,
                              GenericWindow *pParent, WindowType_t type ):
    SkinObject( pIntf ), m_type( type ), m_left( left ), m_top( top ),
    m_width( 0 ), m_height( 0 ), m_pVarVisible( NULL )
{
    // Get the OSFactory
    OSFactory *pOsFactory = OSFactory::instance( getIntf() );

    // Get the parent OSWindow, if any
    OSWindow *pOSParent = NULL;
    if( pParent )
    {
        pOSParent = pParent->m_pOsWindow;
    }

    // Create an OSWindow to handle OS specific processing
    m_pOsWindow = pOsFactory->createOSWindow( *this, dragDrop, playOnDrop,
                                              pOSParent, type );

    // Create the visibility variable and register it in the manager
    m_pVarVisible = new VarBoolImpl( pIntf );
    VarManager::instance( pIntf )->registerVar( VariablePtr( m_pVarVisible ) );

    // Observe the visibility variable
    m_pVarVisible->addObserver( this );
}
Example #5
0
EqualizerBands::EqualizerBands( intf_thread_t *pIntf ): SkinObject( pIntf ),
    m_isUpdating( false )
{
    for( int i = 0; i < kNbBands; i++ )
    {
        // Create and observe the band variables
        VarPercent *pVar = new VarPercent( pIntf );
        m_cBands[i] = VariablePtr( pVar );
        pVar->set( 0.5f );
        pVar->addObserver( this );
    }
}
Example #6
0
VarTree::VarTree( intf_thread_t *pIntf )
    : Variable( pIntf ), m_pParent( NULL ), m_id( 0 ),
      m_readonly( false ), m_selected( false ),
      m_playing( false ), m_expanded( false ),
      m_flat( false ), m_dontMove( false )
{
    // Create the position variable
    m_cPosition = VariablePtr( new VarPercent( pIntf ) );
    getPositionVar().set( 1.0 );

    getPositionVar().addObserver( this );
}
Example #7
0
ScheduledActions::ScheduledActions(const ParameterValueMap &parameters) :
    Action(parameters),
    clock(Clock::instance()),
    delay(parameters[DELAY]),
    n_repeats(parameters[REPEATS]),
    interval(parameters[DURATION])
{
    if (!parameters[CANCEL].empty()) {
        cancel = VariablePtr(parameters[CANCEL]);
    }

    init();
}
Example #8
0
VarTree::VarTree( const VarTree& v )
    : Variable( v.getIntf() ),
      m_children( v.m_children), m_pParent( v.m_pParent ),
      m_id( v.m_id ), m_cString( v.m_cString ),
      m_readonly( v.m_readonly ), m_selected( v.m_selected ),
      m_playing( v.m_playing ), m_expanded( v.m_expanded ),
      m_flat( false ), m_dontMove( false )
{
    // Create the position variable
    m_cPosition = VariablePtr( new VarPercent( getIntf() ) );
    getPositionVar().set( 1.0 );

    getPositionVar().addObserver( this );
}
Example #9
0
BaseFrameListStimulus::BaseFrameListStimulus(const ParameterValueMap &parameters) :
    StandardDynamicStimulus(parameters),
    loop(registerVariable(parameters[LOOP])),
    repeats(registerVariable(parameters[REPEATS])),
    lastFrameDrawn(-1),
    didSetEnding(false),
    didSetEnded(false)
{
    // We need to use find() because "stimulus_group" isn't a valid parameter for all
    // BaseFrameListStimulus subclasses, meaning it won't always have a default value
    if ((parameters.find(STIMULUS_GROUP) != parameters.end()) && !(parameters[STIMULUS_GROUP].empty())) {
        stimulusGroup = StimulusGroupPtr(parameters[STIMULUS_GROUP]);
    }
    
    // Ditto for "ending"
    if ((parameters.find(ENDING) != parameters.end()) && !(parameters[ENDING].empty())) {
        ending = VariablePtr(parameters[ENDING]);
    }
    
    if (!(parameters[ENDED].empty())) {
        ended = VariablePtr(parameters[ENDED]);
    }
}
Example #10
0
TopWindow::TopWindow( intf_thread_t *pIntf, int left, int top,
                      WindowManager &rWindowManager,
                      bool dragDrop, bool playOnDrop, bool visible ):
    GenericWindow( pIntf, left, top, dragDrop, playOnDrop, NULL ),
    m_visible( visible ), m_rWindowManager( rWindowManager ),
    m_pActiveLayout( NULL ), m_pLastHitControl( NULL ),
    m_pCapturingControl( NULL ), m_pFocusControl( NULL ), m_currModifier( 0 )
{
    // Register as a moving window
    m_rWindowManager.registerWindow( *this );

    // Create the "maximized" variable and register it in the manager
    m_pVarMaximized = new VarBoolImpl( pIntf );
    VarManager::instance( pIntf )->registerVar( VariablePtr( m_pVarMaximized ) );
}
Example #11
0
VarTree::VarTree( intf_thread_t *pIntf, VarTree *pParent, int id,
                  const UStringPtr &rcString, bool selected, bool playing,
                  bool expanded, bool readonly )
    : Variable( pIntf ), m_pParent( pParent ),
      m_id( id ), m_cString( rcString ),
      m_readonly( readonly ), m_selected( selected ),
      m_playing( playing ), m_expanded( expanded ),
      m_flat( false ), m_dontMove( false )
{
    // Create the position variable
    m_cPosition = VariablePtr( new VarPercent( pIntf ) );
    getPositionVar().set( 1.0 );

    getPositionVar().addObserver( this );
}
Example #12
0
WindowManager::WindowManager( intf_thread_t *pIntf ):
    SkinObject( pIntf ), m_magnet( 0 ), m_alpha( 255 ), m_moveAlpha( 255 ),
    m_opacityEnabled( false ), m_opacity( 255 ), m_direction( kNone ),
    m_maximizeRect(0, 0, 50, 50), m_pTooltip( NULL ), m_pPopup( NULL )
{
    // Create and register a variable for the "on top" status
    VarManager *pVarManager = VarManager::instance( getIntf() );
    m_cVarOnTop = VariablePtr( new VarBoolImpl( getIntf() ) );
    pVarManager->registerVar( m_cVarOnTop, "vlc.isOnTop" );

    // transparency switched on or off by user
    m_opacityEnabled = var_InheritBool( getIntf(), "skins2-transparency" );

    // opacity overridden by user
    m_opacity = 255 * var_InheritFloat( getIntf(), "qt-opacity" );
}
Example #13
0
GenericLayout::GenericLayout( intf_thread_t *pIntf, int width, int height,
                              int minWidth, int maxWidth, int minHeight,
                              int maxHeight ):
    SkinObject( pIntf ), m_pWindow( NULL ), m_width( width ),
    m_height( height ), m_minWidth( minWidth ), m_maxWidth( maxWidth ),
    m_minHeight( minHeight ), m_maxHeight( maxHeight ), m_pVideoControl( NULL ),
    m_visible( false ), m_pVarActive( NULL )
{
    // Get the OSFactory
    OSFactory *pOsFactory = OSFactory::instance( getIntf() );
    // Create the graphics buffer
    m_pImage = pOsFactory->createOSGraphics( width, height );

    // Create the "active layout" variable and register it in the manager
    m_pVarActive = new VarBoolImpl( pIntf );
    VarManager::instance( pIntf )->registerVar( VariablePtr( m_pVarActive ) );
}
Example #14
0
NE500PumpNetworkDevice::NE500PumpNetworkDevice(const ParameterValueMap &parameters) :
    IODevice(parameters),
    response_timeout(parameters[RESPONSE_TIMEOUT]),
    logPumpCommands(parameters[LOG_PUMP_COMMANDS]),
    active(false)
{
    std::string address;
    if (!parameters[ADDRESS].empty()) {
        address = VariablePtr(parameters[ADDRESS])->getValue().getString();
    }
    
    if (parameters[PORT].empty()) {
        connection.reset(new NE500SerialConnection(address));
    } else {
        if (address.empty()) {
            throw SimpleException(M_IODEVICE_MESSAGE_DOMAIN, "Address required for NE500 socket connection");
        }
        connection.reset(new NE500SocketConnection(address, int(parameters[PORT])));
    }
}
Example #15
0
EyeStatusMonitorVer1::EyeStatusMonitorVer1(const ParameterValueMap &parameters) :
    EyeStatusMonitor(VariablePtr(parameters[EYEH_CALIBRATED]),
                     VariablePtr(parameters[EYEV_CALIBRATED]),
                     VariablePtr(parameters[EYE_STATE]),
                     int(parameters[WIDTH_SAMPLES])),
    eyeVelocityHIndex(-1),
    eyeVelocityVIndex(-1)
{
    eyeStatusComputer = new EyeStatusComputer(int(parameters[WIDTH_SAMPLES]),
                                              VariablePtr(parameters[SACCADE_ENTRY_SPEED]),
                                              VariablePtr(parameters[SACCADE_EXIT_SPEED]));
    
    if (!(parameters[EYE_VELOCITY_H].empty())) {
        eyeVelocityHIndex = registerOutput(VariablePtr(parameters[EYE_VELOCITY_H]));
    }
    if (!(parameters[EYE_VELOCITY_V].empty())) {
        eyeVelocityVIndex = registerOutput(VariablePtr(parameters[EYE_VELOCITY_V]));
    }
}
Example #16
0
VarList::VarList( intf_thread_t *pIntf ): Variable( pIntf )
{
    // Create the position variable
    m_cPosition = VariablePtr( new VarPercent( pIntf ) );
    getPositionVar().set( 1.0 );
}
Eyelink::Eyelink(const ParameterValueMap &parameters) :
IODevice(parameters),
e_dist(parameters[E_DIST]),
update_period(parameters[UPDATE_PERIOD]),
tracker_ip(parameters[IP].str()),
clock(Clock::instance()),
errors(0),
ack_msg_counter(0)  {
    if (!(parameters[RX].empty())) { e_rx = VariablePtr(parameters[RX]); }
    if (!(parameters[RY].empty())) { e_ry = VariablePtr(parameters[RY]); }
    if (!(parameters[LX].empty())) { e_lx = VariablePtr(parameters[LX]); }
    if (!(parameters[LY].empty())) { e_ly = VariablePtr(parameters[LY]); }
    if (!(parameters[EX].empty())) { e_x = VariablePtr(parameters[EX]); }
    if (!(parameters[EY].empty())) { e_y = VariablePtr(parameters[EY]); }
    if (!(parameters[EZ].empty())) { e_z = VariablePtr(parameters[EZ]); }
    if (!(parameters[H_RX].empty())) { h_rx = VariablePtr(parameters[H_RX]); }
    if (!(parameters[H_RY].empty())) { h_ry = VariablePtr(parameters[H_RY]); }
    if (!(parameters[H_LX].empty())) { h_lx = VariablePtr(parameters[H_LX]); }
    if (!(parameters[H_LY].empty())) { h_ly = VariablePtr(parameters[H_LY]); }
    if (!(parameters[P_RX].empty())) { p_rx = VariablePtr(parameters[P_RX]); }
    if (!(parameters[P_RY].empty())) { p_ry = VariablePtr(parameters[P_RY]); }
    if (!(parameters[P_LX].empty())) { p_lx = VariablePtr(parameters[P_LX]); }
    if (!(parameters[P_LY].empty())) { p_ly = VariablePtr(parameters[P_LY]); }
    if (!(parameters[P_R].empty())) { p_r = VariablePtr(parameters[P_R]); }
    if (!(parameters[P_L].empty())) { p_l = VariablePtr(parameters[P_L]); }
    if (!(parameters[EYE_TIME].empty())) { e_time = VariablePtr(parameters[EYE_TIME]); }
}
VariablePtr FreezableCollection::registerVariable(const ParameterValue &param, bool check_for_duplicates) {
    return registerVariable(VariablePtr(param), check_for_duplicates);
}
Example #19
0
//! main routine implementing outer approximation
int main(int argc, char** argv)
{
  //! Declaration of Variables ============================================
  //! interface to AMPL (NULL):
  MINOTAUR_AMPL::AMPLInterfacePtr iface = MINOTAUR_AMPL::AMPLInterfacePtr();  
  MINOTAUR_AMPL::JacobianPtr jPtr;            //! Jacobian read from AMPL
  MINOTAUR_AMPL::HessianOfLagPtr hPtr;        //! Hessian read from AMPL

  //! environment, timers, options:
  EnvPtr env = (EnvPtr) new Environment();
  TimerFactory *tFactory = new TimerFactory();     
  Timer *timer=tFactory->getTimer();
  OptionDBPtr options;                        //! AMPL and MINOTAUR options

  //! problem pointers (MINLP, NLP, MILP):
  ProblemPtr minlp;                           //! MINLP instance to be solved
  ProblemPtr milp;                            //! MILP master problem

  //! solver pointers, including status
  FilterSQPEngine e(env);                     //! NLP engine: FilterSQP
  EngineStatus status;

  //! pointers to manipulate variables & constraints
  VariablePtr v, objVar;                      //! variable pointer (objective)
  ObjectivePtr objFun;                        //! remember objective function pt.

  //! local variables
  Double *x, *xsoln;
  Double *lobnd, *upbnd;
  Double objfLo = -INFINITY, objfUp = INFINITY, objfNLP, objfMIP;
  Double tol = 1E-2;
  Int    feasibleNLP = 0, iterOA = 1, n;
  // ======================================================================

  //! start the timer
  timer->start();

  //! make sure solver is used correctly
  if (argc < 2) {
    usage();
    return -1;
  }

  //! add AMPL options & flags to environment: flags (options without values)
  options = env->getOptions();
  add_ampl_flags(options);
  env->readOptions(argc, argv);                  //! parse options
  if (!checkUserOK(options,env)) goto CLEANUP;   //! check if user needs help

  //! read MINLP from AMPL & create Hessian/Jacobian for NLP solves
  iface = (MINOTAUR_AMPL::AMPLInterfacePtr) new MINOTAUR_AMPL::AMPLInterface(env);
  minlp = iface->readInstance(options->findString("problem_file")->getValue(),false);
  jPtr  = (MINOTAUR_AMPL::JacobianPtr)      new MINOTAUR_AMPL::Jacobian(iface);
  hPtr  = (MINOTAUR_AMPL::HessianOfLagPtr)  new MINOTAUR_AMPL::HessianOfLag(iface);
  minlp->setJacobian(jPtr);
  minlp->setHessian(hPtr);
    
  //! Display number of constraints and variables, and MINLP problem
  minlp->calculateSize();
  n = minlp->getNumVars();
  std::cout << "No. of vars, cons = " << minlp->getNumVars() 
            << minlp->getNumCons() << std::endl;
  std::cout << std::endl << "The MINLP problem is: " << std::endl;
  minlp->write(std::cout);

  //! load the MINLP into the NLP solver (FilterSQP)
  e.load(minlp);

  //! get initial point & save original bounds
  x     = new Double[n];
  xsoln = new Double[n];
  lobnd = new Double[n];
  upbnd = new Double[n];
  std::copy(iface->getInitialPoint(),iface->getInitialPoint()+n,x);
  for (VariableConstIterator i=minlp->varsBegin(); i!=minlp->varsEnd(); ++i) {
    v = *i;
    lobnd[v->getId()] = v->getLb();
    upbnd[v->getId()] = v->getUb();
  }

  //! initialize the MILP master problem by copying variables & linear c/s
  milp   = (ProblemPtr) new Problem();
  objFun = minlp->getObjective();
  objVar = VariablePtr();
  initMaster(minlp, milp, objVar, objFun, x);

  while ((objfLo <= objfUp)&&(iterOA<4)){

    std::cout << "Iteration " << iterOA << std::endl 
              << "===============" << std::endl << std::endl;

    //! set-up and solve NLP(y) with fixed integers
    solveNLP(minlp, e, x, objfNLP, feasibleNLP, n);
    std::cout << "Solved NLP " << iterOA << "  objective = " << objfNLP 
              << "  NLPfeasible = " << feasibleNLP << std::endl;
    if (feasibleNLP && (objfNLP-tol < objfUp)) {
      objfUp = objfNLP - tol;
      std::copy(x,x+n,xsoln);
    }
        
    //! update MILP master problem by adding outer approximations
    updateMaster(minlp, milp, objVar, objFun, objfUp, x, n);

    //! solve MILP master problem
    solveMaster(env, milp, x, &objfMIP, n);
    objfLo = objfMIP;

    iterOA = iterOA + 1;

  } // end while (objfLo <= objfUp) 

  //! output final result & timing
  std::cout << std::endl << "END outer-approximation: f(x) = " << objfUp 
            << "   time used = " << timer->query() << std::endl;

CLEANUP:
  //! free storage 
   delete timer;
   delete tFactory;
   if (minlp) {
     minlp->clear();
     delete [] x;
     delete [] xsoln;
     delete [] lobnd;
     delete [] upbnd;
   }
   if (milp) {
     milp->clear();
   }
  return 0;
} // end outer approximation main
Example #20
0
VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
    m_varEqBands( pIntf ), m_pVout( NULL ), m_pAout( NULL ),
    m_bEqualizer_started( false )
{
    // Create and register VLC variables
    VarManager *pVarManager = VarManager::instance( getIntf() );

#define REGISTER_VAR( var, type, name ) \
    var = VariablePtr( new type( getIntf() ) ); \
    pVarManager->registerVar( var, name );
    REGISTER_VAR( m_cVarRandom, VarBoolImpl, "playlist.isRandom" )
    REGISTER_VAR( m_cVarLoop, VarBoolImpl, "playlist.isLoop" )
    REGISTER_VAR( m_cVarRepeat, VarBoolImpl, "playlist.isRepeat" )
    REGISTER_VAR( m_cPlaytree, Playtree, "playtree" )
    pVarManager->registerVar( getPlaytreeVar().getPositionVarPtr(),
                              "playtree.slider" );
    pVarManager->registerVar( m_cVarRandom, "playtree.isRandom" );
    pVarManager->registerVar( m_cVarLoop, "playtree.isLoop" );

    REGISTER_VAR( m_cVarPlaying, VarBoolImpl, "vlc.isPlaying" )
    REGISTER_VAR( m_cVarStopped, VarBoolImpl, "vlc.isStopped" )
    REGISTER_VAR( m_cVarPaused, VarBoolImpl, "vlc.isPaused" )

    /* Input variables */
    pVarManager->registerVar( m_cVarRepeat, "playtree.isRepeat" );
    REGISTER_VAR( m_cVarTime, StreamTime, "time" )
    REGISTER_VAR( m_cVarSeekable, VarBoolImpl, "vlc.isSeekable" )
    REGISTER_VAR( m_cVarDvdActive, VarBoolImpl, "dvd.isActive" )

    REGISTER_VAR( m_cVarRecordable, VarBoolImpl, "vlc.canRecord" )
    REGISTER_VAR( m_cVarRecording, VarBoolImpl, "vlc.isRecording" )

    /* Vout variables */
    REGISTER_VAR( m_cVarFullscreen, VarBoolImpl, "vlc.isFullscreen" )
    REGISTER_VAR( m_cVarHasVout, VarBoolImpl, "vlc.hasVout" )

    /* Aout variables */
    REGISTER_VAR( m_cVarHasAudio, VarBoolImpl, "vlc.hasAudio" )
    REGISTER_VAR( m_cVarVolume, Volume, "volume" )
    REGISTER_VAR( m_cVarMute, VarBoolImpl, "vlc.isMute" )
    REGISTER_VAR( m_cVarEqualizer, VarBoolImpl, "equalizer.isEnabled" )
    REGISTER_VAR( m_cVarEqPreamp, EqualizerPreamp, "equalizer.preamp" )

#undef REGISTER_VAR
    m_cVarSpeed = VariablePtr( new VarText( getIntf(), false ) );
    pVarManager->registerVar( m_cVarSpeed, "speed" );
    SET_TEXT( m_cVarSpeed, UString( getIntf(), "1") );
    m_cVarStreamName = VariablePtr( new VarText( getIntf(), false ) );
    pVarManager->registerVar( m_cVarStreamName, "streamName" );
    m_cVarStreamURI = VariablePtr( new VarText( getIntf(), false ) );
    pVarManager->registerVar( m_cVarStreamURI, "streamURI" );
    m_cVarStreamBitRate = VariablePtr( new VarText( getIntf(), false ) );
    pVarManager->registerVar( m_cVarStreamBitRate, "bitrate" );
    m_cVarStreamSampleRate = VariablePtr( new VarText( getIntf(), false ) );
    pVarManager->registerVar( m_cVarStreamSampleRate, "samplerate" );
    m_cVarStreamArt = VariablePtr( new VarString( getIntf() ) );
    pVarManager->registerVar( m_cVarStreamArt, "streamArt" );

    // Register the equalizer bands
    for( int i = 0; i < EqualizerBands::kNbBands; i++)
    {
        stringstream ss;
        ss << "equalizer.band(" << i << ")";
        pVarManager->registerVar( m_varEqBands.getBand( i ), ss.str() );
    }

    // XXX WARNING XXX
    // The object variable callbacks are called from other VLC threads,
    // so they must put commands in the queue and NOT do anything else
    // (X11 calls are not reentrant)

#define ADD_CALLBACK( p_object, var ) \
    var_AddCallback( p_object, var, onGenericCallback, this );

    ADD_CALLBACK( pIntf->p_sys->p_playlist, "volume" )
    ADD_CALLBACK( pIntf->p_libvlc, "intf-toggle-fscontrol" )

    ADD_CALLBACK( pIntf->p_sys->p_playlist, "item-current" )
    ADD_CALLBACK( pIntf->p_sys->p_playlist, "random" )
    ADD_CALLBACK( pIntf->p_sys->p_playlist, "loop" )
    ADD_CALLBACK( pIntf->p_sys->p_playlist, "repeat" )

#undef ADD_CALLBACK

    // Called when a playlist item is added
    var_AddCallback( pIntf->p_sys->p_playlist, "playlist-item-append",
                     onItemAppend, this );
    // Called when a playlist item is deleted
    // TODO: properly handle item-deleted
    var_AddCallback( pIntf->p_sys->p_playlist, "playlist-item-deleted",
                     onItemDelete, this );
    // Called when the current input changes
    var_AddCallback( pIntf->p_sys->p_playlist, "input-current",
                     onInputNew, this );
    // Called when a playlist item changed
    var_AddCallback( pIntf->p_sys->p_playlist, "item-change",
                     onItemChange, this );

    // Called when we have an interaction dialog to display
    var_Create( pIntf, "interaction", VLC_VAR_ADDRESS );
    var_AddCallback( pIntf, "interaction", onInteraction, this );

    // initialize variables refering to liblvc and playlist objects
    init_variables();
}