aboutsummaryrefslogtreecommitdiffstats
path: root/channels-conf/dvb-s/BrasilSat-B3-84.0W
blob: b3632bb8f632eff5bdc3ece7cb76db767737704a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
NoName:3675:v:0:4285:1110:1211:1
Rede 21:3688:v:0:2308:308:256:1
SNG#3 TERRA VIVA:3692:v:0:3200:308:256:1
TV PONTA PORA       :3697:v:0:3333:1110:1211:1
Servico 1:3710:v:0:12960:36:37:1
TV Assembleia:3710:v:0:12960:39:40:2
Servico 3:3710:v:0:12960:42:43:3
TV Cultura:3710:v:0:12960:33:34:4
TV Ra-Tim-Bum:3710:v:0:12960:45:46:5
Tv Morena:3738:v:0:4710:4096:4097:1
[6d65]:3754:v:0:5000:0:0:28005
[6dc9]:3754:v:0:5000:0:0:28105
[0faa]:3754:v:0:5000:0:0:4010
[0fb4]:3754:v:0:5000:0:0:4020
[6d61]:3754:v:0:5000:0:0:28001
[0f9f]:3754:v:0:5000:0:0:3999
[0fbe]:3754:v:0:5000:0:0:4030
[000b]:3754:v:0:5000:0:0:11
[5014]:3754:v:0:5000:0:0:20500
STV:3768:v:0:8000:160:80:1
CANAL 2:3768:v:0:8000:161:84:2
TELECONF:3768:v:0:8000:162:88:3
REDETV RO:3805:v:0:3255:4194:4195:1
Videocom:3858:v:0:4289:1110:1211:1
TVSULBAHIA:3911:v:0:3255:33:36:2
TV ARATU BA:3927:v:0:3255:33:36:2
TV BAND BA:3931:h:0:3255:337:340:21
TV BAND BA:3932:v:0:3255:337:340:21
REDE SUPER:3940:v:0:3255:337:340:1
RBI:3949:v:0:4340:337:340:33
TV TRIBUNA:3955:v:0:4340:337:340:1
5                   :3970:v:0:4445:1160:1120:1
TV EDUCATIVA MS:4013:v:0:3255:337:340:33
TV Justica:4060:v:0:3330:289:290:1
CNT GERACAO 1:4075:v:0:4444:289:290:20101
ASS-LEG-SC:4132:v:0:2532:337:340:33
EMBRATEL 21:4152:v:0:2300:257:514:1
SEXY TV:4155:v:0:2170:257:258:1
BASA:4169:v:0:8140:4141:4140:4
.nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include "machine_type.h"
#include "menu.h"
#include "output.h"
#include "input.h"
#include "markers.h"

void* initmarkers()
{
	tMarkers* p;
	int i;
	p=malloc(sizeof(tMarkers));
	for (i=0;i<NUMMARKERS;i++)
	{
		p->relative[i]='=';
		p->cursorpos[i]=0;
	}
	return p;
}

int	parsemarkerfile(tMarkers* markers,char* filename)
{
	tFptr	f;
	char c;
	tMarkers*	tmp;
	int	markersnum=0;
	tInt8	state=0;	//	0=start of the line, waiting for the relativ tokens, or a number
			//	1=got relative
			//	2=reading in number
			//	3=end of line
	tBool	hadnumber=0;	
	tmp=initmarkers();
	f=fopen(filename,"r");
	if (!f)	return	RETNOK;
	while (!feof(f) && markersnum<10)
	{
		fread(&c,sizeof(char),1,f);
		if (c>='a' && c<='z') c=c-32;	// make the letters uppercase
		if (!feof(f) && c!=' ' && c!=9)	// ignore the spaces
		{
			if (c=='#')	state=3;	// the rest of this line is just a comment
			if (c<32)	//	newline
			{
				if (hadnumber)	
				{
					markersnum++;
					tmp->relative[markersnum]='=';
					tmp->cursorpos[markersnum]=0;
				}
				hadnumber=0;
				state=0;
			}
			if (state==1) state=2;	// the last character was the relative, now for the number
			if (state==0 && (c=='=' || c=='+' || c=='-'))	
			{
				tmp->relative[markersnum]=c;
				state=1;
			}
			if (state==0 && ((c>='A' && c<='F') || (c>='0' && c<='9'))) state=2;	// the number starts right here
			if (state==2)
			{
				tmp->cursorpos[markersnum]<<=4;
				hadnumber=1;
				if (c>='0' && c<='9') tmp->cursorpos[markersnum]+=(c-'0');
				else if (c>='A' && c<='F') tmp->cursorpos[markersnum]+=(c-'A'+10);
				else return RETNOK;	// illegal value
			}
		}	
	}
	fclose(f);
	memcpy(markers,tmp,sizeof(tMarkers));
	free(tmp);
	return	RETOK;
}

int	writemarkerfile(tMarkers* markers,char* filename)
{
	tFptr	f;
	int i;
	
	f=fopen(filename,"w");
	if (!f)	return	RETNOK;
	fprintf(f,"#DHEX MARKERS\n");
	fprintf(f,"#VERSION 0\n");
	fprintf(f,"#lines are all in hex\n");
	fprintf(f,"#relative positions are =, +, -\n");
	fprintf(f,"\n"); 
	for (i=0;i<NUMMARKERS;i++)
	{
		fprintf(f,"%c%016llX\n",markers->relative[i],markers->cursorpos[i]);
	}
	fclose(f);
	return	RETOK;	
}
tInt8 gotomask(tOutput* output,tMarkers* markers,tUInt64* cursorpos,tInt64 baseaddr)
{
	tUInt64 actcursorpos=*cursorpos+baseaddr;
	tUInt64 newcursorpos=*cursorpos+baseaddr;
	tInt8	itemnums[25];
	tInt8	selected;
	tMenu	Menu1;
	tInt16	offsx;
	tInt16	offsy;
	tInt8	retval=RETOK;
	char	buf[17];
	char	filename[64];


	int	i;
	tInt16	ch;

	memset(filename,0,64);

	offsx=COLS/2-30;
	offsy=LINES/2-10;

	drawcenterframe(output,17,60,"Goto...");
	setcolor(output,COLOR_BRACKETS);
	mvwprintw(output->win,offsy+3,offsx+8,"[                 ]");
	clearMenu(&Menu1);
	newMenuItem(&Menu1,"To",3,1,'T',0,&itemnums[0]);
	newMenuItem(&Menu1,"Go",3,48,'G',0,&itemnums[1]);
	newMenuItem(&Menu1,"Cancel",3,53,'C',1,&itemnums[2]);

	newMenuItem(&Menu1,"Set", 5,1,0,0,&itemnums[ 3]);
	newMenuItem(&Menu1,"Set", 6,1,0,0,&itemnums[ 4]);
	newMenuItem(&Menu1,"Set", 7,1,0,0,&itemnums[ 5]);
	newMenuItem(&Menu1,"Set", 8,1,0,0,&itemnums[ 6]);
	newMenuItem(&Menu1,"Set", 9,1,0,0,&itemnums[ 7]);
	newMenuItem(&Menu1,"Set",10,1,0,0,&itemnums[ 8]);
	newMenuItem(&Menu1,"Set",11,1,0,0,&itemnums[ 9]);
	newMenuItem(&Menu1,"Set",12,1,0,0,&itemnums[10]);
	newMenuItem(&Menu1,"Set",13,1,0,0,&itemnums[11]);
	newMenuItem(&Menu1,"Set",14,1,0,0,&itemnums[12]);

	newMenuItem(&Menu1,"Mark 1", 5,7,'1',0,&itemnums[13]);
	newMenuItem(&Menu1,"Mark 2", 6,7,'2',0,&itemnums[14]);
	newMenuItem(&Menu1,"Mark 3", 7,7,'3',0,&itemnums[15]);
	newMenuItem(&Menu1,"Mark 4", 8,7,'4',0,&itemnums[16]);
	newMenuItem(&Menu1,"Mark 5", 9,7,'5',0,&itemnums[17]);
	newMenuItem(&Menu1,"Mark 6",10,7,'6',0,&itemnums[18]);
	newMenuItem(&Menu1,"Mark 7",11,7,'7',0,&itemnums[19]);
	newMenuItem(&Menu1,"Mark 8",12,7,'8',0,&itemnums[20]);
	newMenuItem(&Menu1,"Mark 9",13,7,'9',0,&itemnums[21]);
	newMenuItem(&Menu1,"Mark 0",14,7,'0',0,&itemnums[22]);


	newMenuItem(&Menu1,"Load Markers",16, 1,'L',0,&itemnums[23]);
	newMenuItem(&Menu1,"Save Markers",16,17,'S',0,&itemnums[24]);
	selected=-1;

	while (1)
	{
		setcolor(output,COLOR_FRAME);
		for (i=0;i<58;i++) mvwprintw(output->win,offsy+17,offsx+1+i," ");
		setcolor(output,COLOR_TEXT);
		if (retval!=RETOK) mvwprintw(output->win,offsy+17,offsx+1,"error opening file");
		for (i=0;i<NUMMARKERS;i++) 
		{
			setcolor(output,COLOR_BRACKETS);
			mvwprintw(output->win,offsy+5+i,offsx+14,"[                 ]");
			mvwprintw(output->win,offsy+5+i,offsx+41,"[                ]");
			setcolor(output,COLOR_TEXT);
			mvwprintw(output->win,offsy+5+i,offsx+36,"Diff:");

			snprintf(buf,17,"%c%llx",markers->relative[i],markers->cursorpos[i]);
			mvwprintw(output->win,offsy+5+i,offsx+32-strlen(buf),"%s",buf);
			mvwprintw(output->win,offsy+5+i,offsx+42,"%16llx",abs(markers->cursorpos[i]-actcursorpos));
		}
		setcolor(output,COLOR_TEXT);
		mvwprintw(output->win,offsy+3,offsx+9,"%17llx",newcursorpos);
		selected=MenuInteract(output,&Menu1,offsy,offsx);
		if (selected==itemnums[0]) {
			newcursorpos=actcursorpos;
			hexinput(output,offsy+3,offsx+8,&newcursorpos,NULL,17);
		}
		if (selected==itemnums[1]) {*cursorpos=newcursorpos-baseaddr;return RETOK;} //FIXME
		if (selected==itemnums[2]) return RETNOK;

		for (i=0;i<NUMMARKERS;i++)
		{
			if (selected==itemnums[3+i])
			{ 
				if (markers->relative[i]=='=' && markers->cursorpos[i]==0) markers->cursorpos[i]=actcursorpos;
				hexinput(output,offsy+ 5+i,offsx+14,&markers->cursorpos[i],&markers->relative[i],17);
			}
			if (selected==itemnums[13+i]) 
			{
				if (markers->relative[i]=='=') newcursorpos =markers->cursorpos[i]-baseaddr;	// FIXME
				if (markers->relative[i]=='-') newcursorpos=actcursorpos-markers->cursorpos[i];
				if (markers->relative[i]=='+') newcursorpos=actcursorpos+markers->cursorpos[i];
			}
		}
		if (selected==itemnums[23] || selected==itemnums[24])
		{
			setcolor(output,COLOR_TEXT);
			mvwprintw(output->win,offsy+17,offsx+1,"Filename:");
			setcolor(output,COLOR_BRACKETS);
			mvwprintw(output->win,offsy+17,offsx+10,"[                                ]");
			ch=stringinput(output,offsy+17,offsx+10,filename,32);
			if (ch==KEYENTER)
			{
				if (selected==itemnums[23]) retval=parsemarkerfile(markers,filename);
				if (selected==itemnums[24]) retval=writemarkerfile(markers,filename);
			}
		}
	}
	return	RETOK;
}