예제 #1
0
        public override void OnAction(MediaPortal.GUI.Library.Action action)
        {
            if (viewIsFullscreen)
            {
                if (action.m_key.KeyCode == 27)
                {
                    // makes esc exit fullscreen
                    //hide fullscreen
                    dummyFullscreen.Visible = true;
                    viewIsFullscreen        = false;
                    return;
                }
                if (action.IsUserAction())
                {
                    //this stops the selection wondering around the screen
                    return;
                }
            }

            switch (action.wID)
            {
            case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_DOWN:
            case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_LEFT:
            case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_RIGHT:
            case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_UP:

                base.OnAction(action);
                break;

            default:
                base.OnAction(action);
                break;
            }
        }
예제 #2
0
 public override void OnAction(MediaPortal.GUI.Library.Action action)
 {
     //To allow Esc to go back one level instead of exiting
     if (action.wID == MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU)
     {
         if (newGUIHandler.GoBack()) //if true back handled by plugin
         {
             return;
         }
     }
     else if (action.wID == Action.ActionType.ACTION_PAUSE)
     {
         if (newGUIHandler.ToggleDetails())
         {
             return;
         }
     }
     else if (action.wID == Action.ActionType.ACTION_PLAY)
     {
         if (newGUIHandler.LaunchGame(true))
         {
             return;
         }
     }
     base.OnAction(action); //else exit
 }
예제 #3
0
        public override void OnAction(MediaPortal.GUI.Library.Action action)
        {
            switch (action.wID)
            {
            case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_DOWN:
            case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_LEFT:
            case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_RIGHT:
            case MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_UP:

                base.OnAction(action);
                break;

            default:
                base.OnAction(action);
                break;
            }
        }
 /// <summary>
 /// When a new action is received we'll forward them to the browser host using a WCF service
 /// </summary>
 /// <param name="action"></param>
 private void GUIWindowManager_OnNewAction(MediaPortal.GUI.Library.Action action)
 {
     // Forward the key on to the browser process
     if (_browserProcess != null)
     {
         try
         {
             if (_serviceProxy == null)
             {
                 ReinitialiseService();
             }
             _serviceProxy.OnNewAction(action.wID.ToString());
         }
         catch (Exception ex)
         {
             OnlineVideos.Log.Error(ex);
             ReinitialiseService(); // Attempt to reinitialise the connection to the service
             _serviceProxy.OnNewAction(action.wID.ToString());
         }
     }
 }
예제 #5
0
파일: MainWindow.cs 프로젝트: dizzydezz/jmm
        public MainWindow()
        {
            // get ID of windowplugin belonging to this setup
            // enter your own unique code
            GetID = Constants.PlugInInfo.ID;

            try
            {
                settings = new AnimePluginSettings();

                imageHelper = new ImageDownloader();
                imageHelper.Init();

                listPoster = new AsyncImageResource();
                listPoster.Property = "#Anime3.GroupSeriesPoster";
                listPoster.Delay = artworkDelay;

                fanartTexture = new AsyncImageResource();
                fanartTexture.Property = "#Anime3.Fanart.1";
                fanartTexture.Delay = artworkDelay;

                GroupFilterQuickSorts = new Dictionary<int, QuickSort>();

                //searching
                searchTimer = new System.Timers.Timer();
                searchTimer.AutoReset = true;
                searchTimer.Interval = settings.FindTimeout_s * 1000;
                searchTimer.Elapsed += new System.Timers.ElapsedEventHandler(searchTimer_Elapsed);

                //set the search key sound to the same sound for the REMOTE_1 key
                Key key = new Key('1', (int)Keys.D1);
                MediaPortal.GUI.Library.Action action = new MediaPortal.GUI.Library.Action();
                ActionTranslator.GetAction(GetID, key, ref action);
                searchSound = action.SoundFileName;

                // timer for automatic updates
                autoUpdateTimer = new System.Timers.Timer();
                autoUpdateTimer.AutoReset = true;
                autoUpdateTimer.Interval = 5 * 60 * 1000; // 5 minutes * 60 seconds
                autoUpdateTimer.Elapsed += new System.Timers.ElapsedEventHandler(autoUpdateTimer_Elapsed);

                downloadImagesWorker.DoWork += new DoWorkEventHandler(downloadImagesWorker_DoWork);

                this.OnToggleWatched += new OnToggleWatchedHandler(MainWindow_OnToggleWatched);

                g_Player.PlayBackEnded += new g_Player.EndedHandler(g_Player_PlayBackEnded);
            }
            catch (Exception ex)
            {
                BaseConfig.MyAnimeLog.Write(ex.ToString());
                throw;
            }
        }