| 1 | /* |
|---|
| 2 | * CMPDVDPlayer.h |
|---|
| 3 | * CommonMediaPlayer |
|---|
| 4 | * |
|---|
| 5 | * Created by Graham Booker on Feb. 2 2010 |
|---|
| 6 | * Copyright 2010 Common Media Player |
|---|
| 7 | * All rights reserved. |
|---|
| 8 | * |
|---|
| 9 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
|---|
| 10 | * Lesser General Public License as published by the Free Software Foundation; either version 3 of the |
|---|
| 11 | * License, or (at your option) any later version. |
|---|
| 12 | * |
|---|
| 13 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
|---|
| 14 | * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser |
|---|
| 15 | * General Public License for more details. |
|---|
| 16 | * |
|---|
| 17 | * You should have received a copy of the GNU Lesser General Public License along with this program; if |
|---|
| 18 | * not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
|---|
| 19 | * 02111-1307, USA. |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | #import "CMPPlayer.h" |
|---|
| 23 | |
|---|
| 24 | typedef enum { |
|---|
| 25 | CMPDVDPlayerNavigationUp = 1, |
|---|
| 26 | CMPDVDPlayerNavigationDown, |
|---|
| 27 | CMPDVDPlayerNavigationLeft, |
|---|
| 28 | CMPDVDPlayerNavigationRight, |
|---|
| 29 | CMPDVDPlayerNavigationEnter, |
|---|
| 30 | }CMPDVDPlayerNavigation; |
|---|
| 31 | |
|---|
| 32 | typedef enum { |
|---|
| 33 | CMPDVDStateUnknown, |
|---|
| 34 | CMPDVDStatePlaying, // playing 1x or less (slow mo) |
|---|
| 35 | CMPDVDStatePlayingStill, |
|---|
| 36 | CMPDVDStatePaused, // pause and step frame |
|---|
| 37 | CMPDVDStateStopped, // the DVDEvent for stopping has a 2nd parameter to indicate that the stop was initiated by the DVD disc |
|---|
| 38 | // 0: user, 1: disc initiated |
|---|
| 39 | CMPDVDStateScanningForward, // playing greater than 1x |
|---|
| 40 | CMPDVDStateScanningBackward, |
|---|
| 41 | CMPDVDStateIdle, |
|---|
| 42 | CMPDVDStatePlayingSlowForward, // playing less than 1x |
|---|
| 43 | CMPDVDStatePlayingSlowBackward, // playing less than 1x |
|---|
| 44 | } CMPDVDState; |
|---|
| 45 | |
|---|
| 46 | typedef enum { |
|---|
| 47 | CMPDVDZoomNormal, |
|---|
| 48 | CMPDVDZoomLetterBoxInFullFrame, |
|---|
| 49 | CMPDVDZoom2x, |
|---|
| 50 | CMPDVDZoomLevelCount, |
|---|
| 51 | } CMPDVDZoomLevel; |
|---|
| 52 | |
|---|
| 53 | @class CMPDVDPlayerController, CMPDVDFrameworkLoadAction; |
|---|
| 54 | |
|---|
| 55 | @interface CMPDVDPlayer : NSObject <CMPPlayer>{ |
|---|
| 56 | BRBaseMediaAsset *asset; |
|---|
| 57 | CMPDVDPlayerController *controller; |
|---|
| 58 | CMPDVDFrameworkLoadAction *frameworkLoad; |
|---|
| 59 | int titleNumber; |
|---|
| 60 | UInt16 titleCount; |
|---|
| 61 | UInt32 resumeTime; |
|---|
| 62 | UInt32 titleDuration; |
|---|
| 63 | UInt32 currentElapsedTime; |
|---|
| 64 | NSTimer *stopTimer; |
|---|
| 65 | CMPDVDZoomLevel zoomLevel; |
|---|
| 66 | BOOL useStopTimer; |
|---|
| 67 | } |
|---|
| 68 | |
|---|
| 69 | - (BOOL)useStopTimer; |
|---|
| 70 | - (void)setUseStopTimer:(BOOL)value; |
|---|
| 71 | |
|---|
| 72 | - (void)setController:(CMPDVDPlayerController *)controller; |
|---|
| 73 | |
|---|
| 74 | - (BOOL)playing; |
|---|
| 75 | - (BOOL)hasMenu; |
|---|
| 76 | - (BOOL)inMenu; |
|---|
| 77 | - (CMPDVDState)state; |
|---|
| 78 | - (int)playSpeed; //If scanning, number will be speed, if playing slow, number will be 1/speed |
|---|
| 79 | - (int)chapters; |
|---|
| 80 | - (int)currentChapter; |
|---|
| 81 | - (NSString *)currentAudioFormat; |
|---|
| 82 | - (NSString *)currentSubFormat; |
|---|
| 83 | - (int)titleElapsedTime; |
|---|
| 84 | - (int)titleDurationTime; |
|---|
| 85 | |
|---|
| 86 | - (void)initiatePlaybackWithResume:(BOOL *)resume; |
|---|
| 87 | - (void)stopPlayback; |
|---|
| 88 | - (void)doUserNavigation:(CMPDVDPlayerNavigation)navigation; |
|---|
| 89 | |
|---|
| 90 | - (void)setResumeTime:(UInt32)resumeTime; |
|---|
| 91 | - (void)goToMenu; |
|---|
| 92 | - (void)play; |
|---|
| 93 | - (void)pause; |
|---|
| 94 | - (void)restart; |
|---|
| 95 | - (void)incrementScanRate; |
|---|
| 96 | - (void)decrementScanRate; |
|---|
| 97 | - (void)nextChapter; |
|---|
| 98 | - (void)previousChapter; |
|---|
| 99 | - (void)nextFrame; |
|---|
| 100 | - (void)previousFrame; |
|---|
| 101 | |
|---|
| 102 | - (void)nextAudioStream; |
|---|
| 103 | - (void)nextSubStream; |
|---|
| 104 | - (void)setZoomLevel:(CMPDVDZoomLevel)level; |
|---|
| 105 | - (CMPDVDZoomLevel)zoomLevel; |
|---|
| 106 | + (BOOL)isVolume:(NSString *)theVolume; |
|---|
| 107 | + (BOOL)isImage:(NSString *)theVolume; |
|---|
| 108 | @end |
|---|