void SaffirePro24::SaffirePro24EAP::setupDestinations_mid() { addDestination("SPDIF/Out", 6, 2, eRD_AES, 1); addDestination("Line/Out", 0, 6, eRD_InS0, 1); addDestination("Mixer/In", 0, 16, eRD_Mixer0, 1); addDestination("Mixer/In", 0, 2, eRD_Mixer1, 17); addDestination("1394/Out", 0, 12, eRD_ATX0, 1); // Is a Mute destination useful ? // addDestination("Mute", 0, 1, eRD_Muted); }
void FirestudioProject::FirestudioProjectEAP::setupDestinations_low() { addDestination("SPDIF/Out", 2, 2, eRD_AES, 1); addDestination("Line/Out", 0, 8, eRD_InS0, 1); addDestination("Mixer/In", 0, 16, eRD_Mixer0, 1); addDestination("Mixer/In", 0, 2, eRD_Mixer1, 17); addDestination("1394/Out", 0, 10, eRD_ATX0, 1); // Is a Mute destination useful ? // addDestination("Mute", 0, 1, eRD_Muted); }
void FirestudioTube::FirestudioTubeEAP::setupDestinations_low() { addDestination("Line/Out", 0, 6, eRD_InS0, 1); addDestination("Head/Out", 6, 2, eRD_InS0, 7); addDestination("Mixer/In", 0, 16, eRD_Mixer0, 1); addDestination("Mixer/In", 0, 2, eRD_Mixer1, 17); addDestination("1394/Out", 0, 16, eRD_ATX0, 1); // Is a Mute destination useful ? // addDestination("Mute", 0, 1, eRD_Muted); }
void Profire2626::Profire2626EAP::setupDestinations_mid() { addDestination("Line/Out", 0, 8, eRD_InS1, 1); addDestination("ADAT A/Out", 0, 4, eRD_ADAT, 1); addDestination("ADAT B/Out", 4, 4, eRD_ADAT, 1); addDestination("SPDIF/Out", 0, 2, eRD_AES, 1); addDestination("Mixer/In", 0, 16, eRD_Mixer0, 1); addDestination("Mixer/In", 0, 2, eRD_Mixer1, 17); addDestination("1394/Out", 0, 16, eRD_ATX0, 1); addDestination("1394/Out", 0, 10, eRD_ATX1, 1); addDestination("Mute", 0, 1, eRD_Muted); }
// Constructor for a source-specific multicast group Groupsock::Groupsock(UsageEnvironment& env, struct in_addr const& groupAddr, struct in_addr const& sourceFilterAddr, Port port) : OutputSocket(env, port), deleteIfNoMembers(False), isSlave(False), fIncomingGroupEId(groupAddr, sourceFilterAddr, port.num()), fDests(NULL), fTTL(255) { addDestination(groupAddr, port); // First try a SSM join. If that fails, try a regular join: if (!socketJoinGroupSSM(env, socketNum(), groupAddr.s_addr, sourceFilterAddr.s_addr)) { if (DebugLevel >= 3) { env << *this << ": SSM join failed: " << env.getResultMsg(); env << " - trying regular join instead\n"; } if (!socketJoinGroup(env, socketNum(), groupAddr.s_addr)) { if (DebugLevel >= 1) { env << *this << ": failed to join group: " << env.getResultMsg() << "\n"; } } } if (DebugLevel >= 2) env << *this << ": created\n"; }
void TravelWindow::startTravel(const MWWorld::Ptr& actor) { center(); mPtr = actor; clearDestinations(); for(unsigned int i = 0;i<mPtr.get<ESM::NPC>()->mBase->mTransport.size();i++) { std::string cellname = mPtr.get<ESM::NPC>()->mBase->mTransport[i].mCellName; bool interior = true; int x,y; MWBase::Environment::get().getWorld()->positionToIndex(mPtr.get<ESM::NPC>()->mBase->mTransport[i].mPos.pos[0], mPtr.get<ESM::NPC>()->mBase->mTransport[i].mPos.pos[1],x,y); if (cellname == "") { MWWorld::CellStore* cell = MWBase::Environment::get().getWorld()->getExterior(x,y); cellname = MWBase::Environment::get().getWorld()->getCellName(cell); interior = false; } addDestination(cellname,mPtr.get<ESM::NPC>()->mBase->mTransport[i].mPos,interior); } updateLabels(); mDestinationsView->setCanvasSize (MyGUI::IntSize(mDestinationsView->getWidth(), std::max(mDestinationsView->getHeight(), mCurrentY))); }
void TravelWindow::setPtr(const MWWorld::Ptr& actor) { center(); mPtr = actor; clearDestinations(); std::vector<ESM::Transport::Dest> transport; if (mPtr.getClass().isNpc()) transport = mPtr.get<ESM::NPC>()->mBase->getTransport(); else if (mPtr.getTypeName() == typeid(ESM::Creature).name()) transport = mPtr.get<ESM::Creature>()->mBase->getTransport(); for(unsigned int i = 0;i<transport.size();i++) { std::string cellname = transport[i].mCellName; bool interior = true; int x,y; MWBase::Environment::get().getWorld()->positionToIndex(transport[i].mPos.pos[0], transport[i].mPos.pos[1],x,y); if (cellname == "") { MWWorld::CellStore* cell = MWBase::Environment::get().getWorld()->getExterior(x,y); cellname = MWBase::Environment::get().getWorld()->getCellName(cell); interior = false; } addDestination(cellname,transport[i].mPos,interior); } updateLabels(); // Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the scrollbar is hidden mDestinationsView->setVisibleVScroll(false); mDestinationsView->setCanvasSize (MyGUI::IntSize(mDestinationsView->getWidth(), std::max(mDestinationsView->getHeight(), mCurrentY))); mDestinationsView->setVisibleVScroll(true); }
// Constructor for a source-independent multicast group Groupsock::Groupsock(UsageEnvironment& env, struct in_addr const& groupAddr, Port port, u_int8_t ttl) : OutputSocket(env, port), deleteIfNoMembers(False), isSlave(False), fIncomingGroupEId(groupAddr, port.num(), ttl), fDests(NULL), fTTL(ttl) { addDestination(groupAddr, port); // printf("Groupsock: grpaddr %s\n", inet_ntoa(groupAddr)); //jay if (!socketJoinGroup(env, socketNum(), groupAddr.s_addr)) { if (DebugLevel >= 1) { env << *this << ": failed to join group: " << env.getResultMsg() << "\n"; } } // Make sure we can get our source address: if (ourIPAddress(env) == 0) { if (DebugLevel >= 0) { // this is a fatal error env << "Unable to determine our source address: " << env.getResultMsg() << "\n"; } } if (DebugLevel >= 2) env << *this << ": created\n"; }
/** \param[in] action Set the action name to do when arrive in the port. \param[in] portName Set the port name to go to. If NULL and no destinations, a FconditionLink will apply. \retval RET_OK No problemo. \retval RET_STRING2LONG To long string 'linkFieldsNames'. */ long FevenData::setPortAction( char* action, char* portName) { char b[ MAX_STRING]; long l = 1; if( portName) l += strlen( portName); l += strlen( action); if( l > MAX_STRING) return RET_STRING2LONG; if( portName) strcpy( b, portName); else b[ 0] = 0; if( l) { strcat( b, ":"); strcat( b, action); } addDestination( b); if( destination.getCount()) currentDestination = destination.getCount() - 1; else currentDestination = 0; return RET_OK; }
void Solver::Data::Connection::addDestination (uint destRow, uint destCol, uint destRegionID) { addDestination(Position(destCol, destRow), destRegionID); }
SubRouteRequestPacket::SubRouteRequestPacket(const DriverPref* driverPref, const SubRouteVector* origs, const OrigDestInfoList* dests, const OrigDestInfoList* allDests, bool routeToOneDest, uint32 cutOff, int levelDelta, const DisturbanceVector* disturbances, bool calcCostSums, bool dontSendSubRoutes, const DisturbanceVector* infoModuleDists ) { mc2dbg4 << "SubRouteRequestPacket::SubRouteRequestPacket" << endl; setPriority(DEFAULT_PACKET_PRIO); // Calculate size of request // Origins and destinations // Do something about the listtype if ( driverPref->getVehicleRestriction() != ItemTypes::pedestrian ) { setListType(SubRouteListTypes::LOWER_LEVEL); } else { // Pedestrian setListType(SubRouteListTypes::LOWER_LEVEL_WALK); // Lower level walk } uint32 reqSize = SUBROUTE_REQUEST_HEADER_SIZE; // The number of subroutes int nbrSubRoutes = origs->getSize() + // Add the destinations for HIGHER_LEVEL too ((getListType() == SubRouteListTypes::HIGHER_LEVEL) ? dests->size() : 0); // Origin. Will probably be removed if ( origs != NULL && getListType() == SubRouteListTypes::HIGHER_LEVEL ) reqSize += origs->size() * ORIG_DEST_SIZE; // Destinations if ( dests != NULL ) reqSize += dests->size() * ORIG_DEST_SIZE; // Subroutes. for(uint32 i=0; i < origs->size() ; i++ ) { reqSize += SUB_ROUTE_SIZE + SUB_ROUTE_CONNECTION_SIZE * 1; } // Compensate for disturbances // Length reqSize += 4; if ( disturbances != NULL ) { reqSize += DISTURBANCE_SIZE*disturbances->size(); } reqSize += 4; if ( infoModuleDists != NULL ) { reqSize += 8 * infoModuleDists->size(); } if ( reqSize > getBufSize() ) { mc2dbg2 << "SubRouteRequestPacket - buffer too small reallocing" << endl; byte* temp = MAKE_UINT32_ALIGNED_BYTE_BUFFER( reqSize * 2); memcpy(temp, this->buffer, SUBROUTE_REQUEST_HEADER_SIZE); delete [] this->buffer; this->buffer = temp; this->bufSize = reqSize * 2; } // First request? Won't exactly work all the time... bool original = origs->front()->getPrevSubRouteID() == MAX_UINT32; if ( levelDelta == 1 ) { // Higher level routing - do some tricks setMapID( FIRST_OVERVIEWMAP_ID ); setListType(SubRouteListTypes::HIGHER_LEVEL); } //setOriginIP(leaderIP); //setOriginPort(leaderPort); setSubType(Packet::PACKETTYPE_SUBROUTEREQUEST); // Get mapid from one of the origins setMapID(origs->front()->getNextMapID() ); // Setting the extra vehicle to avoid toll roads. uint32 extraVehicle = 0; if ( driverPref->avoidTollRoads() ) { extraVehicle |= ItemTypes::avoidTollRoad; } if ( driverPref->avoidHighways() ) { extraVehicle |= ItemTypes::avoidHighway; } setVehicleRestrictions( driverPref->getVehicleRestriction() | extraVehicle ); setRoutingCosts(driverPref->getRoutingCosts()); setUseTurnCost(driverPref->useUturn()); setTime(driverPref->getTime()); setMinWaitTime(driverPref->getMinWaitTime()); // Some flags. setRouteToAll(! routeToOneDest ); setDontSendSubRoutes( dontSendSubRoutes ); setCalcCostSums( calcCostSums ); setRouteID(0); // Don't know what it should be. Seems to be the same // as the request id, but for the RouteReader. setCutOff(cutOff); setIsOriginalRequest(original); // Add the origins that belongs to this mapID and only the first time. setNbrOrigins(0); int pos = SUBROUTE_REQUEST_HEADER_SIZE; if ( original ) { for(uint32 i=0; i < origs->getSize(); i++) { const SubRoute* curSubRoute = origs->getSubRouteAt(i); // Destinations are origins in next route. const OrigDestInfo* orig = curSubRoute->getDestInfo(); addOrigin(*orig, pos); // addOrigin(curSubRoute->getNextMapID(), // curSubRoute->getDestNodeID(), // curSubRoute->getDestOffset(), // MAX_UINT32, // MAX_UINT32, // pos); } } // Add all destinations ( not allDests, they aren't used yet) setNbrDestinations(0); OrigDestInfoList::const_iterator it; it = dests->begin(); while ( it != dests->end() ) { addDestination(*it, pos); it++; } setNbrSubRoutes( nbrSubRoutes ); for (uint32 i = 0; i < origs->getSize(); i++) { SubRoute* subRoute = (*origs)[i]; if (subRoute != NULL) { addSubRoute(subRoute, pos); } } if ( getListType() == SubRouteListTypes::HIGHER_LEVEL ) { OrigDestInfoList::const_iterator it(dests->begin()); for(uint32 i=0; i < dests->size() ; ++i ) { SubRoute subRoute(*it, *it); ++it; // Add backward subroute for each destination. // The routemodule uses them as destinations later. addSubRoute(&subRoute, pos, false); } } addDisturbances(pos, disturbances); // Add info module disturbances using the more compact format. addInfoModDisturbances( pos, infoModuleDists ); setLength(pos); if ( true || pos > (int)reqSize || (reqSize - pos) > 65536 ) { mc2dbg2 << "SubRouteRequestPacket - calcSize = " << reqSize << "real size = " << pos << endl; } } // Constructor