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 );
......
This diff is collapsed.
This diff is collapsed.
......@@ -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