diff options
-rw-r--r-- | include/vcl/cmdevt.hxx | 53 | ||||
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 22 | ||||
-rw-r--r-- | vcl/osx/salinst.cxx | 22 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 36 |
5 files changed, 69 insertions, 66 deletions
diff --git a/include/vcl/cmdevt.hxx b/include/vcl/cmdevt.hxx index fd308eb829ed..32164687a95d 100644 --- a/include/vcl/cmdevt.hxx +++ b/include/vcl/cmdevt.hxx @@ -274,40 +274,43 @@ public: }; // Media Commands -#define MEDIA_COMMAND_CHANNEL_DOWN ((sal_Int16)1) // Decrement the channel value, for example, for a TV or radio tuner. -#define MEDIA_COMMAND_CHANNEL_UP ((sal_Int16)2) // Increment the channel value, for example, for a TV or radio tuner. -#define MEDIA_COMMAND_NEXTTRACK ((sal_Int16)3) // Go to next media track/slide. -#define MEDIA_COMMAND_PAUSE ((sal_Int16)4) // Pause. If already paused, take no further action. This is a direct PAUSE command that has no state. -#define MEDIA_COMMAND_PLAY ((sal_Int16)5) // Begin playing at the current position. If already paused, it will resume. This is a direct PLAY command that has no state. -#define MEDIA_COMMAND_PLAY_PAUSE ((sal_Int16)6) // Play or pause playback. -#define MEDIA_COMMAND_PREVIOUSTRACK ((sal_Int16)7) // Go to previous media track/slide. -#define MEDIA_COMMAND_RECORD ((sal_Int16)8) // Begin recording the current stream. -#define MEDIA_COMMAND_REWIND ((sal_Int16)9)// Go backward in a stream at a higher rate of speed. -#define MEDIA_COMMAND_STOP ((sal_Int16)10)// Stop playback. -#define MEDIA_COMMAND_MIC_ON_OFF_TOGGLE ((sal_Int16)11)// Toggle the microphone. -#define MEDIA_COMMAND_MICROPHONE_VOLUME_DOWN ((sal_Int16)12)// Increase microphone volume. -#define MEDIA_COMMAND_MICROPHONE_VOLUME_MUTE ((sal_Int16)13)// Mute the microphone. -#define MEDIA_COMMAND_MICROPHONE_VOLUME_UP ((sal_Int16)14)// Decrease microphone volume. -#define MEDIA_COMMAND_VOLUME_DOWN ((sal_Int16)15)// Lower the volume. -#define MEDIA_COMMAND_VOLUME_MUTE ((sal_Int16)16)// Mute the volume. -#define MEDIA_COMMAND_VOLUME_UP ((sal_Int16)17)// Raise the volume. -#define MEDIA_COMMAND_MENU ((sal_Int16)18)// Button Menu pressed. -#define MEDIA_COMMAND_MENU_HOLD ((sal_Int16)19)// Button Menu (long) pressed. -#define MEDIA_COMMAND_PLAY_HOLD ((sal_Int16)20)// Button Play (long) pressed. -#define MEDIA_COMMAND_NEXTTRACK_HOLD ((sal_Int16)21)// Button Right holding pressed. -#define MEDIA_COMMAND_PREVIOUSTRACK_HOLD ((sal_Int16)22)// Button Left holding pressed. +enum class MediaCommand +{ + ChannelDown = 1, // Decrement the channel value, for example, for a TV or radio tuner. + ChannelUp = 2, // Increment the channel value, for example, for a TV or radio tuner. + NextTrack = 3, // Go to next media track/slide. + Pause = 4, // Pause. If already paused, take no further action. This is a direct PAUSE command that has no state. + Play = 5, // Begin playing at the current position. If already paused, it will resume. This is a direct PLAY command that has no state. + PlayPause = 6, // Play or pause playback. + PreviousTrack = 7, // Go to previous media track/slide. + Record = 8, // Begin recording the current stream. + Rewind = 9,// Go backward in a stream at a higher rate of speed. + Stop = 10,// Stop playback. + MicOnOffToggle = 11,// Toggle the microphone. + MicrophoneVolumeDown = 12,// Increase microphone volume. + MicrophoneVolumeMute = 13,// Mute the microphone. + MicrophoneVolumeUp = 14,// Decrease microphone volume. + VolumeDown = 15,// Lower the volume. + VolumeMute = 16,// Mute the volume. + VolumeUp = 17,// Raise the volume. + Menu = 18,// Button Menu pressed. + MenuHold = 19,// Button Menu (long) pressed. + PlayHold = 20,// Button Play (long) pressed. + NextTrackHold = 21,// Button Right holding pressed. + PreviousTrackHold = 22,// Button Left holding pressed. +}; class VCL_DLLPUBLIC CommandMediaData { - sal_Int16 m_nMediaId; + MediaCommand m_nMediaId; bool m_bPassThroughToOS; public: - CommandMediaData(sal_Int16 nMediaId) + CommandMediaData(MediaCommand nMediaId) : m_nMediaId(nMediaId) , m_bPassThroughToOS(true) { } - sal_Int16 GetMediaId() const { return m_nMediaId; } + MediaCommand GetMediaId() const { return m_nMediaId; } void SetPassThroughToOS(bool bPassThroughToOS) { m_bPassThroughToOS = bPassThroughToOS; } bool GetPassThroughToOS() const { return m_bPassThroughToOS; } }; diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index c7bebb074c29..2b9a522e03e4 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -428,7 +428,7 @@ IMPL_LINK( SdModule, EventListenerHdl, VclSimpleEvent*, pEvent ) pMediaData->SetPassThroughToOS(false); switch (pMediaData->GetMediaId()) { - case MEDIA_COMMAND_PLAY: + case MediaCommand::Play: { ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current()); if( pDocShell ) // Impress or Draw ? diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index f03a0e34fe32..4018cb143b3b 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2020,7 +2020,7 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent*, pEvent ) switch (pMediaData->GetMediaId()) { #if defined( MACOSX ) - case MEDIA_COMMAND_MENU: + case MediaCommand::Menu: if( !mnContextMenuEvent ) { if( mpShowWindow ) @@ -2028,42 +2028,42 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent*, pEvent ) mnContextMenuEvent = Application::PostUserEvent( LINK( this, SlideshowImpl, ContextMenuHdl ) ); } break; - case MEDIA_COMMAND_VOLUME_DOWN: + case MediaCommand::VolumeDown: gotoPreviousSlide(); break; - case MEDIA_COMMAND_VOLUME_UP: + case MediaCommand::VolumeUp: gotoNextEffect(); break; #endif - case MEDIA_COMMAND_NEXTTRACK: + case MediaCommand::NextTrack: gotoNextEffect(); break; - case MEDIA_COMMAND_PAUSE: + case MediaCommand::Pause: if( !mbIsPaused ) blankScreen(0); break; - case MEDIA_COMMAND_PLAY: + case MediaCommand::Play: if( mbIsPaused ) resume(); break; - case MEDIA_COMMAND_PLAY_PAUSE: + case MediaCommand::PlayPause: if( mbIsPaused ) resume(); else blankScreen(0); break; - case MEDIA_COMMAND_PREVIOUSTRACK: + case MediaCommand::PreviousTrack: gotoPreviousSlide(); break; - case MEDIA_COMMAND_NEXTTRACK_HOLD: + case MediaCommand::NextTrackHold: gotoLastSlide(); break; - case MEDIA_COMMAND_REWIND: + case MediaCommand::Rewind: gotoFirstSlide(); break; - case MEDIA_COMMAND_STOP: + case MediaCommand::Stop: // in case the user cancels the presentation, switch to current slide // in edit mode if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 433aa027f451..b33aaf6b858a 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -473,7 +473,7 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent ) #if !HAVE_FEATURE_MACOSX_SANDBOX case AppleRemoteControlEvent: // Defined in <apple_remote/RemoteMainController.h> { - sal_Int16 nCommand = 0; + MediaCommand nCommand; SalData* pSalData = GetSalData(); bool bIsFullScreenMode = false; @@ -488,27 +488,27 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent ) switch ([pEvent data1]) { case kRemoteButtonPlay: - nCommand = bIsFullScreenMode ? MEDIA_COMMAND_PLAY_PAUSE : MEDIA_COMMAND_PLAY; + nCommand = bIsFullScreenMode ? MediaCommand::PlayPause : MediaCommand::Play; break; // kept for experimentation purpose (scheduled for future implementation) - // case kRemoteButtonMenu: nCommand = MEDIA_COMMAND_MENU; break; + // case kRemoteButtonMenu: nCommand = MediaCommand::Menu; break; - case kRemoteButtonPlus: nCommand = MEDIA_COMMAND_VOLUME_UP; break; + case kRemoteButtonPlus: nCommand = MediaCommand::VolumeUp; break; - case kRemoteButtonMinus: nCommand = MEDIA_COMMAND_VOLUME_DOWN; break; + case kRemoteButtonMinus: nCommand = MediaCommand::VolumeDown; break; - case kRemoteButtonRight: nCommand = MEDIA_COMMAND_NEXTTRACK; break; + case kRemoteButtonRight: nCommand = MediaCommand::NextTrack; break; - case kRemoteButtonRight_Hold: nCommand = MEDIA_COMMAND_NEXTTRACK_HOLD; break; + case kRemoteButtonRight_Hold: nCommand = MediaCommand::NextTrackHold; break; - case kRemoteButtonLeft: nCommand = MEDIA_COMMAND_PREVIOUSTRACK; break; + case kRemoteButtonLeft: nCommand = MediaCommand::PreviousTrack; break; - case kRemoteButtonLeft_Hold: nCommand = MEDIA_COMMAND_REWIND; break; + case kRemoteButtonLeft_Hold: nCommand = MediaCommand::Rewind; break; - case kRemoteButtonPlay_Hold: nCommand = MEDIA_COMMAND_PLAY_HOLD; break; + case kRemoteButtonPlay_Hold: nCommand = MediaCommand::PlayHold; break; - case kRemoteButtonMenu_Hold: nCommand = MEDIA_COMMAND_STOP; break; + case kRemoteButtonMenu_Hold: nCommand = MediaCommand::Stop; break; // FIXME : not detected case kRemoteButtonPlus_Hold: diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index f689dcc7bd25..ff598c8cd430 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -5188,26 +5188,26 @@ static bool ImplHandleIMEEndComposition( HWND hWnd ) static boolean ImplHandleAppCommand( HWND hWnd, LPARAM lParam, LRESULT & nRet ) { - sal_Int16 nCommand = 0; + MediaCommand nCommand; switch( GET_APPCOMMAND_LPARAM(lParam) ) { - case APPCOMMAND_MEDIA_CHANNEL_DOWN: nCommand = MEDIA_COMMAND_CHANNEL_DOWN; break; - case APPCOMMAND_MEDIA_CHANNEL_UP: nCommand = MEDIA_COMMAND_CHANNEL_UP; break; - case APPCOMMAND_MEDIA_NEXTTRACK: nCommand = MEDIA_COMMAND_NEXTTRACK; break; - case APPCOMMAND_MEDIA_PAUSE: nCommand = MEDIA_COMMAND_PAUSE; break; - case APPCOMMAND_MEDIA_PLAY: nCommand = MEDIA_COMMAND_PLAY; break; - case APPCOMMAND_MEDIA_PLAY_PAUSE: nCommand = MEDIA_COMMAND_PLAY_PAUSE; break; - case APPCOMMAND_MEDIA_PREVIOUSTRACK: nCommand = MEDIA_COMMAND_PREVIOUSTRACK; break; - case APPCOMMAND_MEDIA_RECORD: nCommand = MEDIA_COMMAND_RECORD; break; - case APPCOMMAND_MEDIA_REWIND: nCommand = MEDIA_COMMAND_REWIND; break; - case APPCOMMAND_MEDIA_STOP: nCommand = MEDIA_COMMAND_STOP; break; - case APPCOMMAND_MIC_ON_OFF_TOGGLE: nCommand = MEDIA_COMMAND_MIC_ON_OFF_TOGGLE; break; - case APPCOMMAND_MICROPHONE_VOLUME_DOWN: nCommand = MEDIA_COMMAND_MICROPHONE_VOLUME_DOWN; break; - case APPCOMMAND_MICROPHONE_VOLUME_MUTE: nCommand = MEDIA_COMMAND_MICROPHONE_VOLUME_MUTE; break; - case APPCOMMAND_MICROPHONE_VOLUME_UP: nCommand = MEDIA_COMMAND_MICROPHONE_VOLUME_UP; break; - case APPCOMMAND_VOLUME_DOWN: nCommand = MEDIA_COMMAND_VOLUME_DOWN; break; - case APPCOMMAND_VOLUME_MUTE: nCommand = MEDIA_COMMAND_VOLUME_MUTE; break; - case APPCOMMAND_VOLUME_UP: nCommand = MEDIA_COMMAND_VOLUME_UP; break; + case APPCOMMAND_MEDIA_CHANNEL_DOWN: nCommand = MediaCommand::ChannelDown; break; + case APPCOMMAND_MEDIA_CHANNEL_UP: nCommand = MediaCommand::ChannelUp; break; + case APPCOMMAND_MEDIA_NEXTTRACK: nCommand = MediaCommand::NextTrack; break; + case APPCOMMAND_MEDIA_PAUSE: nCommand = MediaCommand::Pause; break; + case APPCOMMAND_MEDIA_PLAY: nCommand = MediaCommand::Play; break; + case APPCOMMAND_MEDIA_PLAY_PAUSE: nCommand = MediaCommand::PlayPause; break; + case APPCOMMAND_MEDIA_PREVIOUSTRACK: nCommand = MediaCommand::PreviousTrack; break; + case APPCOMMAND_MEDIA_RECORD: nCommand = MediaCommand::Record; break; + case APPCOMMAND_MEDIA_REWIND: nCommand = MediaCommand::Rewind; break; + case APPCOMMAND_MEDIA_STOP: nCommand = MediaCommand::Stop; break; + case APPCOMMAND_MIC_ON_OFF_TOGGLE: nCommand = MediaCommand::MicOnOffToggle; break; + case APPCOMMAND_MICROPHONE_VOLUME_DOWN: nCommand = MediaCommand::MicrophoneVolumeDown; break; + case APPCOMMAND_MICROPHONE_VOLUME_MUTE: nCommand = MediaCommand::MicrophoneVolumeMute; break; + case APPCOMMAND_MICROPHONE_VOLUME_UP: nCommand = MediaCommand::MicrophoneVolumeUp; break; + case APPCOMMAND_VOLUME_DOWN: nCommand = MediaCommand::VolumeDown; break; + case APPCOMMAND_VOLUME_MUTE: nCommand = MediaCommand::VolumeMute; break; + case APPCOMMAND_VOLUME_UP: nCommand = MediaCommand::VolumeUp; break; default: return false; } |