bool CMoviePlayerDlg::Open(LPCTSTR Path) { if (!m_Movie.Open(Path, TRUE)) return(FALSE); m_Path = Path; SetTitle(); if (IsWindow(m_hWnd)) { m_Pos.SetRange(0, m_Movie.GetFrameCount() - 1); ClearRange(); int Trans = m_Transport; SetTransport(STOP); // display initial frame SetTransport(Trans); // restore previous transport } return(TRUE); }
BOOL CMoviePlayerDlg::OnInitDialog() { CPersistDlg::OnInitDialog(); GetWindowText(m_Caption); m_Frm = CMainFrame::GetThis(); ASSERT(m_Frm != NULL); CWhorldView *View = m_Frm->GetView(); m_Movie.SetView(View); SetLoop(FALSE); SetTitle(); GetWindowRect(m_InitRect); m_Hidden = FALSE; m_Transport = IsOpen() ? PLAY : STOP; // if movie is open, auto-play it SetTransport(m_Transport); m_Open.SetIcon(AfxGetApp()->LoadIcon(IDI_OPEN)); m_Save.SetIcon(AfxGetApp()->LoadIcon(IDI_SAVE)); m_TakeSnap.SetIcon(AfxGetApp()->LoadIcon(IDI_TAKE_SNAP)); m_SetIn.SetIcon(AfxGetApp()->LoadIcon(IDI_SET_IN)); m_SetOut.SetIcon(AfxGetApp()->LoadIcon(IDI_SET_OUT)); m_GotoStart.SetIcon(AfxGetApp()->LoadIcon(IDI_GOTO_START)); m_GotoEnd.SetIcon(AfxGetApp()->LoadIcon(IDI_GOTO_END)); m_Pos.SetRange(0, m_Movie.GetFrameCount() - 1); DragAcceptFiles(TRUE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void MoveSplineInit::Move(PathFinder const* pfinder) { MovebyPath(pfinder->getPath()); if (pfinder->GetTransport()) SetTransport(pfinder->GetTransport()->GetGUIDLow()); if (pfinder->getPathType() & PATHFIND_FLYPATH) SetFly(); }
void DynamicObject::CleanupsBeforeDelete(bool finalCleanup /* = true */) { WorldObject::CleanupsBeforeDelete(finalCleanup); if (Transport* transport = GetTransport()) { transport->RemovePassenger(this); SetTransport(NULL); m_movementInfo.transport.Reset(); } }
bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type) { SetMap(caster->GetMap()); Relocate(pos); if (!IsPositionValid()) { TC_LOG_ERROR("misc", "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spell->Id, GetPositionX(), GetPositionY()); return false; } WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask()); SetEntry(spell->Id); SetObjectScale(1); SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID()); SetUInt32Value(DYNAMICOBJECT_BYTES, spell->SpellVisual[0] | (type << 28)); SetUInt32Value(DYNAMICOBJECT_SPELLID, spell->Id); SetFloatValue(DYNAMICOBJECT_RADIUS, radius); SetUInt32Value(DYNAMICOBJECT_CASTTIME, getMSTime()); if (IsWorldObject()) setActive(true); //must before add to map to be put in world container Transport* transport = caster->GetTransport(); if (transport) { m_movementInfo.transport.guid = GetGUID(); float x, y, z, o; pos.GetPosition(x, y, z, o); transport->CalculatePassengerOffset(x, y, z, &o); m_movementInfo.transport.pos.Relocate(x, y, z, o); SetTransport(transport); // This object must be added to transport before adding to map for the client to properly display it transport->AddPassenger(this); } if (!GetMap()->AddToMap(this)) { // Returning false will cause the object to be deleted - remove from transport if (transport) transport->RemovePassenger(this); return false; } return true; }
Creature* Transport::AddNPCPassenger(uint32 entry, float x, float y, float z, float o, uint32 anim) { Map* map = GetMap(); //make it world object so it will not be unloaded with grid auto const creature = new Creature(true); if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, GetPhaseMask(), entry, 0, GetGOInfo()->faction, 0, 0, 0, 0)) { delete creature; return nullptr; } creature->SetTransport(this); creature->m_movementInfo.t_pos.Relocate(x, y, z, o); if (anim) creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, anim); creature->Relocate( GetPositionX() + (x * std::cos(GetOrientation()) + y * std::sin(GetOrientation() + float(M_PI))), GetPositionY() + (y * std::cos(GetOrientation()) + x * std::sin(GetOrientation())), z + GetPositionZ(), o + GetOrientation()); creature->SetHomePosition(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation()); creature->SetTransportHomePosition(creature->m_movementInfo.t_pos); if (!creature->IsPositionValid()) { TC_LOG_ERROR("entities.transport", "Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", creature->GetGUIDLow(), creature->GetEntry(), creature->GetPositionX(), creature->GetPositionY()); delete creature; return nullptr; } map->AddToMap(creature); m_NPCPassengerSet.insert(creature); creature->setActive(true); sScriptMgr->OnAddCreaturePassenger(this, creature); return creature; }
void CMixereView::OnStop() { SetTransport(CChannel::STOP); }
void CMixereView::OnPause() { SetTransport(CChannel::PAUSE); }
void CMixereView::OnPlay() { SetTransport(CChannel::PLAY); }
long DeskShareSender::DeleteTrack() { SetTransport(NULL); return MediaClient::DeleteTrack(); }