home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.5 KB | 142 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: MoviePar.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef MOVIEPAR_H
- #define MOVIEPAR_H
-
- #ifndef MOVIEDEF_H
- #include "MovieDef.h"
- #endif
-
- #ifndef FWPART_H
- #include "FWPart.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWMENU_H
- #include <FWMenu.h>
- #endif
-
- #ifndef FWPICTUR_H
- #include "FWPictur.h"
- #endif
-
- //========================================================================================
- // Forward declarations
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
- class FW_CLASS_ATTR FW_CMenuEvent;
- class FW_CLASS_ATTR FW_CNullEvent;
- class FW_CLASS_ATTR FW_CFileSpecification;
- class FW_CLASS_ATTR FW_CMenuBar;
- class FW_CLASS_ATTR FW_CFrame;
- class FW_CLASS_ATTR CMovie;
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
-
- //========================================================================================
- // Constants
- //========================================================================================
-
- const ODCommandID cChooseMovie = FW_kFirstUserCommandID;
- const ODCommandID cStartStopMovie = cChooseMovie + 1;
- const ODCommandID cSetMovieLooping = cStartStopMovie + 1;
- const ODCommandID cShowMovieController = cSetMovieLooping + 1;
-
- //========================================================================================
- // CLASS CMoviePart
- //========================================================================================
-
- class FW_CLASS_ATTR CMoviePart : public FW_CPart
- {
- public:
- static const ODValueType kPartKind;
- static const ODValueType kPartUserName;
-
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CMoviePart(ODPart* odPart);
- virtual ~CMoviePart();
-
- virtual void Initialize(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void InternalizeContent(Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
- virtual void ExternalizeContent(Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
- virtual FW_CFrame* NewFrame(Environment* ev,
- ODFrame* odFrame,
- FW_CPresentation* presentation,
- FW_Boolean fromStorage);
-
- virtual FW_Boolean DoIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
- virtual FW_Boolean DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- FW_PPicture GetDefaultPicture(Environment *ev) const;
- FW_Boolean IsLooping(Environment *ev) const;
- FW_Boolean IsControllerShown(Environment *ev) const;
- CMovie* GetInternalizedMovie(Environment *ev) const;
-
-
- void InternalizeODFMovie(Environment* ev, ODStorageUnit* storageUnit);
- void InternalizeMovieFile(Environment* ev, ODStorageUnit* storageUnit);
-
- protected:
- FW_Boolean GetMovieFileFromUser(Environment* ev, FW_CFileSpecification& fileSpec) const;
-
- void ChooseMovie(Environment* ev);
- void ToggleLooping(Environment* ev);
- void ToggleController(Environment* ev);
-
- private:
- FW_PPicture fDefaultPicture;
- FW_Boolean fLooping;
- FW_Boolean fShowController;
- FW_CPresentation* fPresentation;
- CMovie* fInternalizedMovie; // Temporary cache for internalized movies
- };
-
- //----------------------------------------------------------------------------------------
- // CMoviePart::IsLooping
- //----------------------------------------------------------------------------------------
- inline FW_Boolean CMoviePart::IsLooping(Environment *ev) const
- {
- return fLooping;
- }
-
- //----------------------------------------------------------------------------------------
- // CMoviePart::IsControllerShown
- //----------------------------------------------------------------------------------------
- inline FW_Boolean CMoviePart::IsControllerShown(Environment *ev) const
- {
- return fShowController;
- }
-
- //----------------------------------------------------------------------------------------
- // CMoviePart::GetInternalizedMovie
- //----------------------------------------------------------------------------------------
- inline CMovie* CMoviePart::GetInternalizedMovie(Environment *ev) const
- {
- return fInternalizedMovie;
- }
-
- #endif