From da65bd50adfa5a9c146f45b8414a80233971c1b9 Mon Sep 17 00:00:00 2001 From: Eric Petit Date: Sun, 22 Jun 2003 00:40:18 +0000 Subject: [PATCH] beos/* : - cleaned the way to mute/unmute - save the volume when exiting --- modules/gui/beos/Interface.cpp | 3 +-- modules/gui/beos/InterfaceWindow.cpp | 7 ++++++- modules/gui/beos/MediaControlView.cpp | 4 ++-- modules/gui/beos/VlcWrapper.cpp | 6 +++--- modules/gui/beos/VlcWrapper.h | 3 +-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/modules/gui/beos/Interface.cpp b/modules/gui/beos/Interface.cpp index c6a3626383..929cd72d57 100644 --- a/modules/gui/beos/Interface.cpp +++ b/modules/gui/beos/Interface.cpp @@ -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 * Samuel Hocevar @@ -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; diff --git a/modules/gui/beos/InterfaceWindow.cpp b/modules/gui/beos/InterfaceWindow.cpp index 3c6776bc8a..d0bce6bd29 100644 --- a/modules/gui/beos/InterfaceWindow.cpp +++ b/modules/gui/beos/InterfaceWindow.cpp @@ -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 * Samuel Hocevar @@ -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() ) diff --git a/modules/gui/beos/MediaControlView.cpp b/modules/gui/beos/MediaControlView.cpp index 5a50fefab5..4e0624eb0d 100644 --- a/modules/gui/beos/MediaControlView.cpp +++ b/modules/gui/beos/MediaControlView.cpp @@ -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 * Stephan Aßmus @@ -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 diff --git a/modules/gui/beos/VlcWrapper.cpp b/modules/gui/beos/VlcWrapper.cpp index 3356be16e1..9528d5c44c 100644 --- a/modules/gui/beos/VlcWrapper.cpp +++ b/modules/gui/beos/VlcWrapper.cpp @@ -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 * Jon Lech Johansen @@ -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; } diff --git a/modules/gui/beos/VlcWrapper.h b/modules/gui/beos/VlcWrapper.h index 0af0afdf51..1fc11534ea 100644 --- a/modules/gui/beos/VlcWrapper.h +++ b/modules/gui/beos/VlcWrapper.h @@ -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 * Jon Lech Johansen @@ -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; -- 2.39.2