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

📄 0.lua

📁 htc manila 2 sourcecode
💻 LUA
字号:
-- Decompiled using luadec 0.7 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l ;0,4,8,12;;0,0,0,12;0,4,8;0,4,8;0,0,7,11,15,19;;;;;8,10;;;; 710a1147_manila_4A8.luac 

require("theme")
require("audio_manager_svc")
trace("[MG] Delete Page\n")
if _config_os == "windowsmobile" then
   gPlayer = MusicPlayer_Instance()
   gOrder = nil
   gParam = nil
end
gListView_Height = 80
gScreenWidth = 480
gScreenHeight = 800
EnterList = function(l_1_0)
   local l_1_1 = ItemListGenerator:GetItem(l_1_0)
   local l_1_2 = l_1_1.Namespace:FindName("removeicon")
   local l_1_3 = ItemListGenerator:GetData(l_1_0)
   if l_1_2._visible == true then
      l_1_2._visible = false
      l_1_3.IsDeleted = false
   else
      l_1_2._visible = true
      l_1_3.IsDeleted = true
   end
end

HandleItemSelection = function(l_2_0)
   EnterList(l_2_0)
end

HandleKeyForItem = function(l_3_0, l_3_1, l_3_2)
   if l_3_1.Code == KeyCode_Return or l_3_1.Code == KeyCode_Space then
      local l_3_3 = ItemListGenerator:GetIndexForItem(l_3_0)
      EnterList(l_3_3)
      l_3_2.value = true
   end
end

HandleSelectionForItem = function(l_4_0)
   local l_4_1 = l_4_0.Namespace:FindName("title")
   local l_4_2 = l_4_0.Namespace:FindName("albumartist")
   l_4_1.Color = GetMainTextSelectedColor()
   l_4_2.Color = GetSubTextSelectedColor()
end

HandleDeselectionForItem = function(l_5_0)
   local l_5_1 = l_5_0.Namespace:FindName("title")
   local l_5_2 = l_5_0.Namespace:FindName("albumartist")
   l_5_1.Color = GetMainTextUnselectedColor()
   l_5_2.Color = GetSubTextUnselectedColor()
end

HandleItemCreated = function(l_6_0, l_6_1)
   if _config_os == "windowsmobile" then
      local l_6_2 = l_6_1.Namespace:FindName("title")
      local l_6_3 = l_6_1.Namespace:FindName("removeicon")
      local l_6_4 = l_6_1.Namespace:FindName("frame")
      local l_6_5 = l_6_1.Namespace:FindName("image")
      local ss = l_6_1.Namespace:FindName("seperator")      
      local aa = l_6_1.Namespace:FindName("albumartist")
      local cb = l_6_1.Namespace:FindName("checkbox")
      ss.TextureCoords:set(0, 0, gScreenWidth / 2, 1)
      ss.Size.width = gScreenWidth
      aa.Size.width = gScreenWidth - 160
      cb.Position.x = gScreenWidth - 62
      l_6_3.Position.x = gScreenWidth - 51
      l_6_2.Color = GetMainTextUnselectedColor()
      l_6_1.Tag = nil
      l_6_3._visible = false
      if gOrder == "1" then
         l_6_2.Position.x = 40
         l_6_2.Size.width = gScreenWidth - 110
         l_6_2.Size.height = gListView_Height
         l_6_2.String = l_6_0.Name
         if l_6_0.IsDeleted == true then
            l_6_3._visible = true
         end
         l_6_4._visible = false
         l_6_5._visible = false
      else
         l_6_0.IsRealized = true
         l_6_1.Tag = l_6_0
         l_6_2.Position.x = 90
         l_6_2.Size.width = gScreenWidth - 160
         l_6_2.Size.height = gListView_Height / 2
         l_6_2.String = l_6_0.Title
         if l_6_0.IsDeleted == true then
            l_6_3._visible = true
         end
         aa._visible = true
         aa.Color = GetSubTextUnselectedColor()
         aa.String = l_6_0.Artist
         l_6_4._visible = true
         l_6_5._visible = true
         l_6_5.Position.x = 12
         l_6_5.Position.y = -11
         bMusicExist = MusicHelper_FileExists(l_6_0.ArtPath)
         if bMusicExist == false then
            l_6_5:SetTextureRef("MusicRemove")
         elseif l_6_0.ArtPath ~= "" and MusicHelper_FileExists(l_6_0.ArtPath) == true then
            l_6_5:SetTextureRef("Music_tile")
            if ListImageLoader == nil then
               ListImageLoader = ListImageLoaderClass()
            end
            ListImageLoader:AddImage(l_6_5, l_6_0)
         else
            l_6_5:SetTextureRef("Music_tile")
         end
      end
      l_6_1.Focusable = true
      l_6_1.onKeyDown:connect(HandleKeyForItem)
      l_6_1.OnSelected:connect(HandleSelectionForItem)
      l_6_1.OnDeselected:connect(HandleDeselectionForItem)
   end
end

HandleItemDestroyed = function(l_7_0)
   if l_7_0.Tag ~= nil then
      l_7_0.Tag.IsRealized = false
   end
   l_7_0.onKeyDown:disconnect(HandleKeyForItem)
   l_7_0.OnSelected:disconnect(HandleSelectionForItem)
   l_7_0.OnDeselected:disconnect(HandleDeselectionForItem)
end

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

RSKFunction = function()
   GotoUpLayer()
end

LSKFunction = function()
   if gOrder == "1" then
      gPlayer:Database():DeletePlaylists()
   else
      local mi = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
      gPlayer:Database():UpdatePlaylistSongs(mi, PLMODE_DELETE_SONGS)
   end
   _application.Navigation:NavigateBack()
end

SelectData = function()
   if gOrder ~= "1" then
      local l_11_0 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
      local l_11_1 = MusicWhereConditions()
      trace("[MG] Playlist Uid " .. l_11_0 .. "\n")
      l_11_1:AddCondition(l_11_0)
      gPlayer:Database():Select(VID_SONGS_INFO_OF_PLAYLIST, l_11_1)
      _application.Navigation.Title = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST_NAME)
   end
end

OnListChange = function()
   SelectData()
   if gOrder == "1" then
      GroupCollection = gPlayer:Database():GetAllPlaylists(false)
   else
      GroupCollection = gPlayer:Database().CurMusicList
   end
   ItemListGenerator.Collection = GroupCollection
   listview:Focus()
end

OnNavigateOutTo = function(l_13_0)
   _request.NavigateOutTo:disconnect(OnNavigateOutTo)
   gPlayer.onListChange:disconnect(OnListChange)
   ListPhysics:DisconnectMouseEvents()
   Transition(l_13_0, "Out")
end

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

ItemListLayout = TileLayout()
ItemListLayout:SetItemSize(480, gListView_Height, 0)
ItemListLayout.SelectionNode = Selector
listview:SetLayout(ItemListLayout)
if _config_os == "windowsmobile" then
   _request.NavigateOutTo:connect(OnNavigateOutTo)
   _request.NavigateInFrom:connect(OnNavigateInFrom)
   gPlayer.onListChange:connect(OnListChange)
   gOrder = _request.URL.Parameters:GetParameter("order")
   _application.Navigation.Title = Locale:GetString("IDS_MUSIC_DELETE")
   SelectData()
   if gOrder == "1" then
      GroupCollection = gPlayer:Database():GetAllPlaylists(false)
      ItemListGenerator = LibraryGeneratorPlaylistInfo(GroupCollection, listview:GetMovie(), listview.ComponentLibraryName, listview.ComponentLibraryID)
   else
      GroupCollection = gPlayer:Database().CurMusicList
      ItemListGenerator = LibraryGeneratorMusicInfo(GroupCollection, listview:GetMovie(), listview.ComponentLibraryName, listview.ComponentLibraryID)
   end
   _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
ItemListGenerator.ItemCreated:connect(HandleItemCreated)
ItemListGenerator.ItemDestroyed:connect(HandleItemDestroyed)
listview:SetGenerator(ItemListGenerator)
listview:Focus()
ListPhysics = ScrollPhysics(listview, listview, HandleItemSelection)
ListPhysics:ConnectMouseEvents()
if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
   trace("[MG] : EnableLandscape")
   require("Audio\\Music_Delete_playlist_Landscape")
   _MusicDeletePlaylist_ScreenRotation = MusicDeletePlaylist_ScreenRotation()
end

⌨️ 快捷键说明

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