Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
6a352469
Commit
6a352469
authored
Jul 16, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: CAS: implemented MRL/option string creation
Panel is fully functional now and needs testing.
parent
fc1d88d7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
20 deletions
+119
-20
extras/package/macosx/Resources/English.lproj/ConvertAndSave.xib
...package/macosx/Resources/English.lproj/ConvertAndSave.xib
+27
-12
modules/gui/macosx/ConvertAndSave.h
modules/gui/macosx/ConvertAndSave.h
+2
-1
modules/gui/macosx/ConvertAndSave.m
modules/gui/macosx/ConvertAndSave.m
+90
-7
No files found.
extras/package/macosx/Resources/English.lproj/ConvertAndSave.xib
View file @
6a352469
...
...
@@ -2117,14 +2117,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int
key=
"connectionID"
>
99
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
windowButtonAction:
</string>
<reference
key=
"source"
ref=
"203744709"
/>
<reference
key=
"destination"
ref=
"210468830"
/>
</object>
<int
key=
"connectionID"
>
101
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
performClose:
</string>
...
...
@@ -2573,6 +2565,22 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int
key=
"connectionID"
>
296
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
switchProfile:
</string>
<reference
key=
"source"
ref=
"203744709"
/>
<reference
key=
"destination"
ref=
"803077624"
/>
</object>
<int
key=
"connectionID"
>
297
</int>
</object>
<object
class=
"IBConnectionRecord"
>
<object
class=
"IBActionConnection"
key=
"connection"
>
<string
key=
"label"
>
saveFile:
</string>
<reference
key=
"source"
ref=
"203744709"
/>
<reference
key=
"destination"
ref=
"210468830"
/>
</object>
<int
key=
"connectionID"
>
298
</int>
</object>
</object>
<object
class=
"IBMutableOrderedSet"
key=
"objectRecords"
>
<object
class=
"NSArray"
key=
"orderedObjects"
>
...
...
@@ -4385,7 +4393,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
<nil
key=
"sourceID"
/>
<int
key=
"maxID"
>
29
6
</int>
<int
key=
"maxID"
>
29
8
</int>
</object>
<object
class=
"IBClassDescriber"
key=
"IBDocument.Classes"
>
<object
class=
"NSMutableArray"
key=
"referencedPartialClassDescriptionsV3.1+"
>
...
...
@@ -4401,7 +4409,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>
closeCustomizationSheet:
</string>
<string>
customizeProfile:
</string>
<string>
openMedia:
</string>
<string>
windowButtonAction:
</string>
<string>
saveFile:
</string>
<string>
switchProfile:
</string>
</object>
<object
class=
"NSMutableArray"
key=
"dict.values"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
...
...
@@ -4410,6 +4419,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
<string>
id
</string>
</object>
</object>
<object
class=
"NSMutableDictionary"
key=
"actionInfosByName"
>
...
...
@@ -4420,7 +4430,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>
closeCustomizationSheet:
</string>
<string>
customizeProfile:
</string>
<string>
openMedia:
</string>
<string>
windowButtonAction:
</string>
<string>
saveFile:
</string>
<string>
switchProfile:
</string>
</object>
<object
class=
"NSMutableArray"
key=
"dict.values"
>
<bool
key=
"EncodedWithXMLCoder"
>
YES
</bool>
...
...
@@ -4441,7 +4452,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBActionInfo"
>
<string
key=
"name"
>
windowButtonAction:
</string>
<string
key=
"name"
>
saveFile:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
<object
class=
"IBActionInfo"
>
<string
key=
"name"
>
switchProfile:
</string>
<string
key=
"candidateClassName"
>
id
</string>
</object>
</object>
...
...
modules/gui/macosx/ConvertAndSave.h
View file @
6a352469
...
...
@@ -102,8 +102,9 @@
-
(
IBAction
)
toggleWindow
;
-
(
IBAction
)
windowButtonAction
:(
id
)
sender
;
-
(
IBAction
)
saveFile
:(
id
)
sender
;
-
(
IBAction
)
openMedia
:(
id
)
sender
;
-
(
IBAction
)
switchProfile
:(
id
)
sender
;
-
(
IBAction
)
customizeProfile
:(
id
)
sender
;
-
(
IBAction
)
closeCustomizationSheet
:(
id
)
sender
;
-
(
IBAction
)
chooseDestination
:(
id
)
sender
;
...
...
modules/gui/macosx/ConvertAndSave.m
View file @
6a352469
...
...
@@ -224,6 +224,8 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[
_customize_vid_scale_pop
addItemWithTitle
:
@"2"
];
[
_ok_btn
setEnabled
:
NO
];
[
self
resetCustomizationSheetBasedOnProfile
:[
_profileValueList
objectAtIndex
:
0
]];
}
# pragma mark -
...
...
@@ -237,8 +239,34 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
# pragma mark -
# pragma mark User Interaction
-
(
IBAction
)
windowButtonAction
:(
id
)
sender
-
(
IBAction
)
saveFile
:(
id
)
sender
{
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
input_item_t
*
p_input
=
input_item_New
([
_MRL
UTF8String
],
[[
_dropin_media_lbl
stringValue
]
UTF8String
]);
if
(
!
p_input
)
return
;
input_item_AddOption
(
p_input
,
[[
self
composedOptions
]
UTF8String
],
VLC_INPUT_OPTION_TRUSTED
);
int
returnValue
;
returnValue
=
playlist_AddInput
(
p_playlist
,
p_input
,
PLAYLIST_STOP
,
PLAYLIST_END
,
true
,
pl_Unlocked
);
if
(
returnValue
==
VLC_SUCCESS
)
{
/* let's "play" */
PL_LOCK
;
playlist_item_t
*
p_item
=
playlist_ItemGetByInput
(
p_playlist
,
p_input
);
playlist_Control
(
p_playlist
,
PLAYLIST_VIEWPLAY
,
pl_Locked
,
NULL
,
p_item
);
PL_UNLOCK
;
}
else
msg_Err
(
VLCIntf
,
"CAS: playlist add input failed :("
);
/* we're done with this input */
vlc_gc_decref
(
p_input
);
[
_window
performClose
:
sender
];
}
-
(
IBAction
)
openMedia
:(
id
)
sender
...
...
@@ -261,12 +289,15 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
}
}
-
(
IBAction
)
customize
Profile
:(
id
)
sender
-
(
IBAction
)
switch
Profile
:(
id
)
sender
{
NSUInteger
index
=
[
_profile_pop
indexOfSelectedItem
];
if
(
index
<
([
_profileValueList
count
]
-
1
))
[
self
resetCustomizationSheetBasedOnProfile
:[
_profileValueList
objectAtIndex
:
index
]];
}
-
(
IBAction
)
customizeProfile
:(
id
)
sender
{
[
NSApp
beginSheet
:
_customize_panel
modalForWindow
:
_window
modalDelegate
:
self
didEndSelector
:
NULL
contextInfo
:
nil
];
}
...
...
@@ -326,12 +357,12 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
-
(
void
)
savePanelDidEnd
:(
NSSavePanel
*
)
sheet
returnCode
:(
int
)
returnCode
contextInfo
:(
void
*
)
contextInfo
{
if
(
returnCode
==
NSOKButton
)
{
_outputDestination
=
[[
sheet
URL
]
path
];
[
self
setOutputDestination
:[[
sheet
URL
]
path
]
];
[
_destination_filename_lbl
setStringValue
:
[[
NSFileManager
defaultManager
]
displayNameAtPath
:
_outputDestination
]];
[[
_destination_filename_stub_lbl
animator
]
setHidden
:
YES
];
[[
_destination_filename_lbl
animator
]
setHidden
:
NO
];
}
else
{
_outputDestination
=
@""
;
[
self
setOutputDestination
:
@""
]
;
[[
_destination_filename_lbl
animator
]
setHidden
:
YES
];
[[
_destination_filename_stub_lbl
animator
]
setHidden
:
NO
];
}
...
...
@@ -513,13 +544,13 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[
_customize_encap_matrix
selectCellWithTag
:
MP4
];
else
if
([
format
isEqualToString
:
@"ps"
])
[
_customize_encap_matrix
selectCellWithTag
:
MPEGPS
];
else
if
([
format
isEqualToString
:
@"mjpeg"
])
else
if
([
format
isEqualToString
:
@"m
p
jpeg"
])
[
_customize_encap_matrix
selectCellWithTag
:
MJPEG
];
else
if
([
format
isEqualToString
:
@"wav"
])
[
_customize_encap_matrix
selectCellWithTag
:
WAV
];
else
if
([
format
isEqualToString
:
@"flv"
])
[
_customize_encap_matrix
selectCellWithTag
:
FLV
];
else
if
([
format
isEqualToString
:
@"mp
g
"
])
else
if
([
format
isEqualToString
:
@"mp
eg1
"
])
[
_customize_encap_matrix
selectCellWithTag
:
MPEG1
];
else
if
([
format
isEqualToString
:
@"mkv"
])
[
_customize_encap_matrix
selectCellWithTag
:
MKV
];
...
...
@@ -565,7 +596,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
returnValue
=
@"flv"
;
break
;
case
MPEG1
:
returnValue
=
@"mp
g
"
;
returnValue
=
@"mp
eg1
"
;
break
;
case
MKV
:
returnValue
=
@"mkv"
;
...
...
@@ -588,6 +619,58 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
return
returnValue
;
}
-
(
NSString
*
)
composedOptions
{
NSMutableString
*
composedOptions
=
[[
NSMutableString
alloc
]
initWithString
:
@":sout=#transcode{"
];
if
([[
_currentProfile
objectAtIndex
:
1
]
intValue
])
{
// video is enabled
[
composedOptions
appendFormat
:
@"vcodec=%@"
,
[
_currentProfile
objectAtIndex
:
4
]];
if
(
!
[[
_currentProfile
objectAtIndex
:
4
]
isEqualToString
:
@"none"
])
{
if
([[
_currentProfile
objectAtIndex
:
5
]
intValue
]
>
0
)
// bitrate
[
composedOptions
appendFormat
:
@",vb=%@"
,
[
_currentProfile
objectAtIndex
:
5
]];
if
([[
_currentProfile
objectAtIndex
:
6
]
floatValue
]
>
0
.)
// scale
[
composedOptions
appendFormat
:
@",scale=%@"
,
[
_currentProfile
objectAtIndex
:
6
]];
if
([[
_currentProfile
objectAtIndex
:
7
]
floatValue
]
>
0
.)
// fps
[
composedOptions
appendFormat
:
@",fps=%@"
,
[
_currentProfile
objectAtIndex
:
7
]];
if
([[
_currentProfile
objectAtIndex
:
8
]
intValue
]
>
0
)
// width
[
composedOptions
appendFormat
:
@",width=%@"
,
[
_currentProfile
objectAtIndex
:
8
]];
if
([[
_currentProfile
objectAtIndex
:
9
]
intValue
]
>
0
)
// height
[
composedOptions
appendFormat
:
@",height=%@"
,
[
_currentProfile
objectAtIndex
:
9
]];
}
}
if
([[
_currentProfile
objectAtIndex
:
2
]
intValue
])
{
// audio is enabled
// add another comma in case video is enabled
if
([[
_currentProfile
objectAtIndex
:
1
]
intValue
])
[
composedOptions
appendString
:
@","
];
[
composedOptions
appendFormat
:
@"acodec=%@"
,
[
_currentProfile
objectAtIndex
:
10
]];
if
(
!
[[
_currentProfile
objectAtIndex
:
10
]
isEqualToString
:
@"none"
])
{
[
composedOptions
appendFormat
:
@",ab=%@"
,
[
_currentProfile
objectAtIndex
:
11
]];
// bitrate
[
composedOptions
appendFormat
:
@",channels=%@"
,
[
_currentProfile
objectAtIndex
:
12
]];
// channel number
[
composedOptions
appendFormat
:
@",samplerate=%@"
,
[
_currentProfile
objectAtIndex
:
13
]];
// sample rate
}
}
if
([
_currentProfile
objectAtIndex
:
3
])
{
// subtitles enabled
[
composedOptions
appendFormat
:
@",scodec=%@"
,
[
_currentProfile
objectAtIndex
:
14
]];
if
([[
_currentProfile
objectAtIndex
:
15
]
intValue
])
[
composedOptions
appendFormat
:
@",soverlay"
];
}
// add muxer
[
composedOptions
appendFormat
:
@"}:standard{mux=%@"
,
[
_currentProfile
objectAtIndex
:
0
]];
// add output destination (file only at this point)
[
composedOptions
appendFormat
:
@",dst=%@,access=file}"
,
_outputDestination
];
NSString
*
returnString
=
[
NSString
stringWithString
:
composedOptions
];
[
composedOptions
release
];
return
returnString
;
}
@end
# pragma mark -
...
...
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