[Approved] File Stacking with Selected Disc Name (1 Viewer)

cyberfix

Portal Member
January 16, 2007
47
14
Home Country
United States of America United States of America
Purpose:
This patch is to show the name of the file in stacked mode. So if you clicked on Family Guy Volume 1, it would show all of the Discs for the various episodes, then at the bottom of the dialog box beneath the Discs, it shows the name of the currently selected episode. I never understood why this was not always normal functionality and I am not sure if my patch is the right way to do it.

This helps me find a particular episode easily and is a much needed feature. The screen shots show what I am referring to.

Patch: (Updated 11/14/2010)
-Added code to detect whether or not a skin has the necessary control to show the title. If not, it will behave as the current default method. If the control exists, then the new title functionality will turn on automatically.
-Updated against SVN 26774
-Cleaned up disc centering code to fix issues with centering when certain number of discs were shown.
-Updated attached files to reflect SVN26774

Read notes below...

--Older original info--
I am attaching the patch against SVN 26596. Plus I am including a ZIP file with the patched skin file for Blue3 and Blue2Wide (only requires one control added to each). The ZIP also contains a patched Dialog.dll file for others to try. Remember to clear your Media Portal Cache if you want to try it. There are simple instructions in the ZIP.

This patch modifies and adds to some of the GUIFileStacking code. Also, I have it centering the box in the screen along with title based on screen resolution, etc.

I add this in every release, so I hope that it would be useful enough to add into the main code base. Feel free to change the code if there is a better way to implement this.

NOTE: (Notes added on 11/14/2010)
The control for CD40 as seen below seems to still have a bug in it. The left control is 139, but the right control should be 101 and not 11. It appears to be a typo unless somebody can explain why it would go to 11 and what it is? This needs to be fixed in both of the Blue3 skins and is included in the attached patch.

Code:
    <control>
      <description>CD40</description>
      <type>button</type>
      <id>140</id>
      <width>113</width>
      <height>80</height>
      <textureFocus>button-cd-focus.png</textureFocus>
      <textureNoFocus>button-cd-nofocus.png</textureNoFocus>
      <onright>11</onright>
      <onleft>139</onleft>
      <animation effect="fade" time="250">WindowOpen</animation>
      <animation effect="fade" time="250">WindowClose</animation>
    </control>


NOTE 2:
Skin designers can add the following control right before the "CD1" control in "dialogFileStacking.xml" if they want the title support to be detected and show up in their skins. See the updated "dialogFileStacking.xml" files in the ZIP for a reference if necessary.

Code:
    <control>
      <description>Movie Title value</description>
      <type>fadelabel</type>
      <id>20</id>
      <posX>300</posX>
      <posY>270</posY>
      <width>720</width>
      <label>-</label>
      <font>font12</font>
      <align>center</align>
      <textcolor>FFFFFFFF</textcolor>
      <animation effect="fade" time="200">WindowOpen</animation>
      <animation effect="fade" time="200">WindowClose</animation>
    </control>

Hope everyone enjoys the change.

Thanks,
cyberfix
 

Attachments

  • stacked-movieFS.jpg
    stacked-movieFS.jpg
    151.3 KB
  • stacked-movieWS.jpg
    stacked-movieWS.jpg
    189 KB
  • FileStacking(SVN 26774).patch
    11.1 KB
  • FileStacking-Files-26774.zip
    24.5 KB

Deda

Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Hi Cyberfix, I quickly tested this and overall is very nice improvement but there is one problem. If this patch is applied, Stack GUI dialog will not working anymore in all skins without new xml code in them. If you can handle that problem that skins will work with this or without then this patch can be candidate to be implemented in MP.

    :D & please continue this, it really looks ok.
     

    cyberfix

    Portal Member
    January 16, 2007
    47
    14
    Home Country
    United States of America United States of America
    Hi Cyberfix, I quickly tested this and overall is very nice improvement but there is one problem. If this patch is applied, Stack GUI dialog will not working anymore in all skins without new xml code in them. If you can handle that problem that skins will work with this or without then this patch can be candidate to be implemented in MP.

    :D & please continue this, it really looks ok.

    Hey Deda! I would have responded sooner, but I was on the road for work and did not have access to update my patch. Thanks for taking the time to look the patch over. I have updated my original first post on this thread. I updated the code to SVN 26774 and put in code to check to see if the control is present in a skin or not. If it is not, it will operate like it currently does before the patch. Also, it will put a warning in the log to let the user or developer know that the control for the title does not exists. It does not log as an error, just a warning message for information as it currently does when any disc control is missing.

    I have tested this with and without the control and it works for me without any issues so far. Also, I think there is a small typo in the Blue3 "guiFileStacking.xml" file for the CD40 control. It is in the patch and decribed in the original updated post.
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    Hi,

    thanks for your work, I agree this is a good feature to have.
    Regarding your code, I have a few questions:
    - Why do you hardcode a controlID (20) and manipulate it directly, why not set a property (#stackedMovie.Selected or similar)? Then you wouldn't need to worry about all the checks if a control exists. Dont forget to reset it when finished
    - Do you need to hardcode the sql query?
    - This shows the filename correct, or does it? You do something with filename, but it comes form the db, an only if it exists there. I don't understand whats going on.
    - Also, is all this string manipulation really nessesary? I think you strip out the filename and extension from the path. You can simply uses a .NET method call to do that.
     

    hkjensen

    MP Donator
  • Premium Supporter
  • June 11, 2007
    165
    65
    Copenhagen
    Home Country
    Denmark Denmark
    Hi

    Added the following properties
    #stackedMovie.Selected (filename without extension)
    #stackedMovie.SelectedId (number)

    If user canceled the selection (ACTION_PREVIOUS_MENU) no file/disc are played

    Control(20) is not needed
    Position of images is now based on position of Control(1) - Width and x-position
    Y-position is taken from Control(3) - Dialogline 2 and not anymore centered on screen

    Simplified the calculation of X-position.

    A warning is given in the log file if Control(1) and Control(3) isn't correctly defined in common.dialog.xml

    File names are passed to GUIDialogStacking by calling SetNumberOfFiles(ArrayList lstMovies)
    if a plugin uses SetNumberOfFiles(int iFiles) then no file names will be displayed but #stackedMovie.SelectedId will contain disc/part number

    To display the filename, skin designers should add the following to dialogFileStacking.xml (added to Blue3 and Blue3wide)
    Code:
        <control>
          <description>Movie Title value</description>
          <type>fadelabel</type>
          <id>0</id>
          <posX>373</posX>
          <posY>452</posY>
          <width>524</width>
          <label>#stackedMovie.Selected</label>
          <font>font12</font>
          <align>center</align>
          <animation effect="fade" time="150">WindowOpen</animation>
          <animation effect="fade" time="150">WindowClose</animation>
        </control>
     

    Attachments

    • FileStacking_with_filename(SVN 26872).patch
      8.9 KB

    cyberfix

    Portal Member
    January 16, 2007
    47
    14
    Home Country
    United States of America United States of America
    Hi,

    thanks for your work, I agree this is a good feature to have.
    Regarding your code, I have a few questions:
    - Why do you hardcode a controlID (20) and manipulate it directly, why not set a property (#stackedMovie.Selected or similar)? Then you wouldn't need to worry about all the checks if a control exists. Dont forget to reset it when finished
    - Do you need to hardcode the sql query?
    - This shows the filename correct, or does it? You do something with filename, but it comes form the db, an only if it exists there. I don't understand whats going on.
    - Also, is all this string manipulation really nessesary? I think you strip out the filename and extension from the path. You can simply uses a .NET method call to do that.

    I agree with your comments, but I wrote this code a long time ago and just updated it to work with the latest version. I am not a coder by trade, so I may not be the best to add additional changes. I have been tied up with Christmas decorations and Show setup, so my time is limited right now.

    Hi

    Added the following properties
    #stackedMovie.Selected (filename without extension)
    #stackedMovie.SelectedId (number)

    If user canceled the selection (ACTION_PREVIOUS_MENU) no file/disc are played

    Control(20) is not needed
    Position of images is now based on position of Control(1) - Width and x-position
    Y-position is taken from Control(3) - Dialogline 2 and not anymore centered on screen

    Simplified the calculation of X-position.

    A warning is given in the log file if Control(1) and Control(3) isn't correctly defined in common.dialog.xml

    File names are passed to GUIDialogStacking by calling SetNumberOfFiles(ArrayList lstMovies)
    if a plugin uses SetNumberOfFiles(int iFiles) then no file names will be displayed but #stackedMovie.SelectedId will contain disc/part number

    This is great! Thanks for taking the time to update the code to better implementation. As I stated to the previous poster, I have been too busy with Xmas light show layout and have limited programming skills.

    Can you verify that the DISC ID did need changed in the GUIDialogStacking.XML as I did in the patch? It appear it should go back to the first item in the list and looked like a typo of 11 instead of 101.

    I will give it a try as soon as I can compile a new build.

    Thanks,
    cyberfix
     

    hkjensen

    MP Donator
  • Premium Supporter
  • June 11, 2007
    165
    65
    Copenhagen
    Home Country
    Denmark Denmark
    Hi

    There is no need to change the onright id since it is change when initializing the dialog
    ....
    pControl.NavigateRight = 101;
     

    Users who are viewing this thread

    Top Bottom