summaryrefslogtreecommitdiffstats
path: root/media/player
diff options
context:
space:
mode:
authorfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 19:52:35 +0000
committerfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 19:52:35 +0000
commitf70de8a744fc70811bfb5a9c8202505f9f43ff8a (patch)
tree899d6d4a8b863e83887a78982c5d8843409e7c68 /media/player
parent0cb941091a7bd3ae1fbb909330d73001afa7f5f3 (diff)
downloadchromium_src-f70de8a744fc70811bfb5a9c8202505f9f43ff8a.zip
chromium_src-f70de8a744fc70811bfb5a9c8202505f9f43ff8a.tar.gz
chromium_src-f70de8a744fc70811bfb5a9c8202505f9f43ff8a.tar.bz2
Media player adds seek menu and dialog.
Review URL: http://codereview.chromium.org/115692 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/player')
-rw-r--r--media/player/mainfrm.h104
-rw-r--r--media/player/movie.cc25
-rw-r--r--media/player/movie.h9
-rw-r--r--media/player/player_wtl.cc1
-rwxr-xr-xmedia/player/player_wtl.rc1068
-rw-r--r--media/player/props.h10
-rw-r--r--media/player/resource.h146
-rw-r--r--media/player/seek.h98
8 files changed, 865 insertions, 596 deletions
diff --git a/media/player/mainfrm.h b/media/player/mainfrm.h
index d3dd669..0ff9e46 100644
--- a/media/player/mainfrm.h
+++ b/media/player/mainfrm.h
@@ -8,16 +8,6 @@
#ifndef MEDIA_PLAYER_MAINFRM_H_
#define MEDIA_PLAYER_MAINFRM_H_
-namespace media {
-// TODO(fbarchard): Reenable this. But it affects ffmpeg filters and got
-// removed in the move to SVN, so I've commented it out for now.
-// It may also hook it to YUV.
-// Both require some pipeline changes to do it in a formal way,
-// or a short term hack to test the feature.
-// g_enablemmx is in ffmpeg_video.
-// extern bool g_enablemmx;
-}
-
const int POPUP_MENU_POSITION = 0;
const int FILE_MENU_POSITION = 0;
const int RECENT_MENU_POSITION = 6;
@@ -25,6 +15,7 @@ const int RECENT_MENU_POSITION = 6;
const wchar_t g_lpcstrMRURegKey[] = L"Software\\Google\\Video\\MediaPlayer";
const wchar_t g_lpcstrApp[] = L"MediaPlayer";
+
class CMainFrame : public CFrameWindowImpl<CMainFrame>,
public CUpdateUI<CMainFrame>,
public CMessageFilter, public CIdleHandler,
@@ -38,6 +29,7 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
WtlVideoWindow m_view;
wchar_t m_szFilePath[MAX_PATH];
+ bool enable_exit;
// printing support
CPrinter m_printer;
@@ -53,6 +45,7 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
m_printer.OpenDefaultPrinter();
m_devmode.CopyFromPrinter(m_printer);
m_szFilePath[0] = 0;
+ enable_exit = false;
}
virtual BOOL PreTranslateMessage(MSG* pMsg) {
@@ -65,6 +58,14 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
virtual BOOL OnIdle() {
BOOL bEnable = !m_view.bmp_.IsNull();
BOOL bMovieOpen = media::Movie::get()->IsOpen() ? true : false;
+
+ float current_position = media::Movie::get()->GetPosition();
+ float duration = media::Movie::get()->GetDuration();
+ if (enable_exit && bEnable &&
+ duration > 0.0f && current_position >= duration) {
+ OnFileExit(0, 0, 0);
+ }
+
UIEnable(ID_FILE_PRINT, bEnable);
UIEnable(ID_FILE_PRINT_PREVIEW, bEnable);
UISetCheck(ID_FILE_PRINT_PREVIEW, m_bPrintPreview);
@@ -86,16 +87,25 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
UIEnable(ID_VIEW_ROTATE270, true);
UIEnable(ID_VIEW_MIRROR_HORIZONTAL, true);
UIEnable(ID_VIEW_MIRROR_VERTICAL, true);
- UIEnable(ID_PLAY_PLAY_PAUSE, bMovieOpen); // if no movie open.
+ UIEnable(ID_PLAY_PLAY_PAUSE, bMovieOpen); // If no movie open.
+ UIEnable(ID_PLAY_STEP_FORWARD, bMovieOpen);
+ UIEnable(ID_PLAY_STEP_BACKWARD, bMovieOpen);
+ UIEnable(ID_PLAY_GOTO_START, bMovieOpen);
+ UIEnable(ID_PLAY_GOTO_END, bMovieOpen);
+ UIEnable(ID_PLAY_GOTO_FRAME, false); // Not working yet.
UIEnable(ID_PLAY_HALFSPEED, true);
UIEnable(ID_PLAY_NORMALSPEED, true);
UIEnable(ID_PLAY_DOUBLESPEED, true);
+ UIEnable(ID_PLAY_TRIPLESPEED, true);
+ UIEnable(ID_PLAY_QUADRUPLESPEED, true);
+ UIEnable(ID_PLAY_EIGHTSPEED, true);
+ UIEnable(ID_PLAY_SIXTEENSPEED, true);
#ifdef _OPENMP
UIEnable(ID_OPTIONS_OPENMP, true);
#else
UIEnable(ID_OPTIONS_OPENMP, false);
#endif
- UIEnable(ID_OPTIONS_MMX, false); // Not currently implemented.
+ UIEnable(ID_OPTIONS_EXIT, true); // Not currently implemented.
UIEnable(ID_OPTIONS_SWSCALER, true);
UIEnable(ID_OPTIONS_DRAW, true);
UIEnable(ID_OPTIONS_AUDIO, !bMovieOpen); // Disable while playing.
@@ -220,11 +230,16 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
OnViewRotate)
COMMAND_ID_HANDLER_EX(ID_VIEW_PROPERTIES, OnViewProperties)
COMMAND_ID_HANDLER_EX(ID_PLAY_PLAY_PAUSE, OnPlayPlayPause)
- COMMAND_RANGE_HANDLER_EX(ID_PLAY_HALFSPEED, ID_PLAY_DOUBLESPEED,
+ COMMAND_ID_HANDLER_EX(ID_PLAY_STEP_FORWARD, OnPlayStepForward)
+ COMMAND_ID_HANDLER_EX(ID_PLAY_STEP_BACKWARD, OnPlayStepBackward)
+ COMMAND_ID_HANDLER_EX(ID_PLAY_GOTO_START, OnPlayGotoStart)
+ COMMAND_ID_HANDLER_EX(ID_PLAY_GOTO_END, OnPlayGotoEnd)
+ COMMAND_ID_HANDLER_EX(ID_PLAY_GOTO_FRAME, OnPlayGotoFrame)
+ COMMAND_RANGE_HANDLER_EX(ID_PLAY_HALFSPEED, ID_PLAY_SIXTEENSPEED,
OnPlaySpeed)
COMMAND_ID_HANDLER_EX(ID_APP_ABOUT, OnAppAbout)
COMMAND_ID_HANDLER_EX(ID_OPTIONS_OPENMP, OnOptionsOpenMP)
- COMMAND_ID_HANDLER_EX(ID_OPTIONS_MMX, OnOptionsMMX)
+ COMMAND_ID_HANDLER_EX(ID_OPTIONS_EXIT, OnOptionsExit)
COMMAND_ID_HANDLER_EX(ID_OPTIONS_SWSCALER, OnOptionsSWScaler)
COMMAND_ID_HANDLER_EX(ID_OPTIONS_DRAW, OnOptionsDraw)
COMMAND_ID_HANDLER_EX(ID_OPTIONS_AUDIO, OnOptionsAudio)
@@ -258,11 +273,20 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
UPDATE_ELEMENT(ID_VIEW_MIRROR_VERTICAL, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_VIEW_PROPERTIES, UPDUI_MENUPOPUP | UPDUI_TOOLBAR)
UPDATE_ELEMENT(ID_PLAY_PLAY_PAUSE, UPDUI_MENUPOPUP | UPDUI_TOOLBAR)
+ UPDATE_ELEMENT(ID_PLAY_STEP_FORWARD, UPDUI_MENUPOPUP)
+ UPDATE_ELEMENT(ID_PLAY_STEP_BACKWARD, UPDUI_MENUPOPUP)
+ UPDATE_ELEMENT(ID_PLAY_GOTO_START, UPDUI_MENUPOPUP)
+ UPDATE_ELEMENT(ID_PLAY_GOTO_END, UPDUI_MENUPOPUP)
+ UPDATE_ELEMENT(ID_PLAY_GOTO_FRAME, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_PLAY_HALFSPEED, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_PLAY_NORMALSPEED, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_PLAY_DOUBLESPEED, UPDUI_MENUPOPUP)
+ UPDATE_ELEMENT(ID_PLAY_TRIPLESPEED, UPDUI_MENUPOPUP)
+ UPDATE_ELEMENT(ID_PLAY_QUADRUPLESPEED, UPDUI_MENUPOPUP)
+ UPDATE_ELEMENT(ID_PLAY_EIGHTSPEED, UPDUI_MENUPOPUP)
+ UPDATE_ELEMENT(ID_PLAY_SIXTEENSPEED, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_OPTIONS_OPENMP, UPDUI_MENUPOPUP)
- UPDATE_ELEMENT(ID_OPTIONS_MMX, UPDUI_MENUPOPUP)
+ UPDATE_ELEMENT(ID_OPTIONS_EXIT, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_OPTIONS_SWSCALER, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_OPTIONS_DRAW, UPDUI_MENUPOPUP)
UPDATE_ELEMENT(ID_OPTIONS_AUDIO, UPDUI_MENUPOPUP)
@@ -285,9 +309,13 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
void UpdateSpeedUICheck() {
if (media::Movie::get()) {
float play_rate = media::Movie::get()->GetPlayRate();
- UISetCheck(ID_PLAY_HALFSPEED, (play_rate == 0.5f));
- UISetCheck(ID_PLAY_NORMALSPEED, (play_rate == 1.0f));
- UISetCheck(ID_PLAY_DOUBLESPEED, (play_rate == 2.0f));
+ UISetCheck(ID_PLAY_HALFSPEED, (play_rate == 0.5f));
+ UISetCheck(ID_PLAY_NORMALSPEED, (play_rate == 1.0f));
+ UISetCheck(ID_PLAY_DOUBLESPEED, (play_rate == 2.0f));
+ UISetCheck(ID_PLAY_TRIPLESPEED, (play_rate == 3.0f));
+ UISetCheck(ID_PLAY_QUADRUPLESPEED, (play_rate == 4.0f));
+ UISetCheck(ID_PLAY_EIGHTSPEED, (play_rate == 8.0f));
+ UISetCheck(ID_PLAY_SIXTEENSPEED, (play_rate == 16.0f));
}
}
@@ -349,6 +377,7 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
UISetCheck(ID_VIEW_STATUS_BAR, 1);
UISetCheck(ID_VIEW_ROTATE0, 1);
UISetCheck(ID_OPTIONS_OPENMP, 0);
+ UISetCheck(ID_OPTIONS_EXIT, 0);
UISetCheck(ID_OPTIONS_DRAW, 1);
UISetCheck(ID_OPTIONS_AUDIO, 1);
UpdateSizeUICheck();
@@ -611,11 +640,38 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
media::Movie::get()->SetPause(paused);
}
+ void OnPlayStepForward(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) {
+ float current_position = media::Movie::get()->GetPosition();
+ media::Movie::get()->SetPosition(current_position + 10.0f);
+ }
+
+ void OnPlayStepBackward(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) {
+ float current_position = media::Movie::get()->GetPosition();
+ media::Movie::get()->SetPosition(current_position - 10.0f);
+ }
+
+ void OnPlayGotoStart(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) {
+ media::Movie::get()->SetPosition(0.0);
+ }
+
+ void OnPlayGotoEnd(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) {
+ float current_position = media::Movie::get()->GetDuration();
+ media::Movie::get()->SetPosition(current_position - 30.0f);
+ }
+
void SetPlayRate(int play_speed) {
if (play_speed == 0) {
media::Movie::get()->Play(0.5f);
} else if (play_speed == 2) {
media::Movie::get()->Play(2.0f);
+ } else if (play_speed == 3) {
+ media::Movie::get()->Play(3.0f);
+ } else if (play_speed == 4) {
+ media::Movie::get()->Play(4.0f);
+ } else if (play_speed == 5) {
+ media::Movie::get()->Play(8.0f);
+ } else if (play_speed == 6) {
+ media::Movie::get()->Play(16.0f);
} else {
media::Movie::get()->Play(1.0f);
}
@@ -637,10 +693,10 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
UpdateLayout();
}
- void OnOptionsMMX(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) {
+ void OnOptionsExit(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) {
// TODO(fbarchard): Implement when pipeline exposes properties.
- // media::g_enablemmx = !media::g_enablemmx;
- // UISetCheck(ID_OPTIONS_MMX, media::g_enablemmx);
+ enable_exit = !enable_exit;
+ UISetCheck(ID_OPTIONS_EXIT, enable_exit);
UpdateLayout();
}
@@ -676,6 +732,12 @@ class CMainFrame : public CFrameWindowImpl<CMainFrame>,
CSimpleDialog<IDD_ABOUTBOX> dlg;
dlg.DoModal();
}
+
+
+ void OnPlayGotoFrame(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wnd*/) {
+ CSeek seek;
+ seek.DoModal();
+ }
};
#endif // MEDIA_PLAYER_MAINFRM_H_
diff --git a/media/player/movie.cc b/media/player/movie.cc
index 32594eb..1ef840f 100644
--- a/media/player/movie.cc
+++ b/media/player/movie.cc
@@ -107,6 +107,31 @@ float Movie::GetPlayRate() {
return play_rate_;
}
+// Get movie duration in seconds.
+float Movie::GetDuration() {
+ float duration = 0.f;
+ if (pipeline_.get())
+ duration = (pipeline_->GetDuration()).InMicroseconds() / 1000000.0f;
+ return duration;
+}
+
+// Get current movie position in seconds.
+float Movie::GetPosition() {
+ float position = 0.f;
+ if (pipeline_.get())
+ position = (pipeline_->GetInterpolatedTime()).InMicroseconds() / 1000000.0f;
+ return position;
+}
+
+// Set current movie position in seconds.
+void Movie::SetPosition(float position) {
+ int64 us = static_cast<int64>(position * 1000000);
+ base::TimeDelta time = base::TimeDelta::FromMicroseconds(us);
+ if (pipeline_.get())
+ pipeline_->Seek(time, NULL);
+}
+
+
// Set playback pause.
void Movie::SetPause(bool pause) {
enable_pause_ = pause;
diff --git a/media/player/movie.h b/media/player/movie.h
index d44126b..fdaa2b5 100644
--- a/media/player/movie.h
+++ b/media/player/movie.h
@@ -29,6 +29,15 @@ class Movie : public Singleton<Movie> {
// Set playback rate.
float GetPlayRate();
+ // Get movie duration in seconds.
+ float GetDuration();
+
+ // Get current movie position in seconds.
+ float GetPosition();
+
+ // Set current movie position in seconds.
+ void SetPosition(float position);
+
// Set playback pause.
void SetPause(bool pause);
diff --git a/media/player/player_wtl.cc b/media/player/player_wtl.cc
index 0f89fd6..3b78cdb 100644
--- a/media/player/player_wtl.cc
+++ b/media/player/player_wtl.cc
@@ -32,6 +32,7 @@
#include "media/player/wtl_renderer.h"
#include "media/player/view.h"
#include "media/player/props.h"
+#include "media/player/seek.h"
#include "media/player/list.h"
#include "media/player/mainfrm.h"
diff --git a/media/player/player_wtl.rc b/media/player/player_wtl.rc
index 1301679..82bcbe2 100755
--- a/media/player/player_wtl.rc
+++ b/media/player/player_wtl.rc
@@ -1,509 +1,559 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "../chrome/third_party/wtl/include/atlres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "../chrome/third_party/wtl/include/atlres.h\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Toolbar
-//
-
-IDR_MAINFRAME4 TOOLBAR 16, 15
-BEGIN
- BUTTON ID_PLAY_PLAY_PAUSE
- SEPARATOR
- BUTTON ID_FILE_OPEN
- BUTTON ID_RECENT_BTN
- SEPARATOR
- BUTTON ID_FILE_PRINT
- BUTTON ID_FILE_PRINT_PREVIEW
- BUTTON ID_FILE_PAGE_SETUP
- SEPARATOR
- BUTTON ID_EDIT_COPY
- BUTTON ID_EDIT_PASTE
- BUTTON ID_EDIT_CLEAR
- SEPARATOR
- BUTTON ID_VIEW_PROPERTIES
- BUTTON ID_APP_ABOUT
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDR_MAINFRAME4 BITMAP "Toolbar.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_MAINFRAME MENU
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
- MENUITEM SEPARATOR
- MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
- MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW
- MENUITEM "Pa&ge Setup...", ID_FILE_PAGE_SETUP
- MENUITEM SEPARATOR
- POPUP "Recent &Files"
- BEGIN
- MENUITEM "(empty)", ID_FILE_MRU_FILE1
- END
- MENUITEM "&Last...\tLast+L", ID_FILE_LAST
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_APP_EXIT
- END
- POPUP "&Edit"
- BEGIN
- MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
- MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
- MENUITEM "Cl&ear\tCTRL+F4", ID_EDIT_CLEAR
- END
- POPUP "&View"
- BEGIN
- MENUITEM "&Quarter Size\tCtrl+9", ID_VIEW_QUARTERSIZE
- MENUITEM "&Half Size\tCtrl+0", ID_VIEW_HALFSIZE
- MENUITEM "&Normal Size\tCtrl+1", ID_VIEW_NORMALSIZE
- MENUITEM "&Double Size\tCtrl+2", ID_VIEW_DOUBLESIZE
- MENUITEM "Triple Size\tCtrl+3", ID_VIEW_TRIPLESIZE
- MENUITEM "Quadruple Size\tCtrl+4", ID_VIEW_QUADRUPLESIZE
- MENUITEM "Fit to Screen", ID_VIEW_FITTOSCREEN
- MENUITEM "&Full Screen\tCtrl+F", ID_VIEW_FULLSCREEN
- MENUITEM SEPARATOR
- MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
- MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
- MENUITEM SEPARATOR
- MENUITEM "N&o Rotation", ID_VIEW_ROTATE0
- MENUITEM "Rotate &90", ID_VIEW_ROTATE90
- MENUITEM "Rotate &180", ID_VIEW_ROTATE180
- MENUITEM "Rotate &270", ID_VIEW_ROTATE270
- MENUITEM "&Mirror Horizontally", ID_VIEW_MIRROR_HORIZONTAL
- MENUITEM "Mirror &Vertically", ID_VIEW_MIRROR_VERTICAL
- MENUITEM SEPARATOR
- MENUITEM "&Properties", ID_VIEW_PROPERTIES
- END
- POPUP "&Play"
- BEGIN
- MENUITEM "&Play/Pause\tSpace", ID_PLAY_PLAY_PAUSE
- MENUITEM SEPARATOR
- MENUITEM "&Half Speed\tAlt+0", ID_PLAY_HALFSPEED
- MENUITEM "&Normal Speed\tAlt+1", ID_PLAY_NORMALSPEED
- MENUITEM "&Double Speed\tAlt+2", ID_PLAY_DOUBLESPEED
- END
- POPUP "&Options"
- BEGIN
- MENUITEM "&OpenMP", ID_OPTIONS_OPENMP
- MENUITEM "&MMX", ID_OPTIONS_MMX
- MENUITEM "SWScaler", ID_OPTIONS_SWSCALER
- MENUITEM "Draw", ID_OPTIONS_DRAW
- MENUITEM "Audio", ID_OPTIONS_AUDIO
- MENUITEM "Dump YUV File", ID_OPTIONS_DUMPYUVFILE
- END
- POPUP "&Help"
- BEGIN
- MENUITEM "&About Media Player...", ID_APP_ABOUT
- END
-END
-
-IDR_CONTEXTMENU MENU
-BEGIN
- POPUP ""
- BEGIN
- MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
- MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
- MENUITEM "Cl&ear", ID_EDIT_CLEAR
- MENUITEM SEPARATOR
- MENUITEM "&Properties", ID_VIEW_PROPERTIES
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDR_MAINFRAME3 ICON "player_wtl.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOGEX 0, 0, 185, 126
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "About"
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,121,97,50,14
- CTEXT "Media Player v2.0\n\nApril 14, 2009\n\nCopyright (c) 2009 The Chromium Authors.\nAll rights reserved.",IDC_STATIC,7,43,171,49
- ICON IDR_MAINFRAME3,IDC_STATIC,80,17,21,20
- GROUPBOX "",IDC_STATIC,7,7,171,112
-END
-
-IDD_PROP_PAGE1 DIALOGEX 0, 0, 212, 114
-STYLE DS_SETFONT | WS_CHILD | WS_CAPTION
-CAPTION "Movie"
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
- LTEXT "Location:",IDC_STATIC,5,20,30,8
- LTEXT "Size:",IDC_STATIC,5,41,16,8
- LTEXT "Created:",IDC_STATIC,5,60,28,8
- LTEXT "Attributes:",IDC_STATIC,5,81,32,8
- LTEXT "Static",IDC_FILESIZE,40,41,170,8
- LTEXT "Static",IDC_FILEDATE,40,60,170,8
- LTEXT "Static",IDC_FILEATTRIB,40,81,170,8
- LTEXT "Static",IDC_FILELOCATION,40,20,170,8,SS_NOTIFY
-END
-
-IDD_PROP_PAGE2 DIALOGEX 0, 0, 212, 114
-STYLE DS_SETFONT | WS_CHILD | WS_CAPTION
-CAPTION "Frame"
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
- LTEXT "Type:",IDC_STATIC,15,10,80,8
- LTEXT "Static",IDC_TYPE,100,10,105,8
- LTEXT "Width:",IDC_STATIC,15,25,80,8
- LTEXT "Static",IDC_WIDTH,100,25,105,8
- LTEXT "Height:",IDC_STATIC,15,40,80,8
- LTEXT "Static",IDC_HEIGHT,100,40,105,8
- LTEXT "Horizontal Resolution:",IDC_STATIC,15,55,80,8
- LTEXT "Static",IDC_HORRES,100,55,105,8
- LTEXT "Vertical Resolution:",IDC_STATIC,15,70,80,8
- LTEXT "Static",IDC_VERTRES,100,70,105,8
- LTEXT "Bit Depth:",IDC_STATIC,15,85,80,8
- LTEXT "Static",IDC_BITDEPTH,100,85,105,8
- LTEXT "Compression:",IDC_STATIC,15,100,80,8
- LTEXT "Static",IDC_COMPRESSION,100,100,105,8
-END
-
-IDD_PROP_PAGE3 DIALOGEX 0, 0, 212, 114
-STYLE DS_SETFONT | WS_CHILD | WS_CAPTION
-CAPTION "Screen"
-FONT 8, "MS Sans Serif", 0, 0, 0x0
-BEGIN
- LTEXT "Width:",IDC_STATIC,15,25,80,8
- LTEXT "Static",IDC_WIDTH,100,25,105,8
- LTEXT "Height:",IDC_STATIC,15,40,80,8
- LTEXT "Static",IDC_HEIGHT,100,40,105,8
- LTEXT "Horizontal DPI:",IDC_STATIC,15,55,80,8
- LTEXT "Static",IDC_HORRES,100,55,105,8
- LTEXT "Vertical DPI:",IDC_STATIC,15,70,80,8
- LTEXT "Static",IDC_VERTRES,100,70,105,8
- LTEXT "Bit Depth:",IDC_STATIC,15,85,80,8
- LTEXT "Static",IDC_BITDEPTH,100,85,105,8
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_ABOUTBOX, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 178
- TOPMARGIN, 7
- BOTTOMMARGIN, 119
- END
-
- IDD_PROP_PAGE1, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 205
- TOPMARGIN, 7
- BOTTOMMARGIN, 107
- END
-
- IDD_PROP_PAGE2, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 205
- TOPMARGIN, 7
- BOTTOMMARGIN, 107
- END
-
- IDD_PROP_PAGE3, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 205
- TOPMARGIN, 7
- BOTTOMMARGIN, 107
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDR_MAINFRAME2 ACCELERATORS
-BEGIN
- VK_F4, ID_EDIT_CLEAR, VIRTKEY, CONTROL, NOINVERT
- "C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
- VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
- "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
- VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
- "L", ID_FILE_LAST, VIRTKEY, CONTROL, NOINVERT
- "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
- "P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT
- "2", ID_PLAY_DOUBLESPEED, VIRTKEY, ALT, NOINVERT
- "0", ID_PLAY_HALFSPEED, VIRTKEY, ALT, NOINVERT
- "1", ID_PLAY_NORMALSPEED, VIRTKEY, ALT, NOINVERT
- " ", ID_PLAY_PLAY_PAUSE, ASCII, NOINVERT
- "2", ID_VIEW_DOUBLESIZE, VIRTKEY, CONTROL, NOINVERT
- "F", ID_VIEW_FULLSCREEN, VIRTKEY, CONTROL, NOINVERT
- "0", ID_VIEW_HALFSIZE, VIRTKEY, CONTROL, NOINVERT
- "1", ID_VIEW_NORMALSIZE, VIRTKEY, CONTROL, NOINVERT
- "9", ID_VIEW_QUARTERSIZE, VIRTKEY, CONTROL, NOINVERT
- "3", ID_VIEW_TRIPLESIZE, VIRTKEY, CONTROL, NOINVERT
- "4", ID_VIEW_QUADRUPLESIZE, VIRTKEY, CONTROL, NOINVERT
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "Comments", "Written by Frank Barchard"
- VALUE "FileDescription", "media_player"
- VALUE "FileVersion", "1, 0, 0, 1"
- VALUE "InternalName", "media_player_wtl"
- VALUE "LegalCopyright", "Copyright 2009"
- VALUE "OriginalFilename", "media_player_wtl.exe"
- VALUE "ProductName", "media_player"
- VALUE "ProductVersion", "1, 0, 0, 1"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
- IDR_MAINFRAME "Media Player"
-END
-
-STRINGTABLE
-BEGIN
- ID_FILE_NEW "Create a new document\nNew"
- ID_FILE_OPEN "Open a movie\nOpen"
- ID_FILE_CLOSE "Close movie\nClose"
- ID_FILE_SAVE "Save the movie\nSave"
- ID_FILE_SAVE_AS "Save the movie with a new name\nSave As"
- ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup"
- ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup"
- ID_FILE_PRINT "Print the movie\nPrint"
- ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
-END
-
-STRINGTABLE
-BEGIN
- ID_VIEW_FULLSCREEN "Full screen mode."
- ID_PLAY_HALFSPEED "Play movie at half normal speed."
- ID_PLAY_NORMALSPEED "Play movie at normal speed."
- ID_PLAY_DOUBLESPEED "Play movie at twice the normal speed."
- ID_FILE_LAST "Replay last movie\nOpen"
- ID_VIEW_ROTATE0 "Turn off rotation."
- ID_VIEW_ROTATE90 "Rotate movie by 90 degrees clockwise."
- ID_VIEW_ROTATE180 "Rotate movie by 180 degrees."
- ID_VIEW_ROTATE270 "Rotate movie by 270 degrees clockwise."
- ID_VIEW_MIRROR_HORIZONTAL "Mirror movie horizontally."
- ID_VIEW_MIRROR_VERTICAL "Mirror movie vertically."
- ID_VIEW_QUARTERSIZE "View movie at quarter normal size."
-END
-
-STRINGTABLE
-BEGIN
- ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
- ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
-END
-
-STRINGTABLE
-BEGIN
- ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
- ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
-END
-
-STRINGTABLE
-BEGIN
- ID_WINDOW_NEW "Open another window for the movie\nNew Window"
- ID_WINDOW_ARRANGE "Arrange icons at the bottom of the window\nArrange Icons"
- ID_WINDOW_CASCADE "Arrange windows so they overlap\nCascade Windows"
- ID_WINDOW_TILE_HORZ "Arrange windows as non-overlapping tiles\nTile Windows"
- ID_WINDOW_TILE_VERT "Arrange windows as non-overlapping tiles\nTile Windows"
- ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
-END
-
-STRINGTABLE
-BEGIN
- ID_EDIT_CLEAR "Removes the movie\nClear"
- ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
- ID_EDIT_COPY "Copy the movie and put it on the Clipboard\nCopy"
- ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
- ID_EDIT_FIND "Find the specified text\nFind"
- ID_EDIT_PASTE "Insert movie from the Clipboard\nPaste"
- ID_EDIT_REPEAT "Repeat the last action\nRepeat"
- ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
- ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
- ID_EDIT_UNDO "Undo the last action\nUndo"
- ID_EDIT_REDO "Redo the previously undone action\nRedo"
-END
-
-STRINGTABLE
-BEGIN
- ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
- ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
-END
-
-STRINGTABLE
-BEGIN
- ATL_IDS_SCSIZE "Change the window size"
- ATL_IDS_SCMOVE "Change the window position"
- ATL_IDS_SCMINIMIZE "Reduce the window to an icon"
- ATL_IDS_SCMAXIMIZE "Enlarge the window to full size"
- ATL_IDS_SCNEXTWINDOW "Switch to the next document window"
- ATL_IDS_SCPREVWINDOW "Switch to the previous document window"
- ATL_IDS_SCCLOSE "Close the active window and prompts to save the documents"
-END
-
-STRINGTABLE
-BEGIN
- ATL_IDS_SCRESTORE "Restore the window to normal size"
- ATL_IDS_SCTASKLIST "Activate Task List"
- ATL_IDS_MDICHILD "Activate this window"
-END
-
-STRINGTABLE
-BEGIN
- ATL_IDS_IDLEMESSAGE "Ready"
-END
-
-STRINGTABLE
-BEGIN
- ATL_IDS_MRU_FILE "Open this document"
-END
-
-STRINGTABLE
-BEGIN
- ID_RECENT_BTN "\nRecent Files"
- ID_VIEW_PROPERTIES "Displays movie properties\nProperties"
- ID_PLAY_PLAY_PAUSE "Start or pause movie playback"
-END
-
-STRINGTABLE
-BEGIN
- ID_OPTIONS_MMX "Enable CPU extensions including MMX and SSE"
- ID_OPTIONS_OPENMP "Enable OpenMP for YUV"
- ID_OPTIONS_SWSCALER "Use SWScaler YUV conversion"
- ID_OPTIONS_DRAW "Enable/Disable Draws"
- ID_OPTIONS_AUDIO "Enable/Disable Audio"
- ID_OPTIONS_DUMPYUVFILE "Dump YUV frames to a file"
- ID_VIEW_HALFSIZE "View movie at half normal size."
- ID_VIEW_NORMALSIZE "View movie at normal size."
- ID_VIEW_DOUBLESIZE "View movie at twice the normal size."
- ID_VIEW_FITTOSCREEN "Maximize window to desktop."
-END
-
-STRINGTABLE
-BEGIN
- ID_VIEW_TRIPLESIZE "View movie at triple the normal size."
- ID_VIEW_QUADRUPLESIZE "View movie at quadruple the normal size."
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "../chrome/third_party/wtl/include/atlres.h"
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""../chrome/third_party/wtl/include/atlres.h\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Toolbar
+//
+
+IDR_MAINFRAME4 TOOLBAR 16, 15
+BEGIN
+ BUTTON ID_PLAY_PLAY_PAUSE
+ SEPARATOR
+ BUTTON ID_FILE_OPEN
+ BUTTON ID_RECENT_BTN
+ SEPARATOR
+ BUTTON ID_FILE_PRINT
+ BUTTON ID_FILE_PRINT_PREVIEW
+ BUTTON ID_FILE_PAGE_SETUP
+ SEPARATOR
+ BUTTON ID_EDIT_COPY
+ BUTTON ID_EDIT_PASTE
+ BUTTON ID_EDIT_CLEAR
+ SEPARATOR
+ BUTTON ID_VIEW_PROPERTIES
+ BUTTON ID_APP_ABOUT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDR_MAINFRAME4 BITMAP "Toolbar.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MAINFRAME MENU
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
+ MENUITEM SEPARATOR
+ MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
+ MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW
+ MENUITEM "Pa&ge Setup...", ID_FILE_PAGE_SETUP
+ MENUITEM SEPARATOR
+ POPUP "Recent &Files"
+ BEGIN
+ MENUITEM "(empty)", ID_FILE_MRU_FILE1
+ END
+ MENUITEM "&Last...\tCtrl+L", ID_FILE_LAST
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_APP_EXIT
+ END
+ POPUP "&Edit"
+ BEGIN
+ MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
+ MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
+ MENUITEM "Cl&ear\tCTRL+F4", ID_EDIT_CLEAR
+ END
+ POPUP "&View"
+ BEGIN
+ MENUITEM "&Quarter Size\tCtrl+9", ID_VIEW_QUARTERSIZE
+ MENUITEM "&Half Size\tCtrl+0", ID_VIEW_HALFSIZE
+ MENUITEM "&Normal Size\tCtrl+1", ID_VIEW_NORMALSIZE
+ MENUITEM "&Double Size\tCtrl+2", ID_VIEW_DOUBLESIZE
+ MENUITEM "Triple Size\tCtrl+3", ID_VIEW_TRIPLESIZE
+ MENUITEM "Quadruple Size\tCtrl+4", ID_VIEW_QUADRUPLESIZE
+ MENUITEM "Fit to Screen", ID_VIEW_FITTOSCREEN
+ MENUITEM "&Full Screen\tCtrl+F", ID_VIEW_FULLSCREEN
+ MENUITEM SEPARATOR
+ MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
+ MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
+ MENUITEM SEPARATOR
+ MENUITEM "N&o Rotation", ID_VIEW_ROTATE0
+ MENUITEM "Rotate &90", ID_VIEW_ROTATE90
+ MENUITEM "Rotate &180", ID_VIEW_ROTATE180
+ MENUITEM "Rotate &270", ID_VIEW_ROTATE270
+ MENUITEM "&Mirror Horizontally", ID_VIEW_MIRROR_HORIZONTAL
+ MENUITEM "Mirror &Vertically", ID_VIEW_MIRROR_VERTICAL
+ MENUITEM SEPARATOR
+ MENUITEM "&Properties", ID_VIEW_PROPERTIES
+ END
+ POPUP "&Play"
+ BEGIN
+ MENUITEM "&Play/Pause\tSpace", ID_PLAY_PLAY_PAUSE
+ MENUITEM "Skip &Forward\tRight Arrow", ID_PLAY_STEP_FORWARD
+ MENUITEM "Skip &Backward\tLeft Arrow", ID_PLAY_STEP_BACKWARD
+ MENUITEM "G&oto Start\tHome", ID_PLAY_GOTO_START
+ MENUITEM "Goto &End\tEnd", ID_PLAY_GOTO_END
+ MENUITEM "&Goto Frame\tCtrl+G", ID_PLAY_GOTO_FRAME
+ MENUITEM SEPARATOR
+ MENUITEM "&Half Speed\tAlt+0", ID_PLAY_HALFSPEED
+ MENUITEM "&Normal Speed\tAlt+1", ID_PLAY_NORMALSPEED
+ MENUITEM "&Double Speed\tAlt+2", ID_PLAY_DOUBLESPEED
+ MENUITEM "&Triple Speed\tAlt+3", ID_PLAY_TRIPLESPEED
+ MENUITEM "&Quadruple Speed\tAlt+4", ID_PLAY_QUADRUPLESPEED
+ MENUITEM "&Eight Times Speed\tAlt+5", ID_PLAY_EIGHTSPEED
+ MENUITEM "&Sixteen Times Speed\tAlt+6", ID_PLAY_SIXTEENSPEED
+ END
+ POPUP "&Options"
+ BEGIN
+ MENUITEM "&Exit at End of Movie", ID_OPTIONS_EXIT
+ MENUITEM "Draw", ID_OPTIONS_DRAW
+ MENUITEM "Audio", ID_OPTIONS_AUDIO
+ MENUITEM "&OpenMP", ID_OPTIONS_OPENMP
+ MENUITEM "SWScaler", ID_OPTIONS_SWSCALER
+ MENUITEM "Dump YUV File", ID_OPTIONS_DUMPYUVFILE
+ END
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "&About Media Player...", ID_APP_ABOUT
+ END
+END
+
+IDR_CONTEXTMENU MENU
+BEGIN
+ POPUP ""
+ BEGIN
+ MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
+ MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
+ MENUITEM "Cl&ear", ID_EDIT_CLEAR
+ MENUITEM SEPARATOR
+ MENUITEM "&Properties", ID_VIEW_PROPERTIES
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDR_MAINFRAME3 ICON "player_wtl.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUTBOX DIALOGEX 0, 0, 185, 126
+STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "About"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,121,97,50,14
+ CTEXT "Media Player\n\nMay 14, 2009\n\nCopyright (c) 2009 The Chromium Authors.\nAll rights reserved.",IDC_STATIC,7,43,171,49
+ ICON IDR_MAINFRAME3,IDC_STATIC,80,17,20,20
+ GROUPBOX "",IDC_STATIC,7,7,171,112
+END
+
+IDD_PROP_PAGE1 DIALOGEX 0, 0, 212, 114
+STYLE DS_SETFONT | WS_CHILD | WS_CAPTION
+CAPTION "Movie"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+ LTEXT "Location:",IDC_STATIC,5,20,30,8
+ LTEXT "Size:",IDC_STATIC,5,34,16,8
+ LTEXT "Created:",IDC_STATIC,5,65,28,8
+ LTEXT "Attributes:",IDC_STATIC,5,81,32,8
+ LTEXT "Static",IDC_FILESIZE,40,34,170,8
+ LTEXT "Static",IDC_FILEDATE,40,65,165,8
+ LTEXT "Static",IDC_FILEATTRIB,40,81,170,8
+ LTEXT "Static",IDC_FILELOCATION,40,20,170,8,SS_NOTIFY
+ LTEXT "Duration:",IDC_STATIC,5,49,30,8
+ LTEXT "Static",IDC_FILEDURATION,40,50,170,8
+END
+
+IDD_PROP_PAGE2 DIALOGEX 0, 0, 212, 114
+STYLE DS_SETFONT | WS_CHILD | WS_CAPTION
+CAPTION "Frame"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+ LTEXT "Type:",IDC_STATIC,15,10,80,8
+ LTEXT "Static",IDC_TYPE,100,10,105,8
+ LTEXT "Width:",IDC_STATIC,15,25,80,8
+ LTEXT "Static",IDC_WIDTH,100,25,105,8
+ LTEXT "Height:",IDC_STATIC,15,40,80,8
+ LTEXT "Static",IDC_HEIGHT,100,40,105,8
+ LTEXT "Horizontal Resolution:",IDC_STATIC,15,55,80,8
+ LTEXT "Static",IDC_HORRES,100,55,105,8
+ LTEXT "Vertical Resolution:",IDC_STATIC,15,70,80,8
+ LTEXT "Static",IDC_VERTRES,100,70,105,8
+ LTEXT "Bit Depth:",IDC_STATIC,15,85,80,8
+ LTEXT "Static",IDC_BITDEPTH,100,85,105,8
+ LTEXT "Compression:",IDC_STATIC,15,100,80,8
+ LTEXT "Static",IDC_COMPRESSION,100,100,105,8
+END
+
+IDD_PROP_PAGE3 DIALOGEX 0, 0, 212, 114
+STYLE DS_SETFONT | WS_CHILD | WS_CAPTION
+CAPTION "Screen"
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+ LTEXT "Width:",IDC_STATIC,15,25,80,8
+ LTEXT "Static",IDC_WIDTH,100,25,105,8
+ LTEXT "Height:",IDC_STATIC,15,40,80,8
+ LTEXT "Static",IDC_HEIGHT,100,40,105,8
+ LTEXT "Horizontal DPI:",IDC_STATIC,15,55,80,8
+ LTEXT "Static",IDC_HORRES,100,55,105,8
+ LTEXT "Vertical DPI:",IDC_STATIC,15,70,80,8
+ LTEXT "Static",IDC_VERTRES,100,70,105,8
+ LTEXT "Bit Depth:",IDC_STATIC,15,85,80,8
+ LTEXT "Static",IDC_BITDEPTH,100,85,105,8
+END
+
+IDD_SEEK DIALOGEX 0, 0, 664, 55
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Seek"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "",IDC_SEEKSLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,7,27,650,21
+ LTEXT "Location:",IDC_STATIC,15,14,30,8
+ LTEXT "Static",IDC_SEEKLOCATION,50,15,170,8
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_ABOUTBOX, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 178
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 119
+ END
+
+ IDD_PROP_PAGE1, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 205
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 107
+ END
+
+ IDD_PROP_PAGE2, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 205
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 107
+ END
+
+ IDD_PROP_PAGE3, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 205
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 107
+ END
+
+ IDD_SEEK, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 657
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 48
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDR_MAINFRAME2 ACCELERATORS
+BEGIN
+ VK_F4, ID_EDIT_CLEAR, VIRTKEY, CONTROL, NOINVERT
+ "C", ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
+ VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL, NOINVERT
+ "V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
+ VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT, NOINVERT
+ "L", ID_FILE_LAST, VIRTKEY, CONTROL, NOINVERT
+ "O", ID_FILE_OPEN, VIRTKEY, CONTROL, NOINVERT
+ "P", ID_FILE_PRINT, VIRTKEY, CONTROL, NOINVERT
+ "2", ID_PLAY_DOUBLESPEED, VIRTKEY, ALT, NOINVERT
+ "5", ID_PLAY_EIGHTSPEED, VIRTKEY, ALT, NOINVERT
+ "G", ID_PLAY_GOTO_FRAME, VIRTKEY, CONTROL, NOINVERT
+ "0", ID_PLAY_HALFSPEED, VIRTKEY, ALT, NOINVERT
+ "1", ID_PLAY_NORMALSPEED, VIRTKEY, ALT, NOINVERT
+ " ", ID_PLAY_PLAY_PAUSE, ASCII, NOINVERT
+ "4", ID_PLAY_QUADRUPLESPEED, VIRTKEY, ALT, NOINVERT
+ "6", ID_PLAY_SIXTEENSPEED, VIRTKEY, ALT, NOINVERT
+ VK_LEFT, ID_PLAY_STEP_BACKWARD, VIRTKEY, NOINVERT
+ VK_RIGHT, ID_PLAY_STEP_FORWARD, VIRTKEY, NOINVERT
+ "3", ID_PLAY_TRIPLESPEED, VIRTKEY, ALT, NOINVERT
+ "2", ID_VIEW_DOUBLESIZE, VIRTKEY, CONTROL, NOINVERT
+ "F", ID_VIEW_FULLSCREEN, VIRTKEY, CONTROL, NOINVERT
+ "0", ID_VIEW_HALFSIZE, VIRTKEY, CONTROL, NOINVERT
+ "1", ID_VIEW_NORMALSIZE, VIRTKEY, CONTROL, NOINVERT
+ "4", ID_VIEW_QUADRUPLESIZE, VIRTKEY, CONTROL, NOINVERT
+ "9", ID_VIEW_QUARTERSIZE, VIRTKEY, CONTROL, NOINVERT
+ "3", ID_VIEW_TRIPLESIZE, VIRTKEY, CONTROL, NOINVERT
+ VK_HOME, ID_PLAY_GOTO_START, VIRTKEY, NOINVERT
+ VK_END, ID_PLAY_GOTO_END, VIRTKEY, NOINVERT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,1
+ PRODUCTVERSION 1,0,0,1
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "Written by Frank Barchard"
+ VALUE "FileDescription", "media_player"
+ VALUE "FileVersion", "1, 0, 0, 1"
+ VALUE "InternalName", "media_player_wtl"
+ VALUE "LegalCopyright", "Copyright 2009"
+ VALUE "OriginalFilename", "media_player_wtl.exe"
+ VALUE "ProductName", "media_player"
+ VALUE "ProductVersion", "1, 0, 0, 1"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ IDR_MAINFRAME "Media Player"
+END
+
+STRINGTABLE
+BEGIN
+ ID_FILE_NEW "Create a new document\nNew"
+ ID_FILE_OPEN "Open a movie\nOpen"
+ ID_FILE_CLOSE "Close movie\nClose"
+ ID_FILE_SAVE "Save the movie\nSave"
+ ID_FILE_SAVE_AS "Save the movie with a new name\nSave As"
+ ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup"
+ ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup"
+ ID_FILE_PRINT "Print the movie\nPrint"
+ ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
+END
+
+STRINGTABLE
+BEGIN
+ ID_VIEW_HALFSIZE "View movie at half normal size."
+ ID_VIEW_NORMALSIZE "View movie at normal size."
+ ID_VIEW_DOUBLESIZE "View movie at twice the normal size."
+ ID_VIEW_TRIPLESIZE "View movie at triple the normal size."
+ ID_VIEW_QUADRUPLESIZE "View movie at quadruple the normal size."
+ ID_VIEW_FITTOSCREEN "Maximize window to desktop."
+ ID_VIEW_FULLSCREEN "Full screen mode."
+ ID_PLAY_HALFSPEED "Play movie at half normal speed."
+ ID_PLAY_NORMALSPEED "Play movie at normal speed."
+ ID_PLAY_DOUBLESPEED "Play movie at twice the normal speed."
+ ID_PLAY_TRIPLESPEED "Play movie at triple the normal speed."
+ ID_PLAY_QUADRUPLESPEED "Play movie at quadruple the normal speed."
+ ID_PLAY_EIGHTSPEED "Play movie at eight times the normal speed."
+ ID_PLAY_SIXTEENSPEED "Play movie at sixteen times the normal speed."
+ ID_PLAY_STEP_FORWARD "Step forward one frame."
+ ID_PLAY_STEP_BACKWARD "Step backward one frame."
+END
+
+STRINGTABLE
+BEGIN
+ ID_FILE_LAST "Replay last movie\nOpen"
+ ID_VIEW_ROTATE0 "Turn off rotation."
+ ID_VIEW_ROTATE90 "Rotate movie by 90 degrees clockwise."
+ ID_VIEW_ROTATE180 "Rotate movie by 180 degrees."
+ ID_VIEW_ROTATE270 "Rotate movie by 270 degrees clockwise."
+ ID_VIEW_MIRROR_HORIZONTAL "Mirror movie horizontally."
+ ID_VIEW_MIRROR_VERTICAL "Mirror movie vertically."
+ ID_VIEW_QUARTERSIZE "View movie at quarter normal size."
+END
+
+STRINGTABLE
+BEGIN
+ ID_RECENT_BTN "\nRecent Files"
+ ID_VIEW_PROPERTIES "Displays movie properties\nProperties"
+ ID_PLAY_PLAY_PAUSE "Start or pause movie playback"
+END
+
+STRINGTABLE
+BEGIN
+ ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
+ ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
+END
+
+STRINGTABLE
+BEGIN
+ ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
+ ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
+END
+
+STRINGTABLE
+BEGIN
+ ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
+ ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
+END
+
+STRINGTABLE
+BEGIN
+ ID_WINDOW_NEW "Open another window for the movie\nNew Window"
+ ID_WINDOW_ARRANGE "Arrange icons at the bottom of the window\nArrange Icons"
+ ID_WINDOW_CASCADE "Arrange windows so they overlap\nCascade Windows"
+ ID_WINDOW_TILE_HORZ "Arrange windows as non-overlapping tiles\nTile Windows"
+ ID_WINDOW_TILE_VERT "Arrange windows as non-overlapping tiles\nTile Windows"
+ ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
+END
+
+STRINGTABLE
+BEGIN
+ ID_EDIT_CLEAR "Removes the movie\nClear"
+ ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
+ ID_EDIT_COPY "Copy the movie and put it on the Clipboard\nCopy"
+ ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
+ ID_EDIT_FIND "Find the specified text\nFind"
+ ID_EDIT_PASTE "Insert movie from the Clipboard\nPaste"
+ ID_EDIT_REPEAT "Repeat the last action\nRepeat"
+ ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
+ ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
+ ID_EDIT_UNDO "Undo the last action\nUndo"
+ ID_EDIT_REDO "Redo the previously undone action\nRedo"
+END
+
+STRINGTABLE
+BEGIN
+ ATL_IDS_SCSIZE "Change the window size"
+ ATL_IDS_SCMOVE "Change the window position"
+ ATL_IDS_SCMINIMIZE "Reduce the window to an icon"
+ ATL_IDS_SCMAXIMIZE "Enlarge the window to full size"
+ ATL_IDS_SCNEXTWINDOW "Switch to the next document window"
+ ATL_IDS_SCPREVWINDOW "Switch to the previous document window"
+ ATL_IDS_SCCLOSE "Close the active window and prompts to save the documents"
+END
+
+STRINGTABLE
+BEGIN
+ ATL_IDS_SCRESTORE "Restore the window to normal size"
+ ATL_IDS_SCTASKLIST "Activate Task List"
+ ATL_IDS_MDICHILD "Activate this window"
+END
+
+STRINGTABLE
+BEGIN
+ ATL_IDS_IDLEMESSAGE "Ready"
+END
+
+STRINGTABLE
+BEGIN
+ ATL_IDS_MRU_FILE "Open this document"
+END
+
+STRINGTABLE
+BEGIN
+ ID_PLAY_GOTO_FRAME "Goto a specified frame in the movie."
+ ID_PLAY_GOTO_START "Goto to start of movie."
+ ID_PLAY_GOTO_END "Goto end of movie minus 30 seconds."
+ ID_OPTIONS_EXIT "Exit player at end of movie."
+END
+
+STRINGTABLE
+BEGIN
+ ID_OPTIONS_OPENMP "Enable OpenMP for YUV"
+ ID_OPTIONS_SWSCALER "Use SWScaler YUV conversion"
+ ID_OPTIONS_DRAW "Enable/Disable Draws"
+ ID_OPTIONS_AUDIO "Enable/Disable Audio"
+ ID_OPTIONS_DUMPYUVFILE "Dump YUV frames to a file"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/media/player/props.h b/media/player/props.h
index ad13998..6545343 100644
--- a/media/player/props.h
+++ b/media/player/props.h
@@ -120,6 +120,16 @@ class CPageOne : public CPropertyPageImpl<CPageOne> {
wchar_t szBuff[100];
wsprintf(szBuff, L"%i KB", nSizeK);
SetDlgItemText(IDC_FILESIZE, szBuff);
+
+ // TODO(fbarchard): We need a pipeline property for frame rate.
+ float duration = media::Movie::get()->GetDuration();
+ float fps = 29.97f;
+ wsprintf(szBuff, L"%i.%2i Seconds, %i Frames",
+ static_cast<int>(duration),
+ static_cast<int>(duration * 100) % 100,
+ static_cast<int>(duration * fps));
+ SetDlgItemText(IDC_FILEDURATION, szBuff);
+
SYSTEMTIME st;
::FileTimeToSystemTime(&find_data.ftCreationTime, &st);
::GetDateFormat(LOCALE_USER_DEFAULT, 0, &st,
diff --git a/media/player/resource.h b/media/player/resource.h
index c0f6186..fd47fe4 100644
--- a/media/player/resource.h
+++ b/media/player/resource.h
@@ -1,66 +1,80 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by player_wtl.rc
-//
-#define IDD_ABOUTBOX 100
-#define IDR_MAINFRAME 128
-#define IDR_MAINFRAME2 128
-#define IDR_MAINFRAME3 128
-#define IDR_MAINFRAME4 128
-#define IDR_CONTEXTMENU 201
-#define IDD_PROP_PAGE1 202
-#define IDD_PROP_PAGE2 203
-#define IDD_PROP_PAGE3 204
-#define IDC_TYPE 1001
-#define IDC_WIDTH 1002
-#define IDC_HEIGHT 1003
-#define IDC_HORRES 1004
-#define IDC_VERTRES 1005
-#define IDC_BITDEPTH 1006
-#define IDC_COMPRESSION 1008
-#define IDC_FILELOCATION 1009
-#define IDC_FILESIZE 1010
-#define IDC_FILEDATE 1011
-#define IDC_FILEATTRIB 1012
-#define ID_RECENT_BTN 32777
-#define ID_VIEW_PROPERTIES 32778
-#define ID_VIEW_MEDIADETAILS 32780
-#define ID_PLAY_PLAY 32781
-#define ID_PLAY_PLAY_PAUSE 32782
-#define ID_OPTIONS_MMX 32789
-#define ID_OPTIONS_OPENMP 32790
-#define ID_OPTIONS_SWSCALER 32791
-#define ID_OPTIONS_DRAW 32792
-#define ID_OPTIONS_AUDIO 32793
-#define ID_OPTIONS_DUMPYUVFILE 32794
-#define ID_Menu 32795
-#define ID_VIEW_QUARTERSIZE 32815
-#define ID_VIEW_HALFSIZE 32816
-#define ID_VIEW_NORMALSIZE 32817
-#define ID_VIEW_DOUBLESIZE 32818
-#define ID_VIEW_TRIPLESIZE 32819
-#define ID_VIEW_QUADRUPLESIZE 32820
-#define ID_VIEW_FITTOSCREEN 32821
-#define ID_VIEW_FULLSCREEN 32822
-#define ID_PLAY_HALFSPEED 32801
-#define ID_PLAY_NORMALSPEED 32802
-#define ID_PLAY_DOUBLESPEED 32803
-#define ID_FILE_LAST 32804
-#define ID_Menu32806 32806
-#define ID_VIEW_ROTATE0 32807
-#define ID_VIEW_ROTATE90 32808
-#define ID_VIEW_ROTATE180 32809
-#define ID_VIEW_ROTATE270 32810
-#define ID_VIEW_MIRROR_HORIZONTAL 32811
-#define ID_VIEW_MIRROR_VERTICAL 32812
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 203
-#define _APS_NEXT_COMMAND_VALUE 32823
-#define _APS_NEXT_CONTROL_VALUE 1013
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by player_wtl.rc
+//
+#define IDD_ABOUTBOX 100
+#define IDR_MAINFRAME 128
+#define IDR_MAINFRAME2 128
+#define IDR_MAINFRAME3 128
+#define IDR_MAINFRAME4 128
+#define IDR_CONTEXTMENU 201
+#define IDD_PROP_PAGE1 202
+#define IDD_PROP_PAGE2 203
+#define IDD_PROP_PAGE3 204
+#define IDD_SEEK 205
+#define IDC_TYPE 1001
+#define IDC_WIDTH 1002
+#define IDC_HEIGHT 1003
+#define IDC_HORRES 1004
+#define IDC_VERTRES 1005
+#define IDC_BITDEPTH 1006
+#define IDC_COMPRESSION 1008
+#define IDC_FILELOCATION 1009
+#define IDC_FILESIZE 1010
+#define IDC_FILEDATE 1011
+#define IDC_FILEATTRIB 1012
+#define IDC_FILEDURATION 1013
+#define IDC_SEEKSLIDER 1013
+#define IDC_SEEKLOCATION 1014
+#define ID_RECENT_BTN 32777
+#define ID_VIEW_PROPERTIES 32778
+#define ID_VIEW_MEDIADETAILS 32780
+#define ID_PLAY_PLAY 32781
+#define ID_PLAY_PLAY_PAUSE 32782
+#define ID_OPTIONS_EXIT 32840
+#define ID_OPTIONS_OPENMP 32790
+#define ID_OPTIONS_SWSCALER 32791
+#define ID_OPTIONS_DRAW 32792
+#define ID_OPTIONS_AUDIO 32793
+#define ID_OPTIONS_DUMPYUVFILE 32794
+#define ID_Menu 32795
+#define ID_FILE_LAST 32804
+#define ID_Menu32806 32806
+#define ID_VIEW_ROTATE0 32807
+#define ID_VIEW_ROTATE90 32808
+#define ID_VIEW_ROTATE180 32809
+#define ID_VIEW_ROTATE270 32810
+#define ID_VIEW_MIRROR_HORIZONTAL 32811
+#define ID_VIEW_MIRROR_VERTICAL 32812
+#define ID_VIEW_QUARTERSIZE 32815
+#define ID_VIEW_HALFSIZE 32816
+#define ID_VIEW_NORMALSIZE 32817
+#define ID_VIEW_DOUBLESIZE 32818
+#define ID_VIEW_TRIPLESIZE 32819
+#define ID_VIEW_QUADRUPLESIZE 32820
+#define ID_VIEW_FITTOSCREEN 32821
+#define ID_VIEW_FULLSCREEN 32822
+#define ID_PLAY_HALFSPEED 32823
+#define ID_PLAY_NORMALSPEED 32824
+#define ID_PLAY_DOUBLESPEED 32825
+#define ID_PLAY_TRIPLESPEED 32826
+#define ID_PLAY_QUADRUPLESPEED 32827
+#define ID_PLAY_EIGHTSPEED 32828
+#define ID_PLAY_SIXTEENSPEED 32829
+#define ID_PLAY_STEP_FORWARD 32830
+#define ID_PLAY_STEP_BACKWARD 32831
+#define ID_PLAY_GOTO_FRAME 32836
+#define ID_PLAY_GOTO_START 32838
+#define ID_PLAY_GOTO_END 32839
+
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 206
+#define _APS_NEXT_COMMAND_VALUE 32842
+#define _APS_NEXT_CONTROL_VALUE 1014
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/media/player/seek.h b/media/player/seek.h
new file mode 100644
index 0000000..1899ce0
--- /dev/null
+++ b/media/player/seek.h
@@ -0,0 +1,98 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+// seek.h : movie seek dialog
+
+#ifndef MEDIA_PLAYER_SEEK_H_
+#define MEDIA_PLAYER_SEEK_H_
+
+// TODO(fbachard): Frame properties only work for images, so
+// this tab is removed until movie frame properties can be added.
+class CSeek : public CSimpleDialog<IDD_SEEK>,
+ public CMessageFilter,
+ public CIdleHandler {
+ public:
+
+ CSeek() {
+ }
+
+ virtual BOOL PreTranslateMessage(MSG* pMsg) {
+ return FALSE;
+ }
+
+ BEGIN_MSG_MAP(CSeek)
+ MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
+ MESSAGE_HANDLER(WM_PAINT, OnPaint)
+ MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
+ CHAIN_MSG_MAP(CSimpleDialog<IDD_SEEK>)
+ END_MSG_MAP()
+
+ LRESULT OnPaint(UINT /*uMsg*/,
+ WPARAM /*wParam*/,
+ LPARAM /*lParam*/,
+ BOOL& bHandled) {
+ static float previous_position = -1.0f;
+
+ float position = media::Movie::get()->GetPosition();
+ if (static_cast<int>(position * 10) !=
+ static_cast<int>(previous_position * 10)) {
+ previous_position = position;
+ wchar_t szBuff[200];
+ float duration = media::Movie::get()->GetDuration();
+ float fps = 29.97f;
+ wsprintf(szBuff, L"%i.%i / %i.%i, %i / %i",
+ static_cast<int>(position),
+ static_cast<int>(position * 10) % 10,
+ static_cast<int>(duration),
+ static_cast<int>(duration * 10) % 10,
+ static_cast<int>(position * fps),
+ static_cast<int>(duration * fps));
+ SetDlgItemText(IDC_SEEKLOCATION, szBuff);
+ bHandled = TRUE;
+ return FALSE;
+ }
+ bHandled = FALSE;
+ return FALSE;
+ }
+
+ virtual BOOL OnIdle() {
+ wchar_t szBuff[200];
+ float position = media::Movie::get()->GetPosition();
+ float duration = media::Movie::get()->GetDuration();
+ // TODO(fbarchard): Use frame rate property when it exists.
+ float fps = 29.97f;
+ wsprintf(szBuff, L"%i.%i / %i.%i, %i / %i",
+ static_cast<int>(position),
+ static_cast<int>(position * 10) % 10,
+ static_cast<int>(duration),
+ static_cast<int>(duration * 10) % 10,
+ static_cast<int>(position * fps),
+ static_cast<int>(duration * fps));
+ SetDlgItemText(IDC_SEEKLOCATION, szBuff);
+ return FALSE;
+ }
+
+ LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/,
+ BOOL& /*bHandled*/) {
+ CMessageLoop* pLoop = g_module.GetMessageLoop();
+ ATLASSERT(pLoop != NULL);
+ pLoop->AddMessageFilter(this);
+ pLoop->AddIdleHandler(this);
+ return TRUE;
+ }
+
+ LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/,
+ BOOL& bHandled) {
+ // unregister message filtering and idle updates
+ CMessageLoop* pLoop = g_module.GetMessageLoop();
+ ATLASSERT(pLoop != NULL);
+ pLoop->RemoveMessageFilter(this);
+ pLoop->RemoveIdleHandler(this);
+ bHandled = FALSE;
+ return 1;
+ }
+};
+
+#endif // MEDIA_PLAYER_SEEK_H_
+