Add new vars. Implement init.

This commit is contained in:
Gregory John Casamento 2022-03-19 03:10:31 -04:00
parent 4b13050e70
commit 04789d7bbf
4 changed files with 52 additions and 23 deletions

View file

@ -7,6 +7,9 @@
Author: Fred Kiefer <FredKiefer@gmx.de>
Date: March 2003
Author: Gregory John Casamento <greg.casamento@gmail.com>
Date: March 2022
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
@ -41,20 +44,21 @@ APPKIT_EXPORT_CLASS
@interface NSMovie : NSObject <NSCopying, NSCoding>
{
@private
NSData* _movie;
NSURL* _url;
NSData *_movieData;
NSURL *_url;
void *_movie;
}
+ (NSArray*) movieUnfilteredFileTypes;
+ (NSArray*) movieUnfilteredPasteboardTypes;
+ (BOOL) canInitWithPasteboard: (NSPasteboard*)pasteboard;
+ (NSArray *) movieUnfilteredFileTypes;
+ (NSArray *) movieUnfilteredPasteboardTypes;
+ (BOOL) canInitWithPasteboard: (NSPasteboard *)pasteboard;
- (id) initWithMovie: (void*)movie;
- (id) initWithURL: (NSURL*)url byReference: (BOOL)byRef;
- (id) initWithPasteboard: (NSPasteboard*)pasteboard;
- (id) initWithMovie: (void *)movie;
- (id) initWithURL: (NSURL *)url byReference: (BOOL)byRef;
- (id) initWithPasteboard: (NSPasteboard *)pasteboard;
- (void*) QTMovie;
- (NSURL*) URL;
- (void *) QTMovie;
- (NSURL *) URL;
@end

View file

@ -44,9 +44,9 @@ APPKIT_EXPORT_CLASS
@interface NSMovieView : NSView
{
@protected
NSMovie* _movie;
float _rate;
float _volume;
NSMovie *_movie;
CGFloat _rate;
CGFloat _volume;
struct NSMovieViewFlags {
unsigned int muted: 1;
unsigned int loopMode: 3;

View file

@ -7,6 +7,9 @@
Author: Fred Kiefer <FredKiefer@gmx.de>
Date: March 2003
Author: Gregory John Casamento <greg.casamento@gmail.com>
Date: March 2022
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
@ -54,24 +57,27 @@
return ([pbTypes firstObjectCommonWithArray: myTypes] != nil);
}
- (id) initWithData: (NSData *)movie
- (id) initWithData: (NSData *)movieData
{
if (movie == nil)
if (movieData == nil)
{
RELEASE(self);
return nil;
}
[super init];
ASSIGN(_movie, movie);
ASSIGN(_movieData, movieData);
return self;
}
- (id) initWithMovie: (void*)movie
{
//FIXME
self = [super init];
if (self != nil)
{
_movie = movie;
}
return self;
}
@ -80,7 +86,6 @@
NSData* data = [url resourceDataUsingCache: YES];
self = [self initWithData: data];
if (byRef)
{
ASSIGN(_url, url);
@ -128,7 +133,7 @@
- (void*) QTMovie
{
return (void*)[_movie bytes];
return (void*)[_movieData bytes];
}
- (NSURL*) URL
@ -141,7 +146,8 @@
{
NSMovie *new = (NSMovie*)NSCopyObject (self, 0, zone);
new->_movie = [_movie copyWithZone: zone];
new->_movie = _movie;
new->_movieData = [_movieData copyWithZone: zone];
new->_url = [_url copyWithZone: zone];
return new;
}
@ -155,7 +161,7 @@
}
else
{
[aCoder encodeObject: _movie];
[aCoder encodeObject: _movieData];
[aCoder encodeObject: _url];
}
}
@ -168,7 +174,7 @@
}
else
{
ASSIGN (_movie, [aDecoder decodeObject]);
ASSIGN (_movieData, [aDecoder decodeObject]);
ASSIGN (_url, [aDecoder decodeObject]);
}
return self;

View file

@ -35,6 +35,25 @@
@implementation NSMovieView
- (instancetype) init
{
self = [super init];
if (self != nil)
{
_movie = nil;
_rate = 1.0;
_volume = 1.0;
_flags.muted = NO;
_flags.loopMode = NSQTMovieNormalPlayback;
_flags.plays_selection_only = NO;
_flags.plays_every_frame = YES;
_flags.is_controller_visible = NO;
_flags.editable = NO;
_flags.reserved = 0;
}
return self;
}
- (void) setMovie: (NSMovie*)movie
{
ASSIGN(_movie, movie);