Ejemplo n.º 1
0
        private void VideoActions(MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if ((actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_PLAY) || (actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_MUSIC_PLAY) || actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
            {
                //play this song, or return to previous level
                if (facadeLayout.ListLayout.SelectedListItem.Label == "..")
                {
                    _currentView = MvView.Artist;
                    addToStack(_currentView, false);
                    logger.Debug("Calling loadCurrent from VideoActions");
                    loadCurrent();
                }
                else
                {
                    //Play currently selected and activate video window
                    string      vidPath = facadeLayout.ListLayout.SelectedListItem.Path;
                    DBTrackInfo db1     = (DBTrackInfo)facadeLayout.ListLayout.SelectedListItem.MusicTag;

                    g_Player.Play(db1.LocalMedia[0].File.FullName);
                    if (db1.LocalMedia[0].IsDVD)
                    {
                        //PlayDVD(db1);
                    }
                }
                if (mvCentralCore.Settings.AutoFullscreen)
                {
                    GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
                }
            }
        }
Ejemplo n.º 2
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     base.OnClicked(controlId, control, actionType);
     if (control == stopButton)
     {
         StopClicked();
     }
     else if (control == prevButton)
     {
         PrevClicked();
     }
     else if (control == nextButton)
     {
         NextClicked();
     }
     else if (control == disconnectButton)
     {
         DisconnectClicked();
     }
     else if (control == overallVolumeBar)
     {
         OverallVolumeChanged();
     }
     else if (control == soundsVolumeBar)
     {
         SoundsVolumeChanged();
     }
     else if (control == musicVolumeBar)
     {
         MusicVolumeChanged();
     }
 }
Ejemplo n.º 3
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control == btnOK)
            {
                DialogModalResult = ModalResult.OK;
                Close();
            }

            if (control == btnCancel)
            {
                DialogModalResult = ModalResult.Cancel;
                Close();
            }

            if (control == SelectionList && actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
            {
                if (SelectionList.SelectedListItem != null)
                {
                    SelectionList.SelectedListItem.Selected = !SelectionList.SelectedListItem.Selected;
                    return;
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
Ejemplo n.º 4
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if (MA3WindowManager.HandleWindowChangeButton(control))
     {
         return;
     }
     base.OnClicked(controlId, control, actionType);
 }
Ejemplo n.º 5
0
 public void GoodMergeClicked(MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     switch (actionType)
     {
     case MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM:
         goodmergeSelected();
         break;
     }
 }
Ejemplo n.º 6
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if (control == ctrlListMessages && actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
     {
         HandleChatMessage(_currentChatSession.Messages[ctrlListMessages.SelectedListItemIndex]);
     }
     if (control == btnNewMessage && _currentChatSession != null)
     {
         _currentChatSession.Reply();
     }
 }
Ejemplo n.º 7
0
        public void SetPin(int pin)
        {
            MediaPortal.GUI.Library.Action.ActionType type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_0;
            switch (pin)
            {
            case 0:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_0;
                break;

            case 1:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_1;
                break;

            case 2:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_2;
                break;

            case 3:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_3;
                break;

            case 4:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_4;
                break;

            case 5:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_5;
                break;

            case 6:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_6;
                break;

            case 7:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_7;
                break;

            case 8:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_8;
                break;

            case 9:
                type = MediaPortal.GUI.Library.Action.ActionType.REMOTE_9;
                break;
            }

            MediaPortal.GUI.Library.Action pinAction = new MediaPortal.GUI.Library.Action(type, 0, 0);
            mpDialog.OnAction(pinAction);
        }
Ejemplo n.º 8
0
        private void GenreActions(MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if ((actionType == Action.ActionType.ACTION_MUSIC_PLAY) || (actionType == Action.ActionType.ACTION_PLAY) || (actionType == Action.ActionType.ACTION_PAUSE))
            {
                if ((actionType == Action.ActionType.ACTION_MUSIC_PLAY) || (actionType == Action.ActionType.ACTION_PLAY) || (actionType == Action.ActionType.ACTION_PAUSE && !g_Player.HasVideo))
                {
                    List <DBArtistInfo> artistList     = new List <DBArtistInfo>();
                    List <DBArtistInfo> artistFullList = DBArtistInfo.GetAll();


                    logger.Debug("Checking for matches for Genre : " + facadeLayout.SelectedListItem.Label);
                    foreach (DBArtistInfo artistInfo in artistFullList)
                    {
                        if (tagMatched(facadeLayout.SelectedListItem.Label, artistInfo))
                        {
                            logger.Debug("Matched Artist {0} with Tag {1}", artistInfo.Artist, facadeLayout.SelectedListItem.Label);
                            if (!artistList.Contains(artistInfo))
                            {
                                artistList.Add(artistInfo);
                            }
                        }
                    }

                    if (mvCentralCore.Settings.ClearPlaylistOnAdd)
                    {
                        ClearPlaylist();
                    }

                    foreach (DBArtistInfo currArtist in artistList)
                    {
                        List <DBTrackInfo> artistTracks = DBTrackInfo.GetEntriesByArtist(currArtist);
                        AddToPlaylist(artistTracks, false, false, mvCentralCore.Settings.GeneratedPlaylistAutoShuffle);
                    }
                    Player.playlistPlayer.Play(0);
                    if (mvCentralCore.Settings.AutoFullscreen)
                    {
                        GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO);
                    }
                }
                else
                {
                    _currentView = MvView.Genres;
                    artistID     = facadeLayout.SelectedListItem.ItemId;
                    logger.Debug("Calling loadCurrent from GenreActions");
                    loadCurrent();
                }
            }
        }
Ejemplo n.º 9
0
        protected override void OnClicked(int controlId, GUIControl control,
                                          MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control == btnNextPage || actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_FORWARD)
            {
                if (m_currentScore != null && m_lines != null)
                {
                    lock (m_lock)
                    {
                        ClearGrid();
                        CreateGrid(m_lines, m_currentScore, m_currentLine, m_currentColumn);
                    }
                    GUIControl.FocusControl(GetID, btnNextPage.GetID);
                }
            }
            else if (control == btnNextScore || control == btnPreviousScore)
            {
                lock (m_lock) ClearGrid();
                if (m_currentScore != null)
                {
                    if (control == btnPreviousScore)
                    {
                        m_currentScore.MovePrev();
                    }
                    else
                    {
                        m_currentScore.MoveNext();
                    }
                    DisplayScore();
                }

                GUIControl.FocusControl(GetID, control.GetID);
            }
            else if (control == lstDetails)
            {
                GUIListItem item = lstDetails.SelectedListItem;
                bool        back = (item.Label == "..");
                if (!back)
                {
                    m_prevIndex.Push(lstDetails.SelectedListItemIndex);
                }

                UpdateListView(item.TVTag as BaseScore, back);
            }

            base.OnClicked(controlId, control, actionType);
        }
Ejemplo n.º 10
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if (control == ctrlListControlContacts && actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
     {
         try {
             CurrentSession = History.Instance.GetSession(ctrlListControlContacts.SelectedListItem.Path);
             ShowChatWindow(CurrentSession);
         } catch (Exception e) {
             Log.Error(e);
         }
     }
     if (control == btnNewMessage && CurrentSession != null)
     {
         CurrentSession.Reply();
     }
     base.OnClicked(controlId, control, actionType);
 }
Ejemplo n.º 11
0
 private void AlbumActions(MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     if ((actionType == Action.ActionType.ACTION_MUSIC_PLAY) || (actionType == Action.ActionType.ACTION_PLAY) || (actionType == Action.ActionType.ACTION_PAUSE))
     {
         if ((actionType == Action.ActionType.ACTION_MUSIC_PLAY) || (actionType == Action.ActionType.ACTION_PLAY) || (actionType == Action.ActionType.ACTION_PAUSE && !g_Player.HasVideo))
         {
             DBArtistInfo       currArtist       = DBArtistInfo.Get(facadeLayout.SelectedListItem.Label);
             List <DBTrackInfo> allTracksOnAlbum = DBTrackInfo.GetEntriesByAlbum((DBAlbumInfo)facadeLayout.SelectedListItem.MusicTag);
             AddToPlaylist(allTracksOnAlbum, true, mvCentralCore.Settings.ClearPlaylistOnAdd, mvCentralCore.Settings.GeneratedPlaylistAutoShuffle);
         }
         else
         {
             _currentView = MvView.Artist;
             artistID     = facadeLayout.SelectedListItem.ItemId;
             logger.Debug("Calling loadCurrent from AlbumActions");
             loadCurrent();
         }
     }
 }
Ejemplo n.º 12
0
        protected void OnClicked(int controlId, GUIControl control,
                                 MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control.GetID == 4)
            {
            }
            if (control.GetID == 208)
            {
                if (actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
                {
                    Torrent torrent = torrentList.SelectedListItem.AlbumInfoTag as Torrent;

                    if (torrent != null)
                    {
                    }
                }
            }

            else if (control.GetID != 0)
            {
            }
        }
Ejemplo n.º 13
0
        private void DoSpell(MediaPortal.GUI.Library.Action.ActionType remoteNum)
        {
            switch (remoteNum)
            {
            case MediaPortal.GUI.Library.Action.ActionType.REMOTE_2:
                GetSortChar("ABC");
                break;

            case MediaPortal.GUI.Library.Action.ActionType.REMOTE_3:
                GetSortChar("DEF");
                break;

            case MediaPortal.GUI.Library.Action.ActionType.REMOTE_4:
                GetSortChar("GHI");
                break;

            case MediaPortal.GUI.Library.Action.ActionType.REMOTE_5:
                GetSortChar("JKL");
                break;

            case MediaPortal.GUI.Library.Action.ActionType.REMOTE_6:
                GetSortChar("MNO");
                break;

            case MediaPortal.GUI.Library.Action.ActionType.REMOTE_7:
                GetSortChar("PQRS");
                break;

            case MediaPortal.GUI.Library.Action.ActionType.REMOTE_8:
                GetSortChar("TUV");
                break;

            case MediaPortal.GUI.Library.Action.ActionType.REMOTE_9:
                GetSortChar("WXYZ");
                break;
            }
            doFacadeSort();
        }
Ejemplo n.º 14
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control == null)
            {
                return;
            }

            base.OnClicked(controlId, control, actionType);

            // button clicks
            if (control == btnRescan)
            {
                videoImporter.RescanFiles();
            }
            if (control == btnResearch)
            {
                videoImporter.RescanIMDB();
            }
            else if (control == btnRestart)
            {
                videoImporter.RestartImporter();
            }
        }
Ejemplo n.º 15
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (!initialized)
            {
                return;
            }

            try
            {
                if (controlId == btnCurrentSong.GetID)
                {
                    ShowSongContext(Core.MusicBox.CurrentSong);
                }

                else if (controlId == btnHistory1Song.GetID)
                {
                    ShowSongContext(Core.MusicBox.PreviousSongs[0]);
                }

                else if (controlId == btnHistory2Song.GetID)
                {
                    ShowSongContext(Core.MusicBox.PreviousSongs[1]);
                }

                else if (controlId == btnHistory3Song.GetID)
                {
                    ShowSongContext(Core.MusicBox.PreviousSongs[2]);
                }

                else if (controlId == btnHistory4Song.GetID)
                {
                    ShowSongContext(Core.MusicBox.PreviousSongs[3]);
                }
            }
            catch (Exception ex) { GracefullyFail(ex); }
        }
Ejemplo n.º 16
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control == btnOK)
            {
                DialogModalResult = ModalResult.OK;
                Close();
            }

            if (control == btnCancel)
            {
                DialogModalResult = ModalResult.Cancel;
                Close();
            }

            if (control == SelectionList && actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
            {
                if (SelectionList.SelectedListItem != null)
                {
                    SelectionList.SelectedListItem.Selected = !SelectionList.SelectedListItem.Selected;

                    // check if item is a toggle button and change label accordingly
                    if (SelectionList.SelectedListItem.TVTag is bool)
                    {
                        if ((bool)SelectionList.SelectedListItem.TVTag)
                        {
                            string currentStateLabel = SelectionList.SelectedListItem.Label2;
                            SelectionList.SelectedListItem.Label2 = currentStateLabel == Translation.On ? Translation.Off : Translation.On;
                        }
                    }

                    return;
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
Ejemplo n.º 17
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (!TorrentEngine.Instance().IsConnected)
            {
                base.OnClicked(controlId, control, actionType);
                return;
            }
            if (controlId > 201 && controlId < 208 && controlId == 210)
            {
                GiveFocus(torrentList);
            }

            switch (control.GetID)
            {
            case 202:     //button_SwitchView
                UnfocusMenu();
                ViewTorrents.ViewButtonHandler();
                GiveFocus(torrentList);

                UpdateScreen();
                break;

            case 203:     //button_Sort
                UnfocusMenu();
                ViewTorrents.SortButtonHandler();
                GiveFocus(torrentList);

                UpdateScreen();
                break;

            case 204:     //button_SearchTorrents
                ListType = "Search";
                UnfocusMenu();
                ShowSearch();
                GiveFocus(torrentList);

                break;

            case 205:     //button_watchItemList
                ListType = "WatchList";
                UnfocusMenu();
                ShowTorrentWatch();
                GiveFocus(torrentList);
                break;

            case 206:     //button_RSS
                ListType = "RSS";
                UnfocusMenu();
                UpdateScreen();
                GiveFocus(torrentList);

                RSSChannelManager.Instance().UpdateChannels(true);
                break;

            case 207:     //button_Log
                ListType = "Log";
                ShowLog();
                UnfocusMenu();
                GiveFocus(torrentList);

                break;

            case 209:     //button_Settings
                //List<UTorrentSettings> settings = TorrentEngine.Instance().TorrentSession.GetSettings();
                break;

            case 210:     //button_Labels
                ViewTorrents.LabelButtonHandler();
                UnfocusMenu();
                GiveFocus(torrentList);
                UpdateScreen();
                break;

            case 208:     //TorrentList
                if (actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
                {
                    switch (ListType)
                    {
                    case "Torrents":
                        Torrent torrent = torrentList.SelectedListItem.AlbumInfoTag as Torrent;
                        if (torrent != null)
                        {
                            ListType = "TorrentDetails";
                            UpdateScreen();
                        }
                        break;

                    case "Search":
                        ViewSearch.SearchItemClicked(torrentList.SelectedListItem.AlbumInfoTag as TorrentSearch.TorrentMatch);
                        break;

                    case "SelectedRSS":
                        ViewRSS.RSSDownload(torrentList.SelectedListItem.AlbumInfoTag as RSSItem);
                        break;

                    case "RSS":
                        ListType = "SelectedRSS";
                        ViewRSS.ShowSelectedRSS(torrentList.SelectedListItem.AlbumInfoTag as IRSSChannel);
                        UpdateScreen();
                        break;

                    case "WatchList":
                        ListType = "SeriesInfo";
                        UnfocusMenu();
                        torrentList.Visible = false;
                        GiveFocus(button_Quality);
                        ViewAutoGrabber.ShowSeries(torrentList.SelectedListItem.AlbumInfoTag);
                        button_IncludeSpecials.Selected  = (torrentList.SelectedListItem.AlbumInfoTag as SeriesItem).includespecials;
                        button_IncludeSpecials.IsFocused = false;
                        break;
                    }
                }
                break;

            case 501:     //FolderList
                if (actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
                {
                    if (!FolderList.SelectedListItem.Selected)
                    {
                        FolderList.ListItems             = ViewFolders.GetGUIFolders(FolderList.SelectedListItem);
                        FolderList.SelectedListItemIndex = 0;
                    }
                    else
                    {
                        ViewFolders.FolderClickMenu(FolderList.SelectedListItem, torrentList.SelectedListItem, ViewSearch.label);
                    }
                }
                break;

            case 502:     //FileList
                if (ListType == "TorrentDetails")
                {
                    lock (UpdateLocker)
                    {
                        int  index        = FileList.SelectedListItemIndex;
                        File selectedfile = FileList.SelectedListItem.AlbumInfoTag as File;
                        ViewDetails.TorrentDetailsOnClick(selectedfile, index);
                    }
                }
                break;

            case 302:
            case 303:
            case 304:
            case 305:
            case 306:
            case 307:
                ViewAutoGrabber.OnClicked(control);
                break;
            }

            base.OnClicked(controlId, control, actionType);
        }
Ejemplo n.º 18
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     base.OnClicked(controlId, control, actionType);
 }
Ejemplo n.º 19
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            if (btnAddCategory != null && control == btnAddCategory)
            {
                string cat = Utils.PromptSelectCategory("");
                if (!string.IsNullOrEmpty(cat))
                {
                    if (!string.IsNullOrEmpty(MainWindow.RandomWindow_SeriesCategories))
                    {
                        MainWindow.RandomWindow_SeriesCategories += ", ";
                    }

                    MainWindow.RandomWindow_SeriesCategories += cat;

                    SetDisplayDetails();
                }
            }

            if (btnEpisodeAddCategory != null && control == btnEpisodeAddCategory)
            {
                string cat = Utils.PromptSelectCategory("");
                if (!string.IsNullOrEmpty(cat))
                {
                    if (!string.IsNullOrEmpty(MainWindow.RandomWindow_EpisodeCategories))
                    {
                        MainWindow.RandomWindow_EpisodeCategories += ", ";
                    }

                    MainWindow.RandomWindow_EpisodeCategories += cat;

                    SetDisplayDetails();
                }
            }

            if (btnClearcategories != null && control == btnClearcategories)
            {
                MainWindow.RandomWindow_SeriesCategories = "";
                SetDisplayDetails();
            }

            if (btnEpisodeClearcategories != null && control == btnEpisodeClearcategories)
            {
                MainWindow.RandomWindow_EpisodeCategories = "";
                SetDisplayDetails();
            }

            if (btnAllAnycategories != null && control == btnAllAnycategories)
            {
                MainWindow.RandomWindow_SeriesAllCategories = !MainWindow.RandomWindow_SeriesAllCategories;
                SetDisplayDetails();
            }

            if (btnEpisodeAllAnycategories != null && control == btnEpisodeAllAnycategories)
            {
                MainWindow.RandomWindow_EpisodeAllCategories = !MainWindow.RandomWindow_EpisodeAllCategories;
                SetDisplayDetails();
            }

            if (btnRandom != null && control == btnRandom)
            {
                if (togWatched != null)
                {
                    MainWindow.RandomWindow_SeriesWatched = togWatched.Selected;
                }
                if (togUnwatched != null)
                {
                    MainWindow.RandomWindow_SeriesUnwatched = togUnwatched.Selected;
                }
                if (togPartiallyWatched != null)
                {
                    MainWindow.RandomWindow_SeriesPartiallyWatched = togPartiallyWatched.Selected;
                }
                if (togCompleteOnly != null)
                {
                    MainWindow.RandomWindow_SeriesOnlyComplete = togCompleteOnly.Selected;
                }

                if (togEpisodeUnwatched != null)
                {
                    MainWindow.RandomWindow_EpisodeUnwatched = togEpisodeUnwatched.Selected;
                }
                if (togEpisodeWatched != null)
                {
                    MainWindow.RandomWindow_EpisodeWatched = togEpisodeWatched.Selected;
                }

                MainWindow.RandomWindow_CurrentEpisode = null;
                MainWindow.RandomWindow_CurrentSeries  = null;
                this.btnRandom.IsFocused = true;
                LoadData();
            }

            if (btnSwitchSeries != null && control == btnSwitchSeries)
            {
                this.btnSwitchSeries.IsFocused     = false;
                this.btnRandom.IsFocused           = true;
                MainWindow.RandomWindow_RandomType = RandomObjectType.Series;
                LoadData();
            }

            if (btnSwitchEpisode != null && control == btnSwitchEpisode)
            {
                this.btnSwitchEpisode.IsFocused    = false;
                this.btnRandom.IsFocused           = true;
                MainWindow.RandomWindow_RandomType = RandomObjectType.Episode;
                LoadData();
            }

            if (btnPlayEpisode != null && control == btnPlayEpisode)
            {
                if (MainWindow.RandomWindow_CurrentEpisode == null)
                {
                    return;
                }
                MainWindow.vidHandler.ResumeOrPlay(MainWindow.RandomWindow_CurrentEpisode);
            }


            if (btnEpisodeList != null && control == btnEpisodeList)
            {
                if (MainWindow.RandomWindow_CurrentSeries == null)
                {
                    return;
                }
                MainWindow.curGroupFilter = GroupFilterHelper.AllGroupsFilter;

                // find the group for this series
                AnimeGroupVM grp = JMMServerHelper.GetGroup(MainWindow.RandomWindow_CurrentSeries.AnimeGroupID);
                if (grp == null)
                {
                    BaseConfig.MyAnimeLog.Write("Group not found");
                    return;
                }
                MainWindow.curAnimeGroup       = grp;
                MainWindow.curAnimeGroupViewed = grp;
                MainWindow.curAnimeSeries      = MainWindow.RandomWindow_CurrentSeries;

                bool foundEpType = false;
                foreach (AnimeEpisodeTypeVM anEpType in MainWindow.RandomWindow_CurrentSeries.EpisodeTypesToDisplay)
                {
                    if (anEpType.EpisodeType == enEpisodeType.Episode)
                    {
                        MainWindow.curAnimeEpisodeType = anEpType;
                        foundEpType = true;
                        break;
                    }
                }

                if (!foundEpType)
                {
                    return;
                }


                MainWindow.listLevel = Listlevel.Episode;

                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.MAIN, false);
                return;
            }

            base.OnClicked(controlId, control, actionType);
        }
Ejemplo n.º 20
0
        public void onFacadeClicked(MediaPortal.GUI.Library.Action.ActionType ButtonPressed)
        {
            ExtendedGUIListItem currentItem = (ExtendedGUIListItem)facade.SelectedListItem;

            //Show games for selected emulator
            if (currentEmulator == null && ButtonPressed != MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU)
            {
                if (ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_NEXT_ITEM)
                {
                    Executor.launchDocument(currentItem.AssociatedEmulator);
                }
                else
                {
                    currentEmulator = currentItem.AssociatedEmulator;
                    if (currentEmulator.isPc())
                    {
                        fillPCGames();
                    }
                    else
                    {
                        currentFolder = currentEmulator.PathToRoms;
                        fillGames();
                        facade.SelectedListItemIndex = 1;
                        onFacadeAction();
                    }
                }
            }

            //Dive into subdir
            else if (currentItem.AssociatedDirectory != null && ButtonPressed != MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU)
            {
                currentFolder = currentItem.AssociatedDirectory;
                fillGames();
                facade.SelectedListItemIndex = 1;
                onFacadeAction();
            }
            //Execute game
            else if (currentItem.AssociatedGame != null && ButtonPressed != MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU)
            {
                if (ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_NEXT_ITEM)
                {
                    Executor.launchDocument(currentItem.AssociatedGame);
                }
                else
                {
                    if (currentItem.AssociatedGame.ParentEmulator.EnableGoodmerge)
                    {
                        if (ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_MUSIC_PLAY)
                        {
                            currentItem.AssociatedGame.LaunchFile = "";
                            Executor.launchGame(currentItem.AssociatedGame);
                        }
                        else
                        {
                            if (ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_PAUSE)
                            {
                                currentItem.AssociatedGame.LaunchFile = "";
                            }

                            if (currentItem.AssociatedGame.LaunchFile.Trim() != "")
                            {
                                Executor.launchGame(currentItem.AssociatedGame);
                                fillGames();

                                for (int i = 0; i < facade.Count; i++)
                                {
                                    try
                                    {
                                        if (((ExtendedGUIListItem)facade[i]).AssociatedGame.Path == currentItem.AssociatedGame.Path)
                                        {
                                            facade.SelectedListItemIndex = i;
                                            onFacadeAction();
                                        }
                                    }
                                    catch { }
                                }
                            }
                            else
                            {
                                SevenZipCompressor.SetLibraryPath(Options.getStringOption("7zdllpath"));
                                using (SevenZipExtractor tmp = new SevenZipExtractor(currentItem.AssociatedGame.Path))
                                {
                                    string GoodmergeTempPath = "";

                                    if (currentItem.AssociatedGame.ParentEmulator.GoodmergeTempPath.EndsWith("\\"))
                                    {
                                        GoodmergeTempPath = currentItem.AssociatedGame.ParentEmulator.GoodmergeTempPath;
                                    }
                                    else
                                    {
                                        GoodmergeTempPath = currentItem.AssociatedGame.ParentEmulator.GoodmergeTempPath + "\\";
                                    }

                                    if (tmp.ArchiveFileNames.Count == 1)
                                    {
                                        Executor.launchGame(currentItem.AssociatedGame);
                                    }
                                    else
                                    {
                                        setView(0);
                                        facade.Clear();

                                        //prev selected
                                        facade.Add(ThumbsHandler.Instance.createBackDots(currentItem.AssociatedGame.Path));

                                        for (int i = 0; i < tmp.ArchiveFileNames.Count; i++)
                                        {
                                            Game RomListGame = DB.getGame(currentItem.AssociatedGame.Path, currentItem.AssociatedGame.ParentEmulator);
                                            RomListGame.LaunchFile = tmp.ArchiveFileNames[i];
                                            facade.Add(ThumbsHandler.Instance.createGameRomFacadeItem(RomListGame));

                                            Log.Error(new Exception("launch" + RomListGame.LaunchFile));
                                        }

                                        facade.SelectedListItemIndex = 1;
                                        onFacadeAction();
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        Executor.launchGame(currentItem.AssociatedGame);
                    }
                }
            }
            else if ((currentItem.IsBackDots || ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU) && !string.IsNullOrEmpty(currentItem.PrevSelected))
            {
                fillGames();

                for (int i = 0; i < facade.Count; i++)
                {
                    try
                    {
                        if (((ExtendedGUIListItem)facade[i]).AssociatedGame.Path == currentItem.PrevSelected)
                        {
                            facade.SelectedListItemIndex = i;
                            onFacadeAction();
                        }
                    }
                    catch { }
                }
            }
            //Go up one level
            else if ((currentItem.IsBackDots || ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU))
            {
                //Go back to all emulators
                if (currentEmulator.isManyEmulators() || currentEmulator.isPc() || currentFolder.Equals(currentEmulator.PathToRoms))
                {
                    currentEmulator     = null;
                    currentFolder       = null;
                    currentSqlTail      = null;
                    currentGameProperty = gameProperty.none;
                    fillEmulators();
                    facade.SelectedListItemIndex = 0;
                    onFacadeAction();
                }
                //Go back to parent directory
                else
                {
                    currentFolder = currentFolder.Remove(currentFolder.LastIndexOf("\\"));
                    fillGames();
                    facade.SelectedListItemIndex = 1;
                }
            }
        }
Ejemplo n.º 21
0
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     base.OnClicked(controlId, control, actionType);
     if (control == btnStar1)
     {
         Rating      = 1;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar2)
     {
         Rating      = 2;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar3)
     {
         Rating      = 3;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar4)
     {
         Rating      = 4;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar5)
     {
         Rating      = 5;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar6)
     {
         Rating      = 6;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar7)
     {
         Rating      = 7;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar8)
     {
         Rating      = 8;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar9)
     {
         Rating      = 9;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar10)
     {
         Rating      = 10;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
 }
Ejemplo n.º 22
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            if (btnViewWatch != null && control == btnViewWatch)
            {
                this.btnViewWatch.IsFocused = false;
                m_Facade.Focus = true;

                if (dummyModeWatch != null)
                {
                    dummyModeWatch.Visible = true;
                }

                SetGUIProperty(GuiProperty.Recommendations_CurrentView, Translation.Watch);

                LoadData();
            }

            if (btnViewDownload != null && control == btnViewDownload)
            {
                this.btnViewDownload.IsFocused = false;
                m_Facade.Focus = true;

                if (dummyModeWatch != null)
                {
                    dummyModeWatch.Visible = false;
                }

                SetGUIProperty(GuiProperty.Recommendations_CurrentView, Translation.Download);

                LoadData();
            }

            if (this.btnGetMissingInfo != null && control == this.btnGetMissingInfo)
            {
                MainWindow.ServerHelper.DownloadRecommendedAnime();
                SetGUIProperty(GuiProperty.Recommendations_Status, Translation.WaitingOnServer + "...");
                GUIControl.FocusControl(GetID, 50);

                return;
            }

            if (control == this.m_Facade)
            {
                // show the files if we are looking at a torrent
                GUIListItem item = m_Facade.SelectedListItem;
                if (item == null || item.TVTag == null)
                {
                    return;
                }
                if (item.TVTag.GetType() == typeof(VM_Recommendation))
                {
                    VM_Recommendation rec = item.TVTag as VM_Recommendation;
                    if (rec != null)
                    {
                        if (dummyModeWatch != null && dummyModeWatch.Visible)
                        {
                            VM_AnimeEpisode_User aniEp = (VM_AnimeEpisode_User)VM_ShokoServer.Instance.ShokoServices.GetNextUnwatchedEpisode(rec.Recommended_AnimeSeries.AnimeSeriesID,
                                                                                                                                             VM_ShokoServer.Instance.CurrentUser.JMMUserID);
                            if (aniEp != null)
                            {
                                MainWindow.vidHandler.ResumeOrPlay(aniEp);
                            }
                            else
                            {
                                Utils.DialogMsg(Translation.Error, Translation.CouldNotFindFirstEpisode);
                            }
                        }
                    }
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
Ejemplo n.º 23
0
        protected void OnRSSClicked(int controlId, GUIControl control,
                                    MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control.GetID == 4)
            {
                OnButtonBack();
            }
            if (control.GetID == 208)
            {
                if (actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
                {
                    //    if (rss.AlbumInfoTag.GetType() == typeof(RSSUTorrentFeeds))
                    //    {
                    //        RSSUTorrentFeeds currentfeed = rss.AlbumInfoTag as RSSUTorrentFeeds;
                    //        List<RSSNextUpdate> nextupd = currentfeed.nextUpd;
                    //        _selectedChannel = currentfeed;
                    //        rss.Clear();
                    //        foreach (RSSNextUpdate it in nextupd)
                    //        {
                    //            GUIListItem listItem = new GUIListItem();
                    //            listItem.Label = it.NameFull;
                    //            DateTime updatedate = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(it.Timestamp).ToLocalTime();
                    //            listItem.Label2 = updatedate.ToShortDateString() + " " + updatedate.ToShortTimeString();
                    //            listItem.AlbumInfoTag = it;

                    //            rssList.Add(listItem);
                    //        }

                    //        if (nextupd.Count == 0)
                    //        {
                    //            GUIListItem listItem = new GUIListItem();
                    //            listItem.Label = "No items.";
                    //            rssList.Add(listItem);
                    //        }
                    //    }

                    //if (rss.Label == "UTorrent Inbuit RSS Feeds")
                    //{
                    //    List<RSSUTorrentFeeds> ufeeds = rssList.SelectedListItem.AlbumInfoTag as List<RSSUTorrentFeeds>;
                    //    rssList.Clear();
                    //    _selectedChannel = ufeeds[0];
                    //    foreach (RSSUTorrentFeeds elem in ufeeds)
                    //    {

                    //        GUIListItem listIt = new GUIListItem();
                    //        listIt.Label = elem.Url.Split(new char[] { '|' }).First() + "\n" + elem.Url.Split(new char[] { '/' })[2];
                    //        DateTime updatedate = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(elem.Timestamp).ToLocalTime();
                    //        listIt.Label2 = updatedate.ToShortDateString() + " " + updatedate.ToShortTimeString();
                    //        listIt.AlbumInfoTag = elem;
                    //        RSSChannel uchannel = new RSSChannel(elem.Url);
                    //        rssList.Add(listIt);
                    //    }

                    //    if (ufeeds.Count == 0)
                    //    {
                    //        GUIListItem listItem = new GUIListItem();
                    //        listItem.Label = "No items.";
                    //        rssList.Add(listItem);
                    //    }
                    //}



                    IRSSChannel channel = rss.AlbumInfoTag as IRSSChannel;
                    RSSItem     item    = rss.AlbumInfoTag as RSSItem;

                    if (channel != null)
                    {
                        _selectedRSSChannel = channel;
                    }
                    else if (item != null)
                    {
                    }
                }
            }
            else if (control.GetID != 0)
            {
            }
        }