Commit 908f4efc authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* include/codecs.h: cosmetic fixes.

* modules/gui/macosx/*:
  - remove the enqueue option from the open panel. why did i even add it? KISS
  - better use of name and uri fields of playlist_item_t
  - when users d&d a CD on VLC, it will now play. This breaks d&d folders
    located on a CD for now. Not really important but should be fixed later on.
parent 4b33c51d
......@@ -204,7 +204,6 @@
OUTLETS = {
"o_btn_cancel" = id;
"o_btn_ok" = id;
"o_ckbox_enqueue" = id;
"o_disc_chapter" = id;
"o_disc_chapter_lbl" = id;
"o_disc_chapter_stp" = id;
......
......@@ -22,6 +22,6 @@
<integer>977</integer>
</array>
<key>IBSystem Version</key>
<string>6L60</string>
<string>6R73</string>
</dict>
</plist>
......@@ -2,7 +2,7 @@
* codecs.h: codec related structures needed by the demuxers and decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: codecs.h,v 1.5 2003/08/18 00:17:44 fenrir Exp $
* $Id: codecs.h,v 1.6 2003/10/19 23:12:16 hartman Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -70,29 +70,31 @@ typedef struct {
/* WAVE form wFormatTag IDs */
#define WAVE_FORMAT_UNKNOWN 0x0000 /* Microsoft Corporation */
#define WAVE_FORMAT_PCM 0x0001 /* Microsoft Corporation */
#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
#define WAVE_FORMAT_IEEE_FLOAT 0x0003 /* Microsoft Corporation */
#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
#define WAVE_FORMAT_DTS 0x0008 /* Microsoft Corporation */
#define WAVE_FORMAT_IMA_ADPCM 0x0011
#define WAVE_FORMAT_MPEG 0x0050 /* Microsoft Corporation */
#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 /* Sonic Foundry */
#define WAVE_FORMAT_UNKNOWN 0x0000 /* Microsoft Corporation */
#define WAVE_FORMAT_PCM 0x0001 /* Microsoft Corporation */
#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
#define WAVE_FORMAT_IEEE_FLOAT 0x0003 /* Microsoft Corporation */
#define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */
#define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */
#define WAVE_FORMAT_DTS 0x0008 /* Microsoft Corporation */
#define WAVE_FORMAT_IMA_ADPCM 0x0011 /* Intel Corporation */
#define WAVE_FORMAT_GSM610 0x0031 /* Microsoft Corporation */
#define WAVE_FORMAT_MSNAUDIO 0x0032 /* Microsoft Corporation */
#define WAVE_FORMAT_MPEG 0x0050 /* Microsoft Corporation */
#define WAVE_FORMAT_MPEGLAYER3 0x0055 /* ISO/MPEG Layer3 Format Tag */
#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 /* Sonic Foundry */
#define WAVE_FORMAT_A52 0x2000
#define WAVE_FORMAT_WMA1 0x0160
#define WAVE_FORMAT_WMA2 0x0161
#define WAVE_FORMAT_WMA3 0x0162
#define WAVE_FORMAT_A52 0x2000
#define WAVE_FORMAT_WMA1 0x0160
#define WAVE_FORMAT_WMA2 0x0161
#define WAVE_FORMAT_WMA3 0x0162
/* Need to check these */
#define WAVE_FORMAT_DK3 0x0061
#define WAVE_FORMAT_DK4 0x0061
#define WAVE_FORMAT_DK3 0x0061
#define WAVE_FORMAT_DK4 0x0062
#if !defined(WAVE_FORMAT_EXTENSIBLE)
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */
#endif
static struct
......
......@@ -2,7 +2,7 @@
* open.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: open.h,v 1.15 2003/07/27 23:05:41 hartman Exp $
* $Id: open.h,v 1.16 2003/10/19 23:12:16 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -40,7 +40,6 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
IBOutlet id o_btn_ok;
IBOutlet id o_btn_cancel;
IBOutlet id o_ckbox_enqueue;
IBOutlet id o_file_path;
IBOutlet id o_file_btn_browse;
......
......@@ -2,7 +2,7 @@
* open.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: open.m,v 1.38 2003/09/19 23:03:27 hartman Exp $
* $Id: open.m,v 1.39 2003/10/19 23:12:16 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -134,7 +134,6 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
[o_panel setTitle: _NS("Open Source")];
[o_mrl_lbl setTitle: _NS("Media Resource Locator (MRL)")];
[o_ckbox_enqueue setTitle: _NS("Only enqueue in playlist, do not play")];
[o_btn_ok setTitle: _NS("OK")];
[o_btn_cancel setTitle: _NS("Cancel")];
......@@ -233,7 +232,6 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
{
NSMutableDictionary *o_dic;
NSMutableArray *o_options = [NSMutableArray array];
BOOL b_enq = [o_ckbox_enqueue state] == NSOnState ? YES : NO;
o_dic = [NSMutableDictionary dictionaryWithObject: [o_mrl stringValue] forKey: @"ITEM_URL"];
if( [o_file_sub_ckbox state] == NSOnState )
......@@ -250,7 +248,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
[o_options addObject: [NSString stringWithFormat: @"sout=%@", [(VLCOutput *)o_sout_options getMRL]]];
}
[o_dic setObject: (NSArray *)[o_options copy] forKey: @"ITEM_OPTIONS"];
[o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:b_enq];
[o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:NO];
}
}
......
......@@ -2,7 +2,7 @@
* playlist.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.m,v 1.33 2003/09/22 03:40:05 hartman Exp $
* $Id: playlist.m,v 1.34 2003/10/19 23:12:16 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net>
......@@ -29,6 +29,7 @@
#include <sys/param.h> /* for MAXPATHLEN */
#include <string.h>
#include <math.h>
#include <sys/mount.h>
#include "intf.h"
#include "playlist.h"
......@@ -315,24 +316,44 @@ int MacVersion102 = -1;
{
/* One item */
NSDictionary *o_one_item;
NSString *o_url;
NSString *o_name;
int j;
int i_total_options = 0;
int i_mode = PLAYLIST_INSERT;
BOOL b_rem = FALSE, b_dir = FALSE;
NSString *o_url, *o_name;
NSArray *o_options;
int j, i_total_options = 0;
char **ppsz_options = NULL;
int i_mode = PLAYLIST_INSERT;
/* Get the item */
o_one_item = [o_array objectAtIndex: i_item];
o_url = (NSString *)[o_one_item objectForKey: @"ITEM_URL"];
o_name = (NSString *)[o_one_item objectForKey: @"ITEM_NAME"];
o_options = (NSArray *)[o_one_item objectForKey: @"ITEM_OPTIONS"];
if( !o_name) o_name = o_url;
/* If no name, then make a guess */
if( !o_name) o_name = [[NSFileManager defaultManager] displayNameAtPath: o_url];
if( [[NSFileManager defaultManager] fileExistsAtPath:o_url isDirectory:&b_dir] && b_dir &&
[[NSWorkspace sharedWorkspace] getFileSystemInfoForPath: o_url isRemovable: &b_rem
isWritable:NULL isUnmountable:NULL description:NULL type:NULL] && b_rem )
{
/* All of this is to make sure CD's play when you D&D them on VLC */
/* Converts mountpoint to a /dev file */
struct statfs *buf;
char *psz_dev, *temp;
buf = (struct statfs *) malloc (sizeof(struct statfs));
statfs( [o_url fileSystemRepresentation], buf );
psz_dev = strdup(buf->f_mntfromname);
free( buf );
temp = strrchr( psz_dev , 's' );
psz_dev[temp - psz_dev] = '\0';
o_url = [NSString stringWithCString: psz_dev ];
NSLog(@"%@", o_url);
}
if (i_item == 0 && !b_enqueue)
i_mode |= PLAYLIST_GO;
if( o_options && [o_options count] > 0 )
{
/* Count the input options */
......@@ -347,16 +368,17 @@ int MacVersion102 = -1;
ppsz_options[j] = strdup([[o_options objectAtIndex:j] UTF8String]);
}
}
playlist_AddExt( p_playlist, [o_name UTF8String], [o_url fileSystemRepresentation], -1,
playlist_AddExt( p_playlist, [o_url fileSystemRepresentation], [o_name UTF8String], -1,
(ppsz_options != NULL ) ? (const char **)ppsz_options : 0, i_total_options,
i_mode, i_position == -1 ? PLAYLIST_END : i_position + i_item );
i_mode, i_position == -1 ? PLAYLIST_END : i_position + i_item);
/* clean up */
for( j = 0; j < i_total_options; j++ )
free( ppsz_options[j] );
if( ppsz_options ) free( ppsz_options );
/* Recent documents menu */
NSURL *o_true_url = [NSURL fileURLWithPath: o_url];
if( o_true_url != nil )
{
......@@ -386,9 +408,7 @@ int MacVersion102 = -1;
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
i_row = p_playlist->i_index;
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
[o_table_view selectRow: i_row byExtendingSelection: NO];
......@@ -526,11 +546,9 @@ int MacVersion102 = -1;
o_array = [o_array arrayByAddingObject: o_dic];
}
[self appendArray: o_array atPos: i_proposed_row enqueue:YES];
return( YES );
return YES;
}
return( NO );
return NO;
}
[self updateRowSelection];
}
......
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