langquicktime.c

Go to the documentation of this file.
00001 
00002 /*  $Id: langquicktime.c 1260 2006-04-13 06:13:10Z sethdill $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 /*
00029 7.0b4 PBS 08/09/00: QuickTime verbs.
00030 */
00031 
00032 #include "frontier.h"
00033 #include "standard.h"
00034 
00035 #ifdef MACVERSION /*7.0b4 PBS: QuickTime verbs are Mac-only.*/
00036 
00037 #include "memory.h"
00038 #include "strings.h"
00039 #include "ops.h"
00040 #include "resources.h"
00041 #include "timedate.h"
00042 #include "lang.h"
00043 #include "langinternal.h"
00044 #include "langhtml.h"
00045 #include "langexternal.h"
00046 #include "langsystem7.h"
00047 #include "tableinternal.h"
00048 #include "tablestructure.h"
00049 #include "tableverbs.h"
00050 #include "kernelverbs.h"
00051 #include "kernelverbdefs.h"
00052 #include "oplist.h"
00053 #include "player.h"
00054 
00055 
00056 typedef enum tyquicktimeverbtoken { /*verbs that are processed by langquicktime.c*/
00057     
00058     quicktimeopenfunc,
00059     quicktimeplayfunc,
00060     quicktimestopfunc,
00061     quicktimeisplayingfunc,
00062     
00063     ctquicktimeverbs
00064     } tyquicktimeverbtoken;
00065 
00066 
00067 /*Functions*/
00068 
00069 
00070 static boolean quicktimeisplayingverb (hdltreenode hp1, tyvaluerecord *v) {
00071     
00072     /*
00073     7.0b4 PBS: Is the QuickTime Player window currently playing a movie?
00074     */
00075     
00076     if (!langcheckparamcount (hp1, 0))
00077         return (false);
00078             
00079     (*v).data.flvalue = playerisplaying ();
00080             
00081     return (true);
00082     } /*quicktimeisplayingverb*/
00083 
00084 
00085 static boolean quicktimeopenverb (hdltreenode hp1, tyvaluerecord *v) {
00086 #pragma unused(v)
00087 
00088     /*
00089     7.0b4 PBS: Open a movie in the QuickTime player window.
00090     */
00091     
00092     tyfilespec fs;
00093 
00094     flnextparamislast = true;
00095     
00096     if (!getfilespecvalue (hp1, 1, &fs))
00097         return (false);
00098 
00099     if (!playeropenmovieinwindow (&fs)) {
00100         
00101         langerrormessage (BIGSTRING ("\x31" "Can't open the file because of a QuickTime error."));
00102         
00103         return (false);
00104         } /*if*/
00105     
00106     return (true);      
00107     } /*quicktimeopenverb*/
00108 
00109 
00110 static boolean quicktimeplayverb (hdltreenode hp1, tyvaluerecord *v) {
00111     
00112     /*
00113     7.0b4 PBS: play the movie in the QuickTime Player window.
00114     */
00115     
00116     if (!langcheckparamcount (hp1, 0))
00117         return (false);
00118             
00119     (*v).data.flvalue = playerplaymovie ();
00120             
00121     return (true);
00122     } /*quicktimeplayverb*/
00123     
00124 
00125 static boolean quicktimestopverb (hdltreenode hp1, tyvaluerecord *v) {
00126     
00127     /*
00128     7.0b4 PBS: stop the movie in the QuickTime Player window.
00129     */
00130     
00131     if (!langcheckparamcount (hp1, 0))
00132         return (false);
00133             
00134     (*v).data.flvalue = playerstopmovie ();
00135             
00136     return (true);
00137     } /*quicktimestopverb*/
00138 
00139 
00140 static boolean quicktimefunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
00141     
00142     /*
00143     7.0b4 PBS: switch statement for QuickTime verbs.
00144     */
00145     
00146     hdltreenode hp1 = hparam1;
00147     tyvaluerecord *v = vreturned;
00148     
00149     setbooleanvalue (false, v); /*by default, string functions return false*/
00150     
00151     switch (token) {
00152         
00153         case quicktimeopenfunc:
00154             return (quicktimeopenverb (hp1, v));
00155         
00156         case quicktimeplayfunc:
00157             return (quicktimeplayverb (hp1, v));
00158         
00159         case quicktimestopfunc:
00160             return (quicktimestopverb (hp1, v));
00161         
00162         case quicktimeisplayingfunc:
00163             return (quicktimeisplayingverb (hp1, v));
00164         
00165         default:
00166             getstringlist (langerrorlist, unimplementedverberror, bserror);
00167             
00168             return (false);
00169         } /*switch*/
00170     } /*quicktimefunctionvalue*/
00171     
00172     
00173 boolean quicktimeinitverbs (void) {
00174     
00175     /*
00176     7.0b4 PBS: new QuickTime verbs.
00177     */
00178         
00179     return (loadfunctionprocessor (idquicktimeverbs, &quicktimefunctionvalue));
00180     } /*quicktimeinitverbs*/
00181 
00182 
00183 #endif

Generated on Wed May 31 18:19:52 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6