ListItem.SubtitleLanguage

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ronie Offline
Team-XBMC Member
Posts: 8,254
Joined: Jan 2009
Reputation: 108
Post: #11
cruzannavy Wrote:yeah i know it would have to be ahacky way around it. but if yuo read my other post. the xbmc subtitle script has a python to do jsut that. it returns a true if it detects .srt etc... and then display an image int he xbmc subtitle window. i was wondering if there was a way to jsut create that small line of code in a sperate python and have it run with when the dialog window opens ? thoughts?

should be reasonably easy to do (although you're never sure until you actually start to code it)...
run the script when the videoinfo dialog opens and pass ListItem.FileNameAndPath to the script.
the script should be able to check for the subtitle files and pass the result back to the skin as a window property.


something like that?

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
cruzannavy Offline
Senior Member
Posts: 203
Joined: Dec 2010
Reputation: 9
Post: #12
unfortunately im not a python/ script guy.. but theres always a time to start right . and im guessing thats now. im going to hack away at it, so intheory for now, if i exceute xbmc subtitle script in conjunction with dialouge info it probably wont pass recognize the dialouge window, im pretty sure it lookd for whats currently playing not whats in the list. is it possible to get me started in the right direction.

cause what im about to do is guess until i get soemthign to work. if i copy subtitle script and change the name and details and make it launch on focus with dialoge ill see what happens then

but yes like you said. run script on open dialouge or focus ( like in a wallstream or list view) and pass info back to skin to either displa image or not based on if it finds the file in the path .
find quote
ronie Offline
Team-XBMC Member
Posts: 8,254
Joined: Jan 2009
Reputation: 108
Post: #13
cruzannavy Wrote:unfortunately im not a python/ script guy.. but theres always a time to start right . and im guessing thats now. im going to hack away at it, so intheory for now, if i exceute xbmc subtitle script in conjunction with dialouge info it probably wont pass recognize the dialouge window, im pretty sure it lookd for whats currently playing not whats in the list. is it possible to get me started in the right direction.

cause what im about to do is guess until i get soemthign to work. if i copy subtitle script and change the name and details and make it launch on focus with dialoge ill see what happens then

but yes like you said. run script on open dialouge or focus ( like in a wallstream or list view) and pass info back to skin to either displa image or not based on if it finds the file in the path .

i'll see if i can come up with some code.
looking at xbmc subtitles would indeed be the way to start.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
cruzannavy Offline
Senior Member
Posts: 203
Joined: Dec 2010
Reputation: 9
Post: #14
thanks, im tryign it now to see what i can come up with, jsut reading the gui.py of the xbmc subtitle

Code:
self.getControl( 111 ).setVisible( False )                              # check for existing subtitles and set to "True" if found
    sub_exts = ["srt", "sub", "txt", "smi", "ssa", "ass" ]
    br = 0
    for i in range(3):
      for sub_ext in sub_exts:
        if br == 0:
          exec("lang = toOpenSubtitles_two(self.language_%s)" % (str(i+1)) )
          if os.path.isfile ("%s.%s.%s" % (os.path.join(sub_folder,os.path.splitext( os.path.basename( self.file_original_path ) )[0]),lang ,sub_ext,)):
            self.getControl( 111 ).setVisible( True )
            br = 1
            break
that is what i am trying to utilize
find quote
ronie Offline
Team-XBMC Member
Posts: 8,254
Joined: Jan 2009
Reputation: 108
Post: #15
here's some basic code to get you started:

dharma: http://pastebin.com/raw.php?i=cD8sXfiM

eden-pre: http://pastebin.com/raw.php?i=jtHrzabS

i haven't tested the dharma code, but the eden-pre one works fine.

in DialogVideoInfo.xml, run the script like this:
Code:
RunScript(script.subtitleinfo,path="$INFO[ListItem.FileNameAndPath]")

the script will set Window.Property(SubtitleInfo) to 'true' when a subtitle is found.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
cruzannavy Offline
Senior Member
Posts: 203
Joined: Dec 2010
Reputation: 9
Post: #16
should i expect a result if <include name="SubFlaggingConditions">
<control type="image">
<description>Closed Captioning Image</description>
<width>60</width>
<height>33</height>
<aspectratio>keep</aspectratio>
<texture>$INFO[Window([12003]).Property(SubtitleInfo),sub/,.png]</texture>
</control>

is in the skin while the script is executed?
find quote
ronie Offline
Team-XBMC Member
Posts: 8,254
Joined: Jan 2009
Reputation: 108
Post: #17
if you remove the square brackets, you might get a result, yes

Code:
$INFO[Window(12003).Property(SubtitleInfo),sub/,.png]

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
cruzannavy Offline
Senior Member
Posts: 203
Joined: Dec 2010
Reputation: 9
Post: #18
i have the script running on focus of the window. and i ca nseeit being executed in the debug log. now im just alittle confused on how i would use the result to display an image. what i want to do is create a studio flag condition im my includecodecflagging.xml and then just use the include name to add to the group of media flags already in the dialoug window. could i use a visible to get it to work or how do i go about , been trying to figure it out. still learning and reading as much as i can about skinning but i dont know too much about python scriptsinteraction with the skin. but i am a quick learner
find quote
ronie Offline
Team-XBMC Member
Posts: 8,254
Joined: Jan 2009
Reputation: 108
Post: #19
since the window property will return 'true', you'll have to create a true.png image in your case.

so skin.foo/media/sub/true.png must exist.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
cruzannavy Offline
Senior Member
Posts: 203
Joined: Dec 2010
Reputation: 9
Post: #20
ronie Wrote:if you remove the square brackets, you might get a result, yes

Code:
$INFO[Window(12003).Property(SubtitleInfo),sub/,.png]

yeah i tried that and still dont see any expected results.. hmmm
find quote