File: SCREENCloseMovie.c

package info (click to toggle)
psychtoolbox-3 3.0.9%2Bsvn2579.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 63,408 kB
  • sloc: ansic: 73,310; cpp: 11,139; objc: 3,129; sh: 1,669; python: 382; php: 272; makefile: 172; java: 113
file content (145 lines) | stat: -rwxr-xr-x 2,270 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*

 Psychtoolbox3/Source/Common/SCREENCloseMovie.c		

 

 AUTHORS:

 mario.kleiner at tuebingen.mpg.de   mk

 

 PLATFORMS:	

 This file should build on any platform. 

 

 HISTORY:

 10/23/05  mk		Created. 

 

 DESCRIPTION:

 

 Close a previously opened movie file and release all associated ressources.

 

 On OS-X, all movie/multimedia handling functions are implemented via the Apple Quicktime API,

 version 7 or later. On a later Windows port we'll probably do the same, but for other OS'es,

 e.g., Linux, we would use a different multimedia engine.

 

 TO DO:

 

 

 

 

 */





#include "Screen.h"





static char useString[] = "Screen('CloseMovie', moviePtr);";

static char synopsisString[] = 

	"Close movie object specified by 'moviePtr' and release all associated ressources.";

static char seeAlsoString[] = "CloseMovie PlayMovie GetMovieImage GetMovieTimeIndex SetMovieTimeIndex";

	 



PsychError SCREENCloseMovie(void) 

{

    int                                     moviehandle = -1;

    

    // All sub functions should have these two lines

    PsychPushHelp(useString, synopsisString, seeAlsoString);

    if(PsychIsGiveHelp()) {PsychGiveHelp(); return(PsychError_none);};

    

    PsychErrorExit(PsychCapNumInputArgs(1));            // Max. 1 input args.

    PsychErrorExit(PsychRequireNumInputArgs(1));        // Min. 1 input args required.

    PsychErrorExit(PsychCapNumOutputArgs(0));           // No output args.

    

    // Get the window record from the window record argument and get info from the window record

    //PsychAllocInWindowRecordArg(kPsychUseDefaultArgPosition, TRUE, &windowRecord);

    // Only onscreen windows allowed:

    //if(!PsychIsOnscreenWindow(windowRecord)) {

      //  PsychErrorExitMsg(PsychError_user, "OpenMovie called on something else than an onscreen window.");

    //}

    

    // Get the movie handle:

    PsychCopyInIntegerArg(1, TRUE, &moviehandle);

    if (moviehandle==-1) {

        PsychErrorExitMsg(PsychError_user, "CloseMovie called without valid handle to a movie object.");

    }

    

    // Try to delete the movie object, releasing all associated ressources:

    PsychDeleteMovie(moviehandle);

    

    // Ready!    

    return(PsychError_none);

}