Commit a5e3711f authored by Sam Hocevar's avatar Sam Hocevar

* ./plugins/win32/*: tried to port the Win32 interface to the new API. Seems

    to be still crashing.
parent 5c13c83c
......@@ -2,7 +2,7 @@
* intf.h: interface header for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: intf.h,v 1.1 2002/06/01 12:31:58 sam Exp $
* $Id: intf.h,v 1.2 2002/06/07 23:53:44 sam Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -36,7 +36,7 @@ extern "C" {
*****************************************************************************/
#include "interface.h"
#include "intf_eject.h"
#include "playlist.h"
#include "vlc_playlist.h"
#include "stream_control.h"
#include "input_ext-intf.h"
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.6 2002/06/04 00:11:12 sam Exp $
* $Id: vlc_common.h,v 1.7 2002/06/07 23:53:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -24,6 +24,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Compiler-specific workarounds
*****************************************************************************/
#if defined( __BORLANDC__ )
# undef HAVE_VARIADIC_MACROS
# undef HAVE_STDINT_H
#endif
/*****************************************************************************
* Required system headers
*****************************************************************************/
......@@ -200,13 +208,6 @@ VLC_DECLARE_STRUCT(iso639_lang)
#include "vlc_threads.h"
/*****************************************************************************
* Compiler-specific workarounds
*****************************************************************************/
#if defined( __BORLANDC__ )
# undef HAVE_VARIADIC_MACROS
#endif
/*****************************************************************************
* Common structure members
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* vlc_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: playlist.h,v 1.7 2002/06/07 19:54:37 sam Exp $
* $Id: vlc_playlist.h,v 1.1 2002/06/07 23:53:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......
......@@ -2,7 +2,7 @@
* intf_vlc_wrapper.c: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf_vlc_wrapper.m,v 1.12 2002/06/02 22:31:52 massiot Exp $
* $Id: intf_vlc_wrapper.m,v 1.13 2002/06/07 23:53:44 sam Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -33,7 +33,7 @@
#include <videolan/vlc.h>
#include "interface.h"
#include "intf_playlist.h"
#include "vlc_playlist.h"
#include "intf_eject.h"
#include "video.h"
......
......@@ -44,55 +44,42 @@ bool ControlBack( TObject *Sender )
bool ControlStop( TObject *Sender )
{
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
/* end playing item */
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;
/* update playlist */
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
p_intfGlobal->p_vlc->p_playlist->i_index--;
p_intfGlobal->p_vlc->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
return false;
}
playlist_Stop( p_playlist );
vlc_object_release( p_playlist );
return true;
}
bool ControlPlay( TObject *Sender )
{
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
p_intfGlobal->p_sys->p_window->MenuOpenFileClick( Sender );
return false;
}
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->i_size )
{
input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
p_intfGlobal->p_vlc->p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Play( p_playlist );
vlc_object_release( p_playlist );
}
else
{
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
if( p_intfGlobal->p_vlc->p_playlist->b_stopped )
{
if( p_intfGlobal->p_vlc->p_playlist->i_size )
{
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
intf_PlaylistJumpto( p_intfGlobal->p_vlc->p_playlist,
p_intfGlobal->p_vlc->p_playlist->i_index );
}
else
{
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
p_intfGlobal->p_sys->p_window->MenuOpenFileClick( Sender );
}
}
else
{
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
}
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
p_intfGlobal->p_sys->p_window->MenuOpenFileClick( Sender );
}
return true;
......@@ -101,13 +88,9 @@ bool ControlPlay( TObject *Sender )
bool ControlPause( TObject *Sender )
{
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
if( p_intfGlobal->p_sys->p_input != NULL )
{
input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PAUSE );
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
p_intfGlobal->p_vlc->p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PAUSE );
}
return true;
......@@ -116,13 +99,9 @@ bool ControlPause( TObject *Sender )
bool ControlSlow( TObject *Sender )
{
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
if( p_intfGlobal->p_sys->p_input != NULL )
{
input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_SLOWER );
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
p_intfGlobal->p_vlc->p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_SLOWER );
}
return true;
......@@ -131,13 +110,9 @@ bool ControlSlow( TObject *Sender )
bool ControlFast( TObject *Sender )
{
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
if( p_intfGlobal->p_sys->p_input != NULL )
{
input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_FASTER );
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
p_intfGlobal->p_vlc->p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_FASTER );
}
return true;
......
......@@ -64,7 +64,14 @@ void __fastcall TDiscDlg::BitBtnCancelClick( TObject *Sender )
void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )
{
AnsiString Device, Source, Method, Title, Chapter;
int i_end = p_intfGlobal->p_vlc->p_playlist->i_size;
playlist_t * p_playlist;
p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
Hide();
......@@ -86,20 +93,13 @@ void __fastcall TDiscDlg::BitBtnOkClick( TObject *Sender )
/* Build source name and add it to playlist */
Source = Method + ":" + Device + "@" + Title + "," + Chapter;
intf_PlaylistAdd( p_intfGlobal->p_vlc->p_playlist,
PLAYLIST_END, Source.c_str() );
playlist_Add( p_playlist, Source.c_str(),
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */
p_intfGlobal->p_sys->p_playlist->
UpdateGrid( p_intfGlobal->p_vlc->p_playlist );
/* stop current item, select added item */
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
{
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;
}
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );
intf_PlaylistJumpto( p_intfGlobal->p_vlc->p_playlist, i_end - 1 );
vlc_object_release( p_playlist );
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::RadioGroupTypeClick( TObject *Sender )
......
......@@ -77,6 +77,8 @@ static int intf_Open( intf_thread_t *p_intf )
/* Initialize Win32 thread */
p_intf->p_sys->b_playing = 0;
p_intf->p_sys->b_popup_changed = 0;
p_intf->p_sys->p_input = NULL;
p_intf->p_sys->i_playing = -1;
p_intf->p_sys->b_slider_free = 1;
......@@ -88,6 +90,11 @@ static int intf_Open( intf_thread_t *p_intf )
*****************************************************************************/
static void intf_Close( intf_thread_t *p_intf )
{
if( p_intf->p_sys->p_input )
{
vlc_object_release( p_intf->p_sys->p_input );
}
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
/* Destroy structure */
......@@ -100,7 +107,7 @@ static void intf_Close( intf_thread_t *p_intf )
static void intf_Run( intf_thread_t *p_intf )
{
p_intf->p_sys->p_window = new TMainFrameDlg( NULL );
p_intf->p_sys->p_playlist = new TPlaylistDlg( NULL );
p_intf->p_sys->p_playwin = new TPlaylistDlg( NULL );
p_intf->p_sys->p_messages = new TMessagesDlg( NULL );
/* show main window and wait until it is closed */
......@@ -110,7 +117,7 @@ static void intf_Run( intf_thread_t *p_intf )
if( p_intf->p_sys->p_network ) delete p_intf->p_sys->p_network;
if( p_intf->p_sys->p_preferences ) delete p_intf->p_sys->p_preferences;
delete p_intf->p_sys->p_messages;
delete p_intf->p_sys->p_playlist;
delete p_intf->p_sys->p_playwin;
}
/*****************************************************************************
......@@ -138,16 +145,30 @@ int Win32Manage( intf_thread_t *p_intf )
p_intf->p_sys->p_messages->UpdateLog();
/* Update the playlist */
p_intf->p_sys->p_playlist->Manage( p_intf );
p_intf->p_sys->p_playwin->Manage( p_intf );
if( p_intf->p_vlc->p_input_bank->pp_input[0] != NULL )
/* Update the input */
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 );
}
else if( p_intf->p_sys->p_input->b_dead )
{
vlc_object_release( p_intf->p_sys->p_input );
p_intf->p_sys->p_input = NULL;
}
if( p_intf->p_sys->p_input )
{
vlc_mutex_lock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
input_thread_t *p_input = p_intf->p_sys->p_input;
if( !p_intf->p_vlc->p_input_bank->pp_input[0]->b_die )
vlc_mutex_lock( &p_input->stream.stream_lock );
if( !p_input->b_die )
{
/* New input or stream map change */
if( p_intf->p_vlc->p_input_bank->pp_input[0]->stream.b_changed )
if( p_input->stream.b_changed )
{
p_intf->p_sys->p_window->ModeManage();
SetupMenus( p_intf );
......@@ -155,13 +176,12 @@ int Win32Manage( intf_thread_t *p_intf )
}
/* Manage the slider */
if( p_intf->p_vlc->p_input_bank->pp_input[0]->stream.b_seekable &&
p_intf->p_sys->b_playing )
if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
{
TTrackBar * TrackBar = p_intf->p_sys->p_window->TrackBar;
off_t NewValue = TrackBar->Position;
#define p_area p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area
#define p_area p_input->stream.p_selected_area
/* If the user hasn't touched the slider since the last time,
* then the input can safely change it */
if( NewValue == p_intf->p_sys->OldValue )
......@@ -179,9 +199,9 @@ int Win32Manage( intf_thread_t *p_intf )
(off_t)SLIDER_MAX_VALUE;
/* release the lock to be able to seek */
vlc_mutex_unlock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
input_Seek( p_intf->p_vlc->p_input_bank->pp_input[0]->p_this, i_seek, INPUT_SEEK_SET );
vlc_mutex_lock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_input->stream.stream_lock );
input_Seek( p_input, i_seek, INPUT_SEEK_SET );
vlc_mutex_lock( &p_input->stream.stream_lock );
/* Update the old value */
p_intf->p_sys->OldValue = NewValue;
......@@ -194,14 +214,14 @@ int Win32Manage( intf_thread_t *p_intf )
}
if( p_intf->p_sys->i_part !=
p_intf->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part )
p_input->stream.p_selected_area->i_part )
{
// p_intf->p_sys->b_chapter_update = 1;
SetupMenus( p_intf );
}
}
vlc_mutex_unlock( &p_intf->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
else if( p_intf->p_sys->b_playing && !p_intf->p_vlc->b_die )
{
......@@ -209,9 +229,6 @@ int Win32Manage( intf_thread_t *p_intf )
p_intf->p_sys->b_playing = 0;
}
/* Manage core vlc functions through the callback */
p_intf->pf_manage( p_intf );
if( p_intf->p_vlc->b_die )
{
vlc_mutex_unlock( &p_intf->change_lock );
......
......@@ -91,21 +91,21 @@ void __fastcall TMainFrameDlg::TrackBarChange( TObject *Sender )
* the stream. It is called whenever the slider changes its value.
* The lock has to be taken before the function is called */
// vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
// vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
if( p_intfGlobal->p_sys->p_input != NULL )
{
#define p_area p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area
#define p_area p_intfGlobal->p_sys->p_input->stream.p_selected_area
char psz_time[ OFFSETTOTIME_MAX_SIZE ];
off_t Value = TrackBar->Position;
GroupBoxSlider->Caption =
input_OffsetToTime( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], psz_time,
input_OffsetToTime( p_intfGlobal->p_sys->p_input, psz_time,
( p_area->i_size * Value ) / (off_t)SLIDER_MAX_VALUE );
#undef p_area
}
// vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
// vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::FormClose( TObject *Sender,
......@@ -128,26 +128,28 @@ void __fastcall TMainFrameDlg::FormClose( TObject *Sender,
****************************************************************************/
void __fastcall TMainFrameDlg::MenuOpenFileClick( TObject *Sender )
{
int i_end = p_intfGlobal->p_vlc->p_playlist->i_size;
AnsiString FileName;
playlist_t * p_playlist;
p_playlist = (playlist_t *)vlc_object_find( p_intfGlobal,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
if( OpenDialog1->Execute() )
{
/* add the new file to the interface playlist */
FileName = OpenDialog1->FileName;
intf_PlaylistAdd( p_intfGlobal->p_vlc->p_playlist, PLAYLIST_END,
(char*)FileName.c_str() );
playlist_Add( p_playlist, (char*)FileName.c_str(),
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the plugin display */
p_intfGlobal->p_sys->p_playlist->UpdateGrid( p_intfGlobal->p_vlc->p_playlist );
/* end current item, select added item */
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
{
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;
}
intf_PlaylistJumpto( p_intfGlobal->p_vlc->p_playlist, i_end - 1 );
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );
};
vlc_object_release( p_playlist );
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::MenuOpenDiscClick( TObject *Sender )
......@@ -184,27 +186,39 @@ void __fastcall TMainFrameDlg::MenuHideinterfaceClick( TObject *Sender )
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::MenuFullscreenClick( TObject *Sender )
{
if( p_intfGlobal->p_vlc->p_vout_bank->i_count )
{
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_vout_bank->pp_vout[0]->change_lock );
p_intfGlobal->p_vlc->p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
vout_thread_t *p_vout;
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_vout_bank->pp_vout[0]->change_lock );
p_vout = (vout_thread_t *)vlc_object_find( p_intfGlobal->p_sys->p_input,
VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout == NULL )
{
return;
}
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
vlc_object_release( p_vout );
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::MenuPlaylistClick( TObject *Sender )
{
TPlaylistDlg *p_playlist = p_intfGlobal->p_sys->p_playlist;
if( p_playlist->Visible )
TPlaylistDlg *p_playwin = p_intfGlobal->p_sys->p_playwin;
if( p_playwin->Visible )
{
p_playlist->Hide();
p_playwin->Hide();
}
else
{
p_playlist->UpdateGrid( p_intfGlobal->p_vlc->p_playlist );
p_playlist->Show();
playlist_t * p_playlist;
p_playlist = (playlist_t *)vlc_object_find( p_intfGlobal,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
p_playwin->UpdateGrid( p_playlist );
vlc_object_release( p_playlist );
p_playwin->Show();
}
}
//---------------------------------------------------------------------------
......@@ -282,17 +296,26 @@ void __fastcall TMainFrameDlg::ToolButtonFastClick( TObject *Sender )
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::ToolButtonPrevClick( TObject *Sender )
{
p_intfGlobal->p_sys->p_playlist->Previous();
p_intfGlobal->p_sys->p_playwin->Previous();
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::ToolButtonNextClick( TObject *Sender )
{
p_intfGlobal->p_sys->p_playlist->Next();
p_intfGlobal->p_sys->p_playwin->Next();
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::ToolButtonEjectClick( TObject *Sender )
{
AnsiString Device = "";
char * psz_current;
playlist_t * p_playlist;
p_playlist = (playlist_t *)vlc_object_find( p_intfGlobal,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
/*
* Get the active input
......@@ -300,29 +323,35 @@ void __fastcall TMainFrameDlg::ToolButtonEjectClick( TObject *Sender )
* If it's neither a VCD nor a DVD, then return
*/
if( p_intfGlobal->p_vlc->p_playlist->current.psz_name != NULL )
vlc_mutex_lock( &p_playlist->object_lock );
psz_current = p_playlist->pp_items[ p_playlist->i_index ]->psz_name;
if( psz_current != NULL )
{
if( strncmp( p_intfGlobal->p_vlc->p_playlist->current.psz_name, "dvd", 3 )
|| strncmp( p_intfGlobal->p_vlc->p_playlist->current.psz_name, "vcd", 3 ) )
if( strncmp( psz_current, "dvd", 3 )
|| strncmp( psz_current, "vcd", 3 ) )
{
/* Determine the device name by omitting the first 4 characters
* and keeping 3 characters */
Device = strdup( ( p_intfGlobal->p_vlc->p_playlist->current.psz_name + 4 ) );
Device = strdup( ( psz_current + 4 ) );
Device = Device.SubString( 1, 2 );
}
}
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
if( Device == "" )
{
return;
}
/* If there's a stream playing, we aren't allowed to eject ! */
if( p_input_bank->pp_input[0] == NULL )
if( p_intfGlobal->p_sys->p_input == NULL )
{
intf_WarnMsg( 4, "intf: ejecting %s", Device.c_str() );
msg_Dbg( p_intfGlobal, "ejecting %s", Device.c_str() );
intf_Eject( Device.c_str() );
intf_Eject( p_intfGlobal, Device.c_str() );
}
}
//--------------------------------------------------------------------------
......@@ -431,95 +460,89 @@ void __fastcall TMainFrameDlg::PopupNetworkStreamClick( TObject *Sender )
void __fastcall TMainFrameDlg::ButtonTitlePrevClick( TObject *Sender )
{
intf_thread_t * p_intf;
input_bank_t * p_input_bank;
input_area_t * p_area;
int i_id;
p_intf = p_intfGlobal;
p_input_bank = p_intf->p_vlc->p_input_bank;
i_id = p_input_bank->pp_input[0]->stream.p_selected_area->i_id - 1;
i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id - 1;
/* Disallow area 0 since it is used for video_ts.vob */
if( i_id > 0 )
{
p_area = p_input_bank->pp_input[0]->stream.pp_areas[i_id];
input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );
p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];
input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_title_update = 1;
vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
SetupMenus( p_intf );
vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
}
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::ButtonTitleNextClick( TObject *Sender )
{
intf_thread_t * p_intf;
input_bank_t * p_input_bank;
input_area_t * p_area;
int i_id;
p_intf = p_intfGlobal;
p_input_bank = p_intf->p_vlc->p_input_bank;
i_id = p_input_bank->pp_input[0]->stream.p_selected_area->i_id + 1;
i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id + 1;
if( i_id < p_input_bank->pp_input[0]->stream.i_area_nb )
if( i_id < p_intf->p_sys->p_input->stream.i_area_nb )
{
p_area = p_input_bank->pp_input[0]->stream.pp_areas[i_id];
input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );
p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];
input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_title_update = 1;
vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
SetupMenus( p_intf );
vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
}
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::ButtonChapterPrevClick( TObject *Sender )
{
intf_thread_t * p_intf = p_intfGlobal;
input_bank_t * p_input_bank = p_intf->p_vlc->p_input_bank;
input_area_t * p_area;
p_area = p_input_bank->pp_input[0]->stream.p_selected_area;
p_area = p_intf->p_sys->p_input->stream.p_selected_area;
if( p_area->i_part > 0 )
{
p_area->i_part--;
input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );
input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_chapter_update = 1;
vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
SetupMenus( p_intf );
vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
}
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::ButtonChapterNextClick( TObject *Sender )
{
intf_thread_t * p_intf = p_intfGlobal;
input_bank_t * p_input_bank = p_intf->p_vlc->p_input_bank;
input_area_t * p_area;
p_area = p_input_bank->pp_input[0]->stream.p_selected_area;
p_area = p_intf->p_sys->p_input->stream.p_selected_area;
if( p_area->i_part < p_area->i_part_nb )
{
p_area->i_part++;
input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );
input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
p_intf->p_sys->b_chapter_update = 1;
vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
SetupMenus( p_intf );
vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
}
}
//---------------------------------------------------------------------------
......@@ -531,7 +554,6 @@ void __fastcall TMainFrameDlg::ButtonChapterNextClick( TObject *Sender )
void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
{
intf_thread_t *p_intf = p_intfGlobal;
input_bank_t *p_input_bank = p_intf->p_vlc->p_input_bank;
int i_channel;
i_channel = SpinEditChannel->Value;
......@@ -541,7 +563,7 @@ void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
network_ChannelJoin( p_intf, i_channel );
vlc_mutex_unlock( &p_intf->change_lock );
// input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
// input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
}
//---------------------------------------------------------------------------
......@@ -555,7 +577,6 @@ void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
void __fastcall TMainFrameDlg::ModeManage()
{
intf_thread_t * p_intf = p_intfGlobal;
input_bank_t * p_input_bank = p_intf->p_vlc->p_input_bank;
TGroupBox * ActiveGB;
int i_Height;
bool b_control;
......@@ -572,14 +593,14 @@ void __fastcall TMainFrameDlg::ModeManage()
b_control = 0;
/* show the box related to current input mode */
if( p_input_bank->pp_input[0] != NULL )
if( p_intf->p_sys->p_input != NULL )
{
switch( p_input_bank->pp_input[0]->stream.i_method & 0xf0 )
switch( p_intf->p_sys->p_input->stream.i_method & 0xf0 )
{
case INPUT_METHOD_FILE:
GroupBoxFile->Visible = true;
ActiveGB = GroupBoxFile;
LabelFileName->Caption = p_input_bank->pp_input[0]->psz_source;
LabelFileName->Caption = p_intf->p_sys->p_input->psz_source;
break;
case INPUT_METHOD_DISC:
GroupBoxDisc->Visible = true;
......@@ -588,7 +609,7 @@ void __fastcall TMainFrameDlg::ModeManage()
case INPUT_METHOD_NETWORK:
GroupBoxNetwork->Visible = true;
ActiveGB = GroupBoxNetwork;
LabelServer->Caption = p_input_bank->pp_input[0]->psz_source;
LabelServer->Caption = p_intf->p_sys->p_input->psz_source;
if( config_GetInt( p_intf, "network-channel" ) )
{
LabelChannel->Visible = true;
......@@ -602,14 +623,14 @@ void __fastcall TMainFrameDlg::ModeManage()
msg_Warn( p_intf, "cannot determine input method" );
GroupBoxFile->Visible = true;
ActiveGB = GroupBoxFile;
LabelFileName->Caption = p_input_bank->pp_input[0]->psz_source;
LabelFileName->Caption = p_intf->p_sys->p_input->psz_source;
break;
}
i_Height = StatusBar->Height + ActiveGB->Height + ToolBar->Height + 54;
/* initialize and show slider for seekable streams */
if( p_input_bank->pp_input[0]->stream.b_seekable )
if( p_intf->p_sys->p_input->stream.b_seekable )
{
TrackBar->Position = p_intf->p_sys->OldValue = 0;
GroupBoxSlider->Show();
......@@ -617,7 +638,7 @@ void __fastcall TMainFrameDlg::ModeManage()
}
/* control buttons for free pace streams */
b_control = p_input_bank->pp_input[0]->stream.b_pace_control;
b_control = p_intf->p_sys->p_input->stream.b_pace_control;
/* get ready for menu regeneration */
p_intf->p_sys->b_program_update = 1;
......@@ -627,7 +648,7 @@ void __fastcall TMainFrameDlg::ModeManage()
p_intf->p_sys->b_spu_update = 1;
p_intf->p_sys->i_part = 0;
p_input_bank->pp_input[0]->stream.b_changed = 0;
p_intf->p_sys->p_input->stream.b_changed = 0;
msg_Dbg( p_intf, "stream has changed, refreshing interface" );
}
else
......
......@@ -100,9 +100,9 @@ static void __fastcall LangChange( TMenuItem *RootCurrent, TMenuItem *Item,
}
else
{
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
p_es = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_es[i_es];
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
p_es = p_intfGlobal->p_sys->p_input->stream.pp_es[i_es];
vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
}
/* find the current ES */
......@@ -118,8 +118,8 @@ static void __fastcall LangChange( TMenuItem *RootCurrent, TMenuItem *Item,
}
/* exchange them */
input_ToggleES( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], p_es_old, false );
input_ToggleES( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], p_es, true );
input_ToggleES( p_intfGlobal->p_sys->p_input, p_es_old, false );
input_ToggleES( p_intfGlobal->p_sys->p_input, p_es, true );
Item->Checked = true;
Index2Item( RootOther, i_index + 1, true )->Checked = true;
......@@ -137,7 +137,7 @@ static void __fastcall ProgramChange( TMenuItem *Item, TMenuItem *RootOther )
int i_program = Item->Tag;
/* toggle the program */
input_ChangeProgram( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], (u16)i_program );
input_ChangeProgram( p_intfGlobal->p_sys->p_input, (u16)i_program );
/* check selected menu items */
Item->Checked = true;
......@@ -146,13 +146,13 @@ static void __fastcall ProgramChange( TMenuItem *Item, TMenuItem *RootOther )
/* update audio/subtitles menus */
p_intf->p_sys->b_audio_update = 1;
p_intf->p_sys->b_spu_update = 1;
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
SetupMenus( p_intf );
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
p_intf->p_sys->b_audio_update = 0;
p_intf->p_sys->b_spu_update = 0;
input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );
}
......@@ -217,10 +217,10 @@ void __fastcall TMainFrameDlg::PopupNavigationClick( TObject *Sender )
int i_title = DATA2TITLE( Item->Tag );
int i_chapter = DATA2CHAPTER( Item->Tag );
p_area = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title];
p_area = p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title];
p_area->i_part = i_chapter;
input_ChangeArea( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], (input_area_t*)p_area );
input_ChangeArea( p_intfGlobal->p_sys->p_input, (input_area_t*)p_area );
Item->Checked = true;
ItemTitle = Index2Item( MenuTitle, i_title - 1, false );
......@@ -232,14 +232,14 @@ void __fastcall TMainFrameDlg::PopupNavigationClick( TObject *Sender )
else
{
/* new title => we must rebuild the chapter menu */
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
RadioMenu( MenuChapter, "Chapter",
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part_nb,
p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part_nb,
i_chapter, MenuChapterClick );
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
}
input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );
}
/*
......@@ -252,13 +252,13 @@ void __fastcall TMainFrameDlg::MenuTitleClick( TObject *Sender )
TMenuItem * ItemTitle;
int i_title = Item->Tag;
input_ChangeArea( p_intfGlobal->p_vlc->p_input_bank->pp_input[0],
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title] );
input_ChangeArea( p_intfGlobal->p_sys->p_input,
p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title] );
Item->Checked = true;
ItemTitle = Index2Item( PopupNavigation, i_title - 1, false );
Index2Item( ItemTitle, 0, false )->Checked = true;
input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );
}
/*
......@@ -273,16 +273,16 @@ void __fastcall TMainFrameDlg::MenuChapterClick( TObject *Sender )
int i_title;
int i_chapter = Item->Tag;
p_area = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area;
p_area = p_intfGlobal->p_sys->p_input->stream.p_selected_area;
p_area->i_part = i_chapter;
input_ChangeArea( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], (input_area_t*)p_area );
input_ChangeArea( p_intfGlobal->p_sys->p_input, (input_area_t*)p_area );
i_title = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id;
i_title = p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_id;
ItemTitle = Index2Item( PopupNavigation, i_title - 1, false );
Index2Item( ItemTitle, i_chapter - 1, false )->Checked = true;
input_SetStatus( p_intfGlobal->p_vlc->p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PLAY );
}
......@@ -405,10 +405,10 @@ static void __fastcall ProgramMenu( TMenuItem * Root,
ItemActive = NULL;
/* create a set of program buttons and append them to the container */
for( i = 0; i < p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_pgrm_number; i++ )
for( i = 0; i < p_intfGlobal->p_sys->p_input->stream.i_pgrm_number; i++ )
{
Name.sprintf( "id %d",
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_programs[i]->i_number );
p_intfGlobal->p_sys->p_input->stream.pp_programs[i]->i_number );
Item = new TMenuItem( Root );
Item->Caption = Name;
......@@ -420,7 +420,7 @@ static void __fastcall ProgramMenu( TMenuItem * Root,
* It will be used in the callback. */
Item->Tag = i + 1;
if( p_pgrm == p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_programs[i] )
if( p_pgrm == p_intfGlobal->p_sys->p_input->stream.pp_programs[i] )
{
/* don't lose Item when we append into menu */
ItemActive = Item;
......@@ -437,7 +437,7 @@ static void __fastcall ProgramMenu( TMenuItem * Root,
}
/* be sure that menu is enabled if more than 1 program */
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_pgrm_number > 1 )
if( p_intfGlobal->p_sys->p_input->stream.i_pgrm_number > 1 )
{
Root->Enabled = true;
}
......@@ -485,19 +485,19 @@ static void __fastcall LanguageMenu( TMenuItem * Root, es_descriptor_t * p_es,
ItemActive = NULL;
i_item = 0;
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
#define ES p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_es[i]
#define ES p_intfGlobal->p_sys->p_input->stream.pp_es[i]
/* create a set of language buttons and append them to the Root */
for( i = 0; i < p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_es_number; i++ )
for( i = 0; i < p_intfGlobal->p_sys->p_input->stream.i_es_number; i++ )
{
if( ( ES->i_cat == i_cat ) &&
( !ES->p_pgrm ||
ES->p_pgrm ==
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_program ) )
p_intfGlobal->p_sys->p_input->stream.p_selected_program ) )
{
i_item++;
Name = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_es[i]->psz_desc;
Name = p_intfGlobal->p_sys->p_input->stream.pp_es[i]->psz_desc;
if( Name.IsEmpty() )
{
Name.sprintf( "Language %d", i_item );
......@@ -509,7 +509,7 @@ static void __fastcall LanguageMenu( TMenuItem * Root, es_descriptor_t * p_es,
Item->Caption = Name;
Item->Tag = i;
if( p_es == p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_es[i] )
if( p_es == p_intfGlobal->p_sys->p_input->stream.pp_es[i] )
{
/* don't lose Item when we append into menu */
ItemActive = Item;
......@@ -522,7 +522,7 @@ static void __fastcall LanguageMenu( TMenuItem * Root, es_descriptor_t * p_es,
}
#undef ES
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
/* check currently selected item */
if( ItemActive != NULL )
......@@ -565,7 +565,7 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
Root->Clear();
ItemActive = NULL;
i_title_nb = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_area_nb;
i_title_nb = p_intfGlobal->p_sys->p_input->stream.i_area_nb;
/* loop on titles */
for( i_title = 1; i_title < i_title_nb; i_title++ )
......@@ -586,7 +586,7 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
}
Name.sprintf( "Title %d (%d)", i_title,
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title]->i_part_nb );
p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb );
{
TitleItem = new TMenuItem( Root );
......@@ -595,7 +595,7 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
TitleItem->Caption = Name;
i_chapter_nb =
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title]->i_part_nb;
p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb;
/* loop on chapters */
for( i_chapter = 0; i_chapter < i_chapter_nb; i_chapter++ )
......@@ -626,9 +626,9 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
* ChapterItem, since we will need them in the callback */
ChapterItem->Tag = (int)POS2DATA( i_title, i_chapter + 1 );
#define p_area p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title]
#define p_area p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]
if( ( p_area ==
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area ) &&
p_intfGlobal->p_sys->p_input->stream.p_selected_area ) &&
( p_area->i_part == i_chapter + 1 ) )
{
ItemActive = ChapterItem;
......@@ -653,7 +653,7 @@ static void __fastcall NavigationMenu( TMenuItem * Root,
TitleItem->Add( ChapterGroup );
}
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_areas[i_title]->i_part_nb
if( p_intfGlobal->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb
> 1 )
{
/* be sure that menu is sensitive */
......@@ -708,13 +708,13 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
{
pgrm_descriptor_t * p_pgrm;
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_new_program )
if( p_intfGlobal->p_sys->p_input->stream.p_new_program )
{
p_pgrm = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_new_program;
p_pgrm = p_intfGlobal->p_sys->p_input->stream.p_new_program;
}
else
{
p_pgrm = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_program;
p_pgrm = p_intfGlobal->p_sys->p_input->stream.p_selected_program;
}
ProgramMenu( p_window->MenuProgram, p_pgrm,
......@@ -729,13 +729,13 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
{
RadioMenu( p_window->MenuTitle, "Title",
//why "-1" ?
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_area_nb - 1,
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id,
p_intfGlobal->p_sys->p_input->stream.i_area_nb - 1,
p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_id,
p_window->MenuTitleClick );
AnsiString CurrentTitle;
CurrentTitle.sprintf( "%d",
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_id );
p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_id );
p_window->LabelTitleCurrent->Caption = CurrentTitle;
p_intf->p_sys->b_title_update = 0;
......@@ -744,8 +744,8 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
if( p_intf->p_sys->b_chapter_update )
{
RadioMenu( p_window->MenuChapter, "Chapter",
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part_nb,
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part,
p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part_nb,
p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part,
p_window->MenuChapterClick );
NavigationMenu( p_window->PopupNavigation,
......@@ -753,11 +753,11 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
AnsiString CurrentChapter;
CurrentChapter.sprintf( "%d",
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part );
p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part );
p_window->LabelChapterCurrent->Caption = CurrentChapter;
p_intf->p_sys->i_part =
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.p_selected_area->i_part;
p_intfGlobal->p_sys->p_input->stream.p_selected_area->i_part;
p_intf->p_sys->b_chapter_update = 0;
}
......@@ -766,24 +766,24 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
p_audio_es = NULL;
p_spu_es = NULL;
for( i = 0; i < p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.i_selected_es_number; i++ )
for( i = 0; i < p_intfGlobal->p_sys->p_input->stream.i_selected_es_number; i++ )
{
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_selected_es[i]->i_cat
if( p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i]->i_cat
== AUDIO_ES )
{
p_audio_es = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_selected_es[i];
p_audio_es = p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i];
p_intfGlobal->p_sys->p_audio_es_old = p_audio_es;
}
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_selected_es[i]->i_cat
if( p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i]->i_cat
== SPU_ES )
{
p_spu_es = p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.pp_selected_es[i];
p_spu_es = p_intfGlobal->p_sys->p_input->stream.pp_selected_es[i];
p_intfGlobal->p_sys->p_spu_es_old = p_spu_es;
}
}
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_unlock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
/* audio menus */
if( p_intf->p_sys->b_audio_update )
......@@ -807,7 +807,7 @@ int __fastcall SetupMenus( intf_thread_t * p_intf )
p_intf->p_sys->b_spu_update = 0;
}
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->stream.stream_lock );
vlc_mutex_lock( &p_intfGlobal->p_sys->p_input->stream.stream_lock );
return true;
}
......
......@@ -89,7 +89,7 @@ void __fastcall TMessagesDlg::UpdateLog()
/* Limit log size */
i_count = RichEditMessages->Lines->Count;
i_max_lines = config_GetIntVariable( "intfwin-max-lines" );
i_max_lines = config_GetInt( p_intfGlobal, "intfwin-max-lines" );
if( i_max_lines > 0 )
{
for( i_del = 0; i_del <= i_count - i_max_lines; i_del++ )
......
......@@ -90,33 +90,33 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
AnsiString Channel = ComboBoxCSAddress->Text;
unsigned int i_channel_port = SpinEditCSPort->Value;
unsigned int i_port;
int i_end = p_intfGlobal->p_vlc->p_playlist->i_size;
playlist_t * p_playlist;
Hide();
p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
/* select added item */
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
{
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;
}
Hide();
/* Check which option was chosen */
switch( OldRadioValue )
{
/* UDP */
case 0:
config_PutIntVariable( "network-channel", FALSE );
config_PutInt( p_intfGlobal, "network-channel", FALSE );
i_port = SpinEditUDPPort->Value;
/* Build source name */
Source = "udp:@:" + IntToStr( i_port );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, Source.c_str() );
playlist_Add( p_playlist, Source.c_str(),
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */
p_intfGlobal->p_sys->p_playlist->UpdateGrid( p_main->p_playlist );
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );
break;
/* UDP Multicast */
......@@ -128,12 +128,11 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
/* Build source name */
Source = "udp:@" + Address + ":" + IntToStr( i_port );
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, Source.c_str() );
playlist_Add( p_playlist, Source.c_str(),
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */
p_intfGlobal->p_sys->p_playlist->UpdateGrid( p_main->p_playlist );
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );
break;
/* Channel server */
......@@ -142,9 +141,9 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
config_PutPsz( p_intfGlobal, "channel-server", Channel.c_str() );
config_PutInt( p_intfGlobal, "channel-port", i_channel_port );
if( p_main->p_channel == NULL )
if( p_intfGlobal->p_vlc->p_channel == NULL )
{
network_ChannelCreate();
network_ChannelCreate( p_intfGlobal );
}
p_intfGlobal->p_sys->b_playing = 1;
......@@ -165,14 +164,15 @@ void __fastcall TNetworkDlg::BitBtnOkClick( TObject *Sender )
Source = "http://" + Address;
}
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, Source.c_str() );
playlist_Add( p_playlist, Source.c_str(),
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
/* update the display */
p_intfGlobal->p_sys->p_playlist->UpdateGrid( p_main->p_playlist );
intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
p_intfGlobal->p_sys->p_playwin->UpdateGrid( p_playlist );
break;
}
vlc_object_release( p_playlist );
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::ChangeEnabled( int i_selected )
......
......@@ -91,6 +91,13 @@ void __fastcall TPlaylistDlg::ListViewPlaylistDblClick( TObject *Sender )
TListItem *ItemStart;
TItemStates Focused;
playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
/* search the selected item */
if( ListViewPlaylist->SelCount > 0 )
{
......@@ -106,15 +113,10 @@ void __fastcall TPlaylistDlg::ListViewPlaylistDblClick( TObject *Sender )
Item = ListViewPlaylist->GetNextItem( ItemStart, sdAll, Focused );
}
/* stop current item, select the good one */
if( ( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL ) &&
( Item->Index != p_intfGlobal->p_sys->i_playing ) )
{
/* FIXME: temporary hack */
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;
}
intf_PlaylistJumpto( p_intfGlobal->p_vlc->p_playlist, Item->Index - 1 );
playlist_Goto( p_playlist, Item->Index - 1 );
}
vlc_object_release( p_playlist );
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::ListViewPlaylistKeyDown( TObject *Sender,
......@@ -179,6 +181,7 @@ void __fastcall TPlaylistDlg::MenuAddUrlClick( TObject *Sender )
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::MenuDeleteSelectedClick( TObject *Sender )
{
#if 0 /* PLAYLIST TARASS */
/* user wants to delete a file in the queue */
int i_pos;
playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist;
......@@ -199,10 +202,12 @@ void __fastcall TPlaylistDlg::MenuDeleteSelectedClick( TObject *Sender )
UpdateGrid( p_playlist );
vlc_mutex_unlock( &p_intfGlobal->change_lock );
#endif
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::MenuDeleteAllClick( TObject *Sender )
{
#if 0 /* PLAYLIST TARASS */
int i_pos;
playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist;
......@@ -219,10 +224,12 @@ void __fastcall TPlaylistDlg::MenuDeleteAllClick( TObject *Sender )
UpdateGrid( p_playlist );
vlc_mutex_unlock( &p_intfGlobal->change_lock );
#endif
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::MenuSelectionInvertClick( TObject *Sender )
{
#if 0 /* PLAYLIST TARASS */
#define NOT( var ) ( (var) ? false : true )
int i_pos;
playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist;
......@@ -234,6 +241,7 @@ void __fastcall TPlaylistDlg::MenuSelectionInvertClick( TObject *Sender )
Items->Item[i_pos]->Selected = NOT( Items->Item[i_pos]->Selected );
}
#undef NOT
#endif
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::MenuSelectionCropClick( TObject *Sender )
......@@ -293,14 +301,14 @@ void __fastcall TPlaylistDlg::UpdateGrid( playlist_t * p_playlist )
{
#ifdef WIN32
/* Position of the last '\' in the string */
FileName = rindex( p_playlist->p_item[i_dummy].psz_name, '\\' );
FileName = rindex( p_playlist->pp_items[i_dummy]->psz_name, '\\' );
#else
/* Position of the last '/' in the string */
FileName = rindex( p_playlist->p_item[i_dummy].psz_name, '/' );
FileName = rindex( p_playlist->pp_items[i_dummy]->psz_name, '/' );
#endif
if( ( FileName == NULL ) || ( *(FileName + 1) == '\0' ) )
{
FileName = p_playlist->p_item[i_dummy].psz_name;
FileName = p_playlist->pp_items[i_dummy]->psz_name;
}
else
{
......@@ -319,9 +327,14 @@ void __fastcall TPlaylistDlg::UpdateGrid( playlist_t * p_playlist )
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::Manage( intf_thread_t * p_intf )
{
playlist_t *p_playlist = p_intfGlobal->p_vlc->p_playlist ;
playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
vlc_mutex_lock( &p_playlist->change_lock );
vlc_mutex_lock( &p_playlist->object_lock );
if( p_intf->p_sys->i_playing != p_playlist->i_index )
{
......@@ -331,47 +344,44 @@ void __fastcall TPlaylistDlg::Manage( intf_thread_t * p_intf )
UpdateGrid( p_playlist );
}
vlc_mutex_unlock( &p_playlist->change_lock );
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::DeleteItem( int i_pos )
{
intf_PlaylistDelete( p_intfGlobal->p_vlc->p_playlist, i_pos );
/* are we deleting the current played stream */
if( p_intfGlobal->p_sys->i_playing == i_pos )
playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
/* next ! */
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;
/* this has to set the slider to 0 */
/* step minus one */
p_intfGlobal->p_sys->i_playing-- ;
vlc_mutex_lock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
p_intfGlobal->p_vlc->p_playlist->i_index-- ;
vlc_mutex_unlock( &p_intfGlobal->p_vlc->p_playlist->change_lock );
return;
}
playlist_Delete( p_playlist, i_pos );
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::Previous()
{
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
/* FIXME: temporary hack */
intf_PlaylistPrev( p_intfGlobal->p_vlc->p_playlist );
intf_PlaylistPrev( p_intfGlobal->p_vlc->p_playlist );
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;
return;
}
playlist_Prev( p_playlist );
}
//---------------------------------------------------------------------------
void __fastcall TPlaylistDlg::Next()
{
if( p_intfGlobal->p_vlc->p_input_bank->pp_input[0] != NULL )
playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if( p_playlist == NULL )
{
/* FIXME: temporary hack */
p_intfGlobal->p_vlc->p_input_bank->pp_input[0]->b_eof = 1;
return;
}
playlist_Next( p_playlist );
}
//---------------------------------------------------------------------------
......@@ -194,7 +194,7 @@ void __fastcall TGroupBoxPlugin::ListViewSelectItem( TObject *Sender,
p_module != NULL ;
p_module = p_module->next )
{
if( strcmp( p_module->psz_name, Name.c_str() ) == 0 )
if( strcmp( p_module->psz_object_name, Name.c_str() ) == 0 )
{
ModuleSelected = p_module;
LabelHint->Caption = p_module->psz_longname ?
......@@ -210,12 +210,13 @@ void __fastcall TGroupBoxPlugin::ListViewSelectItem( TObject *Sender,
void __fastcall TGroupBoxPlugin::ButtonSelectClick( TObject *Sender )
{
if( !ModuleSelected ) return;
Edit->Text = ModuleSelected->psz_name;
Edit->Text = ModuleSelected->psz_object_name;
}
//---------------------------------------------------------------------------
void __fastcall TGroupBoxPlugin::ButtonConfigClick( TObject *Sender )
{
p_intfGlobal->p_sys->p_window->CreatePreferences( ModuleSelected->psz_name );
p_intfGlobal->p_sys->p_window->
CreatePreferences( ModuleSelected->psz_object_name );
}
//---------------------------------------------------------------------------
void __fastcall TGroupBoxPlugin::UpdateChanges()
......@@ -272,10 +273,6 @@ __fastcall TGroupBoxInteger::TGroupBoxInteger( TComponent* Owner,
SpinEdit = CreateSpinEdit( this, 16, 164, 24, 21,
-1, 100000, p_config->i_value );
/* init updown */
UpDown = CreateUpDown( this, -1, 32767, p_config->i_value, false );
UpDown->Associate = Edit;
/* vertical alignment */
Height = LabelDesc->Height + 24;
LabelDesc->Top = Top + ( Height - LabelDesc->Height ) / 2 + 4;
......@@ -380,8 +377,11 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
for( p_module = p_intfGlobal->p_vlc->module_bank.first ; p_module != NULL ;
p_module = p_module->next )
{
if( psz_module_name && !strcmp( psz_module_name, p_module->psz_name ) )
if( psz_module_name
&& !strcmp( psz_module_name, p_module->psz_object_name ) )
{
break;
}
}
if( !p_module ) return;
......@@ -431,7 +431,7 @@ void __fastcall TPreferencesDlg::CreateConfigDialog( char *psz_module_name )
( 1 << p_item->i_value ) )
{
ListItem = GroupBoxPlugin->ListView->Items->Add();
ListItem->Caption = p_module_plugins->psz_name;
ListItem->Caption = p_module_plugins->psz_object_name;
}
}
......
......@@ -59,7 +59,7 @@ struct intf_sys_s
/* windows and widgets */
TMainFrameDlg * p_window; /* main window */
TPlaylistDlg * p_playlist; /* playlist */
TPlaylistDlg * p_playwin; /* playlist */
TPopupMenu * p_popup; /* popup menu */
TAboutDlg * p_about; /* about window */
TDiscDlg * p_disc; /* disc selection window */
......@@ -84,5 +84,8 @@ struct intf_sys_s
/* Language information */
es_descriptor_t * p_audio_es_old;
es_descriptor_t * p_spu_es_old;
/* The input thread */
input_thread_t * p_input;
};
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input.c,v 1.202 2002/06/07 14:30:41 sam Exp $
* $Id: input.c,v 1.203 2002/06/07 23:53:44 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -41,7 +41,7 @@
#endif
#include "netutils.h"
#include "playlist.h"
#include "vlc_playlist.h"
#include "stream_control.h"
#include "input_ext-intf.h"
......
......@@ -4,7 +4,7 @@
* and spawns threads.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: libvlc.c,v 1.8 2002/06/07 14:30:41 sam Exp $
* $Id: libvlc.c,v 1.9 2002/06/07 23:53:44 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -72,7 +72,7 @@
#include "stream_control.h"
#include "input_ext-intf.h"
#include "playlist.h"
#include "vlc_playlist.h"
#include "interface.h"
#include "audio_output.h"
......
......@@ -2,7 +2,7 @@
* modules.c : Builtin and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.66 2002/06/07 14:30:41 sam Exp $
* $Id: modules.c,v 1.67 2002/06/07 23:53:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
......@@ -53,7 +53,7 @@
#include "netutils.h"
#include "interface.h"
#include "playlist.h"
#include "vlc_playlist.h"
#include "intf_eject.h"
#include "stream_control.h"
......
......@@ -2,7 +2,7 @@
* netutils.c: various network functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: netutils.c,v 1.70 2002/06/07 21:45:30 sam Exp $
* $Id: netutils.c,v 1.71 2002/06/07 23:53:44 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr>
......@@ -75,7 +75,7 @@
#endif
#include "netutils.h"
#include "playlist.h"
#include "vlc_playlist.h"
#include "network.h"
......
......@@ -2,7 +2,7 @@
* objects.c: vlc_object_t handling
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: objects.c,v 1.9 2002/06/07 16:06:09 sam Exp $
* $Id: objects.c,v 1.10 2002/06/07 23:53:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -41,7 +41,7 @@
#include "audio_output.h"
#include "playlist.h"
#include "vlc_playlist.h"
#include "interface.h"
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.8 2002/06/07 19:54:37 sam Exp $
* $Id: playlist.c,v 1.9 2002/06/07 23:53:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -30,7 +30,7 @@
#include "stream_control.h"
#include "input_ext-intf.h"
#include "playlist.h"
#include "vlc_playlist.h"
#define PLAYLIST_STOPPED 0
#define PLAYLIST_RUNNING 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment