From: Olivier Teulière Date: Sun, 15 Feb 2004 18:58:38 +0000 (+0000) Subject: * modules/gui/skins/*: X-Git-Tag: 0.7.1~131 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5b34ebd8f322f8a81ebdc1efefbf28df4b5ba0a4;p=vlc * modules/gui/skins/*: Added 'slow' and 'fast' events to play a stream slower/faster --- diff --git a/doc/skins/events-howto.txt b/doc/skins/events-howto.txt index afe464e7d9..52f2c1c3c7 100644 --- a/doc/skins/events-howto.txt +++ b/doc/skins/events-howto.txt @@ -100,6 +100,14 @@ EVENT is the action to execute, it can be one of the following: Action : go to the previous file in the playlist. Parameters: none. + - VLC_SLOWER: + Action : play the stream slower. + Parameters: none. + + - VLC_FASTER: + Action : play the stream faster. + Parameters: none. + - VLC_STREAMPOS: Not supported yet. @@ -196,6 +204,8 @@ shortcut. stop V Stop. next B Next file. prev Z Previous file. + slow Play slower. + fast Play faster. fullscreen F Switch to fullscreen mode. mute Mute the sound. volume_up diff --git a/modules/gui/skins/src/banks.cpp b/modules/gui/skins/src/banks.cpp index 59815c6b55..a8fbee7988 100644 --- a/modules/gui/skins/src/banks.cpp +++ b/modules/gui/skins/src/banks.cpp @@ -2,7 +2,7 @@ * banks.cpp: Bitmap bank, Event bank, Font bank and OffSet bank ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: banks.cpp,v 1.11 2003/10/17 20:21:59 ipkiss Exp $ + * $Id: banks.cpp,v 1.12 2004/02/15 18:58:38 ipkiss Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -164,6 +164,8 @@ EventBank::EventBank( intf_thread_t *_p_intf ) Add( "stop", "VLC_STOP", "V" ); Add( "next", "VLC_NEXT", "B" ); Add( "prev", "VLC_PREV", "Z" ); + Add( "slow", "VLC_SLOWER", "none" ); + Add( "fast", "VLC_FASTER", "none" ); Add( "fullscreen", "VLC_FULLSCREEN", "F" ); // Volume control diff --git a/modules/gui/skins/src/event.cpp b/modules/gui/skins/src/event.cpp index 47edde295d..f770bf19bc 100644 --- a/modules/gui/skins/src/event.cpp +++ b/modules/gui/skins/src/event.cpp @@ -2,7 +2,7 @@ * event.cpp: Event class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: event.cpp,v 1.23 2003/10/17 18:17:28 ipkiss Exp $ + * $Id: event.cpp,v 1.24 2004/02/15 18:58:38 ipkiss Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -146,6 +146,10 @@ unsigned int Event::GetMessageType( string Desc ) return VLC_STREAM_TITLE; else if( Desc == "VLC_HELP_TEXT" ) return VLC_HELP_TEXT; + else if( Desc == "VLC_SLOWER" ) + return VLC_SLOWER; + else if( Desc == "VLC_FASTER" ) + return VLC_FASTER; // Volume control else if( Desc == "VLC_VOLUME_CHANGE" ) diff --git a/modules/gui/skins/src/event.h b/modules/gui/skins/src/event.h index db506cda1e..d948df25b2 100644 --- a/modules/gui/skins/src/event.h +++ b/modules/gui/skins/src/event.h @@ -2,7 +2,7 @@ * event.h: Event class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: event.h,v 1.15 2003/10/17 18:17:28 ipkiss Exp $ + * $Id: event.h,v 1.16 2004/02/15 18:58:38 ipkiss Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -84,6 +84,8 @@ using namespace std; #define VLC_STREAM_NAME (VLC_MESSAGE + 109) #define VLC_STREAM_TITLE (VLC_MESSAGE + 110) #define VLC_HELP_TEXT (VLC_MESSAGE + 111) +#define VLC_SLOWER (VLC_MESSAGE + 112) +#define VLC_FASTER (VLC_MESSAGE + 113) // Volume control #define VLC_VOLUME_CHANGE (VLC_MESSAGE + 201) diff --git a/modules/gui/skins/src/vlcproc.cpp b/modules/gui/skins/src/vlcproc.cpp index fc26a54632..3adfc347d7 100644 --- a/modules/gui/skins/src/vlcproc.cpp +++ b/modules/gui/skins/src/vlcproc.cpp @@ -2,7 +2,7 @@ * vlcproc.cpp: VlcProc class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: vlcproc.cpp,v 1.53 2004/01/05 13:07:03 zorglub Exp $ + * $Id: vlcproc.cpp,v 1.54 2004/02/15 18:58:38 ipkiss Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -52,7 +52,7 @@ VlcProc::VlcProc( intf_thread_t *_p_intf ) VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if( p_playlist != NULL ) { - // We want to be notified of playlit changes + // We want to be notified of playlist changes var_AddCallback( p_playlist, "intf-change", RefreshCallback, this ); // Raise/lower interface with middle click on vout @@ -162,6 +162,14 @@ bool VlcProc::EventProc( Event *evt ) PrevStream(); return true; + case VLC_SLOWER: + SlowStream(); + return true; + + case VLC_FASTER: + FastStream(); + return true; + case VLC_PLAYLIST_ADD_FILE: p_intf->p_sys->p_dialogs->ShowOpen( false ); InterfaceRefresh(); @@ -532,6 +540,34 @@ void VlcProc::PrevStream() InterfaceRefresh(); } //--------------------------------------------------------------------------- +void VlcProc::SlowStream() +{ + input_thread_t *p_input = + (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT, + FIND_ANYWHERE ); + if( p_input ) + { + vlc_value_t val; val.b_bool = VLC_TRUE; + + var_Set( p_input, "rate-slower", val ); + vlc_object_release( p_input ); + } +} +//--------------------------------------------------------------------------- +void VlcProc::FastStream() +{ + input_thread_t *p_input = + (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT, + FIND_ANYWHERE ); + if( p_input ) + { + vlc_value_t val; val.b_bool = VLC_TRUE; + + var_Set( p_input, "rate-faster", val ); + vlc_object_release( p_input ); + } +} +//--------------------------------------------------------------------------- void VlcProc::MoveStream( long Pos ) { if( p_intf->p_sys->p_input == NULL ) diff --git a/modules/gui/skins/src/vlcproc.h b/modules/gui/skins/src/vlcproc.h index 558d3983a1..898baa621e 100644 --- a/modules/gui/skins/src/vlcproc.h +++ b/modules/gui/skins/src/vlcproc.h @@ -2,7 +2,7 @@ * vlcproc.h: VlcProc class ***************************************************************************** * Copyright (C) 2003 VideoLAN - * $Id: vlcproc.h,v 1.11 2003/10/22 19:12:56 ipkiss Exp $ + * $Id: vlcproc.h,v 1.12 2004/02/15 18:58:38 ipkiss Exp $ * * Authors: Olivier Teulière * Emmanuel Puig @@ -47,6 +47,8 @@ class VlcProc void StopStream(); void NextStream(); void PrevStream(); + void SlowStream(); + void FastStream(); void MoveStream( long Pos ); void FullScreen(); void ChangeVolume( unsigned int msg, long param );