2 into 1
Moderator: Mods
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
2 into 1
Hello my coding is not great and I am stuck.I have a code that shows when wmp is PLAYING as i have a dell premium remote that has wmp services on in the background so wmp running will always be true,
somehow i made this and it worked
CustomItems.Key1qq
String status = ((String)GetData("WMP9.Status"));
int fi = status.IndexOf('\'');
if ( fi == -1 )
{ // no track playing
if ( status == "" )
{ // wmp not open
return "false";
}
return "false";
}
int li = status.LastIndexOf('\'');
String track = status.Substring( fi+1, li-(fi+1) );
return "True "
I also have a custom screen which i want displayed all the time except when winamp(being monitored in application monitor) or my CustomItems.Key1qq(windows media player playing)
how do i combine both functions to triger custom screen? any help will be nice.thank you
somehow i made this and it worked
CustomItems.Key1qq
String status = ((String)GetData("WMP9.Status"));
int fi = status.IndexOf('\'');
if ( fi == -1 )
{ // no track playing
if ( status == "" )
{ // wmp not open
return "false";
}
return "false";
}
int li = status.LastIndexOf('\'');
String track = status.Substring( fi+1, li-(fi+1) );
return "True "
I also have a custom screen which i want displayed all the time except when winamp(being monitored in application monitor) or my CustomItems.Key1qq(windows media player playing)
how do i combine both functions to triger custom screen? any help will be nice.thank you
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
i get false when windows media player is playing but should be true & when winamp is running i get this error
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running + custom screen
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running + custom screen
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
i get false when windows media player is playing but should be true & when winamp is running i get this error
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running + custom screen
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running + custom screen
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
i get false when windows media player is playing but should be true & when winamp is running i get this error
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running + custom screen
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running + custom screen
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
i get false when windows media player is playing but should be true & when winamp is running i get this error
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running + custom screen
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running + custom screen
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
i get false when windows media player is playing but should be true & when winamp is running i get this error
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running = custom screen
Unknown:System.InvalidCastException: Specified cast is not valid.
at ScriptedDataItemImpl.eval()
all i want to acheive is my custom screen running when either winamp or key1qq( windows media player playing) is not. I do not want them cycling every 5 seconds. so basically
winamp running= winamp screen
Key1qq( wmp playing= wmp screen
wimamp or Key1qq not running = custom screen
Last edited by darkvader71 on Tue Jan 12, 2010 4:14 pm, edited 2 times in total.
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
[quote]Try removing the quotes from true and false , you returning strings now.
Hello Ray
sorry did not understand your comment "Try removing the quotes from true and false , you returning strings now".
I think i must inform you that I a new to coding. do you mean like this below ?
if(((Boolean)GetData(AppMonitor.Winamp.exe.Running))&&((Boolean)GetData(CustomItems.Key1qq.true))) return true;
else return false;
(yes i am a noob)
Hello Ray
sorry did not understand your comment "Try removing the quotes from true and false , you returning strings now".
I think i must inform you that I a new to coding. do you mean like this below ?
if(((Boolean)GetData(AppMonitor.Winamp.exe.Running))&&((Boolean)GetData(CustomItems.Key1qq.true))) return true;
else return false;
(yes i am a noob)
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
-
- LCD Geek
- Posts: 36
- Joined: Thu Jan 07, 2010 3:02 am
Ray I know you are a very busy man but like I said, I copied this coding from a forum and changed the manes of the items.
I do not poses any coding skills so if you could find the time to correct codes above and paste here or pm me I would be very greatful. this issue is the only outstanding item of my project( which can be seen in the gallery section. Thank you
I do not poses any coding skills so if you could find the time to correct codes above and paste here or pm me I would be very greatful. this issue is the only outstanding item of my project( which can be seen in the gallery section. Thank you
Last edited by darkvader71 on Sat Jan 23, 2010 4:18 am, edited 1 time in total.