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
fcc30d46
Commit
fcc30d46
authored
Jul 13, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: Never try to find an input anywhere, but get the playlist input using pl_CurrentInput.
parent
1c10df82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
60 deletions
+31
-60
modules/gui/macosx/bookmarks.m
modules/gui/macosx/bookmarks.m
+28
-55
modules/gui/macosx/controls.m
modules/gui/macosx/controls.m
+3
-5
No files found.
modules/gui/macosx/bookmarks.m
View file @
fcc30d46
...
@@ -117,11 +117,9 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -117,11 +117,9 @@ static VLCBookmarks *_o_sharedInstance = nil;
-
(
IBAction
)
add
:(
id
)
sender
-
(
IBAction
)
add
:(
id
)
sender
{
{
/* add item to list */
/* add item to list */
intf_thread_t
*
p_intf
=
VLCIntf
;
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_input
)
return
;
if
(
!
p_input
)
return
;
seekpoint_t
bookmark
;
seekpoint_t
bookmark
;
vlc_value_t
pos
;
vlc_value_t
pos
;
...
@@ -129,7 +127,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -129,7 +127,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
bookmark
.
i_byte_offset
=
0
;
bookmark
.
i_byte_offset
=
0
;
bookmark
.
i_time_offset
=
0
;
bookmark
.
i_time_offset
=
0
;
var_Get
(
p_i
ntf
,
"position"
,
&
pos
);
var_Get
(
VLCI
ntf
,
"position"
,
&
pos
);
bookmark
.
psz_name
=
_
(
"Untitled"
);
bookmark
.
psz_name
=
_
(
"Untitled"
);
input_Control
(
p_input
,
INPUT_GET_BYTE_POSITION
,
&
bookmark
.
i_byte_offset
);
input_Control
(
p_input
,
INPUT_GET_BYTE_POSITION
,
&
bookmark
.
i_byte_offset
);
var_Get
(
p_input
,
"time"
,
&
pos
);
var_Get
(
p_input
,
"time"
,
&
pos
);
...
@@ -144,9 +142,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -144,9 +142,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
-
(
IBAction
)
clear
:(
id
)
sender
-
(
IBAction
)
clear
:(
id
)
sender
{
{
/* clear table */
/* clear table */
intf_thread_t
*
p_intf
=
VLCIntf
;
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_input
)
if
(
!
p_input
)
return
;
return
;
...
@@ -163,9 +159,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -163,9 +159,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
/* put values to the sheet's fields and show sheet */
/* put values to the sheet's fields and show sheet */
/* we take the values from the core and not the table, because we cannot
/* we take the values from the core and not the table, because we cannot
* really trust it */
* really trust it */
intf_thread_t
*
p_intf
=
VLCIntf
;
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
seekpoint_t
**
pp_bookmarks
;
seekpoint_t
**
pp_bookmarks
;
int
i_bookmarks
;
int
i_bookmarks
;
int
row
;
int
row
;
...
@@ -214,12 +208,9 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -214,12 +208,9 @@ static VLCBookmarks *_o_sharedInstance = nil;
-
(
IBAction
)
edit_ok
:(
id
)
sender
-
(
IBAction
)
edit_ok
:(
id
)
sender
{
{
/* save field contents and close sheet */
/* save field contents and close sheet */
seekpoint_t
**
pp_bookmarks
;
intf_thread_t
*
p_intf
=
VLCIntf
;
seekpoint_t
**
pp_bookmarks
;
int
i_bookmarks
,
i
;
int
i_bookmarks
,
i
;
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_input
)
if
(
!
p_input
)
{
{
...
@@ -258,7 +249,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -258,7 +249,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
if
(
input_Control
(
p_input
,
INPUT_CHANGE_BOOKMARK
,
pp_bookmarks
[
i
],
i
)
if
(
input_Control
(
p_input
,
INPUT_CHANGE_BOOKMARK
,
pp_bookmarks
[
i
],
i
)
!=
VLC_SUCCESS
)
!=
VLC_SUCCESS
)
{
{
msg_Warn
(
p_i
ntf
,
"Unable to change the bookmark"
);
msg_Warn
(
VLCI
ntf
,
"Unable to change the bookmark"
);
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
return
;
return
;
}
}
...
@@ -274,9 +265,6 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -274,9 +265,6 @@ static VLCBookmarks *_o_sharedInstance = nil;
-
(
IBAction
)
extract
:(
id
)
sender
-
(
IBAction
)
extract
:(
id
)
sender
{
{
/* extract */
/* extract */
intf_thread_t
*
p_intf
=
VLCIntf
;
if
(
[
o_tbl_dataTable
numberOfSelectedRows
]
<
2
)
if
(
[
o_tbl_dataTable
numberOfSelectedRows
]
<
2
)
{
{
NSBeginAlertSheet
(
_NS
(
"Invalid selection"
),
_NS
(
"OK"
),
NSBeginAlertSheet
(
_NS
(
"Invalid selection"
),
_NS
(
"OK"
),
...
@@ -284,9 +272,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -284,9 +272,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
_NS
(
"Two bookmarks have to be selected."
));
_NS
(
"Two bookmarks have to be selected."
));
return
;
return
;
}
}
input_thread_t
*
p_input
=
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_input
)
if
(
!
p_input
)
{
{
NSBeginCriticalAlertSheet
(
_NS
(
"No input found"
),
_NS
(
"OK"
),
NSBeginCriticalAlertSheet
(
_NS
(
"No input found"
),
_NS
(
"OK"
),
...
@@ -319,16 +305,16 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -319,16 +305,16 @@ static VLCBookmarks *_o_sharedInstance = nil;
x
=
(
x
+
1
);
x
=
(
x
+
1
);
}
}
msg_Dbg
(
p_i
ntf
,
"got the bookmark-indexes"
);
msg_Dbg
(
VLCI
ntf
,
"got the bookmark-indexes"
);
if
(
input_Control
(
p_input
,
INPUT_GET_BOOKMARKS
,
&
pp_bookmarks
,
if
(
input_Control
(
p_input
,
INPUT_GET_BOOKMARKS
,
&
pp_bookmarks
,
&
i_bookmarks
)
!=
VLC_SUCCESS
)
&
i_bookmarks
)
!=
VLC_SUCCESS
)
{
{
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
msg_Err
(
p_i
ntf
,
"already defined bookmarks couldn't be retrieved"
);
msg_Err
(
VLCI
ntf
,
"already defined bookmarks couldn't be retrieved"
);
return
;
return
;
}
}
msg_Dbg
(
p_i
ntf
,
"calling wizard"
);
msg_Dbg
(
VLCI
ntf
,
"calling wizard"
);
char
*
psz_uri
=
input_item_GetURI
(
input_GetItem
(
p_input
)
);
char
*
psz_uri
=
input_item_GetURI
(
input_GetItem
(
p_input
)
);
[[[
VLCMain
sharedInstance
]
getWizard
]
initWithExtractValuesFrom
:
[[[
VLCMain
sharedInstance
]
getWizard
]
initWithExtractValuesFrom
:
...
@@ -339,15 +325,12 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -339,15 +325,12 @@ static VLCBookmarks *_o_sharedInstance = nil;
ofItem:
[
NSString
stringWithUTF8String
:
psz_uri
]];
ofItem:
[
NSString
stringWithUTF8String
:
psz_uri
]];
free
(
psz_uri
);
free
(
psz_uri
);
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
msg_Dbg
(
p_i
ntf
,
"released input"
);
msg_Dbg
(
VLCI
ntf
,
"released input"
);
}
}
-
(
IBAction
)
goToBookmark
:(
id
)
sender
-
(
IBAction
)
goToBookmark
:(
id
)
sender
{
{
intf_thread_t
*
p_intf
=
VLCIntf
;
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_input
)
return
;
if
(
!
p_input
)
return
;
...
@@ -359,10 +342,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -359,10 +342,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
-
(
IBAction
)
remove
:(
id
)
sender
-
(
IBAction
)
remove
:(
id
)
sender
{
{
/* remove selected item */
/* remove selected item */
intf_thread_t
*
p_intf
=
VLCIntf
;
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_input
)
return
;
if
(
!
p_input
)
return
;
...
@@ -392,9 +372,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -392,9 +372,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
-
(
int
)
numberOfRowsInTableView
:(
NSTableView
*
)
theDataTable
-
(
int
)
numberOfRowsInTableView
:(
NSTableView
*
)
theDataTable
{
{
/* return the number of bookmarks */
/* return the number of bookmarks */
intf_thread_t
*
p_intf
=
VLCIntf
;
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
seekpoint_t
**
pp_bookmarks
;
seekpoint_t
**
pp_bookmarks
;
int
i_bookmarks
;
int
i_bookmarks
;
...
@@ -415,53 +393,48 @@ static VLCBookmarks *_o_sharedInstance = nil;
...
@@ -415,53 +393,48 @@ static VLCBookmarks *_o_sharedInstance = nil;
(
NSTableColumn
*
)
theTableColumn
row
:
(
int
)
row
(
NSTableColumn
*
)
theTableColumn
row
:
(
int
)
row
{
{
/* return the corresponding data as NSString */
/* return the corresponding data as NSString */
intf_thread_t
*
p_intf
=
VLCIntf
;
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
seekpoint_t
**
pp_bookmarks
;
seekpoint_t
**
pp_bookmarks
;
int
i_bookmarks
;
int
i_bookmarks
;
char
*
toBeReturned
;
char
*
toBeReturned
;
int
i_toBeReturned
=
0
;
int
i_toBeReturned
=
0
;
id
ret
;
if
(
!
p_input
)
return
@""
;
if
(
!
p_input
)
return
@""
;
else
if
(
input_Control
(
p_input
,
INPUT_GET_BOOKMARKS
,
&
pp_bookmarks
,
else
if
(
input_Control
(
p_input
,
INPUT_GET_BOOKMARKS
,
&
pp_bookmarks
,
&
i_bookmarks
)
!=
VLC_SUCCESS
)
&
i_bookmarks
)
!=
VLC_SUCCESS
)
{
{
vlc_object_release
(
p_input
);
ret
=
@""
;
return
@""
;
}
}
else
else
{
{
if
([[
theTableColumn
identifier
]
isEqualToString
:
@"description"
])
if
([[
theTableColumn
identifier
]
isEqualToString
:
@"description"
])
{
{
toBeReturned
=
pp_bookmarks
[
row
]
->
psz_name
;
toBeReturned
=
pp_bookmarks
[
row
]
->
psz_name
;
vlc_object_release
(
p_input
);
ret
=
[
NSString
stringWithUTF8String
:
toBeReturned
];
return
[
NSString
stringWithUTF8String
:
toBeReturned
];
}
}
else
if
([[
theTableColumn
identifier
]
isEqualToString
:
@"size_offset"
])
else
if
([[
theTableColumn
identifier
]
isEqualToString
:
@"size_offset"
])
{
{
i_toBeReturned
=
pp_bookmarks
[
row
]
->
i_byte_offset
;
i_toBeReturned
=
pp_bookmarks
[
row
]
->
i_byte_offset
;
vlc_object_release
(
p_input
);
ret
=
[[
NSNumber
numberWithInt
:
i_toBeReturned
]
stringValue
];
return
[[
NSNumber
numberWithInt
:
i_toBeReturned
]
stringValue
];
}
}
else
if
([[
theTableColumn
identifier
]
isEqualToString
:
@"time_offset"
])
else
if
([[
theTableColumn
identifier
]
isEqualToString
:
@"time_offset"
])
{
{
i_toBeReturned
=
pp_bookmarks
[
row
]
->
i_time_offset
;
i_toBeReturned
=
pp_bookmarks
[
row
]
->
i_time_offset
;
vlc_object_release
(
p_input
);
ret
=
[[
NSNumber
numberWithInt
:
(
i_toBeReturned
/
1000000
)]
return
[[
NSNumber
numberWithInt
:
(
i_toBeReturned
/
1000000
)]
stringValue
];
stringValue
];
}
}
else
else
{
{
/* may not happen, just in case */
/* may not happen, just in case */
vlc_object_release
(
p_input
);
msg_Err
(
VLCIntf
,
"unknown table column identifier (%s) while "
msg_Err
(
p_intf
,
"unknown table column identifier (%s) while "
"updating the bookmark table"
,
[[
theTableColumn
identifier
]
"updating the bookmark table"
,
[[
theTableColumn
identifier
]
UTF8String
]
);
UTF8String
]
);
ret
urn
@"unknown identifier"
;
ret
=
@"unknown identifier"
;
}
}
}
}
vlc_object_release
(
p_input
);
return
ret
;
}
}
/*****************************************************************************
/*****************************************************************************
...
...
modules/gui/macosx/controls.m
View file @
fcc30d46
...
@@ -811,8 +811,7 @@
...
@@ -811,8 +811,7 @@
}
}
else
if
(
sender
==
o_specificTime_ok_btn
)
else
if
(
sender
==
o_specificTime_ok_btn
)
{
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
VLCIntf
,
\
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
p_input
)
if
(
p_input
)
{
{
unsigned
int
timeInSec
=
0
;
unsigned
int
timeInSec
=
0
;
...
@@ -841,14 +840,13 @@
...
@@ -841,14 +840,13 @@
input_Control
(
p_input
,
INPUT_SET_TIME
,
(
int64_t
)(
timeInSec
*
1000000
));
input_Control
(
p_input
,
INPUT_SET_TIME
,
(
int64_t
)(
timeInSec
*
1000000
));
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
}
}
[
NSApp
endSheet
:
o_specificTime_win
];
[
NSApp
endSheet
:
o_specificTime_win
];
[
o_specificTime_win
close
];
[
o_specificTime_win
close
];
}
}
else
else
{
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
vlc_object_find
(
VLCIntf
,
\
input_thread_t
*
p_input
=
pl_CurrentInput
(
VLCIntf
);
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
p_input
)
if
(
p_input
)
{
{
/* we can obviously only do that if an input is available */
/* we can obviously only do that if an input is available */
...
...
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