Commit 15ddcc9c authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx/framework: Change the repeatMode setter to be a property so that it can...

macosx/framework: Change the repeatMode setter to be a property so that it can evenutally be used with Bindings.
parent 55f19bbc
......@@ -26,11 +26,23 @@
@class VLCMedia, VLCMediaPlayer, VLCMediaList;
/**
* VLCRepeatMode
* (don't repeat anything, repeat one, repeat all)
*/
enum VLCRepeatMode {
VLCDoNotRepeat,
VLCRepeatCurrentItem,
VLCRepeatAllItems
};
typedef int VLCRepeatMode;
@interface VLCMediaListPlayer : NSObject {
void *instance;
VLCMedia *_rootMedia;
VLCMediaPlayer *_mediaPlayer;
VLCMediaList *_mediaList;
VLCRepeatMode _repeatMode;
}
@property (readwrite, retain) VLCMediaList *mediaList;
......@@ -53,10 +65,10 @@
/**
* Playmode selection (don't repeat anything, repeat one, repeat all)
* See VLCRepeatMode.
*/
- (void)doNotRepeatAnyItem;
- (void)repeatCurrentItem;
- (void)repeatAllItems;
@property (readwrite) VLCRepeatMode repeatMode;
/**
* media must be in the current media list.
......
......@@ -131,27 +131,29 @@
catch_exception(&ex);
}
- (void)doNotRepeatAnyItem;
- (void)setRepeatMode:(VLCRepeatMode)repeatMode
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_default, &ex);
catch_exception(&ex);
}
- (void)repeatCurrentItem
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_repeat, &ex);
switch (repeatMode) {
case VLCRepeatAllItems:
libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_default, &ex);
break;
case VLCDoNotRepeat:
libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_default, &ex);
break;
case VLCRepeatCurrentItem:
libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_repeat, &ex);
break;
default:
break;
}
catch_exception(&ex);
_repeatMode = repeatMode;
}
- (void)repeatAllItems
- (VLCRepeatMode)repeatMode
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_loop, &ex);
catch_exception(&ex);
return _repeatMode;
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment