-
Notifications
You must be signed in to change notification settings - Fork 0
/
FSAudioController.h
executable file
·81 lines (68 loc) · 2.02 KB
/
FSAudioController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* This file is part of the FreeStreamer project,
* (C)Copyright 2011-2013 Matias Muhonen.
* See the file ''LICENSE'' for using the code.
*/
#import <Foundation/Foundation.h>
@class FSAudioStream;
@class FSCheckContentTypeRequest;
@class FSParsePlaylistRequest;
@class FSParseRssPodcastFeedRequest;
/**
* FSAudioController is functionally equivalent to FSAudioStream with
* one addition: it can be directly fed with a playlist (PLS, M3U) URL
* or an RSS podcast feed. It determines the content type and forms
* a playlist for playback.
*
* Do not use this class but FSAudioStream, if you already know the content type
* of the URL. Using this class will generate more traffic, as the
* content type is checked for each URL.
*/
@interface FSAudioController : NSObject {
NSString *_url;
FSAudioStream *_audioStream;
BOOL _readyToPlay;
FSCheckContentTypeRequest *_checkContentTypeRequest;
FSParsePlaylistRequest *_parsePlaylistRequest;
FSParseRssPodcastFeedRequest *_parseRssPodcastFeedRequest;
}
/**
* Initializes the audio stream with an URL.
*
* @param url The URL from which the stream data is retrieved.
*/
- (id)initWithUrl:(NSString *)url;
/**
* Starts playing the stream. Before the playback starts,
* the URL content type is checked and playlists resolved.
*/
- (void)play;
/**
* Starts playing the stream from an URL. Before the playback starts,
* the URL content type is checked and playlists resolved.
*
* @param url The URL from which the stream data is retrieved.
*/
- (void)playFromURL:(NSString*)url;
/**
* Stops the stream playback.
*/
- (void)stop;
/**
* If the stream is playing, the stream playback is paused upon calling pause.
* Otherwise (the stream is paused), calling pause will continue the playback.
*/
- (void)pause;
/**
* Returns the playback status: YES if the stream is playing, NO otherwise.
*/
- (BOOL)isPlaying;
/**
* The stream URL.
*/
@property (nonatomic,assign) NSString *url;
/**
* The audio stream.
*/
@property (readonly) FSAudioStream *stream;
@end