Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
5ef5531d
Commit
5ef5531d
authored
Oct 21, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/Framework: Updated Sample code. (Patch by Enrique Osuna).
parent
9b89b833
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
586 additions
and
0 deletions
+586
-0
extras/MacOSX/Framework/Examples/test2/Controller.h
extras/MacOSX/Framework/Examples/test2/Controller.h
+24
-0
extras/MacOSX/Framework/Examples/test2/Controller.m
extras/MacOSX/Framework/Examples/test2/Controller.m
+130
-0
extras/MacOSX/Framework/Examples/test2/English.lproj/InfoPlist.strings
.../Framework/Examples/test2/English.lproj/InfoPlist.strings
+0
-0
extras/MacOSX/Framework/Examples/test2/English.lproj/MainMenu.nib/classes.nib
...ork/Examples/test2/English.lproj/MainMenu.nib/classes.nib
+14
-0
extras/MacOSX/Framework/Examples/test2/English.lproj/MainMenu.nib/info.nib
...mework/Examples/test2/English.lproj/MainMenu.nib/info.nib
+22
-0
extras/MacOSX/Framework/Examples/test2/English.lproj/MainMenu.nib/keyedobjects.nib
...xamples/test2/English.lproj/MainMenu.nib/keyedobjects.nib
+0
-0
extras/MacOSX/Framework/Examples/test2/Info.plist
extras/MacOSX/Framework/Examples/test2/Info.plist
+28
-0
extras/MacOSX/Framework/Examples/test2/main.m
extras/MacOSX/Framework/Examples/test2/main.m
+16
-0
extras/MacOSX/Framework/Examples/test2/test.xcodeproj/project.pbxproj
...X/Framework/Examples/test2/test.xcodeproj/project.pbxproj
+345
-0
extras/MacOSX/Framework/Examples/test2/test_Prefix.pch
extras/MacOSX/Framework/Examples/test2/test_Prefix.pch
+7
-0
No files found.
extras/MacOSX/Framework/Examples/test2/Controller.h
0 → 100644
View file @
5ef5531d
/* Controller */
#import <Cocoa/Cocoa.h>
#import <VLC/VLC.h>
#import <VLC/VLCMediaPlayer.h>
@interface
Controller
:
NSObject
{
IBOutlet
id
window
;
IBOutlet
id
playlistOutline
;
IBOutlet
id
videoHolderView
;
VLCVideoView
*
videoView
;
VLCMediaList
*
playlist
;
VLCMediaPlayer
*
player
;
int
mediaIndex
;
}
-
(
void
)
awakeFromNib
;
-
(
void
)
setMediaIndex
:(
int
)
value
;
-
(
void
)
play
:(
id
)
sender
;
-
(
void
)
pause
:(
id
)
sender
;
@end
extras/MacOSX/Framework/Examples/test2/Controller.m
0 → 100644
View file @
5ef5531d
#import "Controller.h"
static
void
*
sleepForMe
(
void
)
{
while
(
1
)
sleep
(
60
);
}
@implementation
Controller
-
(
void
)
awakeFromNib
{
// atexit((void*)sleepForMe); // Only used for memory leak debugging
[
NSApp
setDelegate
:
self
];
// Allocate a VLCVideoView instance and tell it what area to occupy.
NSRect
rect
=
NSMakeRect
(
0
,
0
,
0
,
0
);
rect
.
size
=
[
videoHolderView
frame
].
size
;
videoView
=
[[
VLCVideoView
alloc
]
initWithFrame
:
rect
];
[
videoHolderView
addSubview
:
videoView
];
[
videoView
setAutoresizingMask
:
NSViewHeightSizable
|
NSViewWidthSizable
];
playlist
=
[[
VLCMediaList
alloc
]
init
];
[
playlist
setDelegate
:
self
];
player
=
[[
VLCMediaPlayer
alloc
]
initWithVideoView
:
videoView
];
mediaIndex
=
-
1
;
[
playlistOutline
registerForDraggedTypes
:[
NSArray
arrayWithObjects
:
NSFilenamesPboardType
,
NSURLPboardType
,
nil
]];
[
playlistOutline
setDoubleAction
:
@selector
(
changeAndPlay
:)];
}
-
(
void
)
applicationDidFinishLaunching
:(
NSNotification
*
)
aNotification
{
}
-
(
void
)
applicationWillTerminate
:(
NSNotification
*
)
aNotification
{
[
player
pause
];
[
player
setMedia
:
nil
];
[
player
release
];
[
playlist
release
];
[
videoView
release
];
}
-
(
void
)
changeAndPlay
:(
id
)
sender
{
if
([
playlistOutline
selectedRow
]
!=
mediaIndex
)
{
[
self
setMediaIndex
:[
playlistOutline
selectedRow
]];
if
(
!
[
player
isPlaying
])
[
player
play
];
}
}
-
(
void
)
setMediaIndex
:(
int
)
value
{
if
([
playlist
count
]
<=
0
)
return
;
if
(
value
<
0
)
value
=
0
;
if
(
value
>
[
playlist
count
]
-
1
)
value
=
[
playlist
count
]
-
1
;
mediaIndex
=
value
;
[
player
setMedia
:[
playlist
mediaAtIndex
:
mediaIndex
]];
}
-
(
void
)
play
:(
id
)
sender
{
[
self
setMediaIndex
:
mediaIndex
+
1
];
if
(
!
[
player
isPlaying
])
[
player
play
];
}
-
(
void
)
pause
:(
id
)
sender
{
NSLog
(
@"Sending pause message to media player..."
);
[
player
pause
];
}
//
-
(
void
)
mediaList
:(
VLCMediaList
*
)
mediaList
mediaAdded
:(
VLCMedia
*
)
media
atIndex
:(
int
)
index
{
[
playlistOutline
reloadData
];
}
-
(
void
)
mediaList
:(
VLCMediaList
*
)
mediaList
mediaRemoved
:(
VLCMedia
*
)
media
atIndex
:(
int
)
index
{
[
playlistOutline
reloadData
];
}
// NSTableView Implementation
-
(
int
)
numberOfRowsInTableView
:(
NSTableView
*
)
tableView
{
return
[
playlist
count
];
}
-
(
id
)
tableView
:(
NSTableView
*
)
tableView
objectValueForTableColumn
:(
NSTableColumn
*
)
tableColumn
row
:(
int
)
row
{
return
[[
playlist
mediaAtIndex
:
row
]
description
];
}
-
(
NSDragOperation
)
tableView
:(
NSTableView
*
)
tv
validateDrop
:(
id
<
NSDraggingInfo
>
)
info
proposedRow
:(
int
)
row
proposedDropOperation
:(
NSTableViewDropOperation
)
op
{
return
NSDragOperationEvery
;
/* This is for now */
}
-
(
BOOL
)
tableView
:(
NSTableView
*
)
aTableView
acceptDrop
:(
id
<
NSDraggingInfo
>
)
info
row
:(
int
)
row
dropOperation
:(
NSTableViewDropOperation
)
operation
{
int
i
;
NSArray
*
droppedItems
=
[[
info
draggingPasteboard
]
propertyListForType
:
NSFilenamesPboardType
];
for
(
i
=
0
;
i
<
[
droppedItems
count
];
i
++
)
{
NSString
*
filename
=
[
droppedItems
objectAtIndex
:
i
];
VLCMedia
*
media
=
[
VLCMedia
mediaWithURL
:
filename
];
NSLog
(
@"%@ length = %@"
,
media
,
[
media
lengthWaitUntilDate
:[
NSDate
dateWithTimeIntervalSinceNow
:
60
]]);
[
playlist
addMedia
:
media
];
}
return
YES
;
}
@end
extras/MacOSX/Framework/Examples/test2/English.lproj/InfoPlist.strings
0 → 100644
View file @
5ef5531d
B
/* Localized versions of Info.plist keys */
extras/MacOSX/Framework/Examples/test2/English.lproj/MainMenu.nib/classes.nib
0 → 100644
View file @
5ef5531d
{
IBClasses = (
{
ACTIONS = {pause = id; play = id; };
CLASS = Controller;
LANGUAGE = ObjC;
OUTLETS = {playlistOutline = id; videoHolderView = id; window = id; };
SUPERCLASS = NSObject;
},
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = NSSegmentedControl; LANGUAGE = ObjC; SUPERCLASS = NSControl; }
);
IBVersion = 1;
}
\ No newline at end of file
extras/MacOSX/Framework/Examples/test2/English.lproj/MainMenu.nib/info.nib
0 → 100644
View file @
5ef5531d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
IBDocumentLocation
</key>
<string>
111 87 356 240 0 0 1440 878
</string>
<key>
IBEditorPositions
</key>
<dict>
<key>
29
</key>
<string>
108 299 338 44 0 0 1440 878
</string>
</dict>
<key>
IBFramework Version
</key>
<string>
446.1
</string>
<key>
IBOpenObjects
</key>
<array>
<integer>
29
</integer>
<integer>
21
</integer>
</array>
<key>
IBSystem Version
</key>
<string>
8R2218
</string>
</dict>
</plist>
extras/MacOSX/Framework/Examples/test2/English.lproj/MainMenu.nib/keyedobjects.nib
0 → 100644
View file @
5ef5531d
File added
extras/MacOSX/Framework/Examples/test2/Info.plist
0 → 100644
View file @
5ef5531d
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
CFBundleDevelopmentRegion
</key>
<string>
English
</string>
<key>
CFBundleExecutable
</key>
<string>
${EXECUTABLE_NAME}
</string>
<key>
CFBundleIconFile
</key>
<string></string>
<key>
CFBundleIdentifier
</key>
<string>
com.yourcompany.test
</string>
<key>
CFBundleInfoDictionaryVersion
</key>
<string>
6.0
</string>
<key>
CFBundleName
</key>
<string>
${PRODUCT_NAME}
</string>
<key>
CFBundlePackageType
</key>
<string>
APPL
</string>
<key>
CFBundleSignature
</key>
<string>
????
</string>
<key>
CFBundleVersion
</key>
<string>
1.0
</string>
<key>
NSMainNibFile
</key>
<string>
MainMenu
</string>
<key>
NSPrincipalClass
</key>
<string>
NSApplication
</string>
</dict>
</plist>
extras/MacOSX/Framework/Examples/test2/main.m
0 → 100644
View file @
5ef5531d
//
// main.m
// test
//
// Created by Pierre d'Herbemont on 13/04/07.
// Copyright __MyCompanyName__ 2007. All rights reserved.
//
#import
<Cocoa
/
Cocoa
.
h
>
#import
<VLC
/
VLC
.
h
>
#include
<stdio
.
h
>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}
extras/MacOSX/Framework/Examples/test2/test.xcodeproj/project.pbxproj
0 → 100644
View file @
5ef5531d
This diff is collapsed.
Click to expand it.
extras/MacOSX/Framework/Examples/test2/test_Prefix.pch
0 → 100644
View file @
5ef5531d
//
// Prefix header for all source files of the 'test' target in the 'test' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
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