crea/integration/generator.html
author ymh <ymh.work@gmail.com>
Wed, 06 Jun 2012 23:00:42 +0200
changeset 16 e37a29d23c86
parent 2 44deeff592e2
child 15 f1d070549d94
permissions -rw-r--r--
First version of tralalere platform
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
     1
<!DOCTYPE html>
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
     2
<html lang="fr">
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
     3
    <head>
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
     4
        <meta charset="utf-8" />
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
     5
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
     6
        <title>Musitag - Futur en Seine 2012</title>
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
     7
        <link rel="stylesheet" type="text/css" href="css/musitag.css" />
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
     8
        <script type="text/javascript" src="libs/underscore-min.js"></script>
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
     9
        <script type="text/javascript" src="metadataplayer/LdtPlayer-core.js"></script>
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    10
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    11
    </head>
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    12
    <body>
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    13
 
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    14
    <script type="text/javascript">
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    15
    
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    16
    IriSP._ = _;
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    17
    
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    18
    var _directory = new IriSP.Model.Directory(),
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    19
        _source = _directory.newLocalSource({
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    20
            serializer: IriSP.serializers.ldt
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    21
        }),
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    22
        _mediaList = new IriSP.Model.List(_directory),
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    23
        _annotationList = new IriSP.Model.List(_directory),
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    24
        _tagList = new IriSP.Model.List(_directory),
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    25
        _annotationTypeList = new IriSP.Model.List(_directory),
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    26
        _colors = ['red','yellow','green','blue'],
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    27
        _emoticons = ['happy','unhappy','laughing','surprised'],
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    28
        _alltags = _colors.concat(_emoticons),
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    29
        _duration = 147000;
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    30
    
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    31
    
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    32
    var _media = new IriSP.Model.Media('au-clair-de-la-lune',_source);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    33
    _media.video = 'media/wari_0710.mp3';
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    34
    _media.setDuration(_duration);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    35
    _media.title = "Au Clair de La Lune";
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    36
    _media.description = "Steve Waring";
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    37
    _mediaList.push(_media);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    38
    
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    39
    var _annotationType = new IriSP.Model.Media('musitag',_source);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    40
    _annotationType.title = "Musitag";
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    41
    _annotationType.description = "Une couleur + une émotion, déposés par Musitag";
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    42
    _annotationTypeList.push(_annotationType);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    43
    
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    44
    _alltags.forEach(function(_name) {
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    45
        var _tag = new IriSP.Model.Tag(_name, _source);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    46
        _tag.title = _name;
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    47
        _tagList.push(_tag);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    48
    });
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    49
    
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    50
    for (var _i = 0; _i < 50; _i++) {
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    51
        var _time = Math.floor(_duration * Math.random()),
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    52
            _color = _colors[Math.floor(4*Math.random())],
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    53
            _emoticon = _emoticons[Math.floor(4*Math.random())],
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    54
            _annotation = new IriSP.Model.Annotation('annotation-'+_i,_source);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    55
        _annotation.setTags([_color,_emoticon]);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    56
        _annotation.setBegin(_time);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    57
        _annotation.setEnd(_time);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    58
        _annotation.setAnnotationType('musitag');
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    59
        _annotation.setMedia('au-clair-de-la-lune');
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    60
        _annotation.created = new Date();
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    61
        _annotation.creator = "Math.random()";
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    62
        _annotation.description = _color + " " + _emoticon;
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    63
        _annotationList.push(_annotation);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    64
    }
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    65
    
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    66
    _source.addList('media',_mediaList);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    67
    _source.addList('tag',_tagList);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    68
    _source.addList('annotationType',_annotationTypeList);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    69
    _source.addList('annotation',_annotationList);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    70
    
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    71
    console.log(_source);
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    72
    console.log(_source.serialize());
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    73
    </script>
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    74
    </body>
44deeff592e2 Added metadataplayer, "widgetized" the interface
veltr
parents:
diff changeset
    75
</html>