* vlcproc.cpp: VlcProc class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.45 2003/10/15 12:24:14 gbazin Exp $
+ * $Id: vlcproc.cpp,v 1.54 2004/02/15 18:58:38 ipkiss Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
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
LoadSkin();
return true;
+ case VLC_ON_TOP:
+ for( list<SkinWindow *>::const_iterator win =
+ p_intf->p_sys->p_theme->WindowList.begin();
+ win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
+ {
+ (*win)->ToggleOnTop();
+ }
+ // Set the indicator to the new state
+ p_intf->p_sys->b_on_top = !p_intf->p_sys->b_on_top;
+ return true;
+
case VLC_DROP:
- DropFile( evt->GetParam1() );
+ DropFile( evt->GetParam1(), evt->GetParam2() );
return true;
case VLC_PLAY:
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();
// Refresh
if( PlayList != NULL )
{
+ vlc_mutex_lock( &PlayList->object_lock );
+
// Refresh stream control controls ! :)
switch( PlayList->i_status )
{
EnabledEvent( "next", true );
// Update file name
- if( PlayList->i_index != Sys->i_index )
+ if( PlayList->i_index >= 0 && PlayList->i_index != Sys->i_index )
{
string long_name = PlayList->pp_items[PlayList->i_index]->psz_name;
int pos = long_name.rfind( DIRECTORY_SEPARATOR, long_name.size() );
Sys->i_size = PlayList->i_size;
Sys->i_index = PlayList->i_index;
}
+
+ vlc_mutex_unlock( &PlayList->object_lock );
}
else
{
{
OSAPI_PostMessage( NULL, CTRL_ENABLED, (unsigned int)
p_intf->p_sys->p_theme->EvtBank->Get( type ), (int)state );
+
+ if( !state )
+ {
+ OSAPI_PostMessage( NULL, CTRL_SYNCHRO, (unsigned int)
+ p_intf->p_sys->p_theme->EvtBank->Get( type ), (int)false );
+ }
}
//---------------------------------------------------------------------------
delete Loader;
// Uninitialize new theme
- delete[] p_intf->p_sys->p_new_theme_file;
+ free( p_intf->p_sys->p_new_theme_file );
p_intf->p_sys->p_new_theme_file = NULL;
+
+ OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (int)true );
}
}
//---------------------------------------------------------------------------
-void VlcProc::DropFile( unsigned int param )
+void VlcProc::DropFile( unsigned int param1, long param2 )
{
// Get pointer to file
- char *FileName = (char *)param;
+ char *FileName = (char *)param1;
// Add the new file to the playlist
if( p_intf->p_sys->p_playlist != NULL )
{
- if( config_GetInt( p_intf, "enqueue" ) )
+ if( param2 == 0 )
{
- playlist_Add( p_intf->p_sys->p_playlist, FileName, 0, 0,
+ // Enqueue the item
+ playlist_Add( p_intf->p_sys->p_playlist, FileName, FileName,
PLAYLIST_APPEND, PLAYLIST_END );
}
else
{
- playlist_Add( p_intf->p_sys->p_playlist, FileName, 0, 0,
+ // Enqueue and play the item
+ playlist_Add( p_intf->p_sys->p_playlist, FileName, FileName,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
}
}
// Refresh interface
InterfaceRefresh();
-
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void VlcProc::PauseStream()
{
- if( p_intf->p_sys->p_input == NULL )
+ if( p_intf->p_sys->p_playlist == NULL )
return;
- input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE );
+
+ playlist_Command( p_intf->p_sys->p_playlist, PLAYLIST_PAUSE, 0 );
// Refresh interface
InterfaceRefresh();
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 )
aout_VolumeDown( p_intf, 1, NULL );
break;
case VLC_VOLUME_SET:
- aout_VolumeSet( p_intf, param * AOUT_VOLUME_MAX / SLIDER_RANGE );
+ aout_VolumeSet( p_intf, param * (AOUT_VOLUME_DEFAULT * 2) /
+ SLIDER_RANGE );
break;
}
aout_VolumeGet( p_intf, &volume );
-
}
//---------------------------------------------------------------------------