wiki:AUDIO_CONTENT_R0
Last modified 12 years ago Last modified on 04/22/09 15:12:16

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro 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|) failed
current transaction is aborted, commands ignored until end of transaction block

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<AudioResource>.
  • 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)

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".

trunk/sophie2-platform/modules/org.sophie2.main.view/src/test/java/org/sophie2/main/view/content/AudioContentViewTest.java

Implementation

[1268]
[1269]
[1270]
[1271]
[1272]
[1273]
[1274]
[1276]
[1277]
[1279]
[1282]
[1283]
[1286]

Unit test:
[1278]
[1280]

Testing

Comments

(Write comments for this or later revisions here.)