/**************************************************************************************
* *
* This application contains code from OpenDivX and is released as a "Larger Work" *
* under that license. Consistant with that license, this application is released *
* under the GNU General Public License. *
* *
* The OpenDivX license can be found at: http://www.projectmayo.com/opendivx/docs.php *
* The GPL can be found at: http://www.gnu.org/copyleft/gpl.html *
* *
* Copyright (c) 2001 - Project Mayo *
* *
* Authors: Damien Chavarria <darc at projectmayo dot com> *
* *
**************************************************************************************/
#include "Playa.h"
#include "Skin.h"
#include "Playlist.h"
#include "MediaPlayback.h"
#include "DirDialog.h"
#include "SkinList.h"
#include "Resizer.h"
#include "DebugFile.h"
/*
* Ressources files
*
*/
#ifdef WIN32
#include "../build/win32/ressources.h"
#include "../build/win32/resource.h"
#endif
#include <math.h>
#include <commctrl.h>
#include <windows.h>
#include <windowsx.h>
#include <shlobj.h>
/*
* Intervals for the timers
*/
#define TIMER_ID 1
#define TIMER_RATE 50
/*
* Variables
*
* Please regroup that in a struct...
*
*/
BOOL openning_network;
DWORD anonymous;
HWND hwndDisplay;
BOOL screenSaverActive;
int action = ACTION_NONE;
DWORD count = 0;
DWORD use_subtitles = 1;
DWORD no_resize = 0;
char skinPath[MAX_PATH];
COLORREF backColor;
UINT uTimerID;
RECT clientRect, cwindowRect;
RECT windowRect, fullwindowRect;
int moveX = 0, moveY = 0;
Skin *skin;
MediaPlayback *playback;
CDirDialog *dirChooser;
SkinList *skinList;
Resizer *resizer;
Playlist *playlist;
char Name[] = "The \"Playa\"";
char *RecentFiles[5];
HWND hwnd, about, urlW = NULL;
HMENU popupMenu;
HACCEL hAccel;
DWORD id;
HINSTANCE hInstance;
int showing_cursor;
int compact_mode;
BOOL openOK;
char *url;
DWORD firstStart;
options_t options, tmpOptions;
WCHAR wallpaper[MAX_PATH];
WCHAR pattern[MAX_PATH];
/*
* Needed definitions
*/
/*
* The Main message loop functions
*
*/
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
void UpdateMainWindow();
/*
* opens the current playlist position
*
*/
void OpenFileForPlaying(HWND hwnd);
/*
* Rebuilds the playlist popup menu
*
*/
void ReBuildPlaylistMenu();
/**************************************************************************************
* *
* SAVE AND LOAD OPTIONS *
* *
**************************************************************************************/
void LoadOptions() {
HKEY key;
DWORD created, size;
LONG result;
DWORD type, i;
char file[256], name[5];
/*
* Put the default options
*
*/
compact_mode = 0;
strcpy(skinPath, "Default");
options.change_fullscreen_res = 0;
options.loop = 1;
options.on_top = 1;
options.use_bilinear = 0;
options.aspect_ratio = ASPECT_RATIO_FREE;
options.disable_screen_saver = 1;
options.save_pos = 1;
options.posX = 100;
options.posY = 30;
options.postprocessing = 60;
options.startFullscreen = 0;
/*
* Init the recent file list
*/
for(i=0; i < 5; i++) {
RecentFiles[i] = NULL;
}
/*
* Open the registry key
*/
result = RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\DivXNetworks\\ThePlaya",
0, "CONFIG", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
NULL, &key, &created);
if(result != ERROR_SUCCESS) {
MP_ERROR("Couldn't load options");
return;
}
switch(created) {
case REG_CREATED_NEW_KEY:
/*
* First time launch (we keep the default)
*
*/
break;
case REG_OPENED_EXISTING_KEY:
/*
* We can read the values
*/
size = 4;
result = RegQueryValueEx(key, "UseBilinear", 0, &type, (BYTE *)&options.use_bilinear, &size);
size = 4;
result = RegQueryValueEx(key, "MaintainAspectRatio", 0, &type, (BYTE *)&options.aspect_ratio, &size);
size = 4;
result = RegQueryValueEx(key, "ChangeFullscreenRes", 0, &type, (BYTE *)&options.change_fullscreen_res, &size);
size = 4;
result = RegQueryValueEx(key, "UseSubtitles", 0, &type, (BYTE *)&use_subtitles, &size);
size = 4;
result = RegQueryValueEx(key, "Loop", 0, &type, (BYTE *)&options.loop, &size);
size = 4;
result = RegQueryValueEx(key, "OnTop", 0, &type, (BYTE *)&options.on_top, &size);
size = 4;
result = RegQueryValueEx(key, "PreventScreenSaver", 0, &type, (BYTE *)&options.disable_screen_saver, &size);
size = 4;
result = RegQueryValueEx(key, "SavePlayerPos", 0, &type, (BYTE *)&options.save_pos, &size);
size = 4;
result = RegQueryValueEx(key, "PostProcessing", 0, &type, (BYTE *)&options.postprocessing, &size);
size = 4;
result = RegQueryValueEx(key, "CustomAspectX", 0, &type, (BYTE *)&aspectRatios[ASPECT_RATIO_CUSTOM].xFactor, &size);
size = 4;
result = RegQueryValueEx(key, "CustomAspectY", 0, &type, (BYTE *)&aspectRatios[ASPECT_RATIO_CUSTOM].yFactor, &size);
if(options.save_pos) {
size = 4;
result = RegQueryValueEx(key, "PlayerPosX", 0, &type, (BYTE *)&options.posX, &size);
size = 4;
result = RegQueryValueEx(key, "PlayerPosY", 0, &type, (BYTE *)&options.posY, &size);
}
size = MAX_PATH;
result = RegQueryValueEx(key, "SkinPath", 0, &type, (BYTE *)skinPath, &size);
/*
* And the recent files
*/
for(i=0; i < 5; i++) {
sprintf(name, "File%d", i+1);
size = 256;
result = RegQueryValueEx(key, name, 0, &type, (BYTE *)&file, &size);
if(result == ERROR_SUCCESS) {
RecentFiles[i] = (char *) new char[size];
strncpy(RecentFiles[i], file, size);
}
}
break;
default:
break;
}
RegCloseKey(key);
}
void SaveOptions() {
HKEY key;
LONG result;
DWORD created, i;
char name[5];
options.postprocessing = playback->videoDecoder->decoreDecoder->GetQuality();
/*
* Try to open the registry key
*/
result = RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\DivXNetworks\\ThePlaya",
0, "CONFIG", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
NULL, &key, &created);
if(result != ERROR_SUCCESS) {
MP_ERROR("Couldn't save options");
RegCloseKey(key);
return;
}
RegSetValueEx(key, "UseBilinear", 0, REG_DWORD, (BYTE *) &options.use_bilinear, 4);
RegSetValueEx(key, "MaintainAspectRatio", 0, REG_DWORD, (BYTE *) &options.aspect_ratio, 4);
RegSetValueEx(key, "ChangeFullscreenRes", 0, REG_DWORD, (BYTE *) &options.change_fullscreen_res, 4);
RegSetValueEx(key, "UseSubtitles", 0, REG_DWORD, (BYTE *) &use_subtitles, 4);
RegSetValueEx(key, "Loop", 0, REG_DWORD, (BYTE *) &options.loop, 4);
RegSetValueEx(key, "OnTop", 0, REG_DWORD, (BYTE *) &options.on_top,
没有合适的资源?快使用搜索试试~ 我知道了~
MPEG4播放器PLAYA的源代码
共126个文件
h:40个
cpp:38个
root:8个
需积分: 9 8 下载量 9 浏览量
2009-01-13
15:58:12
上传
评论
收藏 198KB RAR 举报
温馨提示
用VC6实现,MPEG4播放器PLAYA的源代码
资源推荐
资源详情
资源评论
收起资源包目录
MPEG4播放器PLAYA的源代码 (126个子文件)
ressources.aps 600KB
Skin.bmp 330KB
mayo_logo_color.bmp 124KB
Controls.bmp 119KB
Skin.bmp 3KB
BITMAP1.BMP 2KB
checkoutlist 506B
commitinfo 775B
CONFIG 541B
Main.cpp 100KB
Layer3.cpp 45KB
Skin.cpp 32KB
MediaPlayback.cpp 30KB
DecapsAVI.cpp 27KB
VideoRendererOverlay.cpp 26KB
VideoRendererRGB.cpp 20KB
Resizer.cpp 15KB
AudioDecoderACM.cpp 13KB
VideoDecoderDecore.cpp 11KB
dct64_i386.cpp 11KB
VideoDecoderVFW.cpp 9KB
AudioRenderer.cpp 9KB
Layer2.cpp 9KB
InputInternet.cpp 9KB
VideoBuffer.cpp 8KB
Decaps.cpp 7KB
AudioDecoderMP3.cpp 6KB
VideoRenderer.cpp 6KB
SubtitlesMicroDVD.cpp 6KB
interface.cpp 5KB
Common.cpp 5KB
SkinList.cpp 5KB
InputFile.cpp 5KB
decode_i386.cpp 5KB
Layer1.cpp 5KB
Input.cpp 4KB
Playlist.cpp 4KB
VideoDecoder.cpp 4KB
Tabinit.cpp 4KB
DirDialog.cpp 4KB
Ring.cpp 3KB
RingBuffer.cpp 3KB
AudioDecoder.cpp 3KB
Subtitles.cpp 3KB
MediaBuffer.cpp 2KB
SkinFile.cpp 2KB
DebugFile.cpp 2KB
ARROWCOP.CUR 326B
cvswrappers 776B
ThePlaya.dsp 22KB
ThePlaya.dsw 541B
EDITINFO 1KB
Entries 3KB
Entries 621B
Entries 467B
Entries 377B
Entries 290B
Entries 55B
Entries 52B
Entries 13B
Huffman.h 17KB
MediaClasses.h 11KB
L2tables.h 9KB
RESOURCE.H 7KB
DecapsAVI.h 5KB
Mpg123.h 5KB
DECORE.H 4KB
MediaPlayback.h 4KB
VideoRendererOverlay.h 4KB
Skin.h 3KB
Decaps.h 3KB
VideoRendererRGB.h 3KB
AudioRenderer.h 3KB
VideoDecoderDecore.h 3KB
VideoRenderer.h 3KB
InputInternet.h 3KB
VideoDecoderVFW.h 3KB
VideoBuffer.h 3KB
VideoDecoder.h 2KB
AudioDecoderACM.h 2KB
InputFile.h 2KB
Input.h 2KB
SubtitlesMicroDVD.h 2KB
AudioDecoderMP3.h 2KB
AudioDecoder.h 2KB
Playlist.h 2KB
Resizer.h 2KB
Subtitles.h 2KB
Playa.h 2KB
Mpglib.h 2KB
SkinList.h 2KB
MediaBuffer.h 2KB
RingBuffer.h 2KB
Ring.h 2KB
Error.h 2KB
DebugFile.h 2KB
SkinFile.h 2KB
MP3REG.H 1KB
ressources.h 856B
DirDialog.h 510B
共 126 条
- 1
- 2
资源评论
wudawen_Huangyan
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功