SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-21-2006, 12:37 AM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Listener Question

I think I know the answer to this but I have to ask. On other Widgets you can set one of its properties like this:

=GetProperty("properties_file_key", "default")

But can you set the "Listener Type" property on a Listener this way?

It doesn't appear to work but I thought I might have something wrong like the case or spelling of the event.

BobP.
Reply With Quote
  #2  
Old 05-21-2006, 01:10 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Is anyone else doing this to set a listener type?

I never played around with that idea until just now. I'm sure someone else must be doing that already, but my results showed that it doesn't seem to always reload the listener's type value every time you go back to the menu, so it may be using what was in its cache.

Basically: it worked for me to set the listener's type to be equal to some variable or property value, but once set, it didn't catch a new value unless I used F5 on the menu widget to force a reload of the menu. That should mean that it would load the value & use it properly when you restart SageTV after making the change. I'm going to see about getting more details on this.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #3  
Old 05-21-2006, 01:21 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
The property name is 'ListenerEvent' (seen from browsing the XML STV)

I Get it in my multifunction stop import hook...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #4  
Old 05-21-2006, 01:25 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by nielm
The property name is 'ListenerEvent' (seen from browsing the XML STV)

I Get it in my multifunction stop import hook...
But, aren't you talking about getting the widget & changing its value via SetWidgetProperty() as part of the import process, rather than using a dynamic property assignment to set its value on the fly as the STV is in use? I believe he wants to have a setting to choose which command is used for some functionality.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #5  
Old 05-21-2006, 12:09 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by nielm
The property name is 'ListenerEvent' (seen from browsing the XML STV)

I Get it in my multifunction stop import hook...
Yes I have used that in the STVImported hook but with other Widgets you can do it while the GUI is running.

Quote:
Originally Posted by Opus4
But, aren't you talking about getting the widget & changing its value via SetWidgetProperty() as part of the import process, rather than using a dynamic property assignment to set its value on the fly as the STV is in use? I believe he wants to have a setting to choose which command is used for some functionality.

- Andy
That is correct I would like to modify it on the fly and set up a popup for the User to change which event to use. Thanks for testing this I wasn't able to get as far as you did so I know it is possible just have to see what I did wrong. Was trying the Custom1-5 commands.

BobP.
Reply With Quote
  #6  
Old 05-21-2006, 12:40 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
If Custom1-5 are the only ones you're interested in, you could just listen for all of them and call PassiveListen on the ones that aren't enabled:

Code:
Listener: Custom1
    targetval = "Custom1"
        if GetProperty("key", ...)
Listener: Custom2
    targetval = "Custom2"
        if GetProperty("key", ...)
Listener: Custom3
    targetval = "Custom3"
        if GetProperty("key", ...)
Listener: Custom4
    targetval = "Custom4"
        if GetProperty("key", ...)
Listener: Custom5
    targetval = "Custom5"
        if GetProperty("key", ...)
            > targetval
                do your thing
            > else
                PassiveListen()
Not as sexy as the dynamic property, but it should work.
__________________
-- Greg
Reply With Quote
  #7  
Old 05-21-2006, 12:55 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by GKusnick
If Custom1-5 are the only ones you're interested in, you could just listen for all of them and call PassiveListen on the ones that aren't enabled:

Code:
Listener: Custom1
    targetval = "Custom1"
        if GetProperty("key", ...)
Listener: Custom2
    targetval = "Custom2"
        if GetProperty("key", ...)
Listener: Custom3
    targetval = "Custom3"
        if GetProperty("key", ...)
Listener: Custom4
    targetval = "Custom4"
        if GetProperty("key", ...)
Listener: Custom5
    targetval = "Custom5"
        if GetProperty("key", ...)
            > targetval
                do your thing
            > else
                PassiveListen()
Not as sexy as the dynamic property, but it should work.
That's how I have it currently in one of my plugins but I just wanted more options. Specificly I was looking at a plugin that would allow the user to define any event and direct it to any menu in SageTV. Coding all of the Event Types is possible but I would definately like another option if possible.

BobP.
Reply With Quote
  #8  
Old 05-22-2006, 02:35 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
The listener type is definitely cached, so a dynamic value isn't going to work to update the listener automatically. It _might_ work if you have the user restart after making a change, but I'm not entirely sure about that... and users might not like having to restart.

You may want to just stick to the 'standard' way of checking the setting for a limited series of commands, as above.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #9  
Old 05-22-2006, 04:38 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
I was afraid of that. Oh well thanks for checking. Just like to have options.

BobP.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.