*****************************************************************************
* Copyright (C) 2001 VideoLAN
*
- * Authors: Colin Delacroix <colin@zoy.org>
- * Eugenio Jarosiewicz <ej0@cise.ufl.edu>
+ * Authors:
*
* 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
#include "intf_msg.h"
#include "interface.h"
-/* FIXME: get rid of this and do menus & command keys*/
-#include "keystrokes.h"
-
#include "modules.h"
#include "stream_control.h"
kMenuControls = 130,
kAppleAbout = 1,
- kAppleQuit = 7, //is this always the same?
+ kAppleQuit = 8, //is this always the same?
kFileNew = 1,
kFileOpen,
kFileCloseDivisor,
kFileClose,
+ kFileQuitHack,
kControlsPlayORPause = 1,
kControlsStop,
kControlsEject
-
#if 0
//virtual key codes ; raw subtract 0x40 from these values
//http://devworld.apple.com/techpubs/mac/Text/Text-577.html#HEADING577-0
InitCursor();
SetQDGlobalsRandomSeed( TickCount() );
-#if 0
- p_intf->p_intf_get_key = intf_GetKey;
-
- intf_AssignKey( p_intf , 'Q', INTF_KEY_QUIT, 0);
- intf_AssignKey( p_intf , 'q', INTF_KEY_QUIT, 0);
- intf_AssignKey( p_intf , 27, INTF_KEY_QUIT, 0);
- intf_AssignKey( p_intf , 3, INTF_KEY_QUIT, 0);
- intf_AssignKey( p_intf , '0', INTF_KEY_SET_CHANNEL, 0);
- intf_AssignKey( p_intf , '1', INTF_KEY_SET_CHANNEL, 1);
- intf_AssignKey( p_intf , '2', INTF_KEY_SET_CHANNEL, 2);
- intf_AssignKey( p_intf , '3', INTF_KEY_SET_CHANNEL, 3);
- intf_AssignKey( p_intf , '4', INTF_KEY_SET_CHANNEL, 4);
- intf_AssignKey( p_intf , '5', INTF_KEY_SET_CHANNEL, 5);
- intf_AssignKey( p_intf , '6', INTF_KEY_SET_CHANNEL, 6);
- intf_AssignKey( p_intf , '7', INTF_KEY_SET_CHANNEL, 7);
- intf_AssignKey( p_intf , '8', INTF_KEY_SET_CHANNEL, 8);
- intf_AssignKey( p_intf , '9', INTF_KEY_SET_CHANNEL, 9);
- intf_AssignKey( p_intf , '0', INTF_KEY_SET_CHANNEL, 0);
- intf_AssignKey( p_intf , '+', INTF_KEY_INC_VOLUME, 0);
- intf_AssignKey( p_intf , '-', INTF_KEY_DEC_VOLUME, 0);
- intf_AssignKey( p_intf , 'm', INTF_KEY_TOGGLE_VOLUME, 0);
- intf_AssignKey( p_intf , 'M', INTF_KEY_TOGGLE_VOLUME, 0);
- intf_AssignKey( p_intf , 'g', INTF_KEY_DEC_GAMMA, 0);
- intf_AssignKey( p_intf , 'G', INTF_KEY_INC_GAMMA, 0);
- intf_AssignKey( p_intf , 'c', INTF_KEY_TOGGLE_GRAYSCALE, 0);
- intf_AssignKey( p_intf , ' ', INTF_KEY_TOGGLE_INTERFACE, 0);
- intf_AssignKey( p_intf , 'i', INTF_KEY_TOGGLE_INFO, 0);
- intf_AssignKey( p_intf , 's', INTF_KEY_TOGGLE_SCALING, 0);
- intf_AssignKey( p_intf , 'd', INTF_KEY_DUMP_STREAM, 0);
-
-
-//EJ - neat menu but don't know if we want it.
+// neat menu but don't know if we want it.
// Install the Windows menu. Free of charge!
// CreateStandardWindowMenu( 0, &windMenu );
// InsertMenu( windMenu, 0 );
// DrawMenuBar();
-#else
-
menu = NewMenu( kMenuApple, "\p\024" );
AppendMenu( menu, "\pAbout VLCÉ/A" );
InsertMenu( menu, 0 );
AppendMenu( menu, "\pOpenÉ/O" );
AppendMenu( menu, "\p(-" );
AppendMenu( menu, "\pClose/W" );
+ //standard OS X application menu quit isn't working nicely
+ AppendMenu( menu, "\pQuit/Q" );
InsertMenu( menu, 0 );
//BIG HONKING MENU - in order Mac OS 9 dvd player
AppendMenu( menu, "\pEject/E" ); //14
InsertMenu( menu, 0 );
-#endif
+
+
DrawMenuBar();
EventLoopTimerUPP manageUPP;
+/*
+Eventually we want to use Carbon events, or maybe even write this app in Cocoa
+*/
+
// EventTypeSpec windowEventType = { kEventClassWindow, kEventWindowClose };
// EventHandlerUPP windowHandlerUPP;
*/
-#ifndef CocoaEvents
+#ifndef CarbonEvents
//UGLY Event Loop!
EventLoop( p_intf );
#else
}
}
-#ifndef CocoaEvents
+#ifndef CarbonEvents
void EventLoop( intf_thread_t *p_intf )
{
do
{
+ p_intf->pf_manage( p_intf );
gotEvent = WaitNextEvent(everyEvent,&event,32767,nil);
if (gotEvent)
DoEvent( p_intf, &event);
} while (! p_intf->b_die );
- ExitToShell();
+ //ExitToShell();
}
+
void DoEvent( intf_thread_t *p_intf , EventRecord *event)
{
short part;
case kAppleQuit:
p_intf->b_die = true;
+ //hrmm...
+ ExitToShell();
return;
break;
//DoAboutBox();
break;
+ case kFileQuitHack:
+ p_intf->b_die = true;
+ break;
+
default:
break;
}
break;
case kControlsChapterNext:
- //Fixme
- SysBeep(30);
+ if( p_intf->p_input != NULL )
+ {
+ /* FIXME: temporary hack */
+ p_intf->p_input->b_eof = 1;
+ }
break;
case kControlsChapterPrevious:
- //Fixme
- SysBeep(30);
+ if( p_intf->p_input != NULL )
+ {
+ /* FIXME: temporary hack */
+ intf_PlaylistPrev( p_main->p_playlist );
+ intf_PlaylistPrev( p_main->p_playlist );
+ p_intf->p_input->b_eof = 1;
+ }
break;
case kControlsDVDMenu:
}
return result;
}
-#endif
+#endif
\ No newline at end of file
*****************************************************************************
* Copyright (C) 2001 VideoLAN
*
- * Authors: Colin Delacroix <colin@zoy.org>
- * Eugenio Jarosiewicz <ej0@cise.ufl.edu>
+ * Authors:
*
* 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
intf_ErrMsg( "FindBestMemoryLocation : gNewNewGWorld = false !" );
#if 0
-//EJ added
p_vout->i_screen_depth = wPixDepth;
p_vout->i_bytes_per_pixel = wPixDepth;
p_vout->i_bytes_per_line = p_vout->i_width * p_vout->i_bytes_per_pixel;
return( 1 );
}
+//FIXME ? - lock this down until the end...
hPixmap0 = GetGWorldPixMap( p_vout->p_sys->p_gw[0] );
-//FIXME BIGTIME - in SDL they just lock this down until the end...KLUDGE
-//but alas sounds good to me to try it.
-//well fuck a duck it works.
LockPixels(hPixmap0);
hPixmap1 = GetGWorldPixMap( p_vout->p_sys->p_gw[1] );
LockPixels(hPixmap1);
return( 1 );
}
-//FIXME TODO - if I ever dispose of the Gworlds and recreate them, i'll have a new address
+//FIXME - if I ever dispose of the Gworlds and recreate them, i'll have a new address
//and I'll need to tell vout about them... dunno what problems vout might have if we just updateGworld
vout_SetBuffers( p_vout, hPixmapBaseAddr0, hPixmapBaseAddr1 );
p_vout->i_bytes_per_line = p_vout->i_width * p_vout->i_bytes_per_pixel;
p_vout->p_sys->i_page_size = p_vout->i_width * p_vout->i_height * p_vout->i_bytes_per_pixel;
-//EJ added
-#if 1
-p_vout->i_bytes_per_line = (**(**GetWindowDevice( p_vout )).gdPMap).rowBytes & 0x3FFF ;
+ p_vout->i_bytes_per_line = (**(**GetWindowDevice( p_vout )).gdPMap).rowBytes & 0x3FFF ;
switch ( p_vout->i_screen_depth )
{
default:
break;
}
-#endif
-//EJ - not sure about these...
#if 0
p_vout->i_red_lshift = 0x10;
p_vout->i_red_rshift = 0x0;
GetPortBitMapForCopyBits( GetWindowPort( p_vout->p_sys->p_window ) ),
&rectSource, &rectDest, srcCopy, NULL);
// UnlockPixels( GetGWorldPixMap( p_vout->p_sys->p_gw[index] ) );
-//EJ
//flushQD( p_vout );
-/*
- }
- else
- {
- intf_ErrMsg( "error: Could not LockPixels" );
- }
-*/
+// }
SetPort ( pCGrafSave );
}