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 11-11-2005, 10:40 PM
src666 src666 is offline
Sage Aficionado
 
Join Date: Feb 2005
Posts: 459
Working with Arrays

OK, I'm probably missing something obvious here, but I just got started playing with Studio.

I'm trying to load all songs by an artist into a playlist, and start playing that playlist, just by pressing the Play button when the artist is selected. I don't want any intermediate selection screens/windows.

Obviously, I call GetAllMusicForArtist, which returns the "Airings" as an array.

Obviously, I want to call AddToPlaylist for each of these airings, since AddToPlaylist only accepts a single airing.

Unfortunately, I'm reminded of an old cartoon, where two scientists stand in front of a large blackboard. On the left side is a hugely complex equation. On the right side is a hugely complex equation. In the middle are the words "and then a miracle occurs".

I'm missing the miracle. I see the looping capability, but I don't see a way to interate through the array (determine the upper/lower bounds to control the loop, or any sort of FOR EACH type of ability), much less access individual elements of it. I'm just missing the miracle in the middle.

Thanks in advance for pointing out the obvious solution, because I'm sure there is one!
Reply With Quote
  #2  
Old 11-11-2005, 11:32 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
You can use Size(<array>) to get the number of elements in the list.

To get a particular element in the list, use the GetElement(<list>, index) API call, where index is 0 for the first element.

For basic loop concepts, see "Tutorial 10 – Loops" in the Studio manual + accompanying tutorial STV.

There are loops using GetElement() all over the default STV -- if you do a search for "GetElement(" (w/o quotes), you will run across lots of loops... but the search could take a little while to complete.

- 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 11-12-2005, 08:15 AM
src666 src666 is offline
Sage Aficionado
 
Join Date: Feb 2005
Posts: 459
Thanks, Andy. I appreciate the guidance.
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 06:10 PM.


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