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 08-14-2010, 10:09 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
How does CONFIG_MULTICHOICE work?

I've been experimenting with a General plugin and trying to use a configuration type of CONFIG_MULTICHOICE and can't sort out how it's supposed to work. Does anybody have any experience using this type?

getConfigValue is being called, but I have no idea what's supposed to be returned since it returns a String and and CONFIG_MULTICHOICE deals with String[].

getConfigValues and setConfigValues are not doing what I expected either. Before I pollute other people's thoughts and post what I expected them to do, can somebody tell me how you think these methods should work?

Thanks,

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #2  
Old 08-14-2010, 10:44 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
I haven't used it, but here's what I'd expect:

getConfigOptions() returns an Array of all allowable values.

getConfigValues() returns an Array containing the currently set value(s).

setConfigValues() receives an Array containing the value(s) to be set as current.

getConfigValue() and setConfigValue() would not be called.

Looking at the calling code in the stock STV seems to bear this out, with one exception: there's a call to GetPluginConfigValue() in the MenuNeedsDefaultFocus hook of the choice popup dialog. Maybe Andy can comment further on that, but if this is by design, then it would seem to indicate that getConfigValue() should return the single value that you want to receive focus when that dialog comes up. For Choice settings this would be the same as the selected value; for Multichoice it's less clear what this should be. Perhaps the STV should be modified to call GetPluginConfigValues() instead and put the focus on the first value returned (if any).
__________________
-- Greg
Reply With Quote
  #3  
Old 08-14-2010, 10:55 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
I just used this past night for the first time.

Get config value is returning the current property setting. In the ui is puts a dot next to the current property value as well as uses it to display the current value on the main config screen.

Reall all you need to in java with it is define it with the property an pass the string[] of values you want.

You can also subscribe to the listener and do anything you need to do on the change.

Somehow I missed option in the plugin implentation until last night I just admit it is nicely done.
Reply With Quote
  #4  
Old 08-14-2010, 11:00 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
I wasn't using the getConfigOptions() method since the comment in the code Sage posted indicated it was for CONFIG_CHOICE.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #5  
Old 08-14-2010, 11:11 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by PLUCKYHD View Post
I just used this past night for the first time.

Get config value is returning the current property setting. In the ui is puts a dot next to the current property value as well as uses it to display the current value on the main config screen.

Reall all you need to in java with it is define it with the property an pass the string[] of values you want.

You can also subscribe to the listener and do anything you need to do on the change.

Somehow I missed option in the plugin implentation until last night I just admit it is nicely done.
I think this confused me even more.

In any case, I don't think it will do what I wanted. I'm looking for a way to display a table with three columns. The first column contains items I populate (Channel Names) and the next two (or three) columns contain choices that the user can select.

Specifically, in the CommercialDetector plugin I'm trying to present a table of Channel Names to the user so (s)he can choose to use comskip on shows from that channel, ShowAnalyzer, or neither. I'd also like a way to specify what .ini file to use on a per-channel basis.

Is this doable or am I asking too much?

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #6  
Old 08-14-2010, 11:23 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Sorry that is what I get for posting on my iphone that is a confusing post

Basically you define a popup of options in java that the user can select from. All you have to pass is the property you want defined and the String[] of options you want.

You don't need to use get or set unless you are wanting to do something different then just setting or getting a property.

What you are wanting is possible although not easy as you would have to listen to changes and do your code in that. three columns really isn't possible but you could separate it with --- or commas or such.

For what you are wanting to do I would do it in a stvi or in Greg's stvi configuration he coded
Reply With Quote
  #7  
Old 08-14-2010, 01:51 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Plucky,

I'm trying to keep all of the configuration within the plugin so for now I think I will not use STVi code or Greg's config tool. (I have not used Greg's tool yet but I was under the impression that it's to be used from STV code and not Java code. Please correct me if I'm wrong.)

What I've decided to do is dynamically add ConfigSettings based on the channels that the user has defined. (One ConfigSetting per channel.) I then make each ConfigSetting type CONFIG_CHOICE allowing the user to choose from a menu of items.

To avoid cluttering up the configuration with too many settings there is a setting that the user can use to display, or not display, all of the channels.

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #8  
Old 08-14-2010, 02:03 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by tmiranda View Post
(I have not used Greg's tool yet but I was under the impression that it's to be used from STV code and not Java code. Please correct me if I'm wrong.)
STVI Configurator just makes the standard config machinery available to STVIs. It does not add any new config capabilities that the standard machinery does not offer. So if you're already writing a Standard plugin, there's nothing to be gained (except complexity) from using STVI Configurator.

You can use my XmlConfig class from a Standard plugin, but again, it doesn't offer any new capabilities; it just allows you to simplify your config code by defining most of the structure in an XML file instead of directly in the code.

Quote:
Originally Posted by tmiranda View Post
What I've decided to do is dynamically add ConfigSettings based on the channels that the user has defined. (One ConfigSetting per channel.) I then make each ConfigSetting type CONFIG_CHOICE allowing the user to choose from a menu of items.
That's probably the best approach for what you want to accomplish.
__________________
-- Greg
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
I've tried and tried and just can't get this to work... atlantadude1972 SageTV Placeshifter 13 08-31-2009 07:14 PM
Will this work? sheddav Hardware Support 2 03-06-2009 04:12 PM
Will this work? rileydogmi SageTV Media Extender 2 02-18-2009 08:51 AM
Need help with getting CC to work. lovingHDTV SageTV Software 4 11-09-2004 07:15 AM
No 5.1 out....it does work, right? broderp SageTV Software 21 06-05-2004 04:46 PM


All times are GMT -6. The time now is 02:29 AM.


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