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>
*
......@@ -77,7 +77,9 @@ typedef struct {
#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_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 */
......@@ -89,7 +91,7 @@ typedef struct {
/* Need to check these */
#define WAVE_FORMAT_DK3 0x0061
#define WAVE_FORMAT_DK4 0x0061
#define WAVE_FORMAT_DK4 0x0062
#if !defined(WAVE_FORMAT_EXTENSIBLE)
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */
......
......@@ -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,12 +316,13 @@ 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];
......@@ -328,7 +330,26 @@ int MacVersion102 = -1;
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;
......@@ -348,15 +369,16 @@ int MacVersion102 = -1;
}
}
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