Skip to content

Instantly share code, notes, and snippets.

@yoavp77
Last active November 27, 2018 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoavp77/7141069b1a00c021e157adf545e7295a to your computer and use it in GitHub Desktop.
Save yoavp77/7141069b1a00c021e157adf545e7295a to your computer and use it in GitHub Desktop.
function GetChannels() {
var Channel = [];
var Channels = [];
for (i = 0; i < ChannelAPI.GetAllChannels().length; i++) {
DiscoveredChannel = ChannelAPI.GetAllChannels()[i];
var Channel = [];
Channel["StationID"] = DiscoveredChannel.getStationID();
Channel["Number"] = DiscoveredChannel.getNumber();
Channel["Name"] = DiscoveredChannel.getFullName();
Channel["Physical"] = ChannelAPI.GetPhysicalChannelNumberForLineup(DiscoveredChannel, Global.GetAllLineups()[0]);
Channel["Viewable"] = DiscoveredChannel.isViewable();
Channel["Description"] = ChannelAPI.GetChannelDescription(DiscoveredChannel);
Channels.push(Channel);
}
return Channels;
}
function RestoreChannels(CallSign, Description, Network, StationID, LogicalNumber, PhysicalNumber) {
ChannelObject = ChannelAPI.AddChannel(CallSign, Description, Network, StationID);
ChannelAPI.SetChannelMappingForLineup(ChannelObject, Global.GetAllLineups()[0], LogicalNumber);
ChannelAPI.SetPhysicalChannelMappingForLineup(ChannelObject, Global.GetAllLineups()[0], PhysicalNumber);
return LogicalChannelResponse;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment