Skip to content

Commit

Permalink
1.0.0.1
Browse files Browse the repository at this point in the history
- Changed default codebase for x86 and x64 MediaPlayer to use wide/unicode for better handling and display of unicode filenames.
- Ini file now is created with BOM to allow unicode - for MRU filenames.
- Ini file prepends a play/pause unicode glyph to its name (helps indicate that it is unicode perhaps?)
- Add clear recent files option.
- Fix memory leak - missing DragFinish call.
- Fix transparent painting issue in about dialog box.
- Added use of ChangeWindowMessageFilter to better support drag and drop for UAC blocking drag and drop operations.
- Added play rate (slower/faster) buttons and menu items.
- Added step 10 seconds (backward/forward) buttons and menu items.
- Add additional accelerators for play rate and step 10 options.
- Add missing accelerator resource for x64 version.
- Combined toolbars to just one toolbar now.
  • Loading branch information
mrfearless committed Sep 1, 2024
1 parent 1a18010 commit 9510419
Show file tree
Hide file tree
Showing 78 changed files with 2,903 additions and 861 deletions.
Binary file added MediaPlayer-x64/Images/Controls/Faster.ico
Binary file not shown.
Binary file added MediaPlayer-x64/Images/Controls/Slower.ico
Binary file not shown.
Binary file added MediaPlayer-x64/Images/Controls/Step10B.ico
Binary file not shown.
Binary file added MediaPlayer-x64/Images/Controls/Step10F.ico
Binary file not shown.
Binary file added MediaPlayer-x64/Images/MediaPlayerLogoMusic.ico
Binary file not shown.
Binary file added MediaPlayer-x64/Images/Menu/Faster.bmp
Binary file not shown.
Binary file added MediaPlayer-x64/Images/Menu/MRUClear.bmp
Binary file not shown.
Binary file added MediaPlayer-x64/Images/Menu/PlaybackSpeed.bmp
Binary file not shown.
Binary file added MediaPlayer-x64/Images/Menu/Slower.bmp
Binary file not shown.
Binary file added MediaPlayer-x64/Images/Menu/Step10B.bmp
Binary file not shown.
Binary file added MediaPlayer-x64/Images/Menu/Step10F.bmp
Binary file not shown.
341 changes: 271 additions & 70 deletions MediaPlayer-x64/MediaPlayer.asm

Large diffs are not rendered by default.

Binary file modified MediaPlayer-x64/MediaPlayer.exe
Binary file not shown.
159 changes: 132 additions & 27 deletions MediaPlayer-x64/MediaPlayer.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ includelib gdi32.lib
includelib comctl32.lib
includelib shell32.lib

include shlwapi.inc
includelib shlwapi.lib

include msimg32.inc
includelib msimg32.lib

Expand All @@ -46,6 +49,8 @@ GUIPaintStatics PROTO hWin:QWORD, lParam:QWORD, wParam:QWORD

GUIInit PROTO hWin:QWORD
GUIResize PROTO hWin:QWORD, wParam:QWORD, lParam:QWORD
GUIAllowDragDrop PROTO bAllow:QWORD

GUISetDurationTime PROTO dwMilliseconds:DWORD
GUISetPositionTime PROTO dwMilliseconds:DWORD
GUISetTitleMediaLoaded PROTO hWin:QWORD, lpszMediaLoaded:QWORD
Expand All @@ -68,6 +73,37 @@ MPBrushOrgs PROTO hControl:QWORD, hdc:QWORD, lpdwBrushOrgX:QWORD

CmdLineProcess PROTO ; Process cmd line parameters to handle opening file from cmdline or shell explorer

MFP_ConvertStringToAnsi PROTO lpszWideString:QWORD
MFP_ConvertStringToWide PROTO lpszAnsiString:QWORD
MFP_ConvertStringFree PROTO lpString:QWORD

IFNDEF DragFinish
DragFinish PROTO hDrop:QWORD
ENDIF

; ChangeWindowMessageFilter Prototype
ChangeWindowMessageFilter_Proto TYPEDEF PROTO message:DWORD, dwFlag:DWORD
ChangeWindowMessageFilter_Ptr TYPEDEF PTR ChangeWindowMessageFilter_Proto

; ChangeWindowMessageFilter dwFlag:
IFNDEF MSGFLT_ADD
MSGFLT_ADD EQU 1 ; Adds the message to the filter. This has the effect of allowing the message to be received.
ENDIF
IFNDEF MSGFLT_REMOVE
MSGFLT_REMOVE EQU 2 ; Removes the message from the filter. This has the effect of blocking the message.
ENDIF

; For Drag and Drop support
IFNDEF WM_DROPFILES
WM_DROPFILES EQU 0233h
ENDIF
IFNDEF WM_COPYDATA
WM_COPYDATA EQU 004Ah
ENDIF
IFNDEF WM_COPYGLOBALDATA
WM_COPYGLOBALDATA EQU 0049h
ENDIF

;--------------------------------------
; Structures for Gradient usage
;--------------------------------------
Expand Down Expand Up @@ -121,9 +157,11 @@ ENDIF
; MediaPlayer Constants
;------------------------------------------------------------------------------
ICO_MAIN EQU 100
ICO_MFPLAYER EQU 101
BMP_PATTERN EQU 102
BMP_FILE_MRU EQU 103
ICO_MFPLAY_VIDEO EQU 101
ICO_MFPLAY_AUDIO EQU 102
BMP_PATTERN EQU 103
BMP_FILE_MRU EQU 104
BMP_FILE_MRU_CLEAR EQU 105

; Main Dialog
IDD_DIALOG EQU 1000
Expand All @@ -138,6 +176,10 @@ ACC_FILE_OPEN EQU 901
ACC_FILE_EXIT EQU 902
ACC_MC_STOP EQU 903
ACC_MC_PLAY EQU 904
ACC_MC_STEP10F EQU 905
ACC_MC_STEP10B EQU 906
ACC_MC_SLOWER EQU 907
ACC_MC_FASTER EQU 908

MFPLAYER_LEFT EQU 10 ;9;14
MFPLAYER_TOP EQU 10 ;15;20
Expand All @@ -164,25 +206,42 @@ MP_AREA_PLAYER EQU 0
MP_AREA_LOGO EQU 1
MP_AREA_CM_PLAYER EQU 2


MFP_DEFAULT_RATE EQU 1000

.DATA
;------------------------------------------------------------------------------
; MediaPlayer Initialized Data
;------------------------------------------------------------------------------
szClass db 'Win64class', 0
szAppName db 'Dialog As Main x64', 0

ClassName DB 'DLGCLASS',0
IFDEF __UNICODE__
ClassName DB 'D',0,'L',0,'G',0,'C',0,'L',0,'A',0,'S',0,'S',0
DB 0,0,0,0
AppName DB 'M',0,'e',0,'d',0,'i',0,'a',0,'P',0,'l',0,'a',0,'y',0,'e',0,'r',0
DB 0,0,0,0
szSegoeUIFont DB 'S',0,'e',0,'g',0,'o',0,'e',0,' ',0,'U',0,'I',0
DB 0,0,0,0
szDurationTimeEmpty DB '-',0,'-',0,':',0,'-',0,'-',0
DB 0,0,0,0
szPositionTimeEmpty DB '-',0,'-',0,':',0,'-',0,'-',0
DB 0,0,0,0
szSpaceDashSpace DB ' ',0,'-',0,' ',0
DB 0,0,0,0
szUser32dll DB 'U',0,'s',0,'e',0,'r',0,'3',0,'2',0,'.',0,'d',0,'l',0,'l',0
DB 0,0,0,0
szCMF DB 'C',0,'h',0,'a',0,'n',0,'g',0,'e',0
DB 'W',0,'i',0,'n',0,'d',0,'o',0,'w',0
DB 'M',0,'e',0,'s',0,'s',0,'a',0,'g',0,'e',0
DB 'F',0,'i',0,'l',0,'t',0,'e',0,'r',0
DB 0,0,0,0
ELSE
ClassName DB 'DLGCLASS',0
AppName DB 'MediaPlayer',0
AboutMsg DB 'github.com/mrfearless',0
szSegoeUIFont DB 'Segoe UI',0

szMFPlayerClass DB 'MFPlay Window Class',0
szDurationTimeEmpty DB "--:--",0
szPositionTimeEmpty DB "--:--",0
szSpace DB " ",0
szSpaceDashSpace DB " - ",0
szUser32dll DB 'User32.dll',0
szCMF DB 'ChangeWindowMessageFilter',0
ENDIF

pMP DQ 0 ; pMediaPlayer
pMI DQ 0 ; pMediaItem
Expand All @@ -192,6 +251,9 @@ lpszMediaFileName DQ 0

dwDurationTimeMS DD 0
dwPositionTimeMS DD 0
dwSlowestRate DD 0
dwFastestRate DD 0
dwCurrentRate DD 0

g_Playing DQ FALSE
g_Fullscreen DQ FALSE
Expand All @@ -204,24 +266,59 @@ g_WasMaximized DQ FALSE
g_Mute DQ FALSE
g_Shown DQ FALSE
g_AspectMode DQ 0

g_MediaType DQ 0 ; 0 = video, 1 = audio
CmdLineProcessFileFlag DQ 0 ; 0 = no file to process (normal operation), 1 = file to open
pChangeWindowMessageFilter ChangeWindowMessageFilter_Ptr 0

IFDEF __UNICODE__
MediaPlayerIniFile DB 1024 DUP (0)
szDroppedFilename DB 1024 DUP (0)
szJustFilename DB 1024 DUP (0)
TitleBuffer DB 1024 DUP (0)
szMenuString DB 1024 DUP (0)
CmdLineFilename DB 1024 DUP (0)
CmdLineFullPathFilename DB 1024 DUP (0)
ELSE
MediaPlayerIniFile DB 512 DUP (0)
szStatusBarBuffer DB 512 DUP (0)
szDroppedFilename DB 512 DUP (0)
szJustFilename DB 512 DUP (0)
TitleBuffer DB 512 DUP (0)
szMenuString DB 512 DUP (0)
CmdLineFilename DB 512 DUP (0)
CmdLineFullPathFilename DB 512 DUP (0)
ENDIF

hPatternBitmap DQ 0
hPatternBrush DQ 0

; Command line processing stuff
szCmdLineFilenameDoesNotExist DB 'The filename specified on the command line does not exist: ',0
CmdLineFilename DB 256 DUP (0)
CmdLineFullPathFilename DB 512 DUP (0)
CmdLineProcessFileFlag DQ 0 ; 0 = no file to process (normal operation), 1 = file to open


IFDEF __UNICODE__
szMediaFiles DB 'M',0,'e',0,'d',0,'i',0,'a',0,' ',0,'F',0,'i',0,'l',0,'e',0,'s',0
DB 0,0,0,0
szMediaFilesSpec DB '*',0,'.',0,'m',0,'p',0,'4',0,';',0,'*',0,'.',0,'m',0,'4',0,'v',0,';',0
DB '*',0,'.',0,'m',0,'o',0,'v',0,';',0,'*',0,'.',0,'m',0,'k',0,'v',0,';',0
DB '*',0,'.',0,'w',0,'m',0,'v',0,';',0,'*',0,'.',0,'a',0,'v',0,'i',0,';',0
DB '*',0,'.',0,'a',0,'s',0,'f',0,';',0,'*',0,'.',0,'m',0,'p',0,'3',0,';',0
DB '*',0,'.',0,'m',0,'4',0,'a',0,';',0,'*',0,'.',0,'a',0,'a',0,'c',0,';',0
DB '*',0,'.',0,'w',0,'m',0,'a',0,';',0,'*',0,'.',0,'w',0,'a',0,'v',0
DB 0,0,0,0
szVideoFiles DB 'V',0,'i',0,'d',0,'e',0,'o',0,' ',0,'F',0,'i',0,'l',0,'e',0,'s',0
DB 0,0,0,0
szVideoFilesSpec DB '*',0,'.',0,'m',0,'p',0,'4',0,';',0,'*',0,'.',0,'m',0,'4',0,'v',0,';',0
DB '*',0,'.',0,'m',0,'o',0,'v',0,';',0,'*',0,'.',0,'m',0,'k',0,'v',0,';',0
DB '*',0,'.',0,'w',0,'m',0,'v',0,';',0,'*',0,'.',0,'a',0,'v',0,'i',0,';',0
DB '*',0,'.',0,'a',0,'s',0,'f',0
DB 0,0,0,0
szAudioFiles DB 'A',0,'u',0,'d',0,'i',0,'o',0,' ',0,'F',0,'i',0,'l',0,'e',0,'s',0
DB 0,0,0,0
szAudioFilesSpec DB '*',0,'.',0,'m',0,'p',0,'3',0,';',0,'*',0,'.',0,'m',0,'4',0,'a',0,';',0
DB '*',0,'.',0,'a',0,'a',0,'c',0,';',0,'*',0,'.',0,'w',0,'m',0,'a',0,';',0
DB '*',0,'.',0,'w',0,'a',0,'v',0
DB 0,0,0,0
szAllFiles DB 'A',0,'l',0,'l',0,' ',0,'F',0,'i',0,'l',0,'e',0,'s',0,' ',0,'(',0,'*',0,'.',0,'*',0,')',0
DB 0,0,0,0
szAllFilesSpec DB '*',0,'.',0,'*',0
DB 0,0,0,0
ELSE
szMediaFiles DB 'Media Files',0
szMediaFilesSpec DB '*.mp4;*.m4v;*.mov;*.mkv;*.wmv;*.avi;*.asf;*.mp3;*.m4a;*.aac;*.wma;*.wav',0
szVideoFiles DB 'Video Files',0
Expand All @@ -230,25 +327,29 @@ szAudioFiles DB 'Audio Files',0
szAudioFilesSpec DB '*.mp3;*.m4a;*.aac;*.wma;*.wav',0
szAllFiles DB 'All Files (*.*)',0
szAllFilesSpec DB '*.*',0
ENDIF

FileSpecs \
COMDLG_FILTERSPEC <Offset szMediaFiles, Offset szMediaFilesSpec>
COMDLG_FILTERSPEC <Offset szVideoFiles, Offset szVideoFilesSpec>
COMDLG_FILTERSPEC <Offset szAudioFiles, Offset szAudioFilesSpec>
COMDLG_FILTERSPEC <Offset szAllFiles, Offset szAllFilesSpec>


IFNDEF MFP_DIV100
MFP_DIV100 REAL4 0.01
ENDIF
IFNDEF MFP_DIV1000
MFP_DIV1000 REAL4 0.001
ENDIF
IFNDEF MFP_DIV10000
MFP_DIV10000 REAL4 0.0001
ENDIF





IFNDEF MFP_MUL100
MFP_MUL100 REAL4 100.0
ENDIF
IFNDEF MFP_MUL1000
MFP_MUL1000 REAL4 1000.0
ENDIF

.DATA?
;------------------------------------------------------------------------------
Expand All @@ -264,7 +365,10 @@ hMainWindow DQ ?

hIcoMain DQ ?
hIcoMFPlayer DQ ?
hIcoMFPlayVideo DQ ?
hIcoMFPlayAudio DQ ?
hBmpFileMRU DQ ?
hBmpFileMRUClear DQ ?

hMediaPlayerWindow DQ ?
hMediaPlayerControls DQ ?
Expand All @@ -273,6 +377,7 @@ hMediaPlayerSeekBar DQ ?
hMediaPlayerMainMenu DQ ?
hMediaPlayerContextMenu DQ ?
hMediaPlayerAspectMenu DQ ?
hMediaPlayerSpeedMenu DQ ?

hMFP_Position DQ ?
hMFP_Duration DQ ?
Expand Down
Binary file modified MediaPlayer-x64/MediaPlayer.mnu
Binary file not shown.
Loading

0 comments on commit 9510419

Please sign in to comment.