* intf_beos.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: Interface.cpp,v 1.2 2002/09/30 18:30:27 titer Exp $
+ * $Id: Interface.cpp,v 1.3 2002/10/10 23:11:52 titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
}
p_intf->p_sys->p_input = NULL;
+ p_intf->p_sys->p_vlc_wrapper = new Intf_VLCWrapper( p_intf );
+ p_intf->p_sys->p_playlist =
+ (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
p_intf->pf_run = Run;
{
while( !p_intf->b_die )
{
+ if( p_intf->p_sys->p_input == NULL )
+ {
+ p_intf->p_sys->p_input =
+ (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+ FIND_ANYWHERE );
+ }
+
/* Update the input */
if( p_intf->p_sys->p_input != NULL )
{
/* Manage the slider */
p_intf->p_sys->p_window->updateInterface();
}
-
- if( p_intf->p_sys->p_input == NULL )
- {
- p_intf->p_sys->p_input =
- (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
- FIND_ANYWHERE );
- }
/* Wait a bit */
msleep( INTF_IDLE_SLEEP );
* InterfaceWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: InterfaceWindow.cpp,v 1.2 2002/09/30 18:30:27 titer Exp $
+ * $Id: InterfaceWindow.cpp,v 1.3 2002/10/10 23:11:52 titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
fSettings( new BMessage( 'sett' ) )
{
p_intf = p_interface;
- p_vlc_wrapper = p_vlc_wrapper->getVLCWrapper(p_intf);
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
fPlaylistIsEmpty = (p_playlist->i_size < 0);
+ fPlaylistWindow = new PlayListWindow( BRect( 20.0, 20.0, 170.0, 320.0 ),
+ "Playlist",
+ p_playlist,
+ this,
+ p_intf );
+
// set the title bar
SetName( "interface" );
SetTitle( VOUT_TITLE );
void InterfaceWindow::MessageReceived( BMessage * p_message )
{
int playback_status; // remember playback state
- playback_status = p_vlc_wrapper->inputGetStatus();
+ playback_status = p_intf->p_sys->p_vlc_wrapper->inputGetStatus();
switch( p_message->what )
{
if( p_message->FindString( "device", &psz_device ) == B_OK )
{
BString device( psz_device );
- p_vlc_wrapper->openDisc( type, device, 0, 0 );
+ p_intf->p_sys->p_vlc_wrapper->openDisc( type, device, 0, 0 );
}
_UpdatePlaylist();
}
// this currently stops playback not nicely
if (playback_status > UNDEF_S)
{
- p_vlc_wrapper->volume_mute();
+ p_intf->p_sys->p_vlc_wrapper->volume_mute();
snooze( 400000 );
- p_vlc_wrapper->playlistStop();
+ p_intf->p_sys->p_vlc_wrapper->playlistStop();
p_mediaControl->SetStatus(NOT_STARTED_S, DEFAULT_RATE);
}
break;
/* pause if currently playing */
if ( playback_status == PLAYING_S )
{
- p_vlc_wrapper->volume_mute();
+ p_intf->p_sys->p_vlc_wrapper->volume_mute();
snooze( 400000 );
- p_vlc_wrapper->playlistPause();
+ p_intf->p_sys->p_vlc_wrapper->playlistPause();
}
else
{
- p_vlc_wrapper->volume_restore();
- p_vlc_wrapper->playlistPlay();
+ p_intf->p_sys->p_vlc_wrapper->volume_restore();
+ p_intf->p_sys->p_vlc_wrapper->playlistPlay();
}
}
else
{
/* Play a new file */
- p_vlc_wrapper->playlistPlay();
+ p_intf->p_sys->p_vlc_wrapper->playlistPlay();
}
break;
/* cycle the fast playback modes */
if (playback_status > UNDEF_S)
{
- p_vlc_wrapper->volume_mute();
+ p_intf->p_sys->p_vlc_wrapper->volume_mute();
snooze( 400000 );
- p_vlc_wrapper->playFaster();
+ p_intf->p_sys->p_vlc_wrapper->playFaster();
}
break;
/* cycle the slow playback modes */
if (playback_status > UNDEF_S)
{
- p_vlc_wrapper->volume_mute();
+ p_intf->p_sys->p_vlc_wrapper->volume_mute();
snooze( 400000 );
- p_vlc_wrapper->playSlower();
+ p_intf->p_sys->p_vlc_wrapper->playSlower();
}
break;
/* restore speed to normal if already playing */
if (playback_status > UNDEF_S)
{
- p_vlc_wrapper->volume_restore();
- p_vlc_wrapper->playlistPlay();
+ p_intf->p_sys->p_vlc_wrapper->volume_restore();
+ p_intf->p_sys->p_vlc_wrapper->playlistPlay();
}
break;
/* adjust the volume */
if (playback_status > UNDEF_S)
{
- p_vlc_wrapper->set_volume( p_mediaControl->GetVolume() );
- p_mediaControl->SetMuted( p_vlc_wrapper->is_muted() );
+ p_intf->p_sys->p_vlc_wrapper->set_volume( p_mediaControl->GetVolume() );
+ p_mediaControl->SetMuted( p_intf->p_sys->p_vlc_wrapper->is_muted() );
}
break;
case VOLUME_MUTE:
// toggle muting
- p_vlc_wrapper->toggle_mute();
- p_mediaControl->SetMuted( p_vlc_wrapper->is_muted() );
+ p_intf->p_sys->p_vlc_wrapper->toggle_mute();
+ p_mediaControl->SetMuted( p_intf->p_sys->p_vlc_wrapper->is_muted() );
break;
case SELECT_CHANNEL:
int32 channel;
if ( p_message->FindInt32( "channel", &channel ) == B_OK )
{
- p_vlc_wrapper->toggleLanguage( channel );
+ p_intf->p_sys->p_vlc_wrapper->toggleLanguage( channel );
// vlc seems to remember the volume for every channel,
// but I would assume that to be somewhat annoying to the user
// the next call will also unmute the volume, which is probably
// desired as well, because if the user selects another language,
// he probably wants to hear the change as well
snooze( 400000 ); // we have to wait a bit, or the change will be reverted
- p_vlc_wrapper->set_volume( p_mediaControl->GetVolume() );
+ p_intf->p_sys->p_vlc_wrapper->set_volume( p_mediaControl->GetVolume() );
}
}
break;
{
int32 subtitle;
if ( p_message->FindInt32( "subtitle", &subtitle ) == B_OK )
- p_vlc_wrapper->toggleSubtitle( subtitle );
+ p_intf->p_sys->p_vlc_wrapper->toggleSubtitle( subtitle );
}
break;
/* Disallow area 0 since it is used for video_ts.vob */
if( i_id > 0 )
{
- p_vlc_wrapper->toggleTitle(i_id);
+ p_intf->p_sys->p_vlc_wrapper->toggleTitle(i_id);
}
break;
}
if( i_id < p_intf->p_sys->p_input->stream.i_area_nb )
{
- p_vlc_wrapper->toggleTitle(i_id);
+ p_intf->p_sys->p_vlc_wrapper->toggleTitle(i_id);
}
break;
}
{
int32 index;
if ( p_message->FindInt32( "index", &index ) == B_OK )
- p_vlc_wrapper->toggleTitle( index );
+ p_intf->p_sys->p_vlc_wrapper->toggleTitle( index );
}
break;
case PREV_CHAPTER:
if( i_id >= 0 )
{
- p_vlc_wrapper->toggleChapter(i_id);
+ p_intf->p_sys->p_vlc_wrapper->toggleChapter(i_id);
}
break;
}
if( i_id >= 0 )
{
- p_vlc_wrapper->toggleChapter(i_id);
+ p_intf->p_sys->p_vlc_wrapper->toggleChapter(i_id);
}
break;
}
{
int32 index;
if ( p_message->FindInt32( "index", &index ) == B_OK )
- p_vlc_wrapper->toggleChapter( index );
+ p_intf->p_sys->p_vlc_wrapper->toggleChapter( index );
}
break;
case PREV_FILE:
- p_vlc_wrapper->playlistPrev();
+ p_intf->p_sys->p_vlc_wrapper->playlistPrev();
break;
case NEXT_FILE:
- p_vlc_wrapper->playlistNext();
+ p_intf->p_sys->p_vlc_wrapper->playlistNext();
break;
// general next/prev functionality (skips to whatever makes most sense)
case NAVIGATE_PREV:
- p_vlc_wrapper->navigatePrev();
+ p_intf->p_sys->p_vlc_wrapper->navigatePrev();
break;
case NAVIGATE_NEXT:
- p_vlc_wrapper->navigateNext();
+ p_intf->p_sys->p_vlc_wrapper->navigateNext();
break;
// drag'n'drop and system messages
case B_REFS_RECEIVED:
files.AddItem( new BString( (char*)path.Path() ) );
}
// give the list to VLC
- p_vlc_wrapper->openFiles(&files, replace);
+ p_intf->p_sys->p_vlc_wrapper->openFiles(&files, replace);
_UpdatePlaylist();
}
break;
{
if (p_intf->p_sys->p_input)
{
- p_vlc_wrapper->volume_mute();
+ p_intf->p_sys->p_vlc_wrapper->volume_mute();
snooze( 400000 );
- p_vlc_wrapper->playlistStop();
+ p_intf->p_sys->p_vlc_wrapper->playlistStop();
p_mediaControl->SetStatus(NOT_STARTED_S, DEFAULT_RATE);
}
{
if ( acquire_sem( p_mediaControl->fScrubSem ) == B_OK )
{
- p_vlc_wrapper->setTimeAsFloat(p_mediaControl->GetSeekTo());
+ p_intf->p_sys->p_vlc_wrapper->setTimeAsFloat(p_mediaControl->GetSeekTo());
}
else if ( Lock() )
{
// enable/disable skip buttons
bool canSkipPrev;
bool canSkipNext;
- p_vlc_wrapper->getNavCapabilities( &canSkipPrev, &canSkipNext );
+ p_intf->p_sys->p_vlc_wrapper->getNavCapabilities( &canSkipPrev, &canSkipNext );
p_mediaControl->SetSkippable( canSkipPrev, canSkipNext );
- if ( p_vlc_wrapper->has_audio() )
+ if ( p_intf->p_sys->p_vlc_wrapper->has_audio() )
{
p_mediaControl->SetAudioEnabled( true );
- p_mediaControl->SetMuted( p_vlc_wrapper->is_muted() );
+ p_mediaControl->SetMuted( p_intf->p_sys->p_vlc_wrapper->is_muted() );
} else
p_mediaControl->SetAudioEnabled( false );
//printf("InterfaceWindow::_InputStreamChanged()\n");
// TODO: move more stuff from updateInterface() here!
snooze( 400000 );
- p_vlc_wrapper->set_volume( p_mediaControl->GetVolume() );
+ p_intf->p_sys->p_vlc_wrapper->set_volume( p_mediaControl->GetVolume() );
}
/*****************************************************************************
* PlayListWindow.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: PlayListWindow.cpp,v 1.2 2002/09/30 18:30:27 titer Exp $
+ * $Id: PlayListWindow.cpp,v 1.3 2002/10/10 23:11:52 titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
*****************************************************************************/
PlayListWindow::PlayListWindow( BRect frame, const char* name,
playlist_t *playlist,
- InterfaceWindow* mainWindow )
+ InterfaceWindow* mainWindow,
+ intf_thread_t *p_interface )
: BWindow( frame, name, B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_WILL_ACCEPT_FIRST_CLICK | B_ASYNCHRONOUS_CONTROLS ),
fPlaylist( playlist ),
fMainWindow( mainWindow )
{
+ this->p_intf = p_interface;
SetName( "playlist" );
// set up the main menu bar
PlayListWindow::ReallyQuit()
{
Lock();
- Hide();
+ Hide();
Quit();
}
void
PlayListWindow::UpdatePlaylist( bool rebuild )
{
- /* if ( rebuild )
+ if ( rebuild )
{
// remove all items
int32 count = fListView->CountItems();
// rebuild listview from VLC's playlist
for ( int i = 0; i < fPlaylist->i_size; i++ )
- fListView->AddItem( new PlaylistItem( fPlaylist->p_item[i].psz_name ) );
+ fListView->AddItem( new PlaylistItem( fPlaylist->pp_items[i]->psz_name ) );
}
fListView->SetCurrent( fPlaylist->i_index );
- fListView->SetPlaying( Intf_VLCWrapper::is_playing() ); */
+ fListView->SetPlaying( p_intf->p_sys->p_vlc_wrapper->is_playing() );
}
* PlayListWindow.h: BeOS interface window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: PlayListWindow.h,v 1.2 2002/09/30 18:30:27 titer Exp $
+ * $Id: PlayListWindow.h,v 1.3 2002/10/10 23:11:52 titer Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
PlayListWindow(BRect frame,
const char* name,
playlist_t* playlist,
- InterfaceWindow* mainWindow );
+ InterfaceWindow* mainWindow,
+ intf_thread_t *p_interface );
virtual ~PlayListWindow();
// BWindow
private:
- playlist_t* fPlaylist;
- PlaylistView* fListView;
- BView* fBackgroundView;
- BMenuBar* fMenuBar;
- InterfaceWindow* fMainWindow;
+ playlist_t * fPlaylist;
+ PlaylistView * fListView;
+ BView * fBackgroundView;
+ BMenuBar * fMenuBar;
+ InterfaceWindow * fMainWindow;
+
+ intf_thread_t * p_intf;
};
#endif // BEOS_PLAY_LIST_WINDOW_H
* intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port )
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: VlcWrapper.cpp,v 1.4 2002/09/30 18:30:27 titer Exp $
+ * $Id: VlcWrapper.cpp,v 1.5 2002/10/10 23:11:52 titer Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
#include <vlc/vlc.h>
#include <vlc/intf.h>
+#include <audio_output.h>
+#include <aout_internal.h>
#include "VlcWrapper.h"
-Intf_VLCWrapper *Intf_VLCWrapper::getVLCWrapper(intf_thread_t *p_if)
+Intf_VLCWrapper *Intf_VLCWrapper::getVLCWrapper(intf_thread_t *p_interface)
{
static Intf_VLCWrapper *one_wrapper;
if (one_wrapper == NULL )
{
- one_wrapper = new Intf_VLCWrapper(p_if);
+ one_wrapper = new Intf_VLCWrapper(p_interface);
}
return one_wrapper;
}
-Intf_VLCWrapper::Intf_VLCWrapper(intf_thread_t *p_if)
+Intf_VLCWrapper::Intf_VLCWrapper(intf_thread_t *p_interface)
{
- p_intf = p_if;
+ p_intf = p_interface;
}
Intf_VLCWrapper::~Intf_VLCWrapper()
#if 0
bool Intf_VLCWrapper::manage()
{
- p_main->p_intf->pf_manage( p_main->p_intf );
+ /* p_main->p_intf->pf_manage( p_intf ); */
- if ( p_main->p_intf->b_die )
+ if ( p_intf->b_die )
{
// exit the lot
return( 1 );
}
- if ( p_input_bank->pp_input[0] != NULL )
+ if ( p_intf->p_sys->p_input != NULL )
{
- vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
- if( !p_input_bank->pp_input[0]->b_die )
+ vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
+ if( !p_intf->p_sys->p_input->b_die )
{
/* New input or stream map change */
- if( p_input_bank->pp_input[0]->stream.b_changed ||
- p_main->p_intf->p_sys->i_part !=
- p_input_bank->pp_input[0]->stream.p_selected_area->i_part )
+ if( p_intf->p_sys->p_input->stream.b_changed ||
+ p_intf->p_sys->i_part !=
+ p_intf->p_sys->p_input->stream.p_selected_area->i_part )
{
setupMenus();
- p_main->p_intf->p_sys->b_disabled_menus = 0;
+ p_intf->p_sys->b_disabled_menus = 0;
}
}
- vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
+ vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
}
- else if ( !p_main->p_intf->p_sys->b_disabled_menus )
+ else if ( !p_intf->p_sys->b_disabled_menus )
{
setupMenus();
- p_main->p_intf->p_sys->b_disabled_menus = 1;
+ p_intf->p_sys->b_disabled_menus = 1;
}
return( 0 );
}
int Intf_VLCWrapper::playlistCurrentPos()
{
- /*playlistLock();
- int pos = p_main->p_playlist->i_index;
+ playlistLock();
+ int pos = p_intf->p_sys->p_playlist->i_index;
playlistUnlock();
- return pos;*/
+ return pos;
}
int Intf_VLCWrapper::playlistSize()
{
- /*playlistLock();
- int size = p_main->p_playlist->i_size;
+ playlistLock();
+ int size = p_intf->p_sys->p_playlist->i_size;
playlistUnlock();
- return size;*/
+ return size;
}
void Intf_VLCWrapper::playlistLock()
{
- /*vlc_mutex_lock( &p_main->p_playlist->change_lock );*/
+ vlc_mutex_lock( &p_intf->p_sys->p_playlist->object_lock );
}
void Intf_VLCWrapper::playlistUnlock()
{
- /*vlc_mutex_unlock( &p_main->p_playlist->change_lock );*/
+ vlc_mutex_unlock( &p_intf->p_sys->p_playlist->object_lock );
}
void Intf_VLCWrapper::getNavCapabilities( bool* canSkipPrev,
bool* canSkipNext )
{
-#if 0
if ( canSkipPrev && canSkipNext )
{
// init the parameters
*canSkipNext = false;
// get playlist info
playlistLock();
- int pos = p_main->p_playlist->i_index;
- int size = p_main->p_playlist->i_size;
+ int pos = p_intf->p_sys->p_playlist->i_index;
+ int size = p_intf->p_sys->p_playlist->i_size;
playlistUnlock();
- input_thread_t* input = p_input_bank->pp_input[0];
+ /* input_thread_t* input = p_input_bank->pp_input[0]; */
+ input_thread_t* input = p_intf->p_sys->p_input;
// see if we have got a stream going
if ( input )
{
if ( !*canSkipNext )
*canSkipNext = pos < size - 1;
}
-#endif
}
void Intf_VLCWrapper::navigatePrev()
void Intf_VLCWrapper::loop()
{
-#if 0
- intf_thread_t * p_intf = p_main->p_intf;
-
if ( p_intf->p_sys->b_loop )
{
- intf_PlaylistDelete( p_main->p_playlist,
- p_main->p_playlist->i_size - 1 );
+ playlist_Delete( p_intf->p_sys->p_playlist,
+ p_intf->p_sys->p_playlist->i_size - 1 );
}
else
{
- intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END,
- "vlc:loop" );
+ playlist_Add( p_intf->p_sys->p_playlist, "vlc:loop",
+ PLAYLIST_APPEND | PLAYLIST_GO,
+ PLAYLIST_END );
}
p_intf->p_sys->b_loop = !p_intf->p_sys->b_loop;
-#endif
}
void Intf_VLCWrapper::volume_mute()
{
-/*
- if( p_aout_bank->i_count > 0
- && p_aout_bank->pp_aout[0] != NULL )
+ 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_main->p_intf->p_sys->b_mute )
+ if( !p_intf->p_sys->b_mute )
{
- p_main->p_intf->p_sys->i_saved_volume =
- p_aout_bank->pp_aout[0]->i_volume;
- p_aout_bank->pp_aout[0]->i_volume = 0;
- p_main->p_intf->p_sys->b_mute = 1;
+ p_intf->p_sys->i_saved_volume = p_intf->p_sys->p_aout->output.i_volume;
+ p_intf->p_sys->p_aout->output.i_volume = 0;
+ p_intf->p_sys->b_mute = 1;
}
}
-*/
+
}
void Intf_VLCWrapper::volume_restore()
{
-/*
- if( p_aout_bank->i_count > 0
- && p_aout_bank->pp_aout[0] != NULL )
+ 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_aout_bank->pp_aout[0]->i_volume =
- p_main->p_intf->p_sys->i_saved_volume;
- p_main->p_intf->p_sys->i_saved_volume = 0;
- p_main->p_intf->p_sys->b_mute = 0;
+ p_intf->p_sys->p_aout->output.i_volume = p_intf->p_sys->i_saved_volume;
+ p_intf->p_sys->i_saved_volume = 0;
+ p_intf->p_sys->b_mute = 0;
}
-*/
+
}
void Intf_VLCWrapper::set_volume(int value)
{
-#if 0
- if( p_aout_bank->i_count > 0
- && p_aout_bank->pp_aout[0] != NULL )
+ 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
if (value < 0)
value = 0;
if (value > AOUT_VOLUME_MAX)
value = AOUT_VOLUME_MAX;
- vlc_mutex_lock( &p_aout_bank->lock );
- // unmute volume if muted
- if ( p_main->p_intf->p_sys->b_mute )
- p_main->p_intf->p_sys->b_mute = 0;
- // set every stream to the given value
- for ( int i = 0 ; i < p_aout_bank->i_count ; i++ )
- {
- if ( p_aout_bank->pp_aout[i] )
- p_aout_bank->pp_aout[i]->i_volume = value;
- }
- vlc_mutex_unlock( &p_aout_bank->lock );
+ vlc_mutex_lock( &p_intf->p_sys->p_aout->mixer_lock );
+ // unmute volume if muted
+ if ( p_intf->p_sys->b_mute )
+ {
+ p_intf->p_sys->b_mute = 0;
+ p_intf->p_sys->p_aout->output.i_volume = value;
+ }
+ vlc_mutex_unlock( &p_intf->p_sys->p_aout->mixer_lock );
}
-#endif
}
void Intf_VLCWrapper::toggle_mute()
{
-/*
- if( p_aout_bank->i_count > 0
- && p_aout_bank->pp_aout[0] != NULL )
+ 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_main->p_intf->p_sys->b_mute )
+ if ( p_intf->p_sys->b_mute )
{
- Intf_VLCWrapper::volume_restore();
+ volume_restore();
}
else
{
- Intf_VLCWrapper::volume_mute();
+ volume_mute();
}
}
-*/
}
bool Intf_VLCWrapper::is_muted()
{
-#if 0
bool muted = true;
- if ( p_aout_bank->i_count > 0 )
+
+ 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_aout_bank->lock );
- for ( int i = 0 ; i < p_aout_bank->i_count ; i++ )
- {
- if ( p_aout_bank->pp_aout[i]
- && p_aout_bank->pp_aout[i]->i_volume > 0 )
- {
- muted = false;
- break;
- }
- }
- vlc_mutex_unlock( &p_aout_bank->lock );
+ vlc_mutex_lock( &p_intf->p_sys->p_aout->mixer_lock );
+ if( p_intf->p_sys->p_aout->output.i_volume > 0 )
+ {
+ muted = false;
+ }
+ vlc_mutex_unlock( &p_intf->p_sys->p_aout->mixer_lock );
// unfortunately, this is not reliable!
// return p_main->p_intf->p_sys->b_mute;
}
return muted;
-#endif
}
bool Intf_VLCWrapper::is_playing()
{
-/*
+
bool playing = false;
- if ( p_input_bank->pp_input[0] )
+ if ( p_intf->p_sys->p_input )
{
- switch ( p_input_bank->pp_input[0]->stream.control.i_status )
+ switch ( p_intf->p_sys->p_input->stream.control.i_status )
{
case PLAYING_S:
case FORWARD_S:
}
}
return playing;
-*/
+
}
void Intf_VLCWrapper::maxvolume()
{
-/*
- if( p_aout_bank->i_count > 0
- && p_aout_bank->pp_aout[0] != NULL )
+ 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_main->p_intf->p_sys->b_mute )
+ if( p_intf->p_sys->b_mute )
{
- p_main->p_intf->p_sys->i_saved_volume = VOLUME_MAX;
+ p_intf->p_sys->i_saved_volume = AOUT_VOLUME_MAX;
}
else
{
- p_aout_bank->pp_aout[0]->i_volume = VOLUME_MAX;
+ p_intf->p_sys->p_aout->output.i_volume = AOUT_VOLUME_MAX;
}
}
-*/
}
bool Intf_VLCWrapper::has_audio()
{
- /* return (p_aout_bank->i_count > 0); */
+ 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 );
}
//void Intf_VLCWrapper::fullscreen()
}
}
-bool Intf_VLCWrapper::playlistPlaying()
+/* bool Intf_VLCWrapper::playlistPlaying()
{
- /* return( !p_main->p_playlist->b_stopped ); */
-}
+ return( !p_intf->p_sys->p_playlist->b_stopped );
+} */
BList *Intf_VLCWrapper::playlistAsArray()
{
void Intf_VLCWrapper::openFiles( BList* o_files, bool replace )
{
BString *o_file;
- 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;
while( ( o_file = (BString *)o_files->LastItem() ) )
{
* intf_vlc_wrapper.h: BeOS plugin for vlc (derived from MacOS X port )
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: VlcWrapper.h,v 1.2 2002/09/30 18:30:27 titer Exp $
+ * $Id: VlcWrapper.h,v 1.3 2002/10/10 23:11:52 titer Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
class InterfaceWindow;
+class Intf_VLCWrapper;
/*****************************************************************************
* intf_sys_t: description and status of FB interface
InterfaceWindow * p_window;
char i_key;
- /* The input thread */
- input_thread_t * p_input;
+ input_thread_t * p_input;
+ playlist_t * p_playlist;
+ aout_instance_t * p_aout;
/* DVD mode */
vlc_bool_t b_disabled_menus;
int i_part;
int i_saved_volume;
int i_channel;
+
+ Intf_VLCWrapper * p_vlc_wrapper;
};
/* Intf_VLCWrapper is a singleton class
void loop();
//private:
- Intf_VLCWrapper( intf_thread_t *p_if );
- es_descriptor_t * p_audio_es;
+ Intf_VLCWrapper( intf_thread_t *p_intf );
+ es_descriptor_t * p_audio_es;
intf_thread_t *p_intf;
};