wiki:BOOK_BACKGROUND_AUDIO_R1
Last modified 15 years ago Last modified on 12/16/09 14:07:29

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

Error: Macro TicketQuery(summary=BOOK_BACKGROUND_AUDIO_R1, 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

The goal of this task is to povide binding between the pages timeline and background audio. The folowing behavior of the book should be achievable:

  • When the user binds pages timelines with the background audio and jumps from page to page, the audio jumps too. If for example we have 3 pages with 1 minute long timelines each, and the user in some point goes to page 3 from page 1 - the audio starts to play from 3th minute. If the user then jumps back to second page - the audio starts to play from 2nd minute and so on.

However there are some issues to be discussed here

  • "Loop background audio" - should became disabled when this feature is activated
  • This can't exactly work with looped pages timelines - so we have to make sure that they won't be active in the same time.

Task requirements

  • In the book properties window, add additional check box that enables the binding between pages timeline and the background audio.
    • This should be enabled only if there is a selected audio.
    • The default state should be unselected.
    • If selected and there are no looped pages timelines
      • Modal window appear with the 'ok' button and following text "Activating binding between background audio and pages timeline will disable loop page functionality". Also unselected check box that says "Don't show me this message again." should present.(once activated this, should be preserved trough different sessions)
        • The "Loop background sound" check box becomes disabled (as well as the loop functionality)
        • The UI for timelines should disable loop page functionality - provide a way that this could be easy implemented (in the ticket #2169)
        • The binding is activated
    • if selected and there are looped pages timelines
      • Modal window appear with "ok" and "cancel" buttons. The massage should be "There are currently pages with looped timeline. This will be reset and the loop page functionality will be disabled."
        • Case the user press "cancel" button nothing happens.
        • Case the user press "ok" button.
          • All pages that are looped are reset to "unlooped" and the UI for loop functionality becomes disabled - provide a way that this could be easy implemented (in the ticket #2169)
          • The "Loop background sound" check box becomes disabled (as well as the loop functionality)
          • The binding is activated
  • Make the "Loop background audio" enabled only if there is a selected audio from the combo box.
  • When binding audio and page timelines is disabled - If there were looped pages before the activating and no changes were made to them - they should get back to their previous state

Task result

  • Result should be code.

Implementation idea

  • Currently there is no UI for looped page timeline, there for the disabling and enabling should be implemented latter.
  • There is no need for the looped page timeline properties to be reset, they could be ignored by the reader or in preview mode.

BOOK_BACKGROUND_AUDIO_R1
#2169

How to demo

  • Run the application
  • Import audio longer than a minute
  • Create few pages that are obviously different (different background or frames - something that make the different pages easily noticeable)
  • Set the imported audio as background sound and bind it to the pages timeline
  • Go to preview and start jumping from page to page

Design

  • BookPropertiesDialog changes:
    • Add to the dialog new check box for synchronization the background audio with the pages.
    • Make the loop check and the sync check not enabled when no audio resource is selected, use the ItemListener interface for that.
    • Synchronize the new sync check box with the loop check box like mentioned in the analysis, use the ItemListener interface for that.
    • All the listeners will be added once in the constructor of the dialog.
    • The messages from the analysis will pop up, but the check box for 'remember my decision' will not be added... For now that is.
    • Add a new demo for testing the dialog's behavior -> BookPropertiesDialogDemo.
    • About the idea check boxes to radio buttons, there will be some problems because of the saving the 'loop' check after sync is turned off.
    • Refactor the BookPropertiesDialog when there is time, it's too ugly and messy now...
  • BookR4 and BookH changes:
    • Add a new key in the BookR4:
      	public static final TemplatedKey<Boolean> KEY_BIND_AUDIO_TO_PAGES = 
      		new TemplatedKey<Boolean>("key-bind-audio-to-pages",
      				Boolean.class, false);
      
    • BookH has to have a method that retrieves the value of this key.

  • All the logic that modifies the book with the BookPropertiesDialog have to take in mind the new sync property.
  • BookTimeState changes:
    • Modify the method gotoPage to update the bookTime of the new state that is returned.
    • Update the bookTime as the sum of the times of the pages to the one becoming current.
  • BookView changes:
    • Modify the AudioChunk getBgAudioChunk(TimePos time) method to use the sync key of the BookR4. If the sync is turned on, use the bookTime of the current state to get chunk...
    • When the synchronization is on use TimelineOptions for the pages with turned of looping... For that purpose add a modifier method setLooped in the TimelineOptions.

Implementation

Testing

(Place the testing results here.)

Comments

(Write comments for this or later revisions here.)