diff options
Diffstat (limited to 'src/media.c')
-rw-r--r-- | src/media.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/media.c b/src/media.c index c0d6d3de..dcda0664 100644 --- a/src/media.c +++ b/src/media.c | |||
@@ -24,6 +24,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
24 | #include "gmdocument.h" | 24 | #include "gmdocument.h" |
25 | #include "ui/window.h" | 25 | #include "ui/window.h" |
26 | #include "audio/player.h" | 26 | #include "audio/player.h" |
27 | #include "app.h" | ||
27 | 28 | ||
28 | #include <the_Foundation/ptrarray.h> | 29 | #include <the_Foundation/ptrarray.h> |
29 | #include <stb_image.h> | 30 | #include <stb_image.h> |
@@ -214,8 +215,9 @@ void setData_Media(iMedia *d, iGmLinkId linkId, const iString *mime, const iBloc | |||
214 | updateSourceData_Player(audio->player, NULL, NULL, complete_PlayerUpdate); | 215 | updateSourceData_Player(audio->player, NULL, NULL, complete_PlayerUpdate); |
215 | } | 216 | } |
216 | pushBack_PtrArray(&d->audio, audio); | 217 | pushBack_PtrArray(&d->audio, audio); |
217 | /* TEST: Start playing right away. */ | 218 | /* Start playing right away. */ |
218 | start_Player(audio->player); | 219 | start_Player(audio->player); |
220 | postCommandf_App("media.player.started player:%p", audio->player); | ||
219 | } | 221 | } |
220 | } | 222 | } |
221 | } | 223 | } |
@@ -231,6 +233,10 @@ iMediaId findLinkImage_Media(const iMedia *d, iGmLinkId linkId) { | |||
231 | return 0; | 233 | return 0; |
232 | } | 234 | } |
233 | 235 | ||
236 | size_t numAudio_Media(const iMedia *d) { | ||
237 | return size_PtrArray(&d->audio); | ||
238 | } | ||
239 | |||
234 | iMediaId findLinkAudio_Media(const iMedia *d, iGmLinkId linkId) { | 240 | iMediaId findLinkAudio_Media(const iMedia *d, iGmLinkId linkId) { |
235 | /* TODO: use a hash */ | 241 | /* TODO: use a hash */ |
236 | iConstForEach(PtrArray, i, &d->audio) { | 242 | iConstForEach(PtrArray, i, &d->audio) { |