* intf_beos.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: Interface.cpp,v 1.3 2002/10/10 23:11:52 titer Exp $
+ * $Id: Interface.cpp,v 1.4 2002/10/30 06:12:27 titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#include <vlc/vlc.h>
#include <vlc/intf.h>
+#include <vlc/aout.h>
+#include <aout_internal.h>
#include "VlcWrapper.h"
#include "InterfaceWindow.h"
}
p_intf->p_sys->p_input = NULL;
- p_intf->p_sys->p_vlc_wrapper = new Intf_VLCWrapper( p_intf );
+ p_intf->p_sys->p_aout = NULL;
p_intf->p_sys->p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ p_intf->p_sys->p_vlc_wrapper = new Intf_VLCWrapper( p_intf );
p_intf->pf_run = Run;
vlc_object_release( p_intf->p_sys->p_input );
}
+ if( p_intf->p_sys->p_playlist )
+ {
+ vlc_object_release( p_intf->p_sys->p_playlist );
+ }
+
+ if( p_intf->p_sys->p_aout )
+ {
+ vlc_object_release( p_intf->p_sys->p_aout );
+ }
+
/* Destroy the interface window */
p_intf->p_sys->p_window->Lock();
p_intf->p_sys->p_window->Quit();
{
p_intf->p_sys->p_input =
(input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
- FIND_ANYWHERE );
+ FIND_ANYWHERE );
+ }
+ if( p_intf->p_sys->p_aout == NULL )
+ {
+ p_intf->p_sys->p_aout =
+ (aout_instance_t*)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
+ FIND_ANYWHERE );
}
/* Update the input */
{
vlc_object_release( p_intf->p_sys->p_input );
p_intf->p_sys->p_input = NULL;
+
+ if( p_intf->p_sys->p_aout )
+ {
+ vlc_object_release( p_intf->p_sys->p_aout );
+ p_intf->p_sys->p_aout = NULL;
+ }
}
- /* Manage the slider */
+ /* Manage the slider */
p_intf->p_sys->p_window->updateInterface();
}
* InterfaceWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: InterfaceWindow.cpp,v 1.6 2002/10/29 17:33:11 titer Exp $
+ * $Id: InterfaceWindow.cpp,v 1.7 2002/10/30 06:12:27 titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
fSettings( new BMessage( 'sett' ) )
{
p_intf = p_interface;
- playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
+
fPlaylistIsEmpty = (p_playlist->i_size < 0);
fPlaylistWindow = new PlayListWindow( BRect( 100.0, 100.0, 400.0, 350.0 ),
fSettingsMenu = new BMenu( "Settings" );
fSettingsMenu->AddItem( fPreferencesMI =
new BMenuItem( "Preferences", new BMessage( OPEN_PREFERENCES ) ) );
- fMenuBar->AddItem( fSettingsMenu );
-
- /* Add the Config menu */
-// BMenu* configMenu = new BMenu( "Config" );
-// menu_bar->AddItem( configMenu );
-// fOnTopMI = new BMenuItem( "Always on Top",
-// new BMessage( TOGGLE_ON_TOP ) )
-// configMenu->AddItem( );
-// fOnTopMI->SetMarked(false);
+ fMenuBar->AddItem( fSettingsMenu );
// prepare fow showing
_SetMenusEnabled(false);
else
_SetMenusEnabled(false);
- playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
+
if ( fPlaylistIsEmpty != ( p_playlist->i_size < 0) )
{
if ( Lock() )
{
fPlaylistWindow->UpdatePlaylist( true );
fPlaylistWindow->Unlock();
- playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
fPlaylistIsEmpty = p_playlist->i_size < 1;
p_mediaControl->SetEnabled( !fPlaylistIsEmpty );
}
* intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port )
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: VlcWrapper.cpp,v 1.9 2002/10/30 00:59:22 titer Exp $
+ * $Id: VlcWrapper.cpp,v 1.10 2002/10/30 06:12:27 titer Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
/* playlist control */
bool Intf_VLCWrapper::playlistPlay()
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->i_size )
{
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Play( p_playlist );
- vlc_object_release( p_playlist );
}
else
{
vlc_mutex_unlock( &p_playlist->object_lock );
- vlc_object_release( p_playlist );
}
return( true );
void Intf_VLCWrapper::playlistPause()
{
- toggle_mute( );
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- playlist_Pause( p_playlist );
- vlc_object_release( p_playlist );
+ toggle_mute();
+ if( p_intf->p_sys->p_input )
+ {
+ input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE );
+ }
}
void Intf_VLCWrapper::playlistStop()
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
+
playlist_Stop( p_playlist );
- vlc_object_release( p_playlist );
}
void Intf_VLCWrapper::playlistNext()
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
playlist_Next( p_playlist );
- vlc_object_release( p_playlist );
}
void Intf_VLCWrapper::playlistPrev()
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
playlist_Prev( p_playlist );
- vlc_object_release( p_playlist );
}
void Intf_VLCWrapper::playlistSkip(int i)
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
playlist_Skip( p_playlist, i );
- vlc_object_release( p_playlist );
}
void Intf_VLCWrapper::playlistGoto(int i)
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
playlist_Goto( p_playlist, i );
- vlc_object_release( p_playlist );
}
void Intf_VLCWrapper::playlistJumpTo( int pos )
void Intf_VLCWrapper::volume_mute()
{
- p_intf->p_sys->p_aout =
- (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
- FIND_ANYWHERE );
if( p_intf->p_sys->p_aout != NULL )
{
if( !p_intf->p_sys->b_mute )
void Intf_VLCWrapper::volume_restore()
{
- p_intf->p_sys->p_aout =
- (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
- FIND_ANYWHERE );
if( p_intf->p_sys->p_aout != NULL )
{
p_intf->p_sys->p_aout->output.i_volume = p_intf->p_sys->i_saved_volume;
void Intf_VLCWrapper::set_volume(int value)
{
- p_intf->p_sys->p_aout =
- (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
- FIND_ANYWHERE );
if( p_intf->p_sys->p_aout != NULL )
{
// make sure value is within bounds
void Intf_VLCWrapper::toggle_mute()
{
- p_intf->p_sys->p_aout =
- (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
- FIND_ANYWHERE );
if( p_intf->p_sys->p_aout != NULL )
{
if ( p_intf->p_sys->b_mute )
{
bool muted = true;
- p_intf->p_sys->p_aout =
- (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
- FIND_ANYWHERE );
if( p_intf->p_sys->p_aout != NULL )
{
vlc_mutex_lock( &p_intf->p_sys->p_aout->mixer_lock );
void Intf_VLCWrapper::maxvolume()
{
- p_intf->p_sys->p_aout =
- (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
- FIND_ANYWHERE );
if( p_intf->p_sys->p_aout != NULL )
{
if( p_intf->p_sys->b_mute )
bool Intf_VLCWrapper::has_audio()
{
- p_intf->p_sys->p_aout =
- (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
- FIND_ANYWHERE );
return( p_intf->p_sys->p_aout != NULL );
}
BList *Intf_VLCWrapper::playlistAsArray()
{
int i;
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
BList* p_list = new BList(p_playlist->i_size);
}
vlc_mutex_unlock( &p_playlist->object_lock );
- vlc_object_release( p_playlist );
return( p_list );
}
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
delete o_file;
}
-
- vlc_object_release( p_playlist );
}
void Intf_VLCWrapper::openDisc(BString o_type, BString o_device, int i_title, int i_chapter)
BString o_source("");
o_source << o_type << ":" << o_device ;
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = p_intf->p_sys->p_playlist;
playlist_Add( p_playlist, o_source.String(),
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
- vlc_object_release( p_playlist );
}
void Intf_VLCWrapper::openNet(BString o_addr, int i_port)
int Intf_VLCWrapper::inputGetStatus()
{
- return 0;
+ return p_intf->p_sys->p_playlist->i_status;
}