Eyelink: Improve error handling in Eyelink('Initialize').

Provide meaningful error message with abort if open_eyelink_system()
fails, instead of silent failure and confusing status return codes.
-> Minor problem, no need to rebuild Eyelink mex file. Will be folded
into release at next real rebuild.
New demo TurnTableDemo - Free your inner DJ!

A demo which uses PsychPortAudio's functions to simulate a good'ol turn
table for some recreational scratching and other auditory fun
activities.

Work in progress - This is a backup commit of a basic working state.
TurnTableDemo: Number zero does not map well - exclude it.
TurnTableDemo: Refine key mappings.

Right ALT doesn't work well on some setups, so use
Right SHIFT instead to stop looping sounds and drop
the old mute function of that right SHIFT key.

Minor cleanups.
Screen/GStreamer: Allow passing arbitrary bins as video sources for video capture.

A deviceIndex of -1 in Screen('OpenVideoCapture') now accepts a
gst-launch style pipeline/bin description string as 'moviename'. The
string is parsed and converted into a GstBin and this bin is attached
as video source element for video capture and recording.

-> Should allow to build unusual or exotic capture pipelines or work
around system limitations.
-> Such a videosource will not allow auto-detection of video
resolution, nor will it validate a provided roi. Either secondary
detection will have to work, or usercode has to pass in a valid roi,
otherwise bad things will happen.

-> Screen.mexw64 for 64-Bit Matlab on Windows rebuilt and lightly
tested. Other mex files will have to wait for next beta release.
DaqDeviceIndex/OSX: Make sure selected daq has nroutputs > 0.

Not that it helped. DaqAInScan fails just as miserably on OSX 10.9 as
it did on 10.7 and 10.5. Seems that one 10.8 machine of user masondar
is the only one that actually works with 64-Bit PTB. Oh, and 10.9
scrambles ordering of daq interfaces even worse than 10.7 did. Strong
work Apple!
IOPort/Unix: Fix missing init assignment of lineTerminator to _POSIX_VDISABLE

Had a == instead of =, so the init was a no-op. Found by llvm clang
compiler.
Adapt to OSX 10.9 Mavericks and 10.9-SDK, rebuild all OSX mex files.

Change base SDK from 10.6 to 10.9, as 10.6 and 10.7 SDK's are no longer
available on the 10.9 build system. Change compiler to llvm-gcc from
llgv-gcc-4.2.
Make modifications to fix as many compile time warnings as possible.
Rebuild all Matlab and Octave mex files for 64-Bit OSX.

All mex files except Screen build without warnings. Remaining warnings
at this point:
- GStreamer deprecated function warnings. Those are on all platforms ->
unrelated.
- CGDisplayBitsPerPixel implicit declaration and CGDisplayBeamposition
implicit declaration. These have been removed from 10.9 SDK but code
still magically works.
- ATSUxxx function implicit declaration warnings in SCREENDrawText.
These have been removed from 64-Bit SDK headers but still magically
work.
-> This could only be fixed by rewriting the ATSUI text renderer into a
CoreText text renderer, and changing CGxxx api. Keep it for now as is,
as long as it works.
-> CGDisplayBeamposition() is a candidate for removal. It has limited
use on 10.6 (Only NVidia gpu's supported), even more limited use on
10.7 (slight inaccuracies, PsychtoolboxKernelDriver is always the
better option), almost no use on 10.8 (only works on VGA-CRT monitors)
and is completely dysfunctional on 10.9 - The function only returns the
-1 "feature unsupported" status code and triggers our fallbacks. All in
all the function is almost useless and mostly a maintenance burden at
this point.

-> This set of Octave mex files is compatible with the Octave-3.7.7+
GUI prototype, useful for testing with Octave GUI on OSX.
Screen/OSX: Rewrite screen glue to remove/fix use of deprecated functions.

Rewrite screen glue to use functions which are supported/current as of
OSX 10.9, to replace functions which are deprecated since 10.6.
Add missing function prototype of CGDisplayBeamPosition() - which was
completely removed in the OSX 10.9 SDK - until we decide if we should
already kill it completely, or let it linger around for a while longer.
Current status:
10.6 - Only works on NVidia gpus, 10.7 - Ditto, but slightly
broken/inaccurate - PTB driver is better solution, 10.8 Severely broken
for everything bug VGA-CRT's, 10.9 completely dysfunctional (always
returns zero on NVidia card).
Remove unused PsychGetNumScreenPlanes() function for all os'es as a
cleanup.

-> Screen for 64-Bit Matlab on OSX rebuilt and lightly tested.
Screen/GStreamer: Silence deprecation warnings on at least OSX and Linux.

When building on GLib version 2.32 and later, disable warnings about
deprecated API calls. This to silence g_value_array_get_nth() and
g_value_array_free() deprecation warning on GLib 2.32+. We know that
GValueArrays are deprecated and should be replaced by GArray's, but
some GStreamer-0.10 functions still use them, so we have to use them as
well until we upgrade to GStreamer-1.0 at some point.

Makes compiler output less cluttered. Also remove some deprecation
warning suppress from OSX Window glue when we're at it - it is no
longer needed.
Rebuild Screen mex files for Octave and Matlab on OSX as baseline.
Screen/OSX: Replace ATSUI text renderer by CoreText text renderer.

ATSUI is deprecated since 10.6 and difficult to support on 10.9+, so
let it die.
Screen('DrawText') for OSX specific textrenderer (type 0 and 1)
reimplemented by use of CoreText framework. Additional code cleanup.
As a little side effect, the CoreText renderer now supports
Screen('TextModes') which never had any function in PTB-3 and it
supports "underlined" text style - in theory, as i couldn't find any
font which actually supports that. As another bonus, the renderer can
now handle the "Kuenstler LT" script font which was so painful to use
in the old implementation.

-> Screen and FontInfo for 64-Bit Octave and Matlab on OSX rebuilt and
tested.
OSX: Transition fontglue from ATSUI to CoreText.

Remove all ATSUI based code for font enumeration and replace by
CoreText equivalents. This incurs some loss of information, as CoreText
doesn't expose some stuff ATSUI did:
* No QuickDraw name of the font anymore, instead an empty string.
* Some entries in the font metrics are now missing: avgAdvanceWidth,
minLeftSideBearing and minRightSideBearing, stemWidth and stemHeight.
These are now returned as zero.

-> Screen and FontInfo for 64-Bit Matlab on OSX rebuilt and tested.
OSX: Optimize/Reduce execution time of CoreText font enumeration.

Full query of all font properties, as reported by info =
FontInfo('Fonts'), is very costly in terms of execution time. It
requires to open->query->close every single font file to retrieve some
properties like font metrics etc. Most of the information is only
needed by FontInfo(). Screen() only needs the font family name and font
style descriptor for selecting a font via Screen('TextFont') [Selects
by font family name] and Screen('TextStyle') [Selects by style symbolic
traits descriptor], and the postscript name of a font for
Screen('DrawText') [Selects font to open/use for drawing via postscript
name]. Luckily the minimal information required by Screen() is also
available in the CTFontDescriptor's returned by the font database
without need to actually open the associated font file. Take advantage
of this: If enumeration is executing within the context of Screen() mex
startup, only perform cheap CTFontDescriptor queries but skip expensive
font open->query->close detailed queries. This saves a lot of startup
time on first load of Screen() mex after startup/clear Screen:

Before: 14-15 seconds for Screen initial startup on a 2010 MacBookPro
with OSX 10.9
Now: 0.137 seconds -> Over 100x faster -> Essentially not noticeable by
user!

-> Also cleanup a few now unused ATS and FM varirables from fontstruct.
-> Also simplify DrawHighQualityUnicodeTextDemo. No need for use of
FontInfo for defining japanese fonts anymore - font family is now
always ASCII encoded. Faster!

-> Screen and FontInfo for 64-Bit Octave and Matlab on OSX rebuilt and
tested.
Screen/OSX: Release font database at flush time.

Was missing a call to PsychFreeFontList() to cleanup font database at
clear Screen time, causing a memory leak over all these years! A small
one though...
-> Screen for Octave and Matlab on OSX rebuilt and tested.
Screen/OSX: Optimize font switching a tiny bit more.

Cache the CTFontDescriptorRef in our font structs and select the font
in Screen('DrawText') directly from the font descriptor, instead of
going through postscript names. The speedup is insignificant though, in
the low microsecond range.

I also checked were most of the time during font enumeration is spent.
It is not in opening the CoreText font, but in querying font metrics
like ascenders, descenders etc. These queries apparently trigger an
iteration over all glyphs in the font file to compute those properties
and that takes up over 96% of the processing time, accounting for about
14 seconds of the 14-15 seconds startup time in FontInfo(). Anyway,
these metrics queries are mostly unavoidable if FontInfo() is supposed
to be useful for much, so we'll have to live with this.

-> FontInfo and Screen for 64-Bit Matlab and Octave on OSX rebuilt and
tested.
Merge branch 'osxcoretext'

This completely switches the OSX implementations of Screen and
FontInfo from old and deprecated FontManager + ATSUI to the new
and shiny CoreText Framework.

This was neccessary due to switch from OSX 10.6 "Snow Leopard"
SDK to OSX 10.9 "Mavericks" SDK to future-proof us here.

This means that OSX 10.6 as a minimum supported version is now
a hard requirement, as this code would not build on 10.5 and
earlier anymore.

Downsides of new implementation:

* 'QuickDraw' font name is no longer reported by FontInfo().
* Some font metrics are no longer reported by FontInfo().

Upsides:

* Future-Proof (until Apple does its next crappy move of course).
* More exotic fonts like "Kuenstler Script LT" now work with default
  renderer.
* Screen() startup time drastically shorter due to much faster font
  enumeration for Screen: 15 seconds to 0.13 seconds.
Remove tons of dead code.

All these files were never ever used in the first place, or they became
obsolete over time. Remove them.
Screen: Make video refresh calibration more robust on broken operating systems.

This is another layer of band-aid to keep OSX in the game. The latest
version of OSX 10.9 Mavericks has rather horrible noisy timing on flip
completion, at least on my early 2010 MacBookPro with NVidia GeForce GT
330M as of OSX 10.9.0. This causes many outlier samples during initial
video refresh calibration. As OSX doesn't report a nominal video
refresh rate on internal flat panels, ifi_nominal can't be used to
filter out outlier samples. The result is frequent sync failure due to
outliers - about 80% of all runs!

Now we add the use of ifi_beamestimate as fallback hint. If ifi_nominal
is unavailable, the ifi_beamestimate from beamposition based video
refresh measurement is used as filter instead. This works on my MBP
with its NVidia card, as the PTB kernel driver supports NVidia cards.
It would also work on AMD cards. However, owners of Intel integrated
graphics cards would be out of luck, as neither OSX nor our kernel
driver support beampos queries on Intel gpu's, so no stabilization for
them.

With this commit i only get occassional sync failures, not the insane
amounts as before.

-> Screen for Octave and Matlab on OSX rebuilt and tested. This patch
should also theoretically help on MS-Windows or Linux but is rarely (if
ever) needed there, as those os'es don't have the totally broken
nominal framerate reporting as Apple's masterpiece.
Add new demo VideoMultiCameraCaptureDemo.

This is work in progress: A demo for simultaneous videocapture
from multiple connected cameras, with all possible bells and
whistles. Works but is incomplete - this is a backup commit.

Also rebuilt Screen.mex for 64-Bit Octave on Linux for testing.