Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
ecebadec
Commit
ecebadec
authored
Nov 22, 2007
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOS X: more EyeTV GUI improvements
parent
1bc33071
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
18 deletions
+79
-18
modules/gui/macosx/eyetv.h
modules/gui/macosx/eyetv.h
+3
-2
modules/gui/macosx/eyetv.m
modules/gui/macosx/eyetv.m
+69
-13
modules/gui/macosx/open.m
modules/gui/macosx/open.m
+7
-3
No files found.
modules/gui/macosx/eyetv.h
View file @
ecebadec
...
...
@@ -33,8 +33,9 @@
-
(
BOOL
)
isEyeTVrunning
;
-
(
BOOL
)
isDeviceConnected
;
-
(
void
)
launchEyeTV
;
-
(
void
)
switchChannelUp
:(
BOOL
)
b_yesOrNo
;
-
(
int
)
currentChannel
;
-
(
int
)
switchChannelUp
:(
BOOL
)
b_yesOrNo
;
-
(
void
)
selectChannel
:(
int
)
theChannelNum
;
-
(
NSEnumerator
*
)
get
Channels
;
-
(
NSEnumerator
*
)
all
Channels
;
@end
modules/gui/macosx/eyetv.m
View file @
ecebadec
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Felix Kühne <fkuehne 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
...
...
@@ -86,19 +87,42 @@ static VLCEyeTVController *_o_sharedInstance = nil;
-
(
void
)
launchEyeTV
{
NSAppleScript
*
script
=
[[
NSAppleScript
alloc
]
initWithSource
:
@"tell application
\"
EyeTV
\"
to launch with server mode"
];
@"tell application
\"
EyeTV
\"\n
"
"launch with server mode
\n
"
"end tell"
];
NSDictionary
*
errorDict
;
NSAppleEventDescriptor
*
descriptor
=
[
script
executeAndReturnError
:
&
errorDict
];
if
(
nil
==
descriptor
)
{
NSString
*
errorString
=
[
errorDict
objectForKey
:
NSAppleScriptErrorMessage
];
msg_Err
(
VLCIntf
,
"opening EyeTV failed with error
code %s
"
,
[
errorString
UTF8String
]
);
msg_Err
(
VLCIntf
,
"opening EyeTV failed with error
status '%s'
"
,
[
errorString
UTF8String
]
);
}
[
script
release
];
}
-
(
void
)
switchChannelUp
:(
BOOL
)
b_yesOrNo
-
(
int
)
currentChannel
{
int
currentChannel
=
0
;
NSAppleScript
*
script
=
[[
NSAppleScript
alloc
]
initWithSource
:
@"tell application
\"
EyeTV
\"
to get current channel"
];
NSDictionary
*
errorDict
;
NSAppleEventDescriptor
*
descriptor
=
[
script
executeAndReturnError
:
&
errorDict
];
if
(
nil
==
descriptor
)
{
NSString
*
errorString
=
[
errorDict
objectForKey
:
NSAppleScriptErrorMessage
];
msg_Err
(
VLCIntf
,
"EyeTV channel inventory failed with error status '%s'"
,
[
errorString
UTF8String
]
);
}
else
{
currentChannel
=
(
int
)[
descriptor
int32Value
];
}
[
script
release
];
return
currentChannel
;
}
-
(
int
)
switchChannelUp
:(
BOOL
)
b_yesOrNo
{
int
currentChannel
=
0
;
NSAppleScript
*
script
;
NSDictionary
*
errorDict
;
NSAppleEventDescriptor
*
descriptor
;
...
...
@@ -106,12 +130,23 @@ static VLCEyeTVController *_o_sharedInstance = nil;
if
(
b_yesOrNo
==
YES
)
{
script
=
[[
NSAppleScript
alloc
]
initWithSource
:
@"tell application
\"
EyeTV
\"
to channel_up"
];
@"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"
);
}
else
{
script
=
[[
NSAppleScript
alloc
]
initWithSource
:
@"tell application
\"
EyeTV
\"
to channel_down"
];
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"
);
}
...
...
@@ -119,9 +154,14 @@ static VLCEyeTVController *_o_sharedInstance = nil;
if
(
nil
==
descriptor
)
{
NSString
*
errorString
=
[
errorDict
objectForKey
:
NSAppleScriptErrorMessage
];
msg_Err
(
VLCIntf
,
"EyeTV channel change failed with error code %s"
,
[
errorString
UTF8String
]
);
msg_Err
(
VLCIntf
,
"EyeTV channel change failed with error status '%s'"
,
[
errorString
UTF8String
]
);
}
else
{
currentChannel
=
(
int
)[
descriptor
int32Value
];
}
[
script
release
];
return
currentChannel
;
}
-
(
void
)
selectChannel
:
(
int
)
theChannelNum
...
...
@@ -131,21 +171,37 @@ static VLCEyeTVController *_o_sharedInstance = nil;
{
case
-
2
:
// Composite
script
=
[[
NSAppleScript
alloc
]
initWithSource
:
@"tell application
\"
EyeTV
\"
to input_change input source composite video input"
];
@"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
"
"end tell"
];
break
;
case
-
1
:
// S-Video
script
=
[[
NSAppleScript
alloc
]
initWithSource
:
@"tell application
\"
EyeTV
\"
to input_change input source S video input"
];
@"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
"
"end tell"
];
break
;
case
0
:
// Tuner
script
=
[[
NSAppleScript
alloc
]
initWithSource
:
@"tell application
\"
EyeTV
\"
to input_change input source tuner input"
];
@"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
"
"end tell"
];
break
;
default:
if
(
theChannelNum
>
0
)
{
NSString
*
channel_change
=
[
NSString
stringWithFormat
:
@"tell application
\"
EyeTV
\"
to channel_change channel number %d"
,
theChannelNum
];
@"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
"
"end tell"
,
theChannelNum
];
script
=
[[
NSAppleScript
alloc
]
initWithSource
:
channel_change
];
}
else
...
...
@@ -156,12 +212,12 @@ static VLCEyeTVController *_o_sharedInstance = nil;
if
(
nil
==
descriptor
)
{
NSString
*
errorString
=
[
errorDict
objectForKey
:
NSAppleScriptErrorMessage
];
msg_Err
(
VLCIntf
,
"EyeTV source change failed with error
code %s
"
,
[
errorString
UTF8String
]
);
msg_Err
(
VLCIntf
,
"EyeTV source change failed with error
status '%s'
"
,
[
errorString
UTF8String
]
);
}
[
script
release
];
}
-
(
NSEnumerator
*
)
get
Channels
-
(
NSEnumerator
*
)
all
Channels
{
NSEnumerator
*
channels
=
nil
;
NSAppleScript
*
script
=
[[
NSAppleScript
alloc
]
initWithSource
:
...
...
@@ -171,7 +227,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
if
(
nil
==
descriptor
)
{
NSString
*
errorString
=
[
errorDict
objectForKey
:
NSAppleScriptErrorMessage
];
msg_Err
(
VLCIntf
,
"EyeTV channel inventory failed with error
code %s
"
,
[
errorString
UTF8String
]
);
msg_Err
(
VLCIntf
,
"EyeTV channel inventory failed with error
status '%s'
"
,
[
errorString
UTF8String
]
);
}
else
{
...
...
modules/gui/macosx/open.m
View file @
ecebadec
...
...
@@ -799,9 +799,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
-
(
IBAction
)
eyetvSwitchChannel
:(
id
)
sender
{
if
(
sender
==
o_eyetv_nextProgram_btn
)
[
[[
VLCMain
sharedInstance
]
getEyeTVController
]
switchChannelUp
:
YES
];
[
o_eyetv_channels_pop
selectItemWithTag
:[[[
VLCMain
sharedInstance
]
getEyeTVController
]
switchChannelUp
:
YES
]
];
else
if
(
sender
==
o_eyetv_previousProgram_btn
)
[
[[
VLCMain
sharedInstance
]
getEyeTVController
]
switchChannelUp
:
NO
];
[
o_eyetv_channels_pop
selectItemWithTag
:[[[
VLCMain
sharedInstance
]
getEyeTVController
]
switchChannelUp
:
NO
]
];
else
if
(
sender
==
o_eyetv_channels_pop
)
[[[
VLCMain
sharedInstance
]
getEyeTVController
]
selectChannel
:
[[
sender
selectedItem
]
tag
]];
...
...
@@ -856,7 +856,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
[
o_eyetv_chn_status_txt
setHidden
:
NO
];
/* retrieve info */
NSEnumerator
*
channels
=
[[[
VLCMain
sharedInstance
]
getEyeTVController
]
get
Channels
];
NSEnumerator
*
channels
=
[[[
VLCMain
sharedInstance
]
getEyeTVController
]
all
Channels
];
int
x
=
-
2
;
[[[
o_eyetv_channels_pop
menu
]
addItemWithTitle
:
_NS
(
"Composite input"
)
action:
nil
...
...
@@ -879,11 +879,15 @@ static VLCOpen *_o_sharedMainInstance = nil;
action:
nil
keyEquivalent:
@""
]
setTag
:
x
++
];
}
/* make Tuner the default */
[
o_eyetv_channels_pop
selectItemWithTag
:[[[
VLCMain
sharedInstance
]
getEyeTVController
]
currentChannel
]];
}
/* clean up GUI */
[
o_eyetv_chn_bgbar
setHidden
:
YES
];
[
o_eyetv_chn_status_txt
setHidden
:
YES
];
[
o_mrl
setStringValue
:
@"eyetv:"
];
}
-
(
IBAction
)
subsChanged
:(
id
)
sender
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment