[[BackLinksMenu]] [[TicketQuery(summary=AUDIO_CONTENT_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|)]] = Analysis = == Overview == Audio content connects an audio resource to a frame * Audio content is a content of a frame representing audio. * Audio resources are resources for audio. * Audio resources have the same information as any other resources plus specific information about the audio they are representing. * Audio content is responsible for returning the visual representation of the audio * There should be drag and drop support, so audio can be dropped onto a frame and a audio content is created automatically from them (Optional). Audio are scaled if they are bigger than the frame they are dropped onto. * There should be support for creating a frame with audio content by choosing an audio file. * Audio resources should support clipping (in point, out point), rate and volume == Task requirements == * Define basic audio content. * Define basic audio resource. * Define how content work with frames to find a renderer (is this a scene?) == Task result == The result of this task should be source code. == Implementation idea == * Create class !AudioContent which is concrete implementation of org.sophie2.base.model.book.!FrameContent for audio. * !AudioContent should override mainResource() and return Prop. * Create class !AudioResource which is concrete implementation of org.sophie2.base.model.book.resource.!BookResource for audio resources. * !AudioResource should have methods: * inPoint * outPoint * startPoint (0) * endPoint (same as duration) * rate * volume * duration * Audio * Audio can be played without a frame presence (some script) * Audio can be represented by an image * Audio can have a controller * Determine if any of this should be part of the content, or kept elsewhere, ie does the content have any say in how the resource is represented on screen? * If yes, maybe contents should have extension points that keep the list of renderers for this content (and similar for audio and video, ie any content) == Related == * [wiki:UNPLANNED_BASE_MODEL_FRAME_CONTENT_R0][[BR]] * [wiki:BASE_RESOURCE_COMMONS_R0] * [wiki:IMAGE_CONTENT_R0] * [wiki:VIDEO_CONTENT_R0] == How to demo == * Create a frame with audio resource. * Check if the resource is set correctly and check if the information about the resource is correct. * Try changing the resource and check again the same things. = Design = * Create class !AudioBookResource extending !MediaBookResource it should: * have constructors to which the audio can be passed as File or !BinData. * the method getResourceKind should return "audio-resource". * Create class !AudioFrameContent extending !MediaFrameContent it should: * implement the mainResource property of !MediaFrameContent with generic type !AudioBookResource. * Move !AudioHandler to org.sophie2.base.scene so that it can be used by !AudioSceneElement. Change !AudioHandler so that it extends !MediaHandler and is empty (for now). * Create interface !AudioSceneElement extending !MediaSceneElement. It is an interface describing a scene element containg audio. It should override the handler property of !MediaSceneElement with generic type !AudioHandler. * Create class !AudioContentView extending !MediaContentView it should: * implement the model property with generic type !AudioFrameContent. * implement the element property with generic type extending !AudioSceneElement. * the concrete implementation of !AudioSceneElement should implement handler as an !AutoProperty depending on model. * implement AudioHandler so that !AudioSceneElement can be implemented. * Add code to the static method createAppropriateContent of !FrameFactory so that it returns !AudioFrameContent if the resource passed to it is of type !AudioBookResource. * Add code to the method create of org.sophie2.main.model.book.format.r1.ResourceLoader and org.sophie2.main.model.book.format.r2.ResourceLoader so that it returns !AudioBookResource if the Storage passed to it contains "AudioBookResource". [source:/trunk/sophie2-platform/modules/org.sophie2.main.view/src/test/java/org/sophie2/main/view/content/AudioContentViewTest.java] = Implementation = [1268][[BR]] [1269][[BR]] [1270][[BR]] [1271][[BR]] [1272][[BR]] [1273][[BR]] [1274][[BR]] [1276][[BR]] [1277][[BR]] [1279][[BR]] [1282][[BR]] [1283][[BR]] [1286][[BR]] Unit test:[[BR]] [1278][[BR]] [1280][[BR]] = Testing = = Comments = ^(Write comments for this or later revisions here.)