Blow WindowPlugins.dll to separate plugin DLLs (1 Viewer)

azzuro

Test Group
  • Team MediaPortal
  • May 10, 2007
    9,955
    5,628
    France - IDF
    Home Country
    France France
    i have tested 10-30 min yesterday no error in log
    but tested quickly
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    • Thread starter
    • Moderator
    • #54
    @hwahrmann @jameson_uk @Deda

    I really need your help to figure out commented code in here:

    https://github.com/MediaPortal/Medi...s/mediaportal/Core/guilib/WindowPluginBase.cs

    Can you tell me how all of this should be done without breaking anything? WindowPluginBase.cs cannot reference anymore to Videos or MyMusic since it should not know anything about plugins.

    Code:
    protected virtual void SetView(int selectedViewId)
    	{
    	  bool isVideoWindow = (this.GetID == (int)Window.WINDOW_VIDEOS || this.GetID == (int)Window.WINDOW_VIDEO_TITLE);
     
    		/* FIXME Move this logic to Videos / Music for their parts, leave rest here
     
    		switch (selectedViewId)
    		{
    		  case 0: // Shares
    			{
    			  int nNewWindow;
    			  if (isVideoWindow)
    			  {
    				nNewWindow = (int)Window.WINDOW_VIDEOS;
    			  }
    			  else
    			  {
    				nNewWindow = (int)Window.WINDOW_MUSIC_FILES;
    			  }
    			  StateBase.StartWindow = nNewWindow;
    			  if (nNewWindow != GetID)
    			  {
    				if (isVideoWindow)
    				{
    				  MediaPortal.GUI.Video.GUIVideoFiles.Reset();
    				}
    				GUIWindowManager.ReplaceWindow(nNewWindow);
    			  }
    			}
    			break;
     
    		  case 4540: // Now playing
    			{
    			  int nPlayingNowWindow = (int)Window.WINDOW_MUSIC_PLAYING_NOW;
     
    			  MediaPortal.GUI.Music.GUIMusicPlayingNow guiPlayingNow =
    				(MediaPortal.GUI.Music.GUIMusicPlayingNow)GUIWindowManager.GetWindow(nPlayingNowWindow);
     
    			  if (guiPlayingNow != null)
    			  {
    				guiPlayingNow.MusicWindow = (MediaPortal.GUI.Music.GUIMusicBaseWindow)this;
    				GUIWindowManager.ActivateWindow(nPlayingNowWindow);
    			  }
    			}
    			break;
     
    		  default: // a db view
    			{
    			  ViewDefinition selectedView = (ViewDefinition)handler.Views[selectedViewId - 1];
    			  handler.CurrentView = selectedView.Name;
    			  StateBase.View = selectedView.Name;
    			  int nNewWindow;
    			  if (isVideoWindow)
    			  {
    				nNewWindow = (int)Window.WINDOW_VIDEO_TITLE;
    				// Reset search variables
    				if (GUIVideoTitle.CurrentViewHistory != handler.CurrentLevelWhere)
    				{
    				  GUIVideoTitle.IsActorSearch = false;
    				  GUIVideoTitle.IsMovieSearch = false;
    				  GUIVideoTitle.ActorSearchString = string.Empty;
    				  GUIVideoTitle.MovieSearchString = string.Empty;
    				  GUIVideoTitle.MovieSearchDbFieldString = string.Empty;
    				}
    			  }
    			  else
    			  {
    				nNewWindow = (int)Window.WINDOW_MUSIC_GENRE;
    			  }
    			  if (GetID != nNewWindow)
    			  {
    				StateBase.StartWindow = nNewWindow;
    				if (nNewWindow != GetID)
    				{
    				  GUIWindowManager.ReplaceWindow(nNewWindow);
    				}
    			  }
    			  else
    			  {
    				LoadDirectory(string.Empty);
    				if (facadeLayout.Count <= 0)
    				{
    				  GUIControl.FocusControl(GetID, btnLayouts.GetID);
    				}
    			  }
    			}
    			break;
    		}
    		*/
    	}
     
    Last edited:

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    I really need your help to figure out commented code in here:
    Not sure, I tried to stay out of it when they refactored everything to create this windowpluginbase class.

    I guess if you look at the history in GIT / SVN you should be able to see what was there previously before it was merged.
    I think the MusicWindowBase and VideoWindowBase classes were there before so it is probably just a copy and paste job I think.

    IIRC this code basically makes you sure you get back to the right window. When you open up music of video it defaults to shares view (which is in fact a completely different window) but if you are in database view (or were in database view last time) then when it tries to open up the music / video window (will always attempt shares view I think) it redirects you to the database window
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    Can you tell me how all of this should be done without breaking anything? WindowPluginBase.cs cannot reference anymore to Videos or MyMusic since it should not know anything about plugins.

    yup, that's a pain.
    I needed to have a new separate few handler for the Music Views rework branch and first commented out the Video stuff.
    We need to find another way. maybe getting rid of this base class.
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    As I commented on Github, this is a big breaking change that will need us to mark all plugins incompatible (some process plugins are going to reference windowplugins.dll too)

    @infinite.loop wrote in a post somewhere that he did not want breaking changes going into 1.5 if we can avoid it.
     

    Users who are viewing this thread

    Top Bottom