Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-0.8.git;a=commitdiff;h=3a6324949f6991208f5eb89d9793b8211f37cc7b

commit 3a6324949f6991208f5eb89d9793b8211f37cc7b
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date:   Sun Jun 8 17:05:23 2008 +0200

vlc-0.8.6-12kalgan3-i686
- display with wx28
- closes #2859

diff --git a/source/xmultimedia-extra/vlc/FrugalBuild 
b/source/xmultimedia-extra/vlc/FrugalBuild
index ac9de69..8126f64 100644
--- a/source/xmultimedia-extra/vlc/FrugalBuild
+++ b/source/xmultimedia-extra/vlc/FrugalBuild
@@ -5,7 +5,7 @@
pkgname=vlc
pkgver=0.8.6
pkgextraver=e
-pkgrel=12kalgan2
+pkgrel=12kalgan3
pkgdesc="The cross-platform media player and streaming server."
url="http://www.videolan.org/vlc/";
depends=('alsa-lib' 'dbus-glib>=0.71' 'hal>=0.5.7.1-3' 'libxml2' 'libdvdnav' 
'libmad' 'libmatroska' \
@@ -21,7 +21,8 @@ up2date="lynx -dump $url/download-sources.html|grep -m1 
'Latest VLC'|sed 's/.*(\
source=(http://download.videolan.org/pub/videolan/vlc/$pkgver$pkgextraver/$pkgname-$pkgver$pkgextraver.tar.bz2
 \
$pkgname-ffmpeg.diff $pkgname.desktop vlc-0.8.5-libintl.diff \
libdca.patch CVE-2008-1489.patch cinepak-mem-corruption-fixes.patch \
-       changeset_r8060b3457e20e6223b70927693f8da8f547b8fef.diff)
+       changeset_r8060b3457e20e6223b70927693f8da8f547b8fef.diff \
+       vlc-0.8.x-wx28-volume-backport.patch)
sha1sums=('6b981ddbe7f6b95cd566ee195b4445b5773c21bd' \
'888a02c9f81331fce1f6ee5f705ce68e5b486ffd' \
'0c58c35fe47c4d14cd4d4c8c505863dbfc93f5e0' \
@@ -29,7 +30,8 @@ sha1sums=('6b981ddbe7f6b95cd566ee195b4445b5773c21bd' \
'edc3a14dfd9b022dca7593e006c324fa5cc17e48' \
'3e794876f5e5a50d4eb8cb3ae1382524a60b37c4' \
'5cd2b133b73a44beb34600e48573c3f717bd4545' \
-          '5a618ca1340352598786273b6e886f3afab6aa0d')
+          '5a618ca1340352598786273b6e886f3afab6aa0d' \
+          'd039b606217ab166e4fa3e50d91a0285478dab24')

build()
{
diff --git a/source/xmultimedia-extra/vlc/vlc-0.8.x-wx28-volume-backport.patch 
b/source/xmultimedia-extra/vlc/vlc-0.8.x-wx28-volume-backport.patch
new file mode 100644
index 0000000..05d89e1
--- /dev/null
+++ b/source/xmultimedia-extra/vlc/vlc-0.8.x-wx28-volume-backport.patch
@@ -0,0 +1,286 @@
+diff -Naurp vlc-0.8.6h/modules/gui/wxwidgets/interface.cpp 
vlc-0.8.6h-fw-backport/modules/gui/wxwidgets/interface.cpp
+--- vlc-0.8.6h/modules/gui/wxwidgets/interface.cpp     2008-05-25 
20:28:57.000000000 +0200
++++ vlc-0.8.6h-fw-backport/modules/gui/wxwidgets/interface.cpp 2008-06-08 
15:55:02.000000000 +0200
+@@ -67,7 +67,7 @@
+ /*****************************************************************************
+  * Local prototypes
+  
*****************************************************************************/
+-static int InteractCallback( vlc_object_t *, const char *, vlc_value_t,
++ static int InteractCallback( vlc_object_t *, const char *, vlc_value_t,
+                              vlc_value_t, void *);
+
+ /*****************************************************************************
+@@ -93,33 +93,6 @@ private:
+
+ };
+
+-class wxVolCtrl;
+-class VLCVolCtrl : public wxControl
+-{
+-public:
+-    VLCVolCtrl( intf_thread_t *p_intf, wxWindow *p_parent );
+-    virtual ~VLCVolCtrl() {};
+-
+-    virtual void OnPaint( wxPaintEvent &event );
+-    void OnChange( wxMouseEvent& event );
+-    void UpdateVolume();
+-
+-  private:
+-    DECLARE_EVENT_TABLE()
+-
+-    wxVolCtrl *gauge;
+-    int i_y_offset;
+-    vlc_bool_t b_mute;
+-    intf_thread_t *p_intf;
+-};
+-
+-BEGIN_EVENT_TABLE(VLCVolCtrl, wxControl)
+-    EVT_PAINT(VLCVolCtrl::OnPaint)
+-
+-    /* Mouse events */
+-    EVT_LEFT_UP(VLCVolCtrl::OnChange)
+-END_EVENT_TABLE()
+-
+ class Splitter : public wxSplitterWindow
+ {
+ public:
+@@ -291,6 +264,8 @@ enum
+     NextStream_Event,
+     SlowStream_Event,
+     FastStream_Event,
++    ToggleMute_Event,
++    SlideVolume_Event,
+
+     /* it is important for the id corresponding to the "About" command to have
+      * this standard value as otherwise it won't be handled properly under Mac
+@@ -344,6 +319,8 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
+     EVT_MENU(NextStream_Event, Interface::OnNextStream)
+     EVT_MENU(SlowStream_Event, Interface::OnSlowStream)
+     EVT_MENU(FastStream_Event, Interface::OnFastStream)
++    EVT_MENU(ToggleMute_Event, Interface::OnToggleMute)
++    EVT_COMMAND_SCROLL(SlideVolume_Event, Interface::OnSlideVolume)
+
+     /* Custom events */
+     EVT_COMMAND(0, wxEVT_INTF, Interface::OnControlEvent)
+@@ -530,7 +507,7 @@ void Interface::Init()
+ void Interface::Update()
+ {
+     /* Misc updates */
+-    if( !(i_update_counter % 10) ) ((VLCVolCtrl *)volctrl)->UpdateVolume();
++//    if( !(i_update_counter % 10) ) ((VLCVolCtrl *)volctrl)->UpdateVolume();
+
+     if( playlist_manager ) playlist_manager->Update();
+
+@@ -683,6 +660,7 @@ void Interface::CreateOurToolBar()
+ #define HELP_PLN N_("Next playlist item")
+ #define HELP_SLOW N_("Play slower")
+ #define HELP_FAST N_("Play faster")
++#define HELP_VOL N_("Toggle mute/unmute of the audio")
+
+ #define LABEL_OPEN N_("Open")
+ #define LABEL_STOP N_("Stop")
+@@ -694,6 +672,8 @@ void Interface::CreateOurToolBar()
+ #define LABEL_PLN N_("Next")
+ #define LABEL_SLOW N_("Slower")
+ #define LABEL_FAST N_("Faster")
++#define LABEL_VOL N_("Mute")
++
+     int minimal = config_GetInt( p_intf, "wx-minimal" );
+     bool label = config_GetInt( p_intf, "wx-labels" );
+
+@@ -740,14 +720,15 @@ void Interface::CreateOurToolBar()
+                           wxBitmap( playlist_small_xpm ), wxU(_(HELP_SPLO)) );
+     }
+
+-    wxControl *p_dummy_ctrl =
+-        new wxControl( toolbar, -1, wxDefaultPosition,
+-                       wxSize(16, 16 ), wxBORDER_NONE );
+-
+-    toolbar->AddControl( p_dummy_ctrl );
+-
+-    volctrl = new VLCVolCtrl( p_intf, toolbar );
+-    toolbar->AddControl( volctrl );
++    wxToolBarToolBase *v_tool = toolbar->AddTool( ToggleMute_Event,
++                         wxU(LABEL_VOL), wxBitmap( speaker_xpm ),
++                         wxU(_(HELP_VOL)), wxITEM_CHECK );
++    v_tool->SetClientData( v_tool );
++
++    wxSlider *v_gauge = new wxSlider(toolbar, SlideVolume_Event, 256, 0,
++                            AOUT_VOLUME_MAX, wxDefaultPosition,
++                            wxSize(64,TOOLBAR_BMP_HEIGHT), wxSL_HORIZONTAL);
++    toolbar->AddControl(v_gauge);
+
+     toolbar->Realize();
+
+@@ -1199,6 +1180,49 @@ void Interface::OnFastStream( wxCommandE
+     }
+ }
+
++void Interface::OnToggleMute ( wxCommandEvent& WXUNUSED(event) )
++{
++    aout_VolumeMute(p_intf, NULL);
++    SyncVolume();
++
++}
++
++void Interface::SyncVolume()
++{
++    wxToolBarToolBase *p_tool = (wxToolBarToolBase *)
++        GetToolBar()->GetToolClientData( ToggleMute_Event );
++    if ( !p_tool) return;
++
++    audio_volume_t i_volume;
++    aout_VolumeGet(p_intf, &i_volume);
++
++// Updating the Mute Button... IF the slider is completely moved to the left,
++// the mute icon is shown too.
++    p_tool->SetNormalBitmap( wxBitmap( i_volume ? speaker_xpm : 
speaker_mute_xpm ) );
++    GetToolBar()->Realize();
++#if defined( __WXMSW__ )
++    /* Needed to work around a bug in wxToolBar::Realize() */
++    GetToolBar()->SetSize( GetSize().GetWidth(),
++                           GetToolBar()->GetSize().GetHeight() );
++    GetToolBar()->Update();
++#endif
++// the Toggle to true and false is nescessary; otherwise, the Icon is not 
repainted
++    GetToolBar()->ToggleTool( ToggleMute_Event, true );
++    GetToolBar()->ToggleTool( ToggleMute_Event, false );
++    GetToolBar()->Update();
++}
++
++void Interface::OnSlideVolume( wxScrollEvent& WXUNUSED(event))
++{
++    wxSlider *p_tool = (wxSlider *)
++        GetToolBar()->FindControl( SlideVolume_Event );
++    if ( !p_tool) return;
++
++    aout_VolumeSet(p_intf , p_tool->GetValue());
++    SyncVolume();
++
++}
++
+ void Interface::TogglePlayButton( int i_playing_status )
+ {
+     wxToolBarToolBase *p_tool = (wxToolBarToolBase *)
+@@ -1325,108 +1349,6 @@ bool DragAndDrop::OnDropFiles( wxCoord,
+ #endif
+
+ /*****************************************************************************
+- * Definition of VolCtrl class.
+- 
*****************************************************************************/
+-class wxVolCtrl: public wxGauge
+-{
+-public:
+-    /* Constructor */
+-    wxVolCtrl( intf_thread_t *_p_intf, wxWindow* parent, wxWindowID id,
+-               wxPoint = wxDefaultPosition, wxSize = wxSize( 20, -1 ) );
+-    virtual ~wxVolCtrl() {};
+-
+-    void UpdateVolume();
+-    int GetVolume();
+-
+-    void OnChange( wxMouseEvent& event );
+-
+-private:
+-    intf_thread_t *p_intf;
+-
+-    DECLARE_EVENT_TABLE();
+-};
+-
+-BEGIN_EVENT_TABLE(wxVolCtrl, wxWindow)
+-    /* Mouse events */
+-    EVT_LEFT_DOWN(wxVolCtrl::OnChange)
+-    EVT_MOTION(wxVolCtrl::OnChange)
+-END_EVENT_TABLE()
+-
+-wxVolCtrl::wxVolCtrl( intf_thread_t *_p_intf, wxWindow* parent, wxWindowID id,
+-                      wxPoint point, wxSize size )
+-  : wxGauge( parent, id, 200, point, size, wxGA_HORIZONTAL | wxGA_SMOOTH )
+-{
+-    p_intf = _p_intf;
+-    UpdateVolume();
+-}
+-
+-void wxVolCtrl::OnChange( wxMouseEvent& event )
+-{
+-    if( !event.LeftDown() && !event.LeftIsDown() ) return;
+-
+-    int i_volume = event.GetX() * 200 / GetClientSize().GetWidth();
+-    aout_VolumeSet( p_intf, i_volume * AOUT_VOLUME_MAX / 200 / 2 );
+-    UpdateVolume();
+-}
+-
+-void wxVolCtrl::UpdateVolume()
+-{
+-    audio_volume_t i_volume;
+-    aout_VolumeGet( p_intf, &i_volume );
+-
+-    int i_gauge_volume = i_volume * 200 * 2 / AOUT_VOLUME_MAX;
+-    if( i_gauge_volume == GetValue() ) return;
+-
+-    SetValue( i_gauge_volume );
+-    SetToolTip( wxString::Format((wxString)wxU(_("Volume")) + wxT(" %d"),
+-                i_gauge_volume / 2 ) );
+-}
+-
+-#if defined(__WXGTK__)
+-#define VLCVOL_HEIGHT p_parent->GetSize().GetHeight()
+-#else
+-#define VLCVOL_HEIGHT TOOLBAR_BMP_HEIGHT
+-#endif
+-VLCVolCtrl::VLCVolCtrl( intf_thread_t *_p_intf, wxWindow *p_parent )
+-  :wxControl( p_parent, -1, wxDefaultPosition, wxSize(64, VLCVOL_HEIGHT ),
+-              wxBORDER_NONE ),
+-   i_y_offset((VLCVOL_HEIGHT - TOOLBAR_BMP_HEIGHT) / 2),
+-   b_mute(0), p_intf(_p_intf)
+-{
+-    gauge = new wxVolCtrl( p_intf, this, -1, wxPoint( 18, i_y_offset ),
+-                           wxSize( 44, TOOLBAR_BMP_HEIGHT ) );
+-}
+-
+-void VLCVolCtrl::OnPaint( wxPaintEvent &evt )
+-{
+-    wxPaintDC dc( this );
+-    wxBitmap mPlayBitmap( b_mute ? speaker_mute_xpm : speaker_xpm );
+-    dc.DrawBitmap( mPlayBitmap, 0, i_y_offset, TRUE );
+-}
+-
+-void VLCVolCtrl::OnChange( wxMouseEvent& event )
+-{
+-    if( event.GetX() < TOOLBAR_BMP_WIDTH )
+-    {
+-        int i_volume;
+-        aout_VolumeMute( p_intf, (audio_volume_t *)&i_volume );
+-
+-        b_mute = !b_mute;
+-        Refresh();
+-    }
+-}
+-
+-void VLCVolCtrl::UpdateVolume()
+-{
+-    gauge->UpdateVolume();
+-
+-    int i_volume = gauge->GetValue();
+-    if( !!i_volume == !b_mute ) return;
+-    b_mute = !b_mute;
+-    Refresh();
+-}
+-
+-/*****************************************************************************
+  * Systray class.
+  
*****************************************************************************/
+
+diff -Naurp vlc-0.8.6h/modules/gui/wxwidgets/interface.hpp 
vlc-0.8.6h-fw-backport/modules/gui/wxwidgets/interface.hpp
+--- vlc-0.8.6h/modules/gui/wxwidgets/interface.hpp     2008-05-25 
20:28:57.000000000 +0200
++++ vlc-0.8.6h-fw-backport/modules/gui/wxwidgets/interface.hpp 2008-06-08 
15:55:02.000000000 +0200
+@@ -147,6 +147,9 @@ namespace wxvlc
+         void OnNextStream( wxCommandEvent& event );
+         void OnSlowStream( wxCommandEvent& event );
+         void OnFastStream( wxCommandEvent& event );
++      void OnToggleMute( wxCommandEvent& event );
++      void OnSlideVolume( wxScrollEvent& event );
++        void SyncVolume( );
+
+         void OnInteraction( wxCommandEvent& event );
+
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to