6 enum {
IDD = IDD_PLAYBACK_STATE};
66 SetDlgItemText(IDC_PATTERN, _T(
"%codec% | %bitrate% kbps | %samplerate% Hz | %channels% | %playback_time%[ / %length%]$if(%ispaused%, | paused,)"));
80 }
else if (m_playback_control->is_playing()) {
91 if (wnd == GetDlgItem(IDC_CONTEXTMENU)) {
94 if (point == CPoint(-1, -1)) {
96 WIN32_OP(wnd.GetWindowRect(&rc));
97 point = rc.CenterPoint();
104 if (m_playback_control->get_now_playing(item)) items += item;
111 WIN32_OP(menu.CreatePopupMenu());
116 menu.AppendMenu(MF_STRING, ID_TESTCMD, _T(
"Test command"));
117 menudesc.
Set(ID_TESTCMD,
"This is a test command.");
118 menu.AppendMenu(MF_SEPARATOR);
121 api->init_context(items, 0);
122 api->win32_build_menu(menu, ID_CM_BASE, ~0);
125 menu.AppendMenu(MF_STRING|MF_GRAYED|MF_DISABLED, (UINT)0, _T(
"No items selected"));
128 int cmd = menu.TrackPopupMenu(TPM_RIGHTBUTTON|TPM_NONOTIFY|TPM_RETURNCMD,point.x,point.y,menudesc,0);
130 if (cmd >= ID_CM_BASE) {
131 api->execute_by_id(cmd - ID_CM_BASE);
t_interface * get_ptr() const
void OnPauseClicked(UINT, int, CWindow)
void on_playback_dynamic_info_track(const file_info &p_info)
Per-track dynamic info (stream track titles etc) change. Happens less often than on_playback_dynamic_...
BOOL SHARED_EXPORT uSetDlgItemText(HWND wnd, UINT id, const char *p_text)
OnPatternChange BN_CLICKED
void OnPrevClicked(UINT, int, CWindow)
void on_playback_edited(metadb_handle_ptr p_track)
Called when currently played file gets edited.
void on_playback_dynamic_info(const file_info &p_info)
Dynamic info (VBR bitrate etc) change.
void OnStopClicked(UINT, int, CWindow)
typedef BOOL(WINAPI *pPowerSetRequest_t)(__in HANDLE PowerRequest
static_api_ptr_t< playback_control > m_playback_control
BOOL SHARED_EXPORT uGetDlgItemText(HWND wnd, UINT id, pfc::string_base &out)
OnPatternChange COMMAND_HANDLER_EX(IDCANCEL, BN_CLICKED, OnCancel) COMMAND_HANDLER_EX(IDC_PLAY
Plays the next track from the current playlist according to the current playback order.
display_level_titles + timing + VBR bitrate display etc
void on_playback_time(double p_time)
Called every second, for time display.
void RunPlaybackStateDemo()
void complain(const char *what, const char *msg)
static BOOL ShowWindowCentered(CWindow wnd, CWindow wndParent)
Provides control for various playback-related operations. All methods provided by this interface work...
Main interface class for information about some playable object.
void on_playback_pause(bool p_state)
Called on pause/unpause.
void on_volume_change(float p_new_val)
User changed volume settings. Possibly called when not playing.
string8_fastalloc string_formatter
void on_playback_new_track(metadb_handle_ptr p_track)
Playback advanced to new track.
void OnCancel(UINT, int, CWindow)
BOOL OnInitDialog(CWindow, LPARAM)
void on_playback_seek(double p_time)
User has seeked to specific time.
void OnRandClicked(UINT, int, CWindow)
void on_playback_stop(play_control::t_stop_reason p_reason)
Playback stopped.
void OnPlayClicked(UINT, int, CWindow)
HWND get_main_window()
Retrieves main app window. WARNING: this is provided for parent of dialog windows and such only; usin...
void OnNextClicked(UINT, int, CWindow)
void OnPatternChange(UINT, int, CWindow)
void OnContextMenu(CWindow wnd, CPoint point)
BEGIN_MSG_MAP(CPlaybackStateDemo) MSG_WM_INITDIALOG(OnInitDialog) COMMAND_HANDLER_EX(IDC_PATTERN
Plays a random track from the current playlist.
titleformat_object::ptr m_script
void on_playback_starting(play_control::t_track_command p_command, bool p_paused)
Playback process is being initialized. on_playback_new_track() should be called soon after this when ...
Plays the previous track from the current playlist according to the current playback order...