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 07-30-2009, 01:23 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
building array in eclipse to pass to studio

Okay I am having issues building an array and passing it through to sage.

I think the issue in in my do..while statements. I know I am setting a max of 2 elements but I am just trying to test it for now.

code

I am sure I am missing something again...

TIA
Reply With Quote
  #2  
Old 07-30-2009, 02:19 PM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
I don't code for Studio and haven't used GetMediaFileMetadata, but it looks like you're expecting it to return a string that consists of a set of tags that are separated by semicolons.

Assuming that, you're making it harder for yourself than it needs to be Try this.

Code:
String [] tagArray = null;
String mediaTags = MediaFileAPI.GetMediaFileMetadata(mediaObject, "MediaTags");
if (mediaTags != null)
{
    tagArray = mediaTags.split(";");
}
return tagArray;
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun.
Extender: STP-HD300, Harmony 550 Remote,
Netgear MCA1001 Ethernet over Coax.
SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client
, Java 1.6.
Plugins: Jetty, Nielm's Web Server, Mobile Web Interface.

Reply With Quote
  #3  
Old 07-30-2009, 02:34 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
WOW talk about a helping hand they are actually they are seperated by ;;

so is there are call to get between ; and ; ?

if not I will change the format maybe.
Reply With Quote
  #4  
Old 07-30-2009, 02:36 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
can I just call split (";*;") ?

edited:that seems to works

thanks 100%

i still would like to know if I had my do while statements correct?

Last edited by PLUCKYHD; 07-30-2009 at 02:50 PM.
Reply With Quote
  #5  
Old 07-30-2009, 03:28 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
They'd work, and (well I guess I am) not to critique coding style, but I'd use a for loop:

Code:
for ( int i = 0; i < 2, i++){
   TagArray[i] = amediatag;
   System.out.println("stuff")
   ...
}
A do-while is really for when you don't know how many times you need to loop (ie you're comparing i to a variable/parameter), but you know you want to do it at least once, regardless of the result of the "test" in the while.
Reply With Quote
  #6  
Old 07-30-2009, 04:47 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stanger89 View Post
They'd work, and (well I guess I am) not to critique coding style, but I'd use a for loop:

Code:
for ( int i = 0; i < 2, i++){
   TagArray[i] = amediatag;
   System.out.println("stuff")
   ...
}
A do-while is really for when you don't know how many times you need to loop (ie you're comparing i to a variable/parameter), but you know you want to do it at least once, regardless of the result of the "test" in the while.
Correct and that is what I wanted to achieve the 2 variable was just for quick testing I wanted a loop that that number of times could change. I am definately open to critque as I am learning
Reply With Quote
  #7  
Old 07-30-2009, 09:51 PM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
Quote:
Originally Posted by PLUCKYHD View Post
WOW talk about a helping hand they are actually they are seperated by ;;

so is there are call to get between ; and ; ?

if not I will change the format maybe.
I don't quite follow but it sounds like you got it working so no need to explain further unless you need more help. Depending on the string and delimiter, sometimes you might end up with nulls or empty strings in the array. If you run into that, post an example mediaTags string and I'll help you clean it up.

I rarely find the need to use a do/while loop. for and while loops can usually handle whatever I need.
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun.
Extender: STP-HD300, Harmony 550 Remote,
Netgear MCA1001 Ethernet over Coax.
SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client
, Java 1.6.
Plugins: Jetty, Nielm's Web Server, Mobile Web Interface.

Reply With Quote
  #8  
Old 08-04-2009, 08:46 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Okay dumb question is a String[] basically and array of strings?
Reply With Quote
  #9  
Old 08-04-2009, 12:08 PM
jreichen's Avatar
jreichen jreichen is offline
Sage Icon
 
Join Date: Jul 2004
Posts: 1,192
That's exactly what it is

If you're interested in learning more about Java, Sun's tutorial is a good reference. Start with a few of the basic topics, you won't need a lot of the advanced ones. And the Collections topic would help explain some of the concepts with arrays, lists, etc.

And as always feel free to keep asking questions here
__________________
Server: Intel Core i5 760 Quad, Gigabyte GA-H57M-USB3, 4GB RAM, Gigabyte GeForce 210, 120GB SSD (OS), 1TB SATA, HD HomeRun.
Extender: STP-HD300, Harmony 550 Remote,
Netgear MCA1001 Ethernet over Coax.
SageTV: SageTV Server 7.1.8 on Ubuntu Linux 11.04, SageTV Placeshifter for Mac 6.6.2, SageTV Client 7.0.15 for Windows, Linux Placeshifter 7.1.8 on Server and Client
, Java 1.6.
Plugins: Jetty, Nielm's Web Server, Mobile Web Interface.

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
Help with removeall in eclipse PLUCKYHD SageTV Studio 3 07-29-2009 10:50 AM
My Frakking array went south trini0 The SageTV Community 0 04-03-2008 04:45 PM
AC3 filter...to pass thru or no pass thru rwc SageTV Software 2 04-01-2008 07:54 AM
Building arrays of arrays in Studio evilpenguin SageTV Studio 2 02-15-2007 11:58 AM
aaaaaaaaaaaagh! Disk array corrupt. sleonard SageTV Software 41 12-23-2004 12:35 PM


All times are GMT -6. The time now is 06:05 PM.


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