⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 13.lua

📁 htc manila 2 sourcecode
💻 LUA
字号:
-- Decompiled using luadec 0.6 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;;0,13,21,30,87;0,12,15;;0,0,7,11,15,19,23,27,31,67;;1,2,3;;;;;;;5;5,7;; 710a1147_manila_18AAC.luac 

require("theme")
if _config_os == "windowsmobile" then
   require("audio_manager_svc")
   gPlayer = MusicPlayer_Instance()
   gOriginalIndex = -1
   gTargetIndex = -1
end
gListView_Height = 80
TimeRolling = 0.099990844726563
DeltaDownY = 25
DeltaUpY = -25
gnTotalCount = 0
glistview_item_count_per_page = 7
gDragMax_Y = 700
gScreenWidth = 480
gScreenHeight = 800
OnChangeOrderTimerProc = function(l_1_0)
   l_1_0:Stop()
   if ListImageLoader ~= nil then
      ListImageLoader:Cancel()
   end
   listview.onMouseUp:disconnect(HandleMouseUp)
   listview.onMouseDown:disconnect(HandleMouseDown)
   gPlayer:Database().onRearrangeListChange:connect(OnRearrangeListChange)
   gPlayer:Database():RearrangePlaylistSongs(gOriginalIndex, gTargetIndex)
end

gChangeOrderTimer = nil
HandleMouseDown = function(l_2_0)
   if l_2_0._xmouse < gScreenWidth - 80 then
      return 
   end
   local l_2_1 = listview:GetIndexAtPoint(l_2_0._xmouse, -l_2_0._ymouse + 111)
   if l_2_1 < 0 then
      return 
   end
   gOriginalIndex = l_2_1
   local l_2_2 = ItemListGenerator:GetData(l_2_1)
   Faketitle.Color = GetMainTextUnselectedColor()
   Fakealbumartist.Color = GetSubTextUnselectedColor()
   local l_2_3 = true
   l_2_3 = MusicHelper_FileExists(l_2_2.FilePath)
   if l_2_3 == false then
      FakeImage:SetTextureRef("MusicRemove")
   elseif l_2_2.ArtPath ~= "" and MusicHelper_FileExists(l_2_2.ArtPath) == true then
      FakeImage:SetTexture(l_2_2.ArtPath)
   else
      FakeImage:SetTextureRef("Music_tile")
   end
   Faketitle.String = l_2_2.Title
   Fakealbumartist.String = l_2_2.Artist
   FakeMovingObj.Position.y = -listview._ymouse + gListView_Height / 2
   FakeMovingObj._visible = true
   ControlListViewGroup._visible = true
   ListPhysics:DisconnectMouseEvents()
   local l_2_4 = listview:GetGenerator():GetCount() - glistview_item_count_per_page
   if l_2_4 > 0 then
      gMaxOffset = l_2_4 * gListView_Height + glistview_item_count_per_page
   else
      gMaxOffset = 0
   end
   gCurrentOffset = listview:GetVerticalScrollOffset()
   listview.Opacity.value = 50
   FakeMovingObj.onMouseMove:connect(OnFakeObjMouseMove)
end

HandleMouseUp = function(l_3_0)
   if FakeMovingObj._visible == false then
      return 
   end
   local l_3_1 = listview:GetIndexAtPoint(l_3_0._xmouse, -l_3_0._ymouse + 111)
   local l_3_2 = -l_3_0._ymouse + 111
   trace("[MG-rearrange] HandleMouseUp, obj._ymouse: " .. tostring(l_3_2) .. ", indexmouse: " .. tostring(l_3_1))
   FakeMovingObj.onMouseMove:disconnect(OnFakeObjMouseMove)
   FakeMovingObj._visible = false
   ControlListViewGroup._visible = false
   if l_3_1 < 0 then
      if l_3_2 > 0 then
         gTargetIndex = 0
      else
         gTargetIndex = gnTotalCount
      end
   else
      gTargetIndex = l_3_1
   end
   trace("[MG-rearrange] HandleMouseUp, Rearrange from: " .. tostring(gOriginalIndex) .. ", to: " .. tostring(gTargetIndex))
   if gTargetIndex == gOriginalIndex + 1 then
      gTargetIndex = gTargetIndex + 1
   end
   if gTargetIndex ~= gOriginalIndex then
      if gChangeOrderTimer == nil then
         gChangeOrderTimer = timer(0.099990844726563)
         gChangeOrderTimer.OnElapsed:connect(OnChangeOrderTimerProc)
      else
         gChangeOrderTimer:Start()
      end
   end
   ListPhysics:ConnectMouseEvents()
   listview.Opacity.value = 100
end

OnFakeObjMouseMove = function(l_4_0)
   if FakeMovingObj._visible == true then
      if l_4_0._ymouse < 100 then
         return 
      end
      if l_4_0._ymouse > gDragMax_Y then
         return 
      end
      FakeMovingObj.Position.y = -l_4_0._ymouse + gListView_Height / 2
   end
end

HandleItemCreated = function(l_5_0, l_5_1)
   if _config_os == "windowsmobile" then
      local l_5_2 = l_5_1.Namespace:FindName("title")
      local l_5_3 = l_5_1.Namespace:FindName("albumartist")
      local l_5_4 = l_5_1.Namespace:FindName("image")
      local l_5_5 = l_5_1.Namespace:FindName("frame")
      local l_5_6 = l_5_1.Namespace:FindName("seperator")
      local l_5_7 = l_5_1.Namespace:FindName("TabMoveIcon")
      local l_5_8 = l_5_1.Namespace:FindName("TargetLine")
      l_5_8._visible = false
      l_5_6.TextureCoords:set(0, 0, gScreenWidth / 2, 1)
      l_5_6.Size.width = gScreenWidth
      l_5_2.Size.width = gScreenWidth - 160
      l_5_3.Size.width = gScreenWidth - 160
      l_5_7.Position.x = gScreenWidth - 62
      l_5_8.Size.width = gScreenWidth
      l_5_0.IsRealized = true
      l_5_1.Tag = l_5_0
      l_5_2.Color = GetMainTextUnselectedColor()
      l_5_3.Color = GetSubTextUnselectedColor()
      local l_5_9 = true
      l_5_9 = MusicHelper_FileExists(l_5_0.FilePath)
      if l_5_9 == false then
         l_5_4:SetTextureRef("MusicRemove")
      elseif l_5_0.ArtPath ~= "" and MusicHelper_FileExists(l_5_0.ArtPath) == true then
         l_5_4:SetTextureRef("Music_tile")
         if FakeMovingObj._visible == false then
            if ListImageLoader == nil then
               ListImageLoader = ListImageLoaderClass()
            end
            ListImageLoader:AddImage(l_5_4, l_5_0)
         end            
      else
         l_5_4:SetTextureRef("Music_tile")
      end
      l_5_2.String = l_5_0.Title
      l_5_3.String = l_5_0.Artist
      l_5_1.Focusable = true
   end
end

HandleItemDestroyed = function(l_6_0)
   l_6_0.Tag.IsRealized = false
end

OnUpdatingTimer = function()
   local l_7_0 = gCurrentOffset
   local l_7_1 = gMaxOffset
   local l_7_2 = delta
   if l_7_2 > 0 then
      if l_7_0 + l_7_2 <= l_7_1 then
         listview:ApplyScrollDelta(Vector3F(0, l_7_2, 0))
         gCurrentOffset = l_7_0 + l_7_2
      elseif l_7_0 < l_7_1 then
         listview:ApplyScrollDelta(Vector3F(0, l_7_1 - l_7_0, 0))
         gCurrentOffset = l_7_1
      end
   else
      if l_7_0 + l_7_2 >= 0 then
         listview:ApplyScrollDelta(Vector3F(0, l_7_2, 0))
         gCurrentOffset = l_7_0 + l_7_2
      elseif l_7_0 > 0 then
         listview:ApplyScrollDelta(Vector3F(0, -l_7_0, 0))
         gCurrentOffset = 0
      end
   end
end

RollOver_UPFast = function()
   delta = DeltaUpY
   OnUpdatingTimer()
   if gTimer == nil then
      gTimer = timer(TimeRolling)
      gTimer.OnElapsed:connect(OnUpdatingTimer)
   else
      gTimer:Start()
   end
end

RollOut = function()
   if gTimer ~= nil then
      gTimer:Stop()
   end
end

RollOver_DownFast = function()
   delta = DeltaDownY
   OnUpdatingTimer()
   if gTimer == nil then
      gTimer = timer(TimeRolling)
      gTimer.OnElapsed:connect(OnUpdatingTimer)
   else
      gTimer:Start()
   end
end

OnNavigateOutTo = function(l_11_0)
   MoveUpArea.onRollOver:disconnect(RollOver_UPFast)
   MoveUpArea.onRollOut:disconnect(RollOut)
   MoveUpArea.onRelease:disconnect(RollOut)
   MoveUpArea.onMouseUp:disconnect(RollOut)
   MoveDownArea.onRollOver:disconnect(RollOver_DownFast)
   MoveDownArea.onRollOut:disconnect(RollOut)
   MoveDownArea.onRelease:disconnect(RollOut)
   MoveDownArea.onMouseUp:disconnect(RollOut)
   ListPhysics:DisconnectMouseEvents()
   listview.onMouseUp:disconnect(HandleMouseUp)
   listview.onMouseDown:disconnect(HandleMouseDown)
   gPlayer:Database().onRearrangeListChange:disconnect(OnRearrangeListChange)
   _request.NavigateInFrom:disconnect(OnNavigateInFrom)
   _request.NavigateOutTo:disconnect(OnNavigateOutTo)
   Transition(l_11_0, "Out")
end

OnNavigateInFrom = function(l_12_0)
   _request.NavigateInFrom:disconnect(OnNavigateInFrom)
   Transition(l_12_0, "In")
end

RSKFunction = function()
   _application.Navigation:NavigateBack()
end

LSKFunction = function()
   local l_14_0 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
   gPlayer:Database():UpdatePlaylistSongs(l_14_0, PLMODE_CHANGE_ORDER)
   _application.Navigation:NavigateBack()
end

SelectData = function()
   local l_15_0 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
   local l_15_1 = MusicWhereConditions()
   trace("[MG-rearrange] Playlist Uid " .. l_15_0 .. "\n")
   l_15_1:AddCondition(l_15_0)
   gPlayer:Database():Select(VID_SONGS_INFO_OF_PLAYLIST, l_15_1)
   _application.Navigation.Title = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST_NAME)
end

OnRearrangeListChange = function()
   trace("[MG-rearrange] OnRearrangeListChange()")
   if FakeMovingObj._visible == true then
      FakeMovingObj.onMouseMove:disconnect(OnFakeObjMouseMove)
      FakeMovingObj._visible = false
      ControlListViewGroup._visible = false
      listview.Opacity.value = 100
      ListPhysics:ConnectMouseEvents()
      listview.onMouseUp:connect(HandleMouseUp)
      listview.onMouseDown:connect(HandleMouseDown)
      return 
   end
   SongCollection = gPlayer:Database():GetMusicListToRearrane()
   ItemListGenerator.Collection = SongCollection
   listview:Focus()
   gPlayer:Database().onRearrangeListChange:disconnect(OnRearrangeListChange)
   ListPhysics:ConnectMouseEvents()
   listview.onMouseUp:connect(HandleMouseUp)
   listview.onMouseDown:connect(HandleMouseDown)
end

trace("[MG] Playlist changeorder page loading.")
ItemListLayout = TileLayout()
ItemListLayout:SetItemSize(gScreenWidth, gListView_Height, 0)
ItemListLayout.SelectionNode = nil
listview:SetLayout(ItemListLayout)
if _config_os == "windowsmobile" then
   _request.NavigateOutTo:connect(OnNavigateOutTo)
   _request.NavigateInFrom:connect(OnNavigateInFrom)
   SelectData()
   SongCollection = gPlayer:Database():GetMusicListToRearrane()
   ItemListGenerator = LibraryGeneratorMusicInfo(SongCollection, listview:GetMovie(), listview.ComponentLibraryName, listview.ComponentLibraryID)
   gnTotalCount = ItemListGenerator:GetCount()
   _application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_MUSIC_EDIT_OK"), LSKFunction))
   _application:SetRightSoftkey(Softkey(Locale:GetString("IDS_MUSIC_EDIT_CANCEL"), RSKFunction))
else
   FakeCollection = VectorNotifyint()
   for i = 0, 10 do
      FakeCollection:push_back(i)
   end
   ItemListGenerator = LibraryGeneratorint(FakeCollection, listview:GetMovie(), listview.ComponentLibraryName, listview.ComponentLibraryID)
end
ItemListGenerator.RecycleItems = true
ListPhysics = ScrollPhysics(listview, listview, HandleItemSelection)
ListPhysics:ConnectMouseEvents()
ItemListGenerator.ItemCreated:connect(HandleItemCreated)
ItemListGenerator.ItemDestroyed:connect(HandleItemDestroyed)
listview:SetGenerator(ItemListGenerator)
listview:ForceLayout()
listview:Focus()
listview.onMouseUp:connect(HandleMouseUp)
listview.onMouseDown:connect(HandleMouseDown)
MoveUpArea.onRollOver:connect(RollOver_UPFast)
MoveUpArea.onRollOut:connect(RollOut)
MoveUpArea.onRelease:connect(RollOut)
MoveUpArea.onMouseUp:connect(RollOut)
MoveDownArea.onRollOver:connect(RollOver_DownFast)
MoveDownArea.onRollOut:connect(RollOut)
MoveDownArea.onRelease:connect(RollOut)
MoveDownArea.onMouseUp:connect(RollOut)
if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
   trace("[MG-Rearrange] : EnableLandscape")
   require("Audio\\Music_Rearrange_Landscape")
   _Music_Rearrange_ScreenRotation = Music_Rearrange_ScreenRotation()
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -