]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/eyetv.m
MacOS X: fix preferences for ModulesConfig
[vlc] / modules / gui / macosx / eyetv.m
index c6ad4c1d947d105c6635fc9457ea74cd4fcbe14c..732d368bd3cd5d0b099232692ee2932e9fe77fbe 100644 (file)
@@ -1,11 +1,11 @@
 /*****************************************************************************
 * eyetv.m: small class to control the notification parts of the EyeTV plugin
 *****************************************************************************
-* Copyright (C) 2006-2007 the VideoLAN team
+* Copyright (C) 2006-2011 VLC authors and VideoLAN
 * $Id$
 *
 * Authors: Felix Kühne <fkuehne at videolan dot org>
-*                Damien Fouilleul <damienf at videolan dot org>
+*          Damien Fouilleul <damienf at videolan dot org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
@@ -57,9 +57,6 @@ static VLCEyeTVController *_o_sharedInstance = nil;
 
 - (void)globalNotificationReceived: (NSNotification *)theNotification
 {
-    msg_Dbg( VLCIntf, "notification received in VLC with name %s and object %s",
-             [[theNotification name] UTF8String], [[theNotification object] UTF8String] );
-
     /* update our info on the used device */
     if( [[theNotification name] isEqualToString: @"DeviceAdded"] )
         b_deviceConnected = YES;
@@ -95,7 +92,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
     if( nil == descriptor ) 
     {
         NSString *errorString = [errorDict objectForKey:NSAppleScriptErrorMessage];
-        msg_Err( VLCIntf, "opening EyeTV failed with error status '%s'", [errorString UTF8String] );
+        NSLog( @"opening EyeTV failed with error status '%@'", errorString );
     }
     [script release];
 }
@@ -110,7 +107,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
     if( nil == descriptor ) 
     {
         NSString *errorString = [errorDict objectForKey:NSAppleScriptErrorMessage];
-        msg_Err( VLCIntf, "EyeTV channel inventory failed with error status '%s'", [errorString UTF8String] );
+        NSLog( @"EyeTV channel inventory failed with error status '%@'", errorString );
     }
     else
     {
@@ -132,29 +129,25 @@ static VLCEyeTVController *_o_sharedInstance = nil;
         script = [[NSAppleScript alloc] initWithSource:
                     @"tell application \"EyeTV\"\n"
                        "channel_up\n"
-                       "volume_change level 0\n"
-                       "tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
                        "get current channel\n"
                      "end tell"];
-        msg_Dbg( VLCIntf, "telling eyetv to switch 1 channel up" );
+        NSLog( @"telling eyetv to switch 1 channel up" );
     }
     else
     {
         script = [[NSAppleScript alloc] initWithSource:
                     @"tell application \"EyeTV\"\n"
                        "channel_down\n"
-                       "volume_change level 0\n"
-                       "tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
                        "get current channel\n"
                      "end tell"];
-        msg_Dbg( VLCIntf, "telling eyetv to switch 1 channel down" );
+        NSLog( @"telling eyetv to switch 1 channel down" );
     }
     
     descriptor = [script executeAndReturnError:&errorDict];
     if( nil == descriptor ) 
     {
         NSString *errorString = [errorDict objectForKey:NSAppleScriptErrorMessage];
-        msg_Err( VLCIntf, "EyeTV channel change failed with error status '%s'", [errorString UTF8String] );
+        NSLog( @"EyeTV channel change failed with error status '%@'", errorString );
     }
     else
     {
@@ -172,25 +165,21 @@ static VLCEyeTVController *_o_sharedInstance = nil;
         case -2: // Composite
             script = [[NSAppleScript alloc] initWithSource:
                         @"tell application \"EyeTV\"\n"
-                         "  input_change input source composite video input"
-                         "  volume_change level 0\n"
-                         "  tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
+                         "  input_change input source composite video input\n"
+                         "  show player_window\n"
                          "end tell"];
             break;
         case -1: // S-Video
             script = [[NSAppleScript alloc] initWithSource:
                         @"tell application \"EyeTV\"\n"
-                         "  input_change input source S video input"
-                         "  volume_change level 0\n"
-                         "  tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
+                         "  input_change input source S video input\n"
+                         "  show player_window\n"
                          "end tell"];
             break;
-        case 0: // Tuner
+        case 0: // Last
             script = [[NSAppleScript alloc] initWithSource:
                         @"tell application \"EyeTV\"\n"
-                         "  input_change input source tuner input"
-                         "  volume_change level 0\n"
-                         "  tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
+                         "  show player_window\n"
                          "end tell"];
             break;
         default:
@@ -198,9 +187,8 @@ static VLCEyeTVController *_o_sharedInstance = nil;
             {
                 NSString *channel_change = [NSString stringWithFormat:
                     @"tell application \"EyeTV\"\n"
-                    @"  channel_change channel number %d\n"
-                     "  volume_change level 0\n"
-                     "  tell application \"System Events\" to set visible of process \"EyeTV\" to false\n"
+                     "  channel_change channel number %d\n"
+                     "  show player_window\n"
                      "end tell", theChannelNum];
                 script = [[NSAppleScript alloc] initWithSource:channel_change];
             }
@@ -212,7 +200,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
     if( nil == descriptor ) 
     {
         NSString *errorString = [errorDict objectForKey:NSAppleScriptErrorMessage];
-        msg_Err( VLCIntf, "EyeTV source change failed with error status '%s'", [errorString UTF8String] );
+        NSLog( @"EyeTV source change failed with error status '%@'", errorString );
     }
     [script release];
 }
@@ -227,7 +215,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
     if( nil == descriptor ) 
     {
         NSString *errorString = [errorDict objectForKey:NSAppleScriptErrorMessage];
-        msg_Err( VLCIntf, "EyeTV channel inventory failed with error status '%s'", [errorString UTF8String] );
+        NSLog( @"EyeTV channel inventory failed with error status '%@'", errorString );
     }
     else
     {