⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pocketmvp.cpp

📁 PocketMVP V0.8082503 source for Pocket 的程序源代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:

void ProcessRelease(int x,int y)
{
	if (!NeedHide||(bPaused))
	{
		if (PlayerSkin.SeekButton.status)
		{
			int nPos;
			PlayerSkin.SeekButton.status=0;
			if (PlayerSkin.SeekSlider.rotated)
				nPos=(((PlayerSkin.SeekButton.top-PlayerSkin.SeekSlider.top)*PlayerSkin.SeekButton.step*100)/(PlayerSkin.SeekSlider.height-PlayerSkin.SeekButton.height));
			else
				nPos=(((PlayerSkin.SeekButton.left-PlayerSkin.SeekSlider.left)*PlayerSkin.SeekButton.step*100)/(PlayerSkin.SeekSlider.width-PlayerSkin.SeekButton.width));
			if (nPos<0) nPos=0;
			if (nPos>100) nPos=100;
			SeekPos(nPos,0,0);
		}
		else if (PlayerSkin.VolButton.status)
		{
			int nPos;
			PlayerSkin.VolButton.status=0;
			if (PlayerSkin.VolSlider.rotated)
			{
				nPos=((PlayerSkin.VolButton.top-PlayerSkin.VolSlider.top)*PlayerSkin.VolButton.step*100)/(PlayerSkin.VolSlider.height-PlayerSkin.VolButton.height);
			}
			else
			{
				nPos=((PlayerSkin.VolButton.left-PlayerSkin.VolSlider.left)*PlayerSkin.VolButton.step*100)/(PlayerSkin.VolSlider.width-PlayerSkin.VolButton.width);
			}
			if (nPos<0) nPos=0;
			if (nPos>100) nPos=100;
			if (!PlayerOptions.Mute) waveOutSetVolume( 0, (0xffff*nPos)/100+(0xffff*nPos)/100*0x10000  );
		}
		else if (CheckRect(x,y,&PlayerSkin.StopButton))
		{
			DrawButtonUp(&PlayerSkin.StopButton);
			SendMessage(hWndMain,WM_COMMAND,IDM_STOP,NULL);
		}
		else if (CheckRect(x,y,&PlayerSkin.EditorButton))
		{
			DrawButtonUp(&PlayerSkin.EditorButton);
			SendMessage(hWndMain,WM_COMMAND,IDM_PLAYLIST,NULL);
		}
		else if (CheckRect(x,y,&PlayerSkin.OpenButton))
		{
			DrawButtonUp(&PlayerSkin.OpenButton);
			SendMessage(hWndMain,WM_COMMAND,IDM_OPEN,NULL);
		}
		else if (CheckRect(x,y,&PlayerSkin.NextButton))
		{
			DrawButtonUp(&PlayerSkin.NextButton);
			SendMessage(hWndMain,WM_COMMAND,IDM_NEXT,NULL);
		}
		else if (CheckRect(x,y,&PlayerSkin.PrevButton))
		{
			DrawButtonUp(&PlayerSkin.PrevButton);
			SendMessage(hWndMain,WM_COMMAND,IDM_PREV,NULL);
		}
		else if (CheckRect(x,y,&PlayerSkin.SeekSlider))
		{
			if (PlayerSkin.SeekSlider.rotated)
			{
				if (y>PlayerSkin.SeekButton.top+PlayerSkin.SeekButton.height)
				{
					PlayerSkin.SeekButton.top+=PlayerSkin.SeekButton.bigstep;//-PlayerSkin.SeekButton.height;
				}
				else if (y<PlayerSkin.SeekButton.top)
				{
					PlayerSkin.SeekButton.top-=PlayerSkin.SeekButton.bigstep;//-PlayerSkin.SeekButton.height;
				}
				SeekPos(((PlayerSkin.SeekButton.top-PlayerSkin.SeekSlider.top)*PlayerSkin.SeekButton.step*100)/PlayerSkin.SeekSlider.height,0,0);
			}
			else
			{
				if (x>PlayerSkin.SeekButton.left+PlayerSkin.SeekButton.width)
				{
					PlayerSkin.SeekButton.left+=PlayerSkin.SeekButton.bigstep;//-PlayerSkin.SeekButton.height;
					if (PlayerSkin.SeekButton.left+PlayerSkin.SeekButton.width>(PlayerSkin.SeekSlider.left+PlayerSkin.SeekSlider.width))
						PlayerSkin.SeekButton.left=(PlayerSkin.SeekSlider.left+PlayerSkin.SeekSlider.width)-PlayerSkin.SeekButton.width;
				}
				else if (x<PlayerSkin.SeekButton.left)
				{
					PlayerSkin.SeekButton.left-=PlayerSkin.SeekButton.bigstep;//-PlayerSkin.SeekButton.height;
					if (PlayerSkin.SeekButton.left<(PlayerSkin.SeekSlider.left))
						PlayerSkin.SeekButton.left=PlayerSkin.SeekSlider.left;
				}
				SeekPos(((PlayerSkin.SeekButton.left-PlayerSkin.SeekSlider.left)*PlayerSkin.SeekButton.step*100)/PlayerSkin.SeekSlider.width,0,0);
			}
			DrawButtonUp(&PlayerSkin.SeekSlider);
			DrawButtonDown(&PlayerSkin.SeekButton);
			PlayerSkin.SeekButton.status=0;
		}
		else if (CheckRect(x,y,&PlayerSkin.VolSlider))
		{
			if (PlayerSkin.VolSlider.rotated)
			{
				if (y>PlayerSkin.VolButton.top+PlayerSkin.VolButton.height)
				{
					PlayerSkin.VolButton.top+=PlayerSkin.VolButton.bigstep;//-PlayerSkin.SeekButton.height;
				}
				else if (y<PlayerSkin.VolButton.top)
				{
					PlayerSkin.VolButton.top-=PlayerSkin.VolButton.bigstep;//-PlayerSkin.SeekButton.height;
				}
				int nPos=((PlayerSkin.VolButton.top-PlayerSkin.VolSlider.top)*PlayerSkin.VolButton.step*100)/PlayerSkin.VolSlider.height;
				if (!PlayerOptions.Mute) waveOutSetVolume( 0, (0xffff*nPos)/100+(0xffff*nPos)/100*0x10000  );
			}
			else
			{
				if (x>PlayerSkin.VolButton.left+PlayerSkin.VolButton.width)
				{
					PlayerSkin.VolButton.left+=PlayerSkin.VolButton.bigstep;//-PlayerSkin.SeekButton.height;
					if (PlayerSkin.VolButton.left+PlayerSkin.VolButton.width>(PlayerSkin.VolSlider.left+PlayerSkin.VolSlider.width))
						PlayerSkin.VolButton.left=(PlayerSkin.VolSlider.left+PlayerSkin.VolSlider.width)-PlayerSkin.VolButton.width;
				}
				else if (x<PlayerSkin.VolButton.left)
				{
					PlayerSkin.VolButton.left-=PlayerSkin.VolButton.bigstep;//-PlayerSkin.SeekButton.height;
					if (PlayerSkin.VolButton.left<(PlayerSkin.VolSlider.left))
						PlayerSkin.VolButton.left=PlayerSkin.VolSlider.left;
				}
				int nPos=((PlayerSkin.VolButton.left-PlayerSkin.VolSlider.left)*PlayerSkin.VolButton.step*100)/PlayerSkin.VolSlider.width;
				if (!PlayerOptions.Mute) waveOutSetVolume( 0, (0xffff*nPos)/100+(0xffff*nPos)/100*0x10000  );
			}
			DrawButtonUp(&PlayerSkin.VolSlider);
			DrawButtonDown(&PlayerSkin.VolButton);
			PlayerSkin.VolButton.status=0;
		}
	}

}

void ProcessPush(int x,int y)
{
	if (!NeedHide||(bPaused))
	{
		if (CheckRect(x,y,&PlayerSkin.ViewPort))
		{
			PauseEvent();
		}
		else if (CheckRect(x,y,&PlayerSkin.StopButton))
		{
			DrawButtonDown(&PlayerSkin.StopButton);
		}
		else if (CheckRect(x,y,&PlayerSkin.EditorButton))
		{
			DrawButtonDown(&PlayerSkin.EditorButton);
		}
		else if (CheckRect(x,y,&PlayerSkin.OpenButton))
		{
			DrawButtonDown(&PlayerSkin.OpenButton);
		}
		else if (CheckRect(x,y,&PlayerSkin.PrevButton))
		{
			DrawButtonDown(&PlayerSkin.PrevButton);
		}
		else if (CheckRect(x,y,&PlayerSkin.NextButton))
		{
			DrawButtonDown(&PlayerSkin.NextButton);
		}
		else if (CheckRect(x,y,&PlayerSkin.PlayButton))
		{
			PauseEvent();

		}
		else if (CheckRect(x,y,&PlayerSkin.FFWDButton))
		{
			SendMessage(hWndMain,WM_COMMAND,IDM_FASTFWD,NULL);

		}
		else if (CheckRect(x,y,&PlayerSkin.RotateButton))
		{
			SendMessage(hWndMain,WM_COMMAND,IDM_ROTATE,NULL);

		}
		else if (CheckRect(x,y,&PlayerSkin.MuteButton))
		{
			SendMessage(hWndMain,WM_COMMAND,IDM_MUTE,NULL);

		}
		else if (CheckRect(x,y,&PlayerSkin.FullScreenButton))
		{
			SendMessage(hWndMain,WM_COMMAND,IDM_DOUBLE,NULL);

		}
		else if (CheckRect(x,y,&PlayerSkin.EQButton))
		{
			SendMessage(hWndMain,WM_COMMAND,IDM_EQON,NULL);

		}
		else if (CheckRect(x,y,&PlayerSkin.RepeatButton))
		{
			SendMessage(hWndMain,WM_COMMAND,IDM_REPEAT,NULL);

		}
		else if (CheckRect(x,y,&PlayerSkin.SeekButton))
		{
			DrawButtonDown(&PlayerSkin.SeekButton);
		}
		else if (CheckRect(x,y,&PlayerSkin.VolButton))
		{
			DrawButtonDown(&PlayerSkin.VolButton);
		}
		else if (CheckRect(x,y,&PlayerSkin.InfoView))
		{
			PlayerSkin.InfoView.scrolltext=!PlayerSkin.InfoView.scrolltext;
		}


	}
	else
	{
		PauseEvent();
	}


}
void ProcessTrack(int x,int y)
{
	if (!NeedHide||(bPaused))
	{
		if (PlayerSkin.SeekButton.status)
		{
			if (PlayerSkin.SeekSlider.rotated)
			{
				if (y>PlayerSkin.SeekSlider.top&&(y<PlayerSkin.SeekSlider.top+PlayerSkin.SeekSlider.height))
				{
					PlayerSkin.SeekButton.top=y;//-PlayerSkin.SeekButton.height;
					if (PlayerSkin.SeekButton.top+PlayerSkin.SeekButton.height>PlayerSkin.SeekSlider.top+PlayerSkin.SeekSlider.height) 
						PlayerSkin.SeekButton.top=PlayerSkin.SeekSlider.top+PlayerSkin.SeekSlider.height-PlayerSkin.SeekButton.height;
					DrawButtonUp(&PlayerSkin.SeekSlider);
					DrawButtonDown(&PlayerSkin.SeekButton);
				}
			}
			else
			{
				x-=PlayerSkin.SeekButton.width/2;
				if (x<PlayerSkin.SeekSlider.left) x=PlayerSkin.SeekSlider.left;
				PlayerSkin.SeekButton.left=x;//-PlayerSkin.SeekButton.width;
				if (PlayerSkin.SeekButton.left+PlayerSkin.SeekButton.width>PlayerSkin.SeekSlider.left+PlayerSkin.SeekSlider.width) 
					PlayerSkin.SeekButton.left=PlayerSkin.SeekSlider.left+PlayerSkin.SeekSlider.width-PlayerSkin.SeekButton.width;
				DrawButtonUp(&PlayerSkin.SeekSlider);
				DrawButtonDown(&PlayerSkin.SeekButton);

			}
		}
		else if (PlayerSkin.VolButton.status)
		{
			if (PlayerSkin.VolSlider.rotated)
			{
				if (y>PlayerSkin.VolSlider.top&&(y<PlayerSkin.VolSlider.top+PlayerSkin.VolSlider.height))
				{
					PlayerSkin.VolButton.top=y;//-PlayerSkin.SeekButton.height;
					if (PlayerSkin.VolButton.top+PlayerSkin.VolButton.height>PlayerSkin.VolSlider.top+PlayerSkin.VolSlider.height) 
						PlayerSkin.VolButton.top=PlayerSkin.VolSlider.top+PlayerSkin.VolSlider.height-PlayerSkin.VolButton.height;
					DrawButtonUp(&PlayerSkin.VolSlider);
					DrawButtonDown(&PlayerSkin.VolButton);
				}
			}
			else
			{
				x-=PlayerSkin.VolButton.width/2;
				if (x<PlayerSkin.VolSlider.left) x=PlayerSkin.VolSlider.left;
				PlayerSkin.VolButton.left=x;//-PlayerSkin.SeekButton.width;
				if (PlayerSkin.VolButton.left+PlayerSkin.VolButton.width>PlayerSkin.VolSlider.left+PlayerSkin.VolSlider.width) 
					PlayerSkin.VolButton.left=PlayerSkin.VolSlider.left+PlayerSkin.VolSlider.width-PlayerSkin.VolButton.width;
				DrawButtonUp(&PlayerSkin.VolSlider);
				DrawButtonDown(&PlayerSkin.VolButton);

			}
		}
		else if (PlayerSkin.StopButton.status)
		{
			if (!CheckRect(x,y,&PlayerSkin.StopButton))
				DrawButtonUp(&PlayerSkin.StopButton);
		}
		else if (PlayerSkin.OpenButton.status)
		{
			if (!CheckRect(x,y,&PlayerSkin.OpenButton))
				DrawButtonUp(&PlayerSkin.OpenButton);
		}
		else if (PlayerSkin.EditorButton.status)
		{
			if (!CheckRect(x,y,&PlayerSkin.EditorButton))
				DrawButtonUp(&PlayerSkin.EditorButton);
		}
		else if (PlayerSkin.NextButton.status)
		{
			if (!CheckRect(x,y,&PlayerSkin.NextButton))
				DrawButtonUp(&PlayerSkin.NextButton);
		}
		else if (PlayerSkin.PrevButton.status)
		{
			if (!CheckRect(x,y,&PlayerSkin.PrevButton))
				DrawButtonUp(&PlayerSkin.PrevButton);
		}
	}
}


/*****************************************************************************************/
//Input Functions
/*****************************************************************************************/

unsigned char* GetNextBuffer(int* refresh, int* frame,int drop)
{
	int size=rd.READER_NextVideoFrame((char*) temp, drop);
	if (size<=0)
	{
		if (size<0) bEnd=1;
		return 0;
	}
	*frame=size;
#ifdef ARM
	*refresh=size>vidinfo->threshhold||(rd.READER_isKeyFrame(vidinfo->video_pos-1));
#endif
	return temp;
}



/*****************************************************************************************/
//Video Decode Functions
/*****************************************************************************************/
int dummy_decore(unsigned long handle, unsigned long dec_opt,	void *param1, void *param2)
{
	return 0;
}
/***/
int dummy_decore_frame(unsigned char *stream, int length, unsigned char *bmp, int render_flag)
{
	memcpy((void*)bmp,(void*)stream,sizeof(AVPicture));
	return 1;
}

int decore_setoutput(unsigned long color_depth, int output_format)
{

	switch (output_format)
	{
		case RGB565:
#ifdef ATI
			if (color_depth!=2)
				convert_yuv = yuv2rgb_420; 
			else
#endif
				convert_yuv = yuv2rgb_565;
			break;
		case RGB565R:
			convert_yuv = yuv2rgb_565R;
#ifdef ATI
			if (color_depth!=2)
				convert_yuv = yuv2rgb_420R; 
#else
#if (defined(ARM)&&(!defined(IPAQ))&&(defined(GAPI)))
			if (e740) convert_yuv = yuv2rgb_565R_e740; 
#endif
#endif
			break;
#ifndef ATI
		case RGB565RZ:
			convert_yuv = yuv2rgb_565RZ;
			break;
		case RGB565Z:
			convert_yuv = yuv2rgb_565Z;
			break;
#endif
		#ifdef MIPS
		case RGB565ZPP:
			convert_yuv = yuv2rgb_565ZPP;
			break;
		#endif
	}
	return 1;
}


long decBegin(int First)
{
	DEC_PARAM dec_param;
	dec_param.x_dim = g_nWidth;
	dec_param.y_dim = g_nHeight;
	dec_param.color_depth = 0;
	dec_param.dither=PlayerOptions.Clean;
	lastshow=0;
#ifdef IPAQ
	if (First<=0)
		dec_param.output_format=RGB565;
	else
		dec_param.output_format=RGB565R;
#else
	dec_param.output_format=RGB565;
#endif

	if (PlayerOptions.Double)
	{
		if (First<=0)
		{
#ifdef ATI
			dec_param.output_format=RGB565;
#else
			dec_param.output_format=RGB565Z;
#endif
#ifdef MIPS
			if (PlayerOptions.Clean)
				dec_param.output_format=RGB565ZPP;
#endif
		}
		else
		{
#ifdef IPAQ
			dec_param.output_format=RGB565R;
#else
			dec_param.output_format=RGB565;
#endif
		}
	}


	if (PlayerOptions.Rotate) 
	{
#ifdef IPAQ
		if (First<=0)
		{
			dec_param.output_format=RGB565R;
		}
		else
		{
			dec_param.output_format=RGB565;
		}
#else
		dec_param.output_format=RGB565R;
#endif
	}

	if (PlayerOptions.Double&&(PlayerOptions.Rotate)) 
	{
		if (First<=0)
		{
#ifndef ATI
			dec_param.output_format=RGB565RZ;
#endif
		}
	}
	if (First==0)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -