Commit 583e3215 authored by Geoffroy Couprie's avatar Geoffroy Couprie
Browse files

Win32: add support for play and pause buttons in media keys (different from a...

Win32: add support for play and pause buttons in media keys (different from a plya/pause unique button
parent 82a0f299
......@@ -1058,6 +1058,28 @@ void MainInputManager::togglePlayPause()
getIM()->togglePlayPause();
}
void MainInputManager::play()
{
/* No input, play */
if( !p_input )
playlist_Play( THEPL );
else
{
if( PLAYING_S != var_GetInteger( p_input, "state" ) )
{
getIM()->togglePlayPause();
}
}
}
void MainInputManager::pause()
{
if(p_input && PLAYING_S == var_GetInteger( p_input, "state" ) )
{
getIM()->togglePlayPause();
}
}
void MainInputManager::toggleRandom()
{
var_ToggleBool( THEPL, "random" );
......
......@@ -268,6 +268,8 @@ private:
void notifyRepeatLoop();
public slots:
void togglePlayPause();
void play();
void pause();
void toggleRandom();
void stop();
void next();
......
......@@ -587,7 +587,8 @@ void MainInterface::createTaskBarButtons()
CONNECT( this, playPauseSignal(), THEMIM, togglePlayPause() );
CONNECT( this, prevSignal(), THEMIM, prev() );
CONNECT( this, nextSignal(), THEMIM, next() );
CONNECT( this, play(), ActionsManager::getInstance( p_intf ), play() );
CONNECT( this, play(), THEMIM, play() );
CONNECT( this, pause(), THEMIM, pause() );
CONNECT( this, mute(), ActionsManager::getInstance( p_intf ), toggleMuteAudio() );
CONNECT( this, volumeUp(), ActionsManager::getInstance( p_intf ), AudioUp() );
CONNECT( this, volumeDown(), ActionsManager::getInstance( p_intf ), AudioDown() );
......@@ -630,7 +631,6 @@ bool MainInterface::winEvent ( MSG * msg, long * result )
break;
case WM_APPCOMMAND:
cmd = GET_APPCOMMAND_LPARAM(msg->lParam);
msg_Err( p_intf, "button pressed = %d", cmd);
switch(cmd)
{
case APPCOMMAND_MEDIA_PLAY_PAUSE:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment