summaryrefslogtreecommitdiff
path: root/src/media.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-25 12:09:28 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-25 12:09:28 +0200
commit45049903a304a6762d5656890213c8ad5a1db3c3 (patch)
tree11335323e83e268120d69434d14298f6dadf7a2d /src/media.h
parentd8b789caf6f5c2ab6ce435f51075a4a4cc83db4b (diff)
Consolidating media handling
Diffstat (limited to 'src/media.h')
-rw-r--r--src/media.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/media.h b/src/media.h
index ddaa2d3c..ebead352 100644
--- a/src/media.h
+++ b/src/media.h
@@ -30,18 +30,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
30typedef uint16_t iMediaId; 30typedef uint16_t iMediaId;
31 31
32iDeclareType(Player) 32iDeclareType(Player)
33iDeclareType(GmImageInfo) 33iDeclareType(GmMediaInfo)
34iDeclareType(GmAudioInfo)
35 34
36struct Impl_GmImageInfo { 35struct Impl_GmMediaInfo {
37 iInt2 size; 36 const char *type; /* MIME */
38 size_t numBytes; 37 size_t numBytes;
39 const char *mime;
40 iBool isPermanent;
41};
42
43struct Impl_GmAudioInfo {
44 const char *mime;
45 iBool isPermanent; 38 iBool isPermanent;
46}; 39};
47 40
@@ -54,17 +47,20 @@ enum iMediaFlags {
54}; 47};
55 48
56void clear_Media (iMedia *); 49void clear_Media (iMedia *);
50iBool setUrl_Media (iMedia *, uint16_t linkId, const iString *url);
57iBool setData_Media (iMedia *, uint16_t linkId, const iString *mime, const iBlock *data, int flags); 51iBool setData_Media (iMedia *, uint16_t linkId, const iString *mime, const iBlock *data, int flags);
58 52
59iMediaId findLinkImage_Media (const iMedia *, uint16_t linkId); 53iMediaId findLinkImage_Media (const iMedia *, uint16_t linkId);
60iBool imageInfo_Media (const iMedia *, iMediaId imageId, iGmImageInfo *info_out); 54iBool imageInfo_Media (const iMedia *, iMediaId imageId, iGmMediaInfo *info_out);
55iInt2 imageSize_Media (const iMedia *, iMediaId imageId);
61SDL_Texture * imageTexture_Media (const iMedia *, iMediaId imageId); 56SDL_Texture * imageTexture_Media (const iMedia *, iMediaId imageId);
62 57
63size_t numAudio_Media (const iMedia *); 58size_t numAudio_Media (const iMedia *);
64iMediaId findLinkAudio_Media (const iMedia *, uint16_t linkId); 59iMediaId findLinkAudio_Media (const iMedia *, uint16_t linkId);
65iBool audioInfo_Media (const iMedia *, iMediaId audioId, iGmAudioInfo *info_out); 60iBool audioInfo_Media (const iMedia *, iMediaId audioId, iGmMediaInfo *info_out);
66iPlayer * audioPlayer_Media (const iMedia *, iMediaId audioId); 61iPlayer * audioPlayer_Media (const iMedia *, iMediaId audioId);
67 62
63iMediaId findLinkDownload_Media (const iMedia *, uint16_t linkId);
68 64
69/*----------------------------------------------------------------------------------------------*/ 65/*----------------------------------------------------------------------------------------------*/
70 66