]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/voutqt.m
gui/macos/*: 2nd String Review (refs #438)
[vlc] / modules / gui / macosx / voutqt.m
index 8340b7ab51c2a8e58177be07487170d1878bf6ca..55e387130b0a750390e7ba70e8b5da31da61b5c5 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * vout.m: MacOS X video output module
  *****************************************************************************
- * Copyright (C) 2001-2004 VideoLAN (Centrale Réseaux) and its contributors
+ * Copyright (C) 2001-2004 the VideoLAN team
  * $Id: vout.m 8351 2004-08-02 13:06:38Z hartman $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
@@ -22,7 +22,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -57,8 +57,8 @@
 struct vout_sys_t
 {
     NSAutoreleasePool *o_pool;
-    VLCWindow * o_window;
     VLCQTView * o_qtview;
+    VLCVoutView       * o_vout_view;
 
     vlc_bool_t  b_saved_frame;
     vlc_bool_t  b_altivec;
@@ -141,7 +141,7 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
         p_vout->p_sys->b_embedded = VLC_FALSE;
 
     p_vout->p_sys->b_altivec = p_vout->p_libvlc->i_cpu & CPU_CAPABILITY_ALTIVEC;
-    msg_Dbg( p_vout, "We do%s have Altivec", p_vout->p_sys->b_altivec ? "" : "n't" );
+    msg_Dbg( p_vout, "we do%s have Altivec", p_vout->p_sys->b_altivec ? "" : "n't" );
     
     /* Initialize QuickTime */
     p_vout->p_sys->h_img_descr = 
@@ -151,7 +151,7 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
 
     if( ( err = EnterMovies() ) != noErr )
     {
-        msg_Err( p_vout, "EnterMovies failed: %d", err );
+        msg_Err( p_vout, "QT initialization failed: EnterMovies failed: %d", err );
         free( p_vout->p_sys->p_matrix );
         DisposeHandle( (Handle)p_vout->p_sys->h_img_descr );
         free( p_vout->p_sys );
@@ -189,7 +189,7 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
     }
     else
     {
-        msg_Err( p_vout, "failed to find an appropriate codec" );
+        msg_Err( p_vout, "QT doesn't support any appropriate chroma" );
     }
 
     if( p_vout->p_sys->img_dc == 0 )
@@ -215,9 +215,9 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
     else
     {
         /* Spawn window */
-        p_vout->p_sys->o_window = [[VLCWindow alloc]
-            initWithVout: p_vout view: o_qtview frame: nil];
-        if( !p_vout->p_sys->o_window )
+        p_vout->p_sys->o_vout_view = [VLCVoutView getVoutView: p_vout
+                    subView: o_qtview frame: nil];
+        if( !p_vout->p_sys->o_vout_view )
         {
             return VLC_EGENERIC;
         }
@@ -247,11 +247,11 @@ int E_(OpenVideoQT) ( vlc_object_t *p_this )
  *****************************************************************************/
 void E_(CloseVideoQT) ( vlc_object_t *p_this )
 {
-    NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init]; 
+    NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
     vout_thread_t * p_vout = (vout_thread_t *)p_this;
 
     if( !p_vout->p_sys->b_embedded )
-        [p_vout->p_sys->o_window close];
+        [p_vout->p_sys->o_vout_view closeVout];
 
     /* Clean Up Quicktime environment */
     ExitMovies();
@@ -294,7 +294,7 @@ static int InitVideo    ( vout_thread_t *p_vout )
 
     if( QTCreateSequence( p_vout ) )
     {
-        msg_Err( p_vout, "unable to create sequence" );
+        msg_Err( p_vout, "unable to initialize QT: QTCreateSequence failed" );
         return( 1 );
     }
 
@@ -386,7 +386,7 @@ static int ManageVideo( vout_thread_t *p_vout )
         p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
     }
 
-    [p_vout->p_sys->o_window manage];
+    [p_vout->p_sys->o_vout_view manage];
 
     return( 0 );
 }
@@ -433,7 +433,7 @@ static void DisplayVideo( vout_thread_t *p_vout, picture_t *p_pic )
                     p_pic->p_sys->i_size,
                     codecFlagUseImageBuffer, &flags, NULL, NULL ) != noErr ) )
     {
-        msg_Warn( p_vout, "DecompressSequenceFrameWhen failed: %d", err );
+        msg_Warn( p_vout, "QT failed to display the frame sequence: %d", err );
     }
     else
     {
@@ -463,7 +463,7 @@ static int ControlVideo( vout_thread_t *p_vout, int i_query, va_list args )
     {
         case VOUT_SET_STAY_ON_TOP:
             b_arg = va_arg( args, vlc_bool_t );
-            [p_vout->p_sys->o_window setOnTop: b_arg];
+            [p_vout->p_sys->o_vout_view setOnTop: b_arg];
             return VLC_SUCCESS;
 
         case VOUT_CLOSE:
@@ -488,12 +488,12 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
     {
         /* Save window size and position */
         p_vout->p_sys->s_frame.size =
-            [[p_vout->p_sys->o_window contentView] frame].size;
+            [p_vout->p_sys->o_vout_view frame].size;
         p_vout->p_sys->s_frame.origin =
-            [p_vout->p_sys->o_window frame].origin;
+            [[p_vout->p_sys->o_vout_view getWindow] frame].origin;
         p_vout->p_sys->b_saved_frame = VLC_TRUE;
     }
-    [p_vout->p_sys->o_window close];
+    [p_vout->p_sys->o_vout_view closeVout];
 
     p_vout->b_fullscreen = !p_vout->b_fullscreen;
 
@@ -503,14 +503,14 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
     
     if( p_vout->p_sys->b_saved_frame )
     {
-        p_vout->p_sys->o_window = [[VLCWindow alloc]
-            initWithVout: p_vout view: o_qtview
+        p_vout->p_sys->o_vout_view = [VLCVoutView getVoutView: p_vout
+            subView: o_qtview
             frame: &p_vout->p_sys->s_frame];
     }
     else
     {
-        p_vout->p_sys->o_window = [[VLCWindow alloc]
-            initWithVout: p_vout view: o_qtview frame: nil];
+        p_vout->p_sys->o_vout_view = [VLCVoutView getVoutView: p_vout
+            subView: o_qtview frame: nil];
     }
 
     /* Retrieve the QuickDraw port */
@@ -524,7 +524,7 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
 
     if( QTCreateSequence( p_vout ) )
     {
-        msg_Err( p_vout, "unable to create sequence" );
+        msg_Err( p_vout, "unable to initialize QT: QTCreateSequence failed" );
         return( 1 ); 
     } 
 
@@ -669,7 +669,7 @@ static int QTCreateSequence( vout_thread_t *p_vout )
                               codecLosslessQuality,
                               bestSpeedCodec ) ) )
     {
-        msg_Err( p_vout, "DecompressSequenceBeginS failed: %d", err );
+        msg_Err( p_vout, "Failed to initialize QT: DecompressSequenceBeginS failed: %d", err );
         return( 1 );
     }
 
@@ -777,7 +777,7 @@ static int QTNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
         default:
             /* Unknown chroma, tell the guy to get lost */
             free( p_pic->p_sys );
-            msg_Err( p_vout, "never heard of chroma 0x%.8x (%4.4s)",
+            msg_Err( p_vout, "Unknown chroma format 0x%.8x (%4.4s)",
                      p_vout->output.i_chroma, (char*)&p_vout->output.i_chroma );
             p_pic->i_planes = 0;
             return( -1 );