Commit 84b846bf authored by Clément Stenac's avatar Clément Stenac

* src/playlist/* && Makefile.am

   - splitted the enormous playlist.c file
   - implemented a better item group system: groups have a name
     and must be created before use by
      playlist_CreateGroup( p_playlist, "newgroupname")

* modules/misc/sap.c
   - Create our own playlist group ("SAP") and use it

* modules/access/slp.c
   - Create our own playlist group ("SLP") and use it

* modules/demux/util/id3tag.c
   - Trigger playlist update when we have parsed our tag

* modules/gui/wxwindows/interface.cpp
   - Fixed the about box by using vlc_wraptext
   - Added the simple open and the streaming wizard icons
           *** Icons need to be changed ! ***
   - Added the visualization to the extended gui

* modules/gui/wxwindows/preferences.cpp && include/vlc_help.h
   - Enlarged the window to fit the wrapped text
   - Added help for audio encoders

* modules/gui/wxwindows/stream.cpp  & open.cpp & include/vlc_interface.h
   - Created a "streaming wizard" window (3-step streaming)

* modules/gui/wxwindows/iteminfo.cpp:
   - Group change is now based on the name

* modules/gui/wxwindows/playlist.cpp
   - Added author and group columns to the listview
   - Redesigned the window
   - Added the Sort menu with several criteria (title, author, group)
   - Added up/down buttons to move an item in the playlist
   - Added the group menu to enable/disable a group in an understandable way


TODO:
-----

* playlist core :
   - Implement advanced sort capabilities  (multi-criteria)
   - File format to save the new features
   - export playlist (to M3U, eg)
   - more robust group creation (duplicates check, ...)

* wxWindows playlist:
   The idea of a treeview seems impossible, because of wxWindow's treeview,
   that don't allow multi-selection, and, as far as I know, multi-columns.
   - Provide a frontend to advanced sort (when it's done :-) )
   - Allow moving items by drag & drop (well, if possible, haven't checked yet)
   - Allow moving several items at once
   - Customizable listview (ability to remove/move columns)
   - Find a solution to the focus problem
     (when you change track, the selected one scrolls at the
      bottom of the visible screen)

* wxWindows interface:
   - New icons, our icons begin to get old and not so pretty
   - Find a solution for the volume bar (nobody understands what it is)
parent f0c46561
...@@ -296,6 +296,10 @@ SOURCES_libvlc_common = \ ...@@ -296,6 +296,10 @@ SOURCES_libvlc_common = \
src/interface/interface.c \ src/interface/interface.c \
src/interface/intf_eject.c \ src/interface/intf_eject.c \
src/playlist/playlist.c \ src/playlist/playlist.c \
src/playlist/sort.c \
src/playlist/loadsave.c \
src/playlist/group.c \
src/playlist/item.c \
src/input/input.c \ src/input/input.c \
src/input/stream.c \ src/input/stream.c \
src/input/demux.c \ src/input/demux.c \
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.84 2003/10/29 01:33:27 gbazin Exp $ * $Id: vlc_common.h,v 1.85 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -184,6 +184,7 @@ typedef struct msg_subscription_t msg_subscription_t; ...@@ -184,6 +184,7 @@ typedef struct msg_subscription_t msg_subscription_t;
/* Playlist */ /* Playlist */
typedef struct playlist_t playlist_t; typedef struct playlist_t playlist_t;
typedef struct playlist_item_t playlist_item_t; typedef struct playlist_item_t playlist_item_t;
typedef struct playlist_group_t playlist_group_t;
/* Modules */ /* Modules */
typedef struct module_bank_t module_bank_t; typedef struct module_bank_t module_bank_t;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlc_help.h: Help strings * vlc_help.h: Help strings
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: vlc_help.h,v 1.3 2003/10/08 19:40:42 gbazin Exp $ * $Id: vlc_help.h,v 1.4 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
* Anil Daoud <anil@videolan.org> * Anil Daoud <anil@videolan.org>
...@@ -58,6 +58,9 @@ ...@@ -58,6 +58,9 @@
#define AOUT_TITLE N_("Audio output modules settings") #define AOUT_TITLE N_("Audio output modules settings")
#define AOUT_HELP N_("These are general settings for audio output modules.") #define AOUT_HELP N_("These are general settings for audio output modules.")
#define AOUT_ENC_TITLE N_("Audio encoders settings")
#define AOUT_ENC_HELP N_("These are general settings for audio encoding modules.")
#define CHROMA_TITLE N_("Chroma modules settings") #define CHROMA_TITLE N_("Chroma modules settings")
#define CHROMA_HELP N_(" ") #define CHROMA_HELP N_(" ")
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* interface, such as message output. * interface, such as message output.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vlc_interface.h,v 1.7 2003/10/14 22:41:41 gbazin Exp $ * $Id: vlc_interface.h,v 1.8 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -135,6 +135,8 @@ VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) ); ...@@ -135,6 +135,8 @@ VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) );
#define INTF_DIALOG_NET 4 #define INTF_DIALOG_NET 4
#define INTF_DIALOG_SAT 5 #define INTF_DIALOG_SAT 5
#define INTF_DIALOG_STREAM 8
#define INTF_DIALOG_PLAYLIST 10 #define INTF_DIALOG_PLAYLIST 10
#define INTF_DIALOG_MESSAGES 11 #define INTF_DIALOG_MESSAGES 11
#define INTF_DIALOG_FILEINFO 12 #define INTF_DIALOG_FILEINFO 12
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vlc_playlist.h : Playlist functions * vlc_playlist.h : Playlist functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_playlist.h,v 1.14 2003/10/06 16:23:30 zorglub Exp $ * $Id: vlc_playlist.h,v 1.15 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -59,6 +59,12 @@ struct playlist_item_t ...@@ -59,6 +59,12 @@ struct playlist_item_t
char * psz_author; /**< Author */ char * psz_author; /**< Author */
}; };
struct playlist_group_t
{
char * psz_name; /**< name of the group */
int i_id; /**< Identifier for the group */
};
/** /**
* Playlist status * Playlist status
*/ */
...@@ -81,7 +87,10 @@ struct playlist_t ...@@ -81,7 +87,10 @@ struct playlist_t
int i_enabled; /**< How many items are enabled ? */ int i_enabled; /**< How many items are enabled ? */
playlist_item_t ** pp_items; /**< array of pointers to the playlist_item_t ** pp_items; /**< array of pointers to the
* playlist items */ * playlist items */
int i_groups; /**< How many groups are in the playlist */
playlist_group_t ** pp_groups;/**< array of pointers to the playlist
* groups */
int i_max_id; /**< Maximal group id given */
input_thread_t * p_input; /**< the input thread ascosiated input_thread_t * p_input; /**< the input thread ascosiated
* with the current item */ * with the current item */
/*@}*/ /*@}*/
...@@ -90,8 +99,8 @@ struct playlist_t ...@@ -90,8 +99,8 @@ struct playlist_t
#define SORT_NORMAL 0 #define SORT_NORMAL 0
#define SORT_REVERSE 1 #define SORT_REVERSE 1
#define PLAYLIST_TYPE_MANUAL 0 #define PLAYLIST_TYPE_MANUAL 1
#define PLAYLIST_TYPE_SAP 1 #define PLAYLIST_TYPE_SAP 2
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
...@@ -117,7 +126,15 @@ VLC_EXPORT( int, playlist_Disable, ( playlist_t *, int ) ); ...@@ -117,7 +126,15 @@ VLC_EXPORT( int, playlist_Disable, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_Enable, ( playlist_t *, int ) ); VLC_EXPORT( int, playlist_Enable, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_DisableGroup, ( playlist_t *, int ) ); VLC_EXPORT( int, playlist_DisableGroup, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_EnableGroup, ( playlist_t *, int ) ); VLC_EXPORT( int, playlist_EnableGroup, ( playlist_t *, int ) );
VLC_EXPORT( int, playlist_Sort, ( playlist_t *, int) );
VLC_EXPORT( playlist_group_t *, playlist_CreateGroup, (playlist_t *, char* ) );
VLC_EXPORT( int, playlist_DeleteGroup, (playlist_t *, int ) );
VLC_EXPORT( char *, playlist_FindGroup, (playlist_t *, int ) );
VLC_EXPORT( int, playlist_SortTitle, ( playlist_t *, int) );
VLC_EXPORT( int, playlist_SortAuthor, ( playlist_t *, int) );
VLC_EXPORT( int, playlist_SortGroup, ( playlist_t *, int) );
VLC_EXPORT( int, playlist_Move, ( playlist_t *, int, int ) ); VLC_EXPORT( int, playlist_Move, ( playlist_t *, int, int ) );
VLC_EXPORT( int, playlist_LoadFile, ( playlist_t *, const char * ) ); VLC_EXPORT( int, playlist_LoadFile, ( playlist_t *, const char * ) );
VLC_EXPORT( int, playlist_SaveFile, ( playlist_t *, const char * ) ); VLC_EXPORT( int, playlist_SaveFile, ( playlist_t *, const char * ) );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* slp.c: SLP access plugin * slp.c: SLP access plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: slp.c,v 1.16 2003/09/14 16:41:48 zorglub Exp $ * $Id: slp.c,v 1.17 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Loc Minier <lool@videolan.org> * Authors: Loc Minier <lool@videolan.org>
* *
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -44,6 +44,8 @@ static int Init ( vlc_object_t * ); ...@@ -44,6 +44,8 @@ static int Init ( vlc_object_t * );
static void End ( vlc_object_t * ); static void End ( vlc_object_t * );
static int Demux ( input_thread_t * ); static int Demux ( input_thread_t * );
int i_group;
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
...@@ -112,10 +114,12 @@ static SLPBoolean AttrCallback( SLPHandle slph_slp, ...@@ -112,10 +114,12 @@ static SLPBoolean AttrCallback( SLPHandle slph_slp,
/* or there was a problem with getting the data we requested */ /* or there was a problem with getting the data we requested */
if( (slpe_errcode != SLP_OK) ) if( (slpe_errcode != SLP_OK) )
{ {
/* msg_Err( (vlc_object_t*)NULL, #if 0
msg_Err( (vlc_object_t*)NULL,
"AttrCallback got an error %i with attribute %s", "AttrCallback got an error %i with attribute %s",
slpe_errcode, slpe_errcode,
psz_attrlist ); */ psz_attrlist );
#endif
return SLP_TRUE; return SLP_TRUE;
} }
...@@ -145,7 +149,7 @@ static SLPBoolean SrvUrlCallback( SLPHandle slph_slp, ...@@ -145,7 +149,7 @@ static SLPBoolean SrvUrlCallback( SLPHandle slph_slp,
{ {
return SLP_TRUE; return SLP_TRUE;
} }
msg_Dbg(p_input,"URL: %s",psz_srvurl); msg_Dbg(p_input,"URL: %s",psz_srvurl);
/* or there was a problem with getting the data we requested */ /* or there was a problem with getting the data we requested */
...@@ -188,6 +192,9 @@ static SLPBoolean SrvUrlCallback( SLPHandle slph_slp, ...@@ -188,6 +192,9 @@ static SLPBoolean SrvUrlCallback( SLPHandle slph_slp,
p_playlist_item->b_autodeletion = VLC_FALSE; p_playlist_item->b_autodeletion = VLC_FALSE;
p_playlist_item->i_options = 0; p_playlist_item->i_options = 0;
p_playlist_item->ppsz_options = 0; p_playlist_item->ppsz_options = 0;
p_playlist_item->psz_author = NULL;
p_playlist_item->i_group = i_group;
p_playlist_item->b_enabled = VLC_TRUE;
/* search the description of the stream */ /* search the description of the stream */
if( SLPOpen( config_GetPsz( p_input, "slp-lang" ), if( SLPOpen( config_GetPsz( p_input, "slp-lang" ),
...@@ -258,7 +265,7 @@ static SLPBoolean SrvTypeCallback( SLPHandle slph_slp, ...@@ -258,7 +265,7 @@ static SLPBoolean SrvTypeCallback( SLPHandle slph_slp,
{ {
return SLP_TRUE; return SLP_TRUE;
} }
msg_Dbg(p_input,"Services: %s",psz_srvurl); msg_Dbg(p_input,"Services: %s",psz_srvurl);
/* or there was a problem with getting the data we requested */ /* or there was a problem with getting the data we requested */
...@@ -289,14 +296,14 @@ static SLPBoolean SrvTypeCallback( SLPHandle slph_slp, ...@@ -289,14 +296,14 @@ static SLPBoolean SrvTypeCallback( SLPHandle slph_slp,
if(!psz_eos) break; if(!psz_eos) break;
if(!strncasecmp(psz_eos+1,"service:",8)) break; if(!strncasecmp(psz_eos+1,"service:",8)) break;
} }
if(psz_eos) if(psz_eos)
*psz_eos = '\0'; *psz_eos = '\0';
psz_service = strdup( psz_srvurl); psz_service = strdup( psz_srvurl);
msg_Dbg(p_input,"Getting details for %s",psz_service); msg_Dbg(p_input,"Getting details for %s",psz_service);
slpe_result = SLPFindSrvs( slph_slp2, slpe_result = SLPFindSrvs( slph_slp2,
psz_service, psz_service,
config_GetPsz( p_input, "slp-scopelist" ), config_GetPsz( p_input, "slp-scopelist" ),
...@@ -306,9 +313,10 @@ static SLPBoolean SrvTypeCallback( SLPHandle slph_slp, ...@@ -306,9 +313,10 @@ static SLPBoolean SrvTypeCallback( SLPHandle slph_slp,
if(psz_eos) if(psz_eos)
psz_srvurl = psz_eos; psz_srvurl = psz_eos;
// SLPClose( slph_slp2 );
#if 0
SLPClose( slph_slp2 );
#endif
if( slpe_result != SLP_OK ) if( slpe_result != SLP_OK )
{ {
msg_Err( p_input, msg_Err( p_input,
...@@ -330,10 +338,11 @@ static SLPBoolean SrvTypeCallback( SLPHandle slph_slp, ...@@ -330,10 +338,11 @@ static SLPBoolean SrvTypeCallback( SLPHandle slph_slp,
*****************************************************************************/ *****************************************************************************/
static int Open( vlc_object_t * p_this ) static int Open( vlc_object_t * p_this )
{ {
input_thread_t * p_input = (input_thread_t *)p_this; input_thread_t * p_input = (input_thread_t *)p_this;
SLPError slpe_result; SLPError slpe_result;
SLPHandle slph_slp; SLPHandle slph_slp;
playlist_t * p_playlist; playlist_t * p_playlist;
playlist_group_t * p_group;
/* remove the "slp:" entry of the playlist */ /* remove the "slp:" entry of the playlist */
p_playlist = (playlist_t *) vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, p_playlist = (playlist_t *) vlc_object_find( p_input, VLC_OBJECT_PLAYLIST,
...@@ -344,6 +353,8 @@ static int Open( vlc_object_t * p_this ) ...@@ -344,6 +353,8 @@ static int Open( vlc_object_t * p_this )
return VLC_FALSE; return VLC_FALSE;
} }
p_group = playlist_CreateGroup( p_playlist , "SLP" );
i_group = p_group->i_id;
p_playlist->pp_items[p_playlist->i_index]->b_autodeletion = VLC_TRUE; p_playlist->pp_items[p_playlist->i_index]->b_autodeletion = VLC_TRUE;
vlc_object_release( (vlc_object_t *)p_playlist ); vlc_object_release( (vlc_object_t *)p_playlist );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* id3tag.c: id3 tag parser/skipper based on libid3tag * id3tag.c: id3 tag parser/skipper based on libid3tag
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: id3tag.c,v 1.13 2003/10/25 00:49:14 sam Exp $ * $Id: id3tag.c,v 1.14 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
* *
...@@ -76,6 +76,7 @@ static void ParseID3Tag( input_thread_t *p_input, uint8_t *p_data, int i_size ) ...@@ -76,6 +76,7 @@ static void ParseID3Tag( input_thread_t *p_input, uint8_t *p_data, int i_size )
return; return;
} }
val.b_bool = VLC_FALSE;
p_id3_tag = id3_tag_parse( p_data, i_size ); p_id3_tag = id3_tag_parse( p_data, i_size );
p_category = input_InfoCategory( p_input, "ID3" ); p_category = input_InfoCategory( p_input, "ID3" );
i = 0; i = 0;
...@@ -93,42 +94,64 @@ static void ParseID3Tag( input_thread_t *p_input, uint8_t *p_data, int i_size ) ...@@ -93,42 +94,64 @@ static void ParseID3Tag( input_thread_t *p_input, uint8_t *p_data, int i_size )
i_genre = strtol( psz_temp, &psz_endptr, 10 ); i_genre = strtol( psz_temp, &psz_endptr, 10 );
if( psz_temp != psz_endptr && i_genre >= 0 && i_genre < NUM_GENRES ) if( psz_temp != psz_endptr && i_genre >= 0 && i_genre < NUM_GENRES )
{ {
input_AddInfo( p_category, (char *)p_frame->description, ppsz_genres[atoi(psz_temp)]); input_AddInfo( p_category, (char *)p_frame->description,
ppsz_genres[atoi(psz_temp)]);
} }
else else
{ {
input_AddInfo( p_category, (char *)p_frame->description, psz_temp ); input_AddInfo( p_category, (char *)p_frame->description,
psz_temp );
} }
} }
else if ( !strcmp(p_frame->id, ID3_FRAME_TITLE ) ) else if ( !strcmp(p_frame->id, ID3_FRAME_TITLE ) )
{ {
p_playlist = vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, FIND_PARENT ); p_playlist = vlc_object_find( p_input, VLC_OBJECT_PLAYLIST,
FIND_PARENT );
if( p_playlist ) if( p_playlist )
{ {
p_playlist->pp_items[p_playlist->i_index]->psz_name = strdup( psz_temp ); p_playlist->pp_items[p_playlist->i_index]->psz_name =
strdup( psz_temp );
val.b_bool = VLC_TRUE;
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
input_AddInfo( p_category, (char *)p_frame->description, psz_temp ); input_AddInfo( p_category, (char *)p_frame->description,
psz_temp );
} }
else if ( !strcmp(p_frame->id, ID3_FRAME_ARTIST ) ) else if ( !strcmp(p_frame->id, ID3_FRAME_ARTIST ) )
{ {
p_playlist = vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, FIND_PARENT ); p_playlist = vlc_object_find( p_input, VLC_OBJECT_PLAYLIST,
FIND_PARENT );
if( p_playlist ) if( p_playlist )
{ {
p_playlist->pp_items[p_playlist->i_index]->psz_author = strdup( psz_temp ); p_playlist->pp_items[p_playlist->i_index]->psz_author =
strdup( psz_temp );
val.b_bool = VLC_TRUE;
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
input_AddInfo( p_category, (char *)p_frame->description, psz_temp ); input_AddInfo( p_category, (char *)p_frame->description,
psz_temp );
} }
else else
{ {
input_AddInfo( p_category, (char *)p_frame->description, psz_temp ); input_AddInfo( p_category, (char *)p_frame->description,
psz_temp );
} }
free( psz_temp ); free( psz_temp );
} }
i++; i++;
} }
id3_tag_delete( p_id3_tag ); id3_tag_delete( p_id3_tag );
if(val.b_bool == VLC_TRUE )
{
p_playlist = vlc_object_find( p_input,
VLC_OBJECT_PLAYLIST, FIND_PARENT );
if( p_playlist )
{
val.b_bool = VLC_TRUE;
var_Set( p_playlist, "intf-change", val );
vlc_object_release( p_playlist );
}
}
val.b_bool = VLC_TRUE; val.b_bool = VLC_TRUE;
var_Change( p_input, "demuxed-id3", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "demuxed-id3", VLC_VAR_SETVALUE, &val, NULL );
} }
......
...@@ -5,6 +5,7 @@ SOURCES_wxwindows = \ ...@@ -5,6 +5,7 @@ SOURCES_wxwindows = \
dialogs.cpp \ dialogs.cpp \
open.cpp \ open.cpp \
streamout.cpp \ streamout.cpp \
stream.cpp \
messages.cpp \ messages.cpp \
playlist.cpp \ playlist.cpp \
iteminfo.cpp \ iteminfo.cpp \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dialogs.cpp : wxWindows plugin for vlc * dialogs.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: dialogs.cpp,v 1.9 2003/10/15 12:24:14 gbazin Exp $ * $Id: dialogs.cpp,v 1.10 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -60,6 +60,8 @@ BEGIN_EVENT_TABLE(DialogsProvider, wxFrame) ...@@ -60,6 +60,8 @@ BEGIN_EVENT_TABLE(DialogsProvider, wxFrame)
DialogsProvider::OnMessages) DialogsProvider::OnMessages)
EVT_COMMAND(INTF_DIALOG_PREFS, wxEVT_DIALOG, EVT_COMMAND(INTF_DIALOG_PREFS, wxEVT_DIALOG,
DialogsProvider::OnPreferences) DialogsProvider::OnPreferences)
EVT_COMMAND(INTF_DIALOG_STREAM, wxEVT_DIALOG,
DialogsProvider::OnStreamDialog)
EVT_COMMAND(INTF_DIALOG_FILEINFO, wxEVT_DIALOG, EVT_COMMAND(INTF_DIALOG_FILEINFO, wxEVT_DIALOG,
DialogsProvider::OnFileInfo) DialogsProvider::OnFileInfo)
EVT_COMMAND(INTF_DIALOG_POPUPMENU, wxEVT_DIALOG, EVT_COMMAND(INTF_DIALOG_POPUPMENU, wxEVT_DIALOG,
...@@ -83,6 +85,7 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf, wxWindow *p_parent ) ...@@ -83,6 +85,7 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf, wxWindow *p_parent )
p_fileinfo_dialog = NULL; p_fileinfo_dialog = NULL;
p_prefs_dialog = NULL; p_prefs_dialog = NULL;
p_file_generic_dialog = NULL; p_file_generic_dialog = NULL;
p_stream_dialog = NULL;
/* Give our interface a nice little icon */ /* Give our interface a nice little icon */
p_intf->p_sys->p_icon = new wxIcon( vlc_xpm ); p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
...@@ -104,6 +107,8 @@ DialogsProvider::~DialogsProvider() ...@@ -104,6 +107,8 @@ DialogsProvider::~DialogsProvider()
if( p_messages_dialog ) delete p_messages_dialog; if( p_messages_dialog ) delete p_messages_dialog;
if( p_fileinfo_dialog ) delete p_fileinfo_dialog; if( p_fileinfo_dialog ) delete p_fileinfo_dialog;
if( p_file_generic_dialog ) delete p_file_generic_dialog; if( p_file_generic_dialog ) delete p_file_generic_dialog;
if( p_stream_dialog ) delete p_stream_dialog;
if( p_intf->p_sys->p_icon ) delete p_intf->p_sys->p_icon; if( p_intf->p_sys->p_icon ) delete p_intf->p_sys->p_icon;
...@@ -177,6 +182,18 @@ void DialogsProvider::OnPreferences( wxCommandEvent& WXUNUSED(event) ) ...@@ -177,6 +182,18 @@ void DialogsProvider::OnPreferences( wxCommandEvent& WXUNUSED(event) )
} }
} }
void DialogsProvider::OnStreamDialog( wxCommandEvent& WXUNUSED(event) )
{
/* Show/hide the stream window */
if( !p_stream_dialog )
p_stream_dialog = new StreamDialog( p_intf, this );
if( p_stream_dialog )
{
p_stream_dialog->Show( !p_stream_dialog->IsShown() );
}
}
void DialogsProvider::OnOpenFileGeneric( wxCommandEvent& event ) void DialogsProvider::OnOpenFileGeneric( wxCommandEvent& event )
{ {
intf_dialog_args_t *p_arg = (intf_dialog_args_t *)event.GetClientData(); intf_dialog_args_t *p_arg = (intf_dialog_args_t *)event.GetClientData();
...@@ -306,7 +323,8 @@ void DialogsProvider::Open( int i_access_method, int i_arg ) ...@@ -306,7 +323,8 @@ void DialogsProvider::Open( int i_access_method, int i_arg )
{ {
/* Show/hide the open dialog */ /* Show/hide the open dialog */
if( !p_open_dialog ) if( !p_open_dialog )
p_open_dialog = new OpenDialog( p_intf, this, i_access_method, i_arg ); p_open_dialog = new OpenDialog(p_intf, this, i_access_method, i_arg ,
OPEN_NORMAL );
if( p_open_dialog ) if( p_open_dialog )
{ {
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* iteminfo.cpp : wxWindows plugin for vlc * iteminfo.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: iteminfo.cpp,v 1.2 2003/10/06 17:41:47 gbazin Exp $ * $Id: iteminfo.cpp,v 1.3 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Clment Stenac <zorglub@videolan.org> * Authors: Clment Stenac <zorglub@videolan.org>
* *
...@@ -66,14 +66,15 @@ enum ...@@ -66,14 +66,15 @@ enum
Name_Event, Name_Event,
Author_Event, Author_Event,
Enabled_Event, Enabled_Event,
New_Event,
}; };
BEGIN_EVENT_TABLE(ItemInfoDialog, wxDialog) BEGIN_EVENT_TABLE(ItemInfoDialog, wxDialog)
/* Button events */ /* Button events */
EVT_BUTTON(wxID_OK, ItemInfoDialog::OnOk) EVT_BUTTON(wxID_OK, ItemInfoDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, ItemInfoDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, ItemInfoDialog::OnCancel)
/* Events generated by the panels */ /* Events generated by the panels */
EVT_BUTTON( New_Event, ItemInfoDialog::OnNewGroup)
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -213,41 +214,60 @@ wxPanel *ItemInfoDialog::GroupPanel( wxWindow* parent ) ...@@ -213,41 +214,60 @@ wxPanel *ItemInfoDialog::GroupPanel( wxWindow* parent )
{ {
wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition, wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
wxDefaultSize ); wxDefaultSize );
wxStaticBox *panel_box = new wxStaticBox( panel, -1, wxStaticBox *panel_box = new wxStaticBox( panel, -1,
wxU(_("Group Info")) ); wxU(_("Group Info")) );
wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box, wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
wxVERTICAL); wxVERTICAL);
wxBoxSizer *subpanel_sizer; wxBoxSizer *subpanel_sizer;
group_subpanel = new wxPanel( panel, -1 ); group_subpanel = new wxPanel( panel, -1 );
subpanel_sizer = new wxBoxSizer( wxVERTICAL) ; subpanel_sizer = new wxBoxSizer( wxVERTICAL) ;
enabled_checkbox = new wxCheckBox( group_subpanel, enabled_checkbox = new wxCheckBox( group_subpanel,
-1, -1, wxU(_("Item enabled")) );
wxU(_("Item enabled")) );
enabled_checkbox->SetValue( p_item->b_enabled); enabled_checkbox->SetValue( p_item->b_enabled);
wxStaticText *group_label = new wxStaticText( group_subpanel, wxStaticText *group_label = new wxStaticText( group_subpanel,
-1, wxU(_("Group")) ); -1, wxU(_("Group")) );
group_spin = new wxSpinCtrl( group_subpanel,
-1 ); playlist_t *p_playlist =
group_spin->SetValue( p_item->i_group > 0 ? p_item->i_group : 0); (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return NULL;
}
group_combo = new wxComboBox( group_subpanel, -1,
wxT(""),wxDefaultPosition, wxDefaultSize,
0, NULL,
wxCB_READONLY );
wxButton *newgroup_button = new wxButton( group_subpanel, New_Event,
wxT(_("New Group")));
for( int i=0; i< p_playlist->i_groups ; i++)
{
group_combo->Append( wxT( p_playlist->pp_groups[i]->psz_name));
}
vlc_object_release ( p_playlist );
subpanel_sizer->Add( enabled_checkbox, 0, wxALIGN_RIGHT| subpanel_sizer->Add( enabled_checkbox, 0, wxALIGN_RIGHT|
wxALIGN_CENTER_VERTICAL ); wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( group_label, 0, wxALIGN_LEFT | subpanel_sizer->Add( group_label, 0, wxALIGN_LEFT |
wxALIGN_CENTER_VERTICAL ); wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( group_spin, 0, wxALIGN_RIGHT );
wxBoxSizer *group_sizer = new wxBoxSizer( wxHORIZONTAL);
group_sizer->Add(group_combo, 0, wxALIGN_LEFT|wxRIGHT, 5);
group_sizer->Add( newgroup_button, 0, wxALIGN_RIGHT|wxLEFT, 5);
group_sizer->Layout();
subpanel_sizer->Add( group_sizer, 0, wxALIGN_RIGHT );
group_subpanel->SetSizerAndFit( subpanel_sizer ); group_subpanel->SetSizerAndFit( subpanel_sizer );
/* Stuff everything into the main panel */ /* Stuff everything into the main panel */
panel_sizer->Add( group_subpanel, 0, panel_sizer->Add( group_subpanel, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel->SetSizerAndFit( panel_sizer ); panel->SetSizerAndFit( panel_sizer );
...@@ -276,11 +296,20 @@ void ItemInfoDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -276,11 +296,20 @@ void ItemInfoDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
else if( b_old_enabled == VLC_TRUE && !enabled_checkbox->IsChecked() ) else if( b_old_enabled == VLC_TRUE && !enabled_checkbox->IsChecked() )
p_playlist->i_enabled --; p_playlist->i_enabled --;
for (int i=0 ; i< p_playlist->i_groups ; i++)
{
if( !strcasecmp( p_playlist->pp_groups[i]->psz_name,
group_combo->GetValue() ))
{
p_item->i_group = p_playlist->pp_groups[i]->i_id;
break;
}
}
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
p_item->b_enabled = enabled_checkbox->IsChecked() ? VLC_TRUE : VLC_FALSE ; p_item->b_enabled = enabled_checkbox->IsChecked() ? VLC_TRUE : VLC_FALSE ;
p_item->i_group = group_spin->GetValue();
EndModal( wxID_OK ); EndModal( wxID_OK );
} }
...@@ -289,6 +318,18 @@ void ItemInfoDialog::OnCancel( wxCommandEvent& WXUNUSED(event) ) ...@@ -289,6 +318,18 @@ void ItemInfoDialog::OnCancel( wxCommandEvent& WXUNUSED(event) )
EndModal( wxID_CANCEL ); EndModal( wxID_CANCEL );
} }
/****************************************************************************** void ItemInfoDialog::OnNewGroup( wxCommandEvent& WXUNUSED(event) )
* Info panel event methods. {
*****************************************************************************/ NewGroup *p_newgroup = NULL;
p_newgroup = new NewGroup( p_intf, this );
if( p_newgroup)
{
if( p_newgroup->ShowModal() == wxID_OK && p_newgroup->psz_name)
{
group_combo->Append( wxT( p_newgroup->psz_name));
}
delete( p_newgroup );
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc * open.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: open.cpp,v 1.38 2003/08/22 14:03:40 adn Exp $ * $Id: open.cpp,v 1.39 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -164,8 +164,17 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -164,8 +164,17 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
int i_access_method, int i_arg ): int i_access_method, int i_arg ):
wxFrame( _p_parent, -1, wxU(_("Open Target")), wxDefaultPosition, wxFrame( _p_parent, -1, wxU(_("Open Target")), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE ) wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{
OpenDialog( _p_intf, _p_parent, i_access_method, i_arg, OPEN_NORMAL );
}
OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
int i_access_method, int i_arg, int _i_method ):
wxFrame( _p_parent, -1, wxU(_("Open Target")), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{ {
/* Initializations */ /* Initializations */
i_method = _i_method;
p_intf = _p_intf; p_intf = _p_intf;
p_parent = _p_parent; p_parent = _p_parent;
SetIcon( *p_intf->p_sys->p_icon ); SetIcon( *p_intf->p_sys->p_icon );
...@@ -206,57 +215,70 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -206,57 +215,70 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
wxU(_("Alternatively, you can build an MRL using one of the " wxU(_("Alternatively, you can build an MRL using one of the "
"following predefined targets:")) ); "following predefined targets:")) );
/* Create Stream Output checkox */ wxFlexGridSizer *sout_sizer = NULL;
wxFlexGridSizer *sout_sizer = new wxFlexGridSizer( 2, 1, 20 ); wxBoxSizer *demuxdump_sizer = NULL;
sout_checkbox = new wxCheckBox( panel, SoutEnable_Event, wxStaticLine *static_line = NULL;
wxU(_("Stream output")) );
sout_checkbox->SetToolTip( wxU(_("Use VLC as a stream server")) ); demuxdump_checkbox = NULL;
sout_sizer->Add( sout_checkbox, 0, demuxdump_textctrl = NULL;
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
sout_button = new wxButton( panel, SoutSettings_Event, if( i_method == OPEN_NORMAL )
wxU(_("Settings...")) );
sout_button->Disable();
char *psz_sout = config_GetPsz( p_intf, "sout" );
if( psz_sout && *psz_sout )
{
sout_checkbox->SetValue(TRUE);
sout_button->Enable();
subsfile_mrl.Add( wxString(wxT("sout=")) + wxU(psz_sout) );
}
if( psz_sout ) free( psz_sout );
sout_sizer->Add( sout_button, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
/* Create Demux Dump checkox */
wxBoxSizer *demuxdump_sizer = new wxBoxSizer( wxHORIZONTAL );
demuxdump_checkbox = new wxCheckBox( panel, DemuxDumpEnable_Event,
wxU(_("Capture input stream")) );
demuxdump_checkbox->SetToolTip(
wxU(_("Capture the stream you are playing to a file")) );
demuxdump_textctrl = new wxTextCtrl( panel, DemuxDump_Event, wxT(""),
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER );
demuxdump_button = new wxButton( panel, DemuxDumpBrowse_Event,
wxU(_("Browse...")) );
char *psz_demuxdump = config_GetPsz( p_intf, "demuxdump-file" );
if( psz_demuxdump && *psz_demuxdump )
{ {
demuxdump_textctrl->SetValue( wxU(psz_demuxdump) ); /* Create Stream Output checkox */
} sout_sizer = new wxFlexGridSizer( 2, 1, 20 );
if( psz_demuxdump ) free( psz_demuxdump );
demuxdump_textctrl->Disable();
demuxdump_button->Disable();
demuxdump_sizer->Add( demuxdump_checkbox, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
demuxdump_sizer->Add( demuxdump_button, 0,
wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 10 );
demuxdump_sizer->Add( demuxdump_textctrl, 1, wxRIGHT, 10 );
/* Separation */ sout_checkbox = new wxCheckBox( panel, SoutEnable_Event,
wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK ); wxU(_("Stream output")) );
sout_checkbox->SetToolTip( wxU(_("Use VLC as a stream server")) );
sout_sizer->Add( sout_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
sout_button = new wxButton( panel, SoutSettings_Event,
wxU(_("Settings...")) );
sout_button->Disable();
char *psz_sout = config_GetPsz( p_intf, "sout" );
if( psz_sout && *psz_sout )
{
sout_checkbox->SetValue(TRUE);
sout_button->Enable();
subsfile_mrl.Add( wxString(wxT("sout=")) + wxU(psz_sout) );
}
if( psz_sout ) free( psz_sout );
sout_sizer->Add( sout_button, 1, wxALIGN_LEFT |
wxALIGN_CENTER_VERTICAL );
/* Create Demux Dump checkox */
demuxdump_sizer = new wxBoxSizer( wxHORIZONTAL );
demuxdump_checkbox = new wxCheckBox( panel, DemuxDumpEnable_Event,
wxU(_("Capture input stream")) );
demuxdump_checkbox->SetToolTip(
wxU(_("Capture the stream you are playing to a file")) );
demuxdump_textctrl = new wxTextCtrl( panel, DemuxDump_Event, wxT(""),
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER );
demuxdump_button = new wxButton( panel, DemuxDumpBrowse_Event,
wxU(_("Browse...")) );
char *psz_demuxdump = config_GetPsz( p_intf, "demuxdump-file" );
if( psz_demuxdump && *psz_demuxdump )
{
demuxdump_textctrl->SetValue( wxU(psz_demuxdump) );
}
if( psz_demuxdump ) free( psz_demuxdump );
demuxdump_textctrl->Disable();
demuxdump_button->Disable();
demuxdump_sizer->Add( demuxdump_checkbox, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
demuxdump_sizer->Add( demuxdump_button, 0,
wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, 10 );
demuxdump_sizer->Add( demuxdump_textctrl, 1, wxRIGHT, 10 );
/* Separation */
static_line = new wxStaticLine( panel, wxID_OK );
}
/* Create the buttons */ /* Create the buttons */
wxButton *ok_button = new wxButton( panel, wxID_OK, wxU(_("OK")) ); wxButton *ok_button = new wxButton( panel, wxID_OK, wxU(_("OK")) );
...@@ -310,9 +332,13 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent, ...@@ -310,9 +332,13 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 ); panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
panel_sizer->Add( label, 0, wxEXPAND | wxALL, 5 ); panel_sizer->Add( label, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 ); panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( sout_sizer, 0, wxALIGN_LEFT | wxALL, 5 ); if( i_method == OPEN_NORMAL)
panel_sizer->Add( demuxdump_sizer, 0, wxEXPAND | wxALIGN_LEFT | wxALL, 5 ); {
panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 ); panel_sizer->Add( sout_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
panel_sizer->Add( demuxdump_sizer, 0, wxEXPAND | wxALIGN_LEFT
| wxALL, 5 );
panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
}
panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALL, 5 ); panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
panel_sizer->Layout(); panel_sizer->Layout();
panel->SetSizerAndFit( panel_sizer ); panel->SetSizerAndFit( panel_sizer );
...@@ -614,11 +640,13 @@ void OpenDialog::UpdateMRL( int i_access_method ) ...@@ -614,11 +640,13 @@ void OpenDialog::UpdateMRL( int i_access_method )
i_current_access_method = i_access_method; i_current_access_method = i_access_method;
/* Check if the user asked for demuxdump */ /* Check if the user asked for demuxdump */
if( demuxdump_checkbox->GetValue() ) if( demuxdump_checkbox )
{ {
demux = wxT("/demuxdump"); if( demuxdump_checkbox->GetValue() )
{
demux = wxT("/demuxdump");
}
} }
switch( i_access_method ) switch( i_access_method )
{ {
case FILE_ACCESS: case FILE_ACCESS:
...@@ -713,6 +741,12 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -713,6 +741,12 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
if( mrl_combo->GetCount() > 10 ) mrl_combo->Delete( 0 ); if( mrl_combo->GetCount() > 10 ) mrl_combo->Delete( 0 );
mrl_combo->SetSelection( mrl_combo->GetCount() - 1 ); mrl_combo->SetSelection( mrl_combo->GetCount() - 1 );
if( i_method == OPEN_STREAM )
{
Hide();
return;
}
/* Update the playlist */ /* Update the playlist */
playlist_t *p_playlist = playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
...@@ -979,12 +1013,15 @@ void OpenDialog::OnV4LSettingsChange( wxCommandEvent& WXUNUSED(event) ) ...@@ -979,12 +1013,15 @@ void OpenDialog::OnV4LSettingsChange( wxCommandEvent& WXUNUSED(event) )
void OpenDialog::OnSubsFileEnable( wxCommandEvent& event ) void OpenDialog::OnSubsFileEnable( wxCommandEvent& event )
{ {
subsfile_button->Enable( event.GetInt() != 0 ); subsfile_button->Enable( event.GetInt() != 0 );
if( event.GetInt() && demuxdump_checkbox->IsChecked() ) if( demuxdump_checkbox )
{ {
demuxdump_checkbox->SetValue( 0 ); if( event.GetInt() && demuxdump_checkbox->IsChecked() )
wxCommandEvent event = wxCommandEvent( wxEVT_NULL ); {
event.SetInt( 0 ); demuxdump_checkbox->SetValue( 0 );
OnDemuxDumpEnable( event ); wxCommandEvent event = wxCommandEvent( wxEVT_NULL );
event.SetInt( 0 );
OnDemuxDumpEnable( event );
}
} }
} }
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* preferences.cpp : wxWindows plugin for vlc * preferences.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: preferences.cpp,v 1.39 2003/10/29 01:33:27 gbazin Exp $ * $Id: preferences.cpp,v 1.40 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -173,7 +173,7 @@ END_EVENT_TABLE() ...@@ -173,7 +173,7 @@ END_EVENT_TABLE()
*****************************************************************************/ *****************************************************************************/
PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, wxWindow *p_parent) PrefsDialog::PrefsDialog( intf_thread_t *_p_intf, wxWindow *p_parent)
: wxFrame( p_parent, -1, wxU(_("Preferences")), wxDefaultPosition, : wxFrame( p_parent, -1, wxU(_("Preferences")), wxDefaultPosition,
wxSize(700,450), wxDEFAULT_FRAME_STYLE ) wxSize(830,450), wxDEFAULT_FRAME_STYLE )
{ {
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
...@@ -305,6 +305,8 @@ static char * GetCapabilityHelp( char *psz_capability, int i_type) ...@@ -305,6 +305,8 @@ static char * GetCapabilityHelp( char *psz_capability, int i_type)
return i_type == 1 ? AUDIO_FILTER_TITLE : AUDIO_FILTER_HELP; return i_type == 1 ? AUDIO_FILTER_TITLE : AUDIO_FILTER_HELP;
if( !strcasecmp(psz_capability,"audio output") ) if( !strcasecmp(psz_capability,"audio output") )
return i_type == 1 ? AOUT_TITLE : AOUT_HELP; return i_type == 1 ? AOUT_TITLE : AOUT_HELP;
if( !strcasecmp(psz_capability,"audio encoder") )
return i_type == 1 ? AOUT_ENC_TITLE : AOUT_ENC_HELP;
if( !strcasecmp(psz_capability,"chroma") ) if( !strcasecmp(psz_capability,"chroma") )
return i_type == 1 ? CHROMA_TITLE : CHROMA_HELP; return i_type == 1 ? CHROMA_TITLE : CHROMA_HELP;
if( !strcasecmp(psz_capability,"decoder") ) if( !strcasecmp(psz_capability,"decoder") )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.65 2003/10/14 22:41:41 gbazin Exp $ * $Id: wxwindows.h,v 1.66 2003/10/29 17:32:54 zorglub Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -73,6 +73,14 @@ class FileInfo; ...@@ -73,6 +73,14 @@ class FileInfo;
#define WRAPCOUNT 80 #define WRAPCOUNT 80
#define OPEN_NORMAL 0
#define OPEN_STREAM 1
#define MODE_NONE 0
#define MODE_GROUP 1
#define MODE_AUTHOR 2
#define MODE_TITLE 3
wxArrayString SeparateEntries( wxString ); wxArrayString SeparateEntries( wxString );
/***************************************************************************** /*****************************************************************************
...@@ -185,6 +193,7 @@ private: ...@@ -185,6 +193,7 @@ private:
void OnOpenNet( wxCommandEvent& event ); void OnOpenNet( wxCommandEvent& event );
void OnOpenSat( wxCommandEvent& event ); void OnOpenSat( wxCommandEvent& event );
void OnOpenV4L( wxCommandEvent& event ); void OnOpenV4L( wxCommandEvent& event );
void OnStream( wxCommandEvent& event );
void OnExtra( wxCommandEvent& event ); void OnExtra( wxCommandEvent& event );
void OnShowDialog( wxCommandEvent& event ); void OnShowDialog( wxCommandEvent& event );
void OnPlayStream( wxCommandEvent& event ); void OnPlayStream( wxCommandEvent& event );
...@@ -202,6 +211,7 @@ private: ...@@ -202,6 +211,7 @@ private:
void OnSaturationUpdate( wxScrollEvent& event ); void OnSaturationUpdate( wxScrollEvent& event );
void OnRatio( wxCommandEvent& event ); void OnRatio( wxCommandEvent& event );
void OnEnableVisual( wxCommandEvent& event );
void OnMenuOpen( wxMenuEvent& event ); void OnMenuOpen( wxMenuEvent& event );
...@@ -229,6 +239,8 @@ private: ...@@ -229,6 +239,8 @@ private:
vlc_bool_t b_misc_menu; vlc_bool_t b_misc_menu;
}; };
class StreamDialog;
/* Dialogs Provider */ /* Dialogs Provider */
class DialogsProvider: public wxFrame class DialogsProvider: public wxFrame
{ {
...@@ -246,6 +258,7 @@ private: ...@@ -246,6 +258,7 @@ private:
void OnMessages( wxCommandEvent& event ); void OnMessages( wxCommandEvent& event );
void OnFileInfo( wxCommandEvent& event ); void OnFileInfo( wxCommandEvent& event );
void OnPreferences( wxCommandEvent& event ); void OnPreferences( wxCommandEvent& event );
void OnStreamDialog( wxCommandEvent& event );
void OnOpenFileGeneric( wxCommandEvent& event ); void OnOpenFileGeneric( wxCommandEvent& event );
void OnOpenFileSimple( wxCommandEvent& event ); void OnOpenFileSimple( wxCommandEvent& event );
...@@ -271,6 +284,7 @@ public: ...@@ -271,6 +284,7 @@ public:
Playlist *p_playlist_dialog; Playlist *p_playlist_dialog;
Messages *p_messages_dialog; Messages *p_messages_dialog;
FileInfo *p_fileinfo_dialog; FileInfo *p_fileinfo_dialog;
StreamDialog *p_stream_dialog;
wxFrame *p_prefs_dialog; wxFrame *p_prefs_dialog;
wxFileDialog *p_file_generic_dialog; wxFileDialog *p_file_generic_dialog;
}; };
...@@ -284,7 +298,11 @@ class OpenDialog: public wxFrame ...@@ -284,7 +298,11 @@ class OpenDialog: public wxFrame
public: public:
/* Constructor */ /* Constructor */
OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent, OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
int i_access_method, int i_arg = 0 ); int i_access_method, int i_arg = 0 );
/* Extended Contructor */
OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
int i_access_method, int i_arg = 0 , int _i_method = 0 );
virtual ~OpenDialog(); virtual ~OpenDialog();
int Show(); int Show();
...@@ -344,6 +362,7 @@ private: ...@@ -344,6 +362,7 @@ private:
wxWindow *p_parent; wxWindow *p_parent;
int i_current_access_method; int i_current_access_method;
int i_method; /* Normal or for the stream dialog ? */
wxComboBox *mrl_combo; wxComboBox *mrl_combo;
wxNotebook *notebook; wxNotebook *notebook;
...@@ -610,6 +629,36 @@ private: ...@@ -610,6 +629,36 @@ private:
wxWindow *p_parent; wxWindow *p_parent;
}; };
/* Stream */
class StreamDialog: public wxFrame
{
public:
/* Constructor */
StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
virtual ~StreamDialog();
private:
void OnClose( wxCommandEvent& event );
void OnOpen( wxCommandEvent& event );
void OnSout( wxCommandEvent& event );
void OnStart( wxCommandEvent& event );
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
wxStaticText *step2_label;
wxStaticText *step3_label;
wxButton *sout_button;
wxButton *start_button;
wxArrayString mrl;
wxArrayString sout_mrl;
OpenDialog *p_open_dialog;
SoutDialog *p_sout_dialog;
};
/* Preferences Dialog */ /* Preferences Dialog */
class PrefsTreeCtrl; class PrefsTreeCtrl;
class PrefsDialog: public wxFrame class PrefsDialog: public wxFrame
...@@ -668,6 +717,7 @@ private: ...@@ -668,6 +717,7 @@ private:
/* Playlist */ /* Playlist */
class ItemInfoDialog; class ItemInfoDialog;
class NewGroup;
class Playlist: public wxFrame class Playlist: public wxFrame
{ {
public: public:
...@@ -687,8 +737,6 @@ private: ...@@ -687,8 +737,6 @@ private:
/* Event handlers (these functions should _not_ be virtual) */ /* Event handlers (these functions should _not_ be virtual) */
void OnAddFile( wxCommandEvent& event ); void OnAddFile( wxCommandEvent& event );
void OnAddMRL( wxCommandEvent& event ); void OnAddMRL( wxCommandEvent& event );
void OnSort( wxCommandEvent& event );
void OnRSort( wxCommandEvent& event );
void OnClose( wxCommandEvent& event ); void OnClose( wxCommandEvent& event );
void OnSearch( wxCommandEvent& event ); void OnSearch( wxCommandEvent& event );
void OnEnDis( wxCommandEvent& event ); void OnEnDis( wxCommandEvent& event );
...@@ -696,6 +744,12 @@ private: ...@@ -696,6 +744,12 @@ private:
void OnSearchTextChange( wxCommandEvent& event ); void OnSearchTextChange( wxCommandEvent& event );
void OnOpen( wxCommandEvent& event ); void OnOpen( wxCommandEvent& event );
void OnSave( wxCommandEvent& event ); void OnSave( wxCommandEvent& event );
void OnSort( wxCommandEvent& event );
void OnUp( wxCommandEvent& event);
void OnDown( wxCommandEvent& event);
void OnEnableSelection( wxCommandEvent& event ); void OnEnableSelection( wxCommandEvent& event );
void OnDisableSelection( wxCommandEvent& event ); void OnDisableSelection( wxCommandEvent& event );
void OnInvertSelection( wxCommandEvent& event ); void OnInvertSelection( wxCommandEvent& event );
...@@ -706,6 +760,8 @@ private: ...@@ -706,6 +760,8 @@ private:
void OnLoop ( wxCommandEvent& event ); void OnLoop ( wxCommandEvent& event );
void OnActivateItem( wxListEvent& event ); void OnActivateItem( wxListEvent& event );
void OnKeyDown( wxListEvent& event ); void OnKeyDown( wxListEvent& event );
void OnNewGroup( wxCommandEvent& event );
void Rebuild(); void Rebuild();
wxTextCtrl *search_text; wxTextCtrl *search_text;
...@@ -717,7 +773,34 @@ private: ...@@ -717,7 +773,34 @@ private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
wxListView *listview; wxListView *listview;
wxTreeCtrl *treeview;
int i_update_counter; int i_update_counter;
int i_sort_mode;
};
class NewGroup: public wxDialog
{
public:
/* Constructor */
NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
virtual ~NewGroup();
private:
/* Event handlers (these functions should _not_ be virtual) */
void OnOk( wxCommandEvent& event );
void OnCancel( wxCommandEvent& event );
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
wxTextCtrl *groupname;
protected:
friend class Playlist;
friend class ItemInfoDialog;
char *psz_name;
}; };
...@@ -739,6 +822,7 @@ private: ...@@ -739,6 +822,7 @@ private:
/* Event handlers (these functions should _not_ be virtual) */ /* Event handlers (these functions should _not_ be virtual) */
void OnOk( wxCommandEvent& event ); void OnOk( wxCommandEvent& event );
void OnCancel( wxCommandEvent& event ); void OnCancel( wxCommandEvent& event );
void OnNewGroup( wxCommandEvent& event );
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
...@@ -758,7 +842,8 @@ private: ...@@ -758,7 +842,8 @@ private:
wxTextCtrl *author_text; wxTextCtrl *author_text;
wxCheckBox *enabled_checkbox; wxCheckBox *enabled_checkbox;
wxSpinCtrl *group_spin; wxComboBox *group_combo;
int ids_array[100];
}; };
...@@ -783,6 +868,7 @@ private: ...@@ -783,6 +868,7 @@ private:
}; };
#if !defined(__WXX11__) #if !defined(__WXX11__)
/* Drag and Drop class */ /* Drag and Drop class */
class DragAndDrop: public wxFileDropTarget class DragAndDrop: public wxFileDropTarget
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* sap.c : SAP interface module * sap.c : SAP interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: sap.c,v 1.27 2003/10/13 05:48:08 zorglub Exp $ * $Id: sap.c,v 1.28 2003/10/29 17:32:55 zorglub Exp $
* *
* Authors: Arnaud Schauly <gitan@via.ecp.fr> * Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr> * Clment Stenac <zorglub@via.ecp.fr>
...@@ -115,6 +115,12 @@ static void free_sd( sess_descr_t * ); ...@@ -115,6 +115,12 @@ static void free_sd( sess_descr_t * );
/* Detect multicast addresses */ /* Detect multicast addresses */
static int ismult( char * ); static int ismult( char * );
/* Our custom structure */
struct intf_sys_t
{
int i_group;
};
/* The struct that contains sdp informations */ /* The struct that contains sdp informations */
struct sess_descr_t struct sess_descr_t
{ {
...@@ -160,9 +166,6 @@ struct attr_descr_t ...@@ -160,9 +166,6 @@ struct attr_descr_t
#define SAP_IPV6_LONGTEXT N_("Set this if you want SAP to listen for IPv6 announces") #define SAP_IPV6_LONGTEXT N_("Set this if you want SAP to listen for IPv6 announces")
#define SAP_SCOPE_TEXT N_("IPv6 SAP scope") #define SAP_SCOPE_TEXT N_("IPv6 SAP scope")
#define SAP_SCOPE_LONGTEXT N_("Sets the scope for IPv6 announces (default is 8)") #define SAP_SCOPE_LONGTEXT N_("Sets the scope for IPv6 announces (default is 8)")
#define SAP_GROUP_ID_TEXT N_("SAP Playlist group ID")
#define SAP_GROUP_ID_LONGTEXT N_("Sets the default group ID in which" \
"SAP items are put" )
vlc_module_begin(); vlc_module_begin();
add_category_hint( N_("SAP"), NULL, VLC_TRUE ); add_category_hint( N_("SAP"), NULL, VLC_TRUE );
...@@ -178,9 +181,6 @@ vlc_module_begin(); ...@@ -178,9 +181,6 @@ vlc_module_begin();
add_string( "sap-ipv6-scope", "8" , NULL, add_string( "sap-ipv6-scope", "8" , NULL,
SAP_SCOPE_TEXT, SAP_SCOPE_LONGTEXT, VLC_TRUE); SAP_SCOPE_TEXT, SAP_SCOPE_LONGTEXT, VLC_TRUE);
add_integer( "sap-group-id", 42, NULL,
SAP_GROUP_ID_TEXT, SAP_GROUP_ID_LONGTEXT, VLC_TRUE);
set_description( _("SAP interface") ); set_description( _("SAP interface") );
set_capability( "interface", 0 ); set_capability( "interface", 0 );
set_callbacks( Activate, NULL); set_callbacks( Activate, NULL);
...@@ -221,6 +221,8 @@ static void Run( intf_thread_t *p_intf ) ...@@ -221,6 +221,8 @@ static void Run( intf_thread_t *p_intf )
module_t *p_network; module_t *p_network;
network_socket_t socket_desc; network_socket_t socket_desc;
playlist_t *p_playlist;
playlist_group_t *p_group;
if( sap_ipv4 == -1 || sap_ipv6 == -1 || sap_ipv6_scope == NULL ) if( sap_ipv4 == -1 || sap_ipv6 == -1 || sap_ipv6_scope == NULL )
{ {
...@@ -228,6 +230,22 @@ static void Run( intf_thread_t *p_intf ) ...@@ -228,6 +230,22 @@ static void Run( intf_thread_t *p_intf )
return; return;
} }
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( !p_intf->p_sys )
{
msg_Err( p_intf, "Out of memory !");
return VLC_EGENERIC;
}
/* Create our playlist group */
p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
p_group = playlist_CreateGroup( p_playlist , "SAP" );
p_intf->p_sys->i_group = p_group->i_id;
vlc_object_release( p_playlist );
/* Prepare IPv4 Networking */ /* Prepare IPv4 Networking */
if ( sap_ipv4 == 1) if ( sap_ipv4 == 1)
{ {
...@@ -487,7 +505,7 @@ static int sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd ) ...@@ -487,7 +505,7 @@ static int sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
if( p_item ) if( p_item )
{ {
p_item->i_group = config_GetInt( p_intf, "sap-group-id" ); p_item->i_group = p_intf->p_sys->i_group;
p_item->b_enabled = VLC_TRUE; p_item->b_enabled = VLC_TRUE;
p_item->psz_author = NULL; p_item->psz_author = NULL;
p_playlist = vlc_object_find( p_intf, p_playlist = vlc_object_find( p_intf,
...@@ -784,8 +802,18 @@ static sess_descr_t * parse_sdp( intf_thread_t * p_intf, char *p_packet ) ...@@ -784,8 +802,18 @@ static sess_descr_t * parse_sdp( intf_thread_t * p_intf, char *p_packet )
*psz_eof = '\0'; *psz_eof = '\0';
sd->pp_attributes[sd->i_attributes]->psz_field = sd->pp_attributes[sd->i_attributes]->psz_field =
strdup( p_packet ); strdup( p_packet );
sd->pp_attributes[sd->i_attributes]->psz_value = if( psz_eof + 1 )
{
sd->pp_attributes[sd->i_attributes]->psz_value =
strdup( ++psz_eof ); strdup( ++psz_eof );
}
else
{
if( sd->pp_attributes[sd->i_attributes]->psz_field )
free( sd->pp_attributes[sd->i_attributes]
->psz_field );
break;
}
for( i=0 ; i< for( i=0 ; i<
strlen(sd->pp_attributes[sd->i_attributes]->psz_value) ; strlen(sd->pp_attributes[sd->i_attributes]->psz_value) ;
i++ ) i++ )
......
This diff is collapsed.
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