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

📄 4.lua

📁 htc manila 2 sourcecode
💻 LUA
字号:
-- Decompiled using luadec 1.0 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l2 110-155;;1,51;30,53;;12;;;7,14,18;;;;;;;; 710a1147_manila_7D36.luac 

require("theme")
trace("[MG] Add/Copy to playlist Page\n")
if _config_os == "windowsmobile" then
   require("audio_manager_svc")
   gPlayer = MusicPlayer_Instance()
   gOrder = nil
   gParam = nil
end
gListView_Height = 80
gScreenWidth = 480
gScreenHeight = 800
OnMessageDialogExit = function(l_1_0)
   _application.Navigation:NavigateBack()
end

ShowMessageDialog = function(l_2_0)
   local l_2_1 = URL("Manila://Confirmation.dialog")
   l_2_1.Parameters:AddParameter("Title", Locale:GetString("IDS_MUSICTITLE"))
   if gOrder == "1" then
      local str = string.format(Locale:GetString("IDS_MUSIC_CONFIRM_ADD_MSG"), l_2_0)
      l_2_1.Parameters:AddParameter("ContentString", str)
   else
      local str = string.format(Locale:GetString("IDS_MUSIC_CONFIRM_COPY_MSG"), l_2_0)
      l_2_1.Parameters:AddParameter("ContentString", str)
   end
   l_2_1.Parameters:AddParameter("Type", "OK")
   local l_2_2 = _application.DialogManager:GetDialog(l_2_1)
   l_2_2.OnExit:connect(OnMessageDialogExit)
   l_2_2:Show()
end

EnterList = function(l_3_0)
   if l_3_0 == 0 then
      local url = URL("Manila://music/playlist/Input/New/new_playlist.page")
      if gOrder == "1" then
         url.Parameters:AddParameter("actionmode", "AddToPL")
      else
         url.Parameters:AddParameter("actionmode", "CopyToPL")
      end
      _application.Navigation:Navigate(url, false)
   else
      local l_3_1 = ItemListGenerator:GetData(l_3_0)
      if gOrder == "1" then
        local sett = MusicConfig_Instance():GetSetting(CONFIG_ADDTOPLAYLIST_FILEPATH)
        if gPlayer:Database():AddtoPlaylist(sett, l_3_1.UID) == true then
        end
      else
        local l_3_2 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
        if gPlayer:Database():CopytoPlaylist(l_3_2, l_3_1.UID) == true then
        end
      end
      ShowMessageDialog(l_3_1.Name)
   end
end

HandleItemSelection = function(l_4_0)
   EnterList(l_4_0)
end

HandleKeyForItem = function(l_5_0, l_5_1, l_5_2)
   if l_5_1.Code == KeyCode_Return or l_5_1.Code == KeyCode_Space then
      local l_5_3 = ItemListGenerator:GetIndexForItem(l_5_0)
      EnterList(l_5_3)
      l_5_2.value = true
   end
end

HandleSelectionForItem = function(l_6_0)
   l_6_0.Namespace:FindName("title").Color = GetMainTextSelectedColor()
end

HandleDeselectionForItem = function(l_7_0)
   l_7_0.Namespace:FindName("title").Color = GetMainTextUnselectedColor()
end

HandleItemCreated = function(l_8_0, l_8_1)
   if _config_os == "windowsmobile" then
      local l_8_2 = l_8_1.Namespace:FindName("title")
      l_8_2.Color = GetMainTextUnselectedColor()
      local l_8_3 = l_8_1.Namespace:FindName("seperator")
      local l_8_4 = l_8_1.Namespace:FindName("image")
      l_8_3.TextureCoords:set(0, 0, gScreenWidth / 2, 1)
      l_8_3.Size.width = gScreenWidth
      l_8_2.Size.width = gScreenWidth - 130
      l_8_2.String = l_8_0.Name
      local item = ItemListGenerator:GetIndexForItem(l_8_1)
      if item == 0 then
         l_8_4:SetTextureRef("New_Playlist")
         l_8_2.String = Locale:GetString("IDS_NEW_PLAYLIST")
      end
      l_8_1.Focusable = true
      l_8_1.onKeyDown:connect(HandleKeyForItem)
      l_8_1.OnSelected:connect(HandleSelectionForItem)
      l_8_1.OnDeselected:connect(HandleDeselectionForItem)
   end
end

HandleItemDestroyed = function(l_9_0)
   l_9_0.onKeyDown:disconnect(HandleKeyForItem)
   l_9_0.OnSelected:disconnect(HandleSelectionForItem)
   l_9_0.OnDeselected:disconnect(HandleDeselectionForItem)
end

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

RSKFunction = function()
   GotoUpLayer()
end

LSKFunction = function()
   GotoUpLayer()
end

NullFunction = function()
end

OnNavigateOutTo = function(l_14_0)
   _request.NavigateOutTo:disconnect(OnNavigateOutTo)
   ListPhysics:DisconnectMouseEvents()
   Transition(l_14_0, "Out")
end

OnNavigateInFrom = function(l_15_0)
   _request.NavigateInFrom:disconnect(OnNavigateInFrom)
   Transition(l_15_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)
   gOrder = _request.URL.Parameters:GetParameter("order")
   if gOrder == "1" then
      _application.Navigation.Title = Locale:GetString("IDS_MUSIC_ADDTOPLAYLIST")
   else
      _application.Navigation.Title = Locale:GetString("IDS_MUSIC_COPYTOPLAYLIST")
   end
   local l_0_0 = "ID0"
   if gOrder ~= "1" then
      l_0_0 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
   end
   GroupCollection = gPlayer:Database():GetPlaylistsToAdd(l_0_0)
   ItemListGenerator = LibraryGeneratorPlaylistInfo(GroupCollection, listview:GetMovie(), listview.ComponentLibraryName, listview.ComponentLibraryID)
   _application:SetLeftSoftkey(Softkey("", NullFunction))
   _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_AddTo_playlist_Landscape")
   _MusicAddToPlaylist_ScreenRotation = MusicAddToPlaylist_ScreenRotation()
end

⌨️ 快捷键说明

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