]> git.sesse.net Git - vlc/commitdiff
beos/* : - cleaned the way to mute/unmute
authorEric Petit <titer@videolan.org>
Sun, 22 Jun 2003 00:40:18 +0000 (00:40 +0000)
committerEric Petit <titer@videolan.org>
Sun, 22 Jun 2003 00:40:18 +0000 (00:40 +0000)
          - save the volume when exiting

modules/gui/beos/Interface.cpp
modules/gui/beos/InterfaceWindow.cpp
modules/gui/beos/MediaControlView.cpp
modules/gui/beos/VlcWrapper.cpp
modules/gui/beos/VlcWrapper.h

index c6a36263831b24618f59a365b98f48f9faa661c2..929cd72d5747414d3a722785a5894af01fa016f7 100644 (file)
@@ -2,7 +2,7 @@
  * intf_beos.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: Interface.cpp,v 1.14 2003/06/13 00:15:40 titer Exp $
+ * $Id: Interface.cpp,v 1.15 2003/06/22 00:40:18 titer Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -93,7 +93,6 @@ int E_(OpenIntf) ( vlc_object_t *p_this )
         message.AddPointer("window", p_intf->p_sys->p_window);
         be_app->PostMessage(&message);
     }
-    p_intf->p_sys->i_saved_volume = AOUT_VOLUME_DEFAULT;
     p_intf->p_sys->b_loop = 0;
     p_intf->p_sys->b_mute = 0;
     
index 3c6776bc8aa46393bf667cfb3c987972f2cd4867..d0bce6bd29e0996f2b01b588eb38a306b4266145 100644 (file)
@@ -2,7 +2,7 @@
  * InterfaceWindow.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: InterfaceWindow.cpp,v 1.41 2003/05/30 18:43:31 titer Exp $
+ * $Id: InterfaceWindow.cpp,v 1.42 2003/06/22 00:40:18 titer Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -1011,6 +1011,11 @@ InterfaceWindow::_RestoreSettings()
 void
 InterfaceWindow::_StoreSettings()
 {
+    /* Save the volume */
+    config_PutInt( p_intf, "volume", p_mediaControl->GetVolume() );
+    config_SaveConfigFile( p_intf, "main" );
+
+    /* Save the windows positions */
        if ( fSettings->ReplaceRect( "main frame", Frame() ) != B_OK )
                fSettings->AddRect( "main frame", Frame() );
        if ( fPlaylistWindow->Lock() )
index 5a50fefab536b023196e97efba9656102b7851b0..4e0624eb0d5280b1d9c5292ef5763822cc7879c1 100644 (file)
@@ -2,7 +2,7 @@
  * MediaControlView.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: MediaControlView.cpp,v 1.18 2003/05/30 17:30:54 titer Exp $
+ * $Id: MediaControlView.cpp,v 1.19 2003/06/22 00:40:18 titer Exp $
  *
  * Authors: Tony Castley <tony@castley.net>
  *          Stephan Aßmus <stippi@yellowbites.com>
@@ -172,7 +172,7 @@ MediaControlView::MediaControlView(BRect frame, intf_thread_t *p_interface)
                                                                                   kVolumeSliderBitmapHeight - 1.0),
                                                                         "volume slider", 1, AOUT_VOLUME_MAX,
                                                                         new BMessage(VOLUME_CHG));
-       fVolumeSlider->SetValue(AOUT_VOLUME_DEFAULT);
+       fVolumeSlider->SetValue( config_GetInt( p_intf, "volume" ) );
        AddChild( fVolumeSlider );
        
        // Position Info View
index 3356be16e12ff736e9dc9ac67486800afdf8fb32..9528d5c44cfff2662c987dfbcf53f75035c3e576 100644 (file)
@@ -2,7 +2,7 @@
  * VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: VlcWrapper.cpp,v 1.34 2003/06/08 16:04:30 titer Exp $
+ * $Id: VlcWrapper.cpp,v 1.35 2003/06/22 00:40:18 titer Exp $
  *
  * Authors: Florian G. Pflug <fgp@phlo.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -749,14 +749,14 @@ void VlcWrapper::SetVolume( int value )
 
 void VlcWrapper::VolumeMute()
 {
-       aout_VolumeGet( p_intf, &p_intf->p_sys->i_saved_volume );
     aout_VolumeMute( p_intf, NULL );
     p_intf->p_sys->b_mute = 1;
 }
 
 void VlcWrapper::VolumeRestore()
 {
-    aout_VolumeSet( p_intf, p_intf->p_sys->i_saved_volume );
+    audio_volume_t dummy;
+    aout_VolumeMute( p_intf, &dummy );
     p_intf->p_sys->b_mute = 0;
 }
 
index 0af0afdf51f579c0c22ed549fd91e50574b9df47..1fc11534ea1dbff4d3cd72b6dae3818628de315c 100644 (file)
@@ -2,7 +2,7 @@
  * VlcWrapper.h: BeOS plugin for vlc (derived from MacOS X port)
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: VlcWrapper.h,v 1.25 2003/05/30 18:43:31 titer Exp $
+ * $Id: VlcWrapper.h,v 1.26 2003/06/22 00:40:18 titer Exp $
  *
  * Authors: Florian G. Pflug <fgp@phlo.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -44,7 +44,6 @@ struct intf_sys_t
     vlc_bool_t           b_loop;
     vlc_bool_t           b_mute;
     int                  i_part;
-    audio_volume_t       i_saved_volume;
     int                  i_channel;
     
     VlcWrapper *         p_wrapper;