Author Topic: Theater Modes / What Are They? / How Do They Work?  (Read 5265 times)

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
Edit: I actually misread your question below. No, you won't find such situations where you have to encompass the below in a settings group.

So there could be a situation where you have type="text" and childElements encompassed within a settings group?
This TM stuff can really give you headaches ;-)
Type="text" and child elements cannot be defined any other way than to wrap them inside the opening and closing tags of a parent element.
It's impossible to use /> on such situations:

<element type="Text" x="5" y="5" width="100" font="SegoeUI" size="10" fg="60,135,165" align="Center" onClick="PlayNext">
   Next Song
</element>

<element type="NowPlayingList" " x="-5"  y="-20" widthDock="X:#Lyrics.Right" heightDock="Y:#Lyrics.Bottom" rowPadding="11">
  <child width="12"/>
  <child id="Speaker" width="15"/>
  <child id="#" width="30" format="#\." align="center"/>
  <child id="TrackArtistAndTitle" width="180"/>
</element>
 
There's also: "year(yyyy)" / "year (yyyy)" in post #3, what is probably unintended?
Or is there maybe some difference between the one with and the one without a space?
year(yyyy) is an ancient id that was kept active for backwards compatibility I believe.
Both still work, but year (yyyy) is widely preferred and expected amongst users.
Last Edit: November 15, 2023, 07:08:30 PM by Mayibongwe
Favourite song at the moment:   Decode by Paramore

hiccup

  • Sr. Member
  • ****
  • Posts: 7790
<element type="NowPlayingList" " x="-5"  y="-20" widthDock="X:#Lyrics.Right" heightDock="Y:#Lyrics.Bottom" rowPadding="11">
  <child width="12"/>
  <child id="Speaker" width="15"/>
  <child id="#" width="30" format="#\." align="center"/>
  <child id="TrackArtistAndTitle" width="180"/>
</element>
Thanks Mayibongwe, this is helpful in trying to wrap my head around getting these TM's looking as clean and easy to read and understand as possible.
It's probably best then to make a habit of always closing an element with the full </name>.
And also frequently use 'new line' instead of having very long lines of code.
Some TM's I looked at to get some ideas or better understanding could benefit from such an approach ;-)
(my own included…)

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
It's probably best then to make a habit of always closing an element with the full </name>.
And also frequently use 'new line' instead of having very long lines of code.
Some TM's I looked at to get some ideas or better understanding could benefit from such an approach ;-)
Most of the theater modes we've seen on the forum don't have long lines of code - which would make the above suggestion good practice.
When I worked on the Motion Pictures TM, I had to shorten the code (syntax-wise, not functionality) as much as I could since the .xml file is about 1.5mb (was a bit more before the shortening). Most TM's aren't even 20kb. In those cases, I also would favour readability over size concerns.
Favourite song at the moment:   Decode by Paramore

hiccup

  • Sr. Member
  • ****
  • Posts: 7790
Most of the theater modes we've seen on the forum don't have long lines of code - which would make the above suggestion good practice.
Yeah, and what I also realised just now:
I have a habit of having three panes open besides each other in my code editor.
That is also not helping in getting a clean overview of the lines and next-lines of code ;-)
Using one or two wider panes does wonders here…

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
Added AutoSwitch. Illustration:

Code
<?xml version="1.0" encoding="utf-8"?>
<root>

<element type="block" xAnchor="Panel.30" widthDock="x:Panel.70" yAnchor="Panel.40" heightDock="y:Panel.60" bg="0,50,0"/>

<autoHide name="#1">
<element type="Text" xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Top" font="Segoe UI" size="20" fg="185,185,185"
>Top Left</element>
</autoHide>

<autoHide name="#2">
<element type="Text" xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Middle" font="Segoe UI" size="20" fg="185,185,185"
>Middle Left</element>
</autoHide>

<autoHide name="#3">
<element type="Text" xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Bottom.Left" font="Segoe UI" size="20" fg="185,185,185"
>Bottom Left</element>
</autoHide>

<autoHide name="#4">
<element type="Text" xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Bottom.Center" font="Segoe UI" size="20" fg="185,185,185"
>Bottom Center</element>
</autoHide>

<autoHide name="#5">
<element type="Text" xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Bottom.Right" font="Segoe UI" size="20" fg="185,185,185"
>Bottom Right</element>
</autoHide>

<autoHide name="#6">
<element type="Text" xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Middle.Right" font="Segoe UI" size="20" fg="185,185,185"
>Middle Right</element>
</autoHide>

<autoHide name="#7">
<element type="Text" xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Top.Right" font="Segoe UI" size="20" fg="185,185,185"
>Top Right</element>
</autoHide>

<autoHide name="#8">
<element type="Text" xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Top.Center" font="Segoe UI" size="20" fg="185,185,185"
>Top Center</element>
</autoHide>

<element type="Text"
xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Top.Center" font="Segoe UI" size="20" fg="185,185,18"
autoSwitch="OpenAutoHidePanel:#1;OpenAutoHidePanel:#2;OpenAutoHidePanel:#3;OpenAutoHidePanel:#4;OpenAutoHidePanel:#5;OpenAutoHidePanel:#6;OpenAutoHidePanel:#7;OpenAutoHidePanel:#8"
autoSwitchInterval="500" visibleTrigger="AutoSwitchOff"
>Start</element>

<element type="Text"
xAnchor="block.Left" widthDock="X:block.Right" yAnchor="block.Top" heightDock="Y:block.Bottom"
align="Middle.Center" font="Segoe UI" size="20" fg="185,185,18"
onClick="StopAutoSwitch" visibleTrigger="AutoSwitchOn"
>Stop</element>

</root>
Favourite song at the moment:   Decode by Paramore

hiccup

  • Sr. Member
  • ****
  • Posts: 7790
Added AutoSwitch. Illustration:
Haha, that's not only funny, but I can imagine some very useful purposes for this.

Thanks for adding and sharing Mayibongwe!

PS
Do you know of any TMs that are using this feature at the moment?

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1014
  • Heal The World
Do you know of any TMs that are using this feature at the moment?
Nope, I don't think we have any present TMs using that feature.
But it surely is interesting though. With the right idea, it would do magic.
Favourite song at the moment:   Decode by Paramore

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3830
  • MB Version: 3.6.8830 P
I didnt think there was much interest in developing theatre mode views but am prepared to spend some time enhancing if there is interest

As this might generate some new interest in theatre mode, I thought a little reminder that this issue was never resolved might be timely.  :-\

]if both type="NowPlayingList" and type="AlbumTracks" are used in the xml (in different autoHide panels of course) formatting and info for "AlbumTracks" is overridden by type="NowPlayingList"
This is not dependant on position in xml
as currently implemented, only one panel showing a list of tracks is supported. Its non-trivial to fully disconnect them. Let me know if its important to what you want to achieve
MusicBee and my library - Making bee-utiful music together

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3830
  • MB Version: 3.6.8830 P
@Bee-liever, could you send me the .xml file?

PM sent
MusicBee and my library - Making bee-utiful music together

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
This should work
https://www.mediafire.com/file/hhfv2uu1y19ts7u/mb_TheaterModePlugin.zip/file

re: your request for a QueueNext action when clicking on an album track, i will think about that some more.

edit:
i have included it but feel the click behavior should be consistent across other skins, especially as there is no visual indication
Last Edit: November 26, 2023, 10:44:55 AM by Steven

Bee-liever

  • Member
  • Sr. Member
  • *****
  • Posts: 3830
  • MB Version: 3.6.8830 P
Thank you Steven
Working just great  :)

edit:
i have included it but feel the click behavior should be consistent across other skins, especially as there is no visual indication
I will add a text line to denote the changed onClick behaviour for that panel
MusicBee and my library - Making bee-utiful music together