* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: BeOS.cpp,v 1.2 2002/09/30 18:30:27 titer Exp $
+ * $Id: BeOS.cpp,v 1.3 2003/01/25 01:03:44 titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
add_submodule();
set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) );
+ add_integer( "beos-intf-width", 0, NULL, "", "" );
+ add_integer( "beos-intf-height", 0, NULL, "", "" );
+ add_integer( "beos-intf-xpos", 0, NULL, "", "" );
+ add_integer( "beos-intf-ypos", 0, NULL, "", "" );
+ add_integer( "beos-playlist-width", 0, NULL, "", "" );
+ add_integer( "beos-playlist-height", 0, NULL, "", "" );
+ add_integer( "beos-playlist-xpos", 0, NULL, "", "" );
+ add_integer( "beos-playlist-ypos", 0, NULL, "", "" );
+ add_bool( "beos-playlist-show", 0, NULL, "", "" );
add_submodule();
set_capability( "video output", 100 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) );
* InterfaceWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: InterfaceWindow.cpp,v 1.20 2003/01/22 01:13:22 titer Exp $
+ * $Id: InterfaceWindow.cpp,v 1.21 2003/01/25 01:03:44 titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
p_wrapper = p_intf->p_sys->p_wrapper;
p_intf->p_sys->b_dvdold = false;
- fPlaylistIsEmpty = ( p_wrapper->PlaylistSize() < 0 );
+ fPlaylistIsEmpty = !( p_wrapper->PlaylistSize() > 0 );
fPlaylistWindow = new PlayListWindow( BRect( 100.0, 100.0, 400.0, 350.0 ),
"Playlist",
p_mediaControl = new MediaControlView( BRect( 0.0, 0.0, 250.0, 50.0 ),
p_intf );
p_mediaControl->SetViewColor( ui_color( B_PANEL_BACKGROUND_COLOR ) );
- p_mediaControl->SetEnabled( !fPlaylistIsEmpty );
float width, height;
p_mediaControl->GetPreferredSize( &width, &height );
new BMenuItem( "Preferences", new BMessage( OPEN_PREFERENCES ) ) );
fMenuBar->AddItem( fSettingsMenu );
- // prepare fow showing
+ /* Prepare fow showing */
_SetMenusEnabled( false );
p_mediaControl->SetEnabled( false );
-
+
+ /* Restore interface settings */
+ int i_width = config_GetInt( p_intf, "beos-intf-width" ),
+ i_height = config_GetInt( p_intf, "beos-intf-height" ),
+ i_xpos = config_GetInt( p_intf, "beos-intf-xpos" ),
+ i_ypos = config_GetInt( p_intf, "beos-intf-ypos" );
+ if( i_width && i_height && i_xpos && i_ypos )
+ {
+ /* main window size and position */
+ ResizeTo( i_width, i_height );
+ MoveTo( i_xpos, i_ypos );
+ }
+ i_width = config_GetInt( p_intf, "beos-playlist-width" ),
+ i_height = config_GetInt( p_intf, "beos-playlist-height" ),
+ i_xpos = config_GetInt( p_intf, "beos-playlist-xpos" ),
+ i_ypos = config_GetInt( p_intf, "beos-playlist-ypos" );
+ if( i_width && i_height && i_xpos && i_ypos )
+ {
+ /* playlist window size and position */
+ fPlaylistWindow->ResizeTo( i_width, i_height );
+ fPlaylistWindow->MoveTo( i_xpos, i_ypos );
+ }
+ if( config_GetInt( p_intf, "beos-playlist-show" ) )
+ {
+ /* playlist showing */
+ if( fPlaylistWindow->Lock() )
+ {
+ fPlaylistWindow->Show();
+ fPlaylistWindow->Unlock();
+ }
+ }
+
Show();
}
{
p_wrapper->PlaylistStop();
p_mediaControl->SetStatus(NOT_STARTED_S, DEFAULT_RATE);
-
+
+ /* Save interface settings */
+ BRect frame = Frame();
+ config_PutInt( p_intf, "beos-intf-width", (int)frame.Width() );
+ config_PutInt( p_intf, "beos-intf-height", (int)frame.Height() );
+ config_PutInt( p_intf, "beos-intf-xpos", (int)frame.left );
+ config_PutInt( p_intf, "beos-intf-ypos", (int)frame.top );
+ if( fPlaylistWindow->Lock() )
+ {
+ frame = fPlaylistWindow->Frame();
+ config_PutInt( p_intf, "beos-playlist-width", (int)frame.Width() );
+ config_PutInt( p_intf, "beos-playlist-height", (int)frame.Height() );
+ config_PutInt( p_intf, "beos-playlist-xpos", (int)frame.left );
+ config_PutInt( p_intf, "beos-playlist-ypos", (int)frame.top );
+ config_PutInt( p_intf, "beos-playlist-show", !fPlaylistWindow->IsHidden() );
+ fPlaylistWindow->Unlock();
+ }
+ config_SaveConfigFile( p_intf, "beos" );
+
p_intf->b_die = 1;
return( true );
}
else if ( Lock() )
{
-// p_mediaControl->SetEnabled( true );
+ p_mediaControl->SetEnabled( true );
bool hasTitles = p_wrapper->HasTitles();
bool hasChapters = p_wrapper->HasChapters();
p_mediaControl->SetStatus( p_wrapper->InputStatus(),
else
{
_SetMenusEnabled( false );
-// p_mediaControl->SetEnabled( false );
+ if( !( p_wrapper->PlaylistSize() > 0 ) )
+ p_mediaControl->SetEnabled( false );
+ else
+ p_mediaControl->SetProgress( 0 );
}
/* always force the user-specified volume */
/* FIXME : I'm quite sure there is a cleaner way to do this */
- if( p_wrapper->GetVolume() != p_mediaControl->GetVolume() )
+ int i_volume = p_mediaControl->GetVolume();
+ if( p_wrapper->GetVolume() != i_volume )
{
- p_wrapper->SetVolume( p_mediaControl->GetVolume() );
+ p_wrapper->SetVolume( i_volume );
}
fLastUpdateTime = system_time();
* MediaControlView.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: MediaControlView.cpp,v 1.12 2003/01/24 06:31:56 titer Exp $
+ * $Id: MediaControlView.cpp,v 1.13 2003/01/25 01:03:44 titer Exp $
*
* Authors: Tony Castley <tony@castley.net>
* Stephan Aßmus <stippi@yellowbites.com>
fScrubSem(B_ERROR),
fCurrentRate(DEFAULT_RATE),
fCurrentStatus(UNDEF_S),
- fBottomControlHeight(0.0)
+ fBottomControlHeight(0.0),
+ fIsEnabled( true )
{
p_intf = p_interface;
void
MediaControlView::SetEnabled(bool enabled)
{
- if ( LockLooper() )
+ if( ( enabled && fIsEnabled ) ||
+ ( !enabled && !fIsEnabled ) )
+ {
+ /* do not redraw if it is not necessary */
+ return;
+ }
+
+ if( LockLooper() )
{
fSkipBack->SetEnabled( enabled );
fPlayPause->SetEnabled( enabled );
fRewind->SetEnabled( enabled );
fForward->SetEnabled( enabled );
UnlockLooper();
+ fIsEnabled = enabled;
}
}
void
SeekSlider::SetPosition(float position)
{
+ LockLooper();
SetValue(fMinValue + (int32)floorf((fMaxValue - fMinValue) * position + 0.5));
+ UnlockLooper();
}
/*****************************************************************************