| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_TOOLS_PLAYER_WTL_SEEK_H_ | 5 #ifndef MEDIA_TOOLS_PLAYER_WTL_SEEK_H_ |
| 6 #define MEDIA_TOOLS_PLAYER_WTL_SEEK_H_ | 6 #define MEDIA_TOOLS_PLAYER_WTL_SEEK_H_ |
| 7 | 7 |
| 8 #include "media/tools/player_wtl/player_wtl.h" | 8 #include "media/tools/player_wtl/player_wtl.h" |
| 9 | 9 |
| 10 // Movie seek dialog. | 10 // Movie seek dialog. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) | 27 MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) |
| 28 CHAIN_MSG_MAP(CSimpleDialog<IDD_SEEK>) | 28 CHAIN_MSG_MAP(CSimpleDialog<IDD_SEEK>) |
| 29 END_MSG_MAP() | 29 END_MSG_MAP() |
| 30 | 30 |
| 31 LRESULT OnPaint(UINT /*uMsg*/, | 31 LRESULT OnPaint(UINT /*uMsg*/, |
| 32 WPARAM /*wParam*/, | 32 WPARAM /*wParam*/, |
| 33 LPARAM /*lParam*/, | 33 LPARAM /*lParam*/, |
| 34 BOOL& bHandled) { | 34 BOOL& bHandled) { |
| 35 static float previous_position = -1.0f; | 35 static float previous_position = -1.0f; |
| 36 | 36 |
| 37 float position = media::Movie::get()->GetPosition(); | 37 float position = media::Movie::GetInstance()->GetPosition(); |
| 38 if (static_cast<int>(position * 10) != | 38 if (static_cast<int>(position * 10) != |
| 39 static_cast<int>(previous_position * 10)) { | 39 static_cast<int>(previous_position * 10)) { |
| 40 previous_position = position; | 40 previous_position = position; |
| 41 wchar_t szBuff[200]; | 41 wchar_t szBuff[200]; |
| 42 float duration = media::Movie::get()->GetDuration(); | 42 float duration = media::Movie::GetInstance()->GetDuration(); |
| 43 float fps = 29.97f; | 43 float fps = 29.97f; |
| 44 wsprintf(szBuff, L"%i.%i / %i.%i, %i / %i", | 44 wsprintf(szBuff, L"%i.%i / %i.%i, %i / %i", |
| 45 static_cast<int>(position), | 45 static_cast<int>(position), |
| 46 static_cast<int>(position * 10) % 10, | 46 static_cast<int>(position * 10) % 10, |
| 47 static_cast<int>(duration), | 47 static_cast<int>(duration), |
| 48 static_cast<int>(duration * 10) % 10, | 48 static_cast<int>(duration * 10) % 10, |
| 49 static_cast<int>(position * fps), | 49 static_cast<int>(position * fps), |
| 50 static_cast<int>(duration * fps)); | 50 static_cast<int>(duration * fps)); |
| 51 SetDlgItemText(IDC_SEEKLOCATION, szBuff); | 51 SetDlgItemText(IDC_SEEKLOCATION, szBuff); |
| 52 bHandled = TRUE; | 52 bHandled = TRUE; |
| 53 return FALSE; | 53 return FALSE; |
| 54 } | 54 } |
| 55 bHandled = FALSE; | 55 bHandled = FALSE; |
| 56 return FALSE; | 56 return FALSE; |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual BOOL OnIdle() { | 59 virtual BOOL OnIdle() { |
| 60 wchar_t szBuff[200]; | 60 wchar_t szBuff[200]; |
| 61 float position = media::Movie::get()->GetPosition(); | 61 float position = media::Movie::GetInstance()->GetPosition(); |
| 62 float duration = media::Movie::get()->GetDuration(); | 62 float duration = media::Movie::GetInstance()->GetDuration(); |
| 63 // TODO(fbarchard): Use frame rate property when it exists. | 63 // TODO(fbarchard): Use frame rate property when it exists. |
| 64 float fps = 29.97f; | 64 float fps = 29.97f; |
| 65 wsprintf(szBuff, L"%i.%i / %i.%i, %i / %i", | 65 wsprintf(szBuff, L"%i.%i / %i.%i, %i / %i", |
| 66 static_cast<int>(position), | 66 static_cast<int>(position), |
| 67 static_cast<int>(position * 10) % 10, | 67 static_cast<int>(position * 10) % 10, |
| 68 static_cast<int>(duration), | 68 static_cast<int>(duration), |
| 69 static_cast<int>(duration * 10) % 10, | 69 static_cast<int>(duration * 10) % 10, |
| 70 static_cast<int>(position * fps), | 70 static_cast<int>(position * fps), |
| 71 static_cast<int>(duration * fps)); | 71 static_cast<int>(duration * fps)); |
| 72 SetDlgItemText(IDC_SEEKLOCATION, szBuff); | 72 SetDlgItemText(IDC_SEEKLOCATION, szBuff); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 88 CMessageLoop* pLoop = g_module.GetMessageLoop(); | 88 CMessageLoop* pLoop = g_module.GetMessageLoop(); |
| 89 ATLASSERT(pLoop != NULL); | 89 ATLASSERT(pLoop != NULL); |
| 90 pLoop->RemoveMessageFilter(this); | 90 pLoop->RemoveMessageFilter(this); |
| 91 pLoop->RemoveIdleHandler(this); | 91 pLoop->RemoveIdleHandler(this); |
| 92 bHandled = FALSE; | 92 bHandled = FALSE; |
| 93 return 1; | 93 return 1; |
| 94 } | 94 } |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 #endif // MEDIA_TOOLS_PLAYER_WTL_SEEK_H_ | 97 #endif // MEDIA_TOOLS_PLAYER_WTL_SEEK_H_ |
| OLD | NEW |